*---------------------- Location Section ------------------------ * Library: Asearchcontrols.vcx * Class: Cntsearchparent * Method: Lregister_assign() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 05/20/2005 - NN * MODIFIED *---------------------------------------------------------------- LPARAMETERS vNewVal *To do: Modify this routine for the Assign method THIS.lRegister = m.vNewVal IF this.lRegister thisform.RegisterControls(this.class, SUBSTR(this.Name,2)) endifIn the Init of the form I call thisform.SetAll('lRegister',.t.).
*---------------------- Location Section ------------------------ * Library: Asearchbiz.vcx * Class: Searchobject * Method: GetWhereExpr() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 05/15/2005 - NN * MODIFIED *---------------------------------------------------------------- lparameters tcSearchType, taFieldsVals external array taFieldsVals local lcSearchType, lnI, llReturn lcSearchType = lower(m.tcSearchType) #define ADDWHERE iif(empty(this.cWhereExpr),"", this.cWhereExpr + " AND ") #define ADDJOIN iif(empty(this.cJoinExpr),"", this.cJoinExpr + " ") #define GuarantorPrefix iif("guarantor" $ m.lcSearchType, "Guarantor_", "") #define dDOBField iif("guarantor" $ m.lcSearchType, "Relateds.dDOB", "Patients.dDOB") llReturn = .t. if m.llReturn do case * Name case "name" $ m.lcSearchType for lnI = 1 to alen(taFieldsVals,1) if lower(taFieldsVals[m.lnI,1]) = "lastname" this.cWhereExpr = ADDWHERE + GuarantorPrefix + [Names.] + [cl_name LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif if lower(taFieldsVals[m.lnI,1]) = "firstname" this.cWhereExpr = ADDWHERE + GuarantorPrefix + [Names.] + [cf_name LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif if lower(taFieldsVals[m.lnI,1]) = "middleinitial" this.cWhereExpr = ADDWHERE + GuarantorPrefix + [Names.] + [cm_initial LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif next this.cWhereExpr = ADDWHERE + GuarantorPrefix + [Names.] + [iAlias_Flag <> 1 ] if "guarantor" $ m.lcSearchType this.cWhereExpr = ADDWHERE + GuarantorPrefix + "Names.cPointer_Table_Name = 'RELATEDS'" if not " trans_relateds" $ lower(this.cJoinExpr ) this.cJoinExpr = ADDJOIN + "INNER Join Trans_Relateds on Trans.cTrans_pk = Trans_Relateds.cTrans_fk" endif if not GuarantorPrefix + "Names" $ this.cJoinExpr this.cJoinExpr = ADDJOIN + "INNER Join Names " + ; GuarantorPrefix + ; "Names on Trans_Relateds.cRelateds_fk = " + ; GuarantorPrefix + ; "Names.cPointer_fk" endif else this.cWhereExpr = ADDWHERE + "Names.cPointer_Table_Name = 'PATIENTS'" endif * Client Account Number case m.lcSearchType = [hospitalacctnum] this.cWhereExpr = ADDWHERE + [Trans.cClient_account_number LIKE "] + alltrim(taFieldsVals[1,2]) + [%"] * Patient's SSN case "patientssn" $ m.lcSearchType this.cWhereExpr = ADDWHERE + [Patients.cSSN LIKE "] + alltrim(taFieldsVals[1,2]) + [%"] * Phone case inlist(m.lcSearchType, "patientphone","guarantorphone" ) for lnI = 1 to alen(taFieldsVals,1) if lower(taFieldsVals[m.lnI,1]) = "areacode" this.cWhereExpr = ADDWHERE + GuarantorPrefix + ; [Phones.] + [cArea_Code LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif if lower(taFieldsVals[m.lnI,1]) = "exchange" this.cWhereExpr = ADDWHERE + GuarantorPrefix + ; [Phones.] + [cExchange LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif if lower(taFieldsVals[m.lnI,1]) = "lastfour" this.cWhereExpr = ADDWHERE + GuarantorPrefix + ; [Phones.] + [cLast_four LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif if lower(taFieldsVals[m.lnI,1]) = "extension" this.cWhereExpr = ADDWHERE + GuarantorPrefix + ; [Phones.] + [cExtension LIKE "] + ; alltrim(taFieldsVals[m.lnI,2]) + [%"] endif next if "guarantor" $ m.lcSearchType this.cWhereExpr = ADDWHERE + GuarantorPrefix + ; "Phones.cPointer_Table_Name = 'RELATEDS'" if not "trans_relateds" $ lower(this.cJoinExpr) this.cJoinExpr = ADDJOIN + "INNER Join Trans_Relateds on Trans.cTrans_pk = Trans_Relateds.cTrans_fk" endif if not GuarantorPrefix + "Phones" $ this.cJoinExpr this.cJoinExpr = ADDJOIN + "INNER Join Phones " + ; GuarantorPrefix + ; "Phones on Trans_Relateds.cRelateds_fk = " + ; GuarantorPrefix + ; "Phones.cPointer_fk" endif else if not " Phones" $ this.cJoinExpr this.cJoinExpr = ADDJOIN + "INNER Join Phones " + ; "on Patients.cPatients_pk = Phones.cPointer_fk" endif this.cWhereExpr = ADDWHERE + "Phones.cPointer_Table_Name = 'PATIENTS'" endifetc.
>>*---------------------- Location Section ------------------------ >>* Library: Aformssearch.vcx >>* Class: Frmquicksearch >>* Method: Registercontrols() >>*----------------------- Usage Section -------------------------- >>*) Description: >>*) >> >>* Scope: Public >>* Parameters: >>*$ Usage: >>*$ >>* Returns: >>*--------------------- Maintenance Section ---------------------- >>* Change Log: >>* CREATED 05/20/2005 - NN >>* MODIFIED >>*---------------------------------------------------------------- >>lparameters tcClassName, tcNamedSearch >> >>with thisform.oSearchCollection >> if .getkey(m.tcNamedSearch) = 0 >> .add(m.tcClassName, m.tcNamedSearch) >> endif >>endwith >>>>