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