| 1 | //kt -- Modified with SourceScanner on 8/25/2007 | 
|---|
| 2 | unit rProbs; | 
|---|
| 3 |  | 
|---|
| 4 | interface | 
|---|
| 5 |  | 
|---|
| 6 | uses SysUtils, Classes, ORNet, ORFn, uCore; | 
|---|
| 7 |  | 
|---|
| 8 | function AddSave(PatientInfo: string; ProviderID: int64; ptVAMC: string; | 
|---|
| 9 | ProbFile: TStringList): TStrings ; | 
|---|
| 10 | function AuditHistory(ProblemIFN: string): TStrings ; | 
|---|
| 11 | function ClinicFilterList(LocList: TStringList): TStrings ; | 
|---|
| 12 | function ClinicSearch(DummyArg:string): TStrings ; | 
|---|
| 13 | function ProblemDelete(ProblemIFN: string; ProviderID: int64; ptVAMC, Comment: string): TStrings ; | 
|---|
| 14 | {function ProblemDetail} | 
|---|
| 15 | function EditLoad(ProblemIFN: string; ProviderID: int64; ptVAMC: string): TStrings ; | 
|---|
| 16 | function EditSave(ProblemIFN: string; ProviderID: int64; ptVAMC, PrimUser: string; | 
|---|
| 17 | ProbFile: TStringList): TStrings ; | 
|---|
| 18 | function InitPt(const PatientDFN: string): TStrings ;  //*DFN* | 
|---|
| 19 | function InitUser(ProviderID: int64): TStrings ; | 
|---|
| 20 | function PatientProviders(const PatientDFN: string): TStrings ;  //*DFN* | 
|---|
| 21 | function ProblemList(const PatientDFN: string; Status:string): TStrings ;  //*DFN* | 
|---|
| 22 | function OldProblemLexiconSearch(SearchFor: string; Matches: integer; ADate: TFMDateTime = 0): TStrings ; | 
|---|
| 23 | function ProblemLexiconCodeSearch(LexIEN: string; CodeType: string; ADate: TFMDateTime = 0): string ; | 
|---|
| 24 | function ProblemLexiconSearch(SearchFor: string; View: string; ADate: TFMDateTime = 0): TStrings ; | 
|---|
| 25 | function ProviderFilterList(ProvList: TStringList): TStrings ; | 
|---|
| 26 | function ProviderList(Flag:string; Number:integer; From,Part: string): TStrings ; | 
|---|
| 27 | function ProblemReplace(ProblemIFN: string): TStrings ; | 
|---|
| 28 | function ServiceFilterList(LocList: TStringList): TStrings ; | 
|---|
| 29 | function ServiceSearch(const StartFrom: string; Direction: Integer; All: boolean = FALSE): TStrings; | 
|---|
| 30 | function ProblemUpdate(AltProbFile: TStringList): TStrings ; | 
|---|
| 31 | function UserProblemCategories(Provider: int64; Location: integer): TStrings ; | 
|---|
| 32 | function UserProblemList(CategoryIEN: string): TStrings ; | 
|---|
| 33 | function ProblemVerify(ProblemIFN: string): TStrings ; | 
|---|
| 34 | function GetProblemComments(ProblemIFN: string): TStrings; | 
|---|
| 35 | procedure SaveViewPreferences(ViewPref: string); | 
|---|
| 36 | function CheckForDuplicateProblem(TermIEN, TermText: string): string; | 
|---|
| 37 |  | 
|---|
| 38 | implementation | 
|---|
| 39 |  | 
|---|
| 40 | function AddSave(PatientInfo: string; ProviderID: int64; ptVAMC: string; | 
|---|
| 41 | ProbFile: TStringList): TStrings ; | 
|---|
| 42 | begin | 
|---|
| 43 | CallV('ORQQPL ADD SAVE',[PatientInfo, ProviderID, ptVAMC, ProbFile]); | 
|---|
| 44 | Result := RPCBrokerV.Results ; | 
|---|
| 45 | end ; | 
|---|
| 46 |  | 
|---|
| 47 | function AuditHistory(ProblemIFN: string): TStrings ; | 
|---|
| 48 | begin | 
|---|
| 49 | CallV('ORQQPL AUDIT HIST',[ProblemIFN]); | 
|---|
| 50 | Result := RPCBrokerV.Results ; | 
|---|
| 51 | end ; | 
|---|
| 52 |  | 
|---|
| 53 | function ClinicFilterList(LocList: TStringList): TStrings ; | 
|---|
| 54 | begin | 
|---|
| 55 | CallV('ORQQPL CLIN FILTER LIST',[LocList]); | 
|---|
| 56 | MixedCaseList(RPCBrokerV.Results) ; | 
|---|
| 57 | Result := RPCBrokerV.Results; | 
|---|
| 58 | end ; | 
|---|
| 59 |  | 
|---|
| 60 | function ClinicSearch(DummyArg:string): TStrings ; | 
|---|
| 61 | begin | 
|---|
| 62 | CallV('ORQQPL CLIN SRCH',[DummyArg]); | 
|---|
| 63 | Result := RPCBrokerV.Results ; | 
|---|
| 64 | end ; | 
|---|
| 65 |  | 
|---|
| 66 | function ProblemDelete(ProblemIFN: string; ProviderID: int64; ptVAMC, Comment: string): TStrings ; | 
|---|
| 67 | begin | 
|---|
| 68 | CallV('ORQQPL DELETE',[ProblemIFN, ProviderID, ptVAMC, Comment]); | 
|---|
| 69 | Result := RPCBrokerV.Results ; | 
|---|
| 70 | end ; | 
|---|
| 71 |  | 
|---|
| 72 | function EditLoad(ProblemIFN: string; ProviderID: int64; ptVAMC: string): TStrings ; | 
|---|
| 73 | begin | 
|---|
| 74 | CallV('ORQQPL EDIT LOAD',[ProblemIFN, ProviderID, ptVAMC]); | 
|---|
| 75 | Result := RPCBrokerV.Results ; | 
|---|
| 76 | end ; | 
|---|
| 77 |  | 
|---|
| 78 | function EditSave(ProblemIFN: string; ProviderID: int64; ptVAMC, PrimUser: string; | 
|---|
| 79 | ProbFile: TStringList): TStrings ; | 
|---|
| 80 | begin | 
|---|
| 81 | CallV('ORQQPL EDIT SAVE',[ProblemIFN, ProviderID, ptVAMC, PrimUser, ProbFile]); | 
|---|
| 82 | Result := RPCBrokerV.Results ; | 
|---|
| 83 | end ; | 
|---|
| 84 |  | 
|---|
| 85 | function InitPt(const PatientDFN: string): TStrings ;  //*DFN* | 
|---|
| 86 | begin | 
|---|
| 87 | CallV('ORQQPL INIT PT',[PatientDFN]); | 
|---|
| 88 | Result := RPCBrokerV.Results ; | 
|---|
| 89 | end ; | 
|---|
| 90 |  | 
|---|
| 91 | function InitUser(ProviderID: int64): TStrings ; | 
|---|
| 92 | begin | 
|---|
| 93 | CallV('ORQQPL INIT USER',[ProviderID]); | 
|---|
| 94 | Result := RPCBrokerV.Results ; | 
|---|
| 95 | end ; | 
|---|
| 96 |  | 
|---|
| 97 | function PatientProviders(const PatientDFN: string): TStrings ;  //*DFN* | 
|---|
| 98 | begin | 
|---|
| 99 | CallV('ORQPT PATIENT TEAM PROVIDERS',[PatientDFN]); | 
|---|
| 100 | Result := RPCBrokerV.Results ; | 
|---|
| 101 | end ; | 
|---|
| 102 |  | 
|---|
| 103 | function ProblemLexiconSearch(SearchFor: string; View: string; ADate: TFMDateTime = 0): TStrings ; | 
|---|
| 104 | begin | 
|---|
| 105 | CallV('ORWPCE LEX',[SearchFor,View, ADate]); | 
|---|
| 106 | Result := RPCBrokerV.Results ; | 
|---|
| 107 | end ; | 
|---|
| 108 |  | 
|---|
| 109 | function ProblemLexiconCodeSearch(LexIEN: string; CodeType: string; ADate: TFMDateTime = 0): string ; | 
|---|
| 110 | begin | 
|---|
| 111 | CallV('ORWPCE LEXCODE',[LexIEN, CodeType, ADate]); | 
|---|
| 112 | Result := RPCBrokerV.Results[0] ; | 
|---|
| 113 | end ; | 
|---|
| 114 |  | 
|---|
| 115 | function OldProblemLexiconSearch(SearchFor: string; Matches: integer; ADate: TFMDateTime = 0): TStrings ; | 
|---|
| 116 | const | 
|---|
| 117 | VIEW = ''; | 
|---|
| 118 | begin | 
|---|
| 119 | CallV('ORQQPL PROBLEM LEX SEARCH',[SearchFor, Matches, VIEW, ADate]); | 
|---|
| 120 | Result := RPCBrokerV.Results ; | 
|---|
| 121 | end ; | 
|---|
| 122 |  | 
|---|
| 123 | function ProblemList(const PatientDFN: string; Status:string): TStrings ;  //*DFN* | 
|---|
| 124 | begin | 
|---|
| 125 | CallV('ORQQPL PROBLEM LIST',[PatientDFN, status]); | 
|---|
| 126 | Result := RPCBrokerV.Results ; | 
|---|
| 127 | end ; | 
|---|
| 128 |  | 
|---|
| 129 | function ProviderFilterList(ProvList: TStringList): TStrings ; | 
|---|
| 130 | begin | 
|---|
| 131 | CallV('ORQQPL PROV FILTER LIST',[ProvList]); | 
|---|
| 132 | Result := RPCBrokerV.Results ; | 
|---|
| 133 | end ; | 
|---|
| 134 |  | 
|---|
| 135 | function ProviderList(Flag:string; Number:integer; From,Part: string): TStrings ; | 
|---|
| 136 | begin | 
|---|
| 137 | CallV('ORQQPL PROVIDER LIST',[Flag,Number,From,Part]); | 
|---|
| 138 | Result := RPCBrokerV.Results ; | 
|---|
| 139 | end ; | 
|---|
| 140 |  | 
|---|
| 141 | function ProblemReplace(ProblemIFN: string): TStrings ; | 
|---|
| 142 | begin | 
|---|
| 143 | CallV('ORQQPL REPLACE',[ProblemIFN]); | 
|---|
| 144 | Result := RPCBrokerV.Results ; | 
|---|
| 145 | end ; | 
|---|
| 146 |  | 
|---|
| 147 | function ServiceFilterList(LocList: TStringList): TStrings ; | 
|---|
| 148 | begin | 
|---|
| 149 | CallV('ORQQPL SERV FILTER LIST',[LocList]); | 
|---|
| 150 | MixedCaseList(RPCBrokerV.Results) ; | 
|---|
| 151 | Result := RPCBrokerV.Results; | 
|---|
| 152 | end ; | 
|---|
| 153 |  | 
|---|
| 154 | function ServiceSearch(const StartFrom: string; Direction: Integer; All: boolean = FALSE): TStrings; | 
|---|
| 155 | begin | 
|---|
| 156 | CallV('ORQQPL SRVC SRCH',[StartFrom, Direction, BoolChar[All]]); | 
|---|
| 157 | MixedCaseList(RPCBrokerV.Results) ; | 
|---|
| 158 | Result := RPCBrokerV.Results ; | 
|---|
| 159 | end ; | 
|---|
| 160 |  | 
|---|
| 161 | function ProblemUpdate(AltProbFile: TStringList): TStrings ; | 
|---|
| 162 | begin | 
|---|
| 163 | CallV('ORQQPL UPDATE',[AltProbFile]); | 
|---|
| 164 | Result := RPCBrokerV.Results ; | 
|---|
| 165 | end ; | 
|---|
| 166 |  | 
|---|
| 167 | function ProblemVerify(ProblemIFN: string): TStrings ; | 
|---|
| 168 | begin | 
|---|
| 169 | CallV('ORQQPL VERIFY',[ProblemIFN]); | 
|---|
| 170 | Result := RPCBrokerV.Results ; | 
|---|
| 171 | end ; | 
|---|
| 172 |  | 
|---|
| 173 | function UserProblemCategories(Provider: int64; Location: integer): TStrings ; | 
|---|
| 174 | begin | 
|---|
| 175 | CallV('ORQQPL USER PROB CATS',[Provider, Location]); | 
|---|
| 176 | Result := RPCBrokerV.Results ; | 
|---|
| 177 | end ; | 
|---|
| 178 |  | 
|---|
| 179 | function UserProblemList(CategoryIEN: string): TStrings ; | 
|---|
| 180 | begin | 
|---|
| 181 | CallV('ORQQPL USER PROB LIST',[CategoryIEN]); | 
|---|
| 182 | Result := RPCBrokerV.Results ; | 
|---|
| 183 | end ; | 
|---|
| 184 |  | 
|---|
| 185 | function GetProblemComments(ProblemIFN: string): TStrings; | 
|---|
| 186 | begin | 
|---|
| 187 | CallV('ORQQPL PROB COMMENTS',[ProblemIFN]); | 
|---|
| 188 | Result := RPCBrokerV.Results ; | 
|---|
| 189 | end; | 
|---|
| 190 |  | 
|---|
| 191 | procedure SaveViewPreferences(ViewPref: string); | 
|---|
| 192 | begin | 
|---|
| 193 | CallV('ORQQPL SAVEVIEW',[ViewPref]); | 
|---|
| 194 | end; | 
|---|
| 195 |  | 
|---|
| 196 | function CheckForDuplicateProblem(TermIEN, TermText: string): string; | 
|---|
| 197 | begin | 
|---|
| 198 | CallV('ORQQPL CHECK DUP',[Patient.DFN, TermIEN, TermText]); | 
|---|
| 199 | Result := RPCBrokerV.Results[0]; | 
|---|
| 200 | end; | 
|---|
| 201 |  | 
|---|
| 202 | end. | 
|---|