Changeset 830 for cprs/trunk/CPRS-Chart/rGraphs.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/rGraphs.pas
r456 r830 8 8 function rpcReportParams(ien: integer): String; 9 9 10 procedure FastAdd(source: TStrings; destination: TStrings); // not used 11 procedure FastAssign(source: TStrings; destination: TStrings); 12 // example: FastAssign(rpcDrugClass, lstDrugClass.Items) 13 10 procedure onoff(x: integer); 11 12 function rpcTestGroups(user: int64): TStrings; 13 function rpcATest(test: integer): TStrings; 14 function rpcATestGroup(testgroup: Integer; user: int64): TStrings; 14 15 function rpcClass(itemtype: string): TStrings; 15 16 function rpcTaxonomy(alltax: boolean; taxonomies: TStrings): TStrings; … … 17 18 ATypeItem: string; complete: boolean); //*DFN* 18 19 function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime; 19 tests: TStrings; complete: boolean): TStrings; //*DFN* 20 tests: TStringList; complete: boolean): TStrings; //*DFN* 21 procedure rpcFastData(const PatientDFN: string; alldata: TStrings; var ok: boolean); 22 procedure rpcFastItems(const PatientDFN: string; allitems: TStrings; var ok: boolean); 23 procedure rpcFastLabs(const PatientDFN: string; alllabs: TStrings; var ok: boolean); 24 function rpcFastTask(const PatientDFN, oldDFN: string): string; 20 25 function rpcGetAllItems(const PatientDFN: string): TStrings; 21 26 function rpcGetItems(typeitem: string; const PatientDFN: string): TStrings; … … 23 28 function rpcGetTypes(const PatientDFN: string; subtypes: boolean): TStrings; 24 29 function rpcGetTestSpec: TStrings; 30 function rpcTesting: TStrings; 31 function rpcGetViews(vtype: string; user: int64): TStrings; 25 32 26 33 function rpcGetGraphDateRange(reportid: string): TStrings; … … 30 37 procedure rpcSetGraphSizing(values: TStrings); 31 38 32 function rpcGetGraphProfiles(profiles, permission: string; ext: integer ): TStrings;39 function rpcGetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings; 33 40 procedure rpcSetGraphProfile(paramname, permission: string; paramvalues: TStrings); 34 41 procedure rpcDeleteGraphProfile(paramname, permission: string); … … 36 43 function rpcLookupItems(const filename, startfrom: string; direction: integer): TStrings; 37 44 function rpcDateItem(oldestdate, newestdate: double; filenum: string; const PatientDFN: string): TStrings; 38 procedure onoff(x: integer);39 45 40 46 implementation 47 48 //-------- RPCs copied from rLabs ------------- 49 function rpcTestGroups(user: int64): TStrings; 50 begin 51 CallV('ORWLRR TG', [user]); 52 MixedCaseList(RPCBrokerV.Results); 53 Result := RPCBrokerV.Results; 54 end; 55 56 function rpcATest(test: integer): TStrings; 57 begin 58 CallV('ORWLRR ATESTS', [test]); 59 MixedCaseList(RPCBrokerV.Results); 60 Result := RPCBrokerV.Results; 61 end; 62 63 function rpcATestGroup(testgroup: Integer; user: int64): TStrings; 64 begin 65 CallV('ORWLRR ATG', [testgroup, user]); 66 MixedCaseList(RPCBrokerV.Results); 67 Result := RPCBrokerV.Results; 68 end; 69 //------------------------------------------ 41 70 42 71 function rpcPublicEdit: Boolean; … … 53 82 Result := sCallV('ORWGRPC RPTPARAM', [ien]); 54 83 onoff(0); 55 end;56 57 procedure FastAssign(source: TStrings; destination: TStrings);58 var59 ms: TMemoryStream;60 begin61 destination.Clear;62 ms := TMemoryStream.Create;63 try64 source.SaveToStream(ms);65 ms.Seek(0, soFromBeginning);66 destination.LoadFromStream(ms);67 finally68 ms.Free;69 end;70 end;71 72 procedure FastAdd(source: TStrings; destination: TStrings);73 var74 ms: TMemoryStream;75 begin76 destination.Clear;77 ms := TMemoryStream.Create;78 try79 destination.SaveToStream(ms);80 ms.Seek(soFromEnd, 0);81 source.SaveToStream(ms);82 ms.Seek(0, soFromBeginning);83 destination.LoadFromStream(ms);84 finally85 ms.Free;86 end;87 84 end; 88 85 … … 96 93 CallV('ORWGRPC DETAILS', [PatientDFN, ADate1, ADate2, ATypeItem, includecomplete]); 97 94 onoff(0); 98 QuickCopy(RPCBrokerV.Results, Dest);95 FastAssign(RPCBrokerV.Results, Dest); 99 96 end; 100 97 101 98 function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime; 102 tests: TString s; complete: boolean): TStrings; //*DFN*99 tests: TStringList; complete: boolean): TStrings; //*DFN* 103 100 var 104 101 includecomplete: string; … … 109 106 onoff(0); 110 107 Result := RPCBrokerV.Results; 108 end; 109 110 procedure rpcFastData(const PatientDFN: string; alldata: TStrings; var ok: boolean); 111 begin 112 onoff(1); 113 CallV('ORWGRPC FASTDATA', [PatientDFN]); 114 onoff(0); 115 FastAssign(RPCBrokerV.Results, alldata); 116 ok := alldata.Count > 0; 117 end; 118 119 procedure rpcFastItems(const PatientDFN: string; allitems: TStrings; var ok: boolean); 120 begin 121 onoff(1); 122 CallV('ORWGRPC FASTITEM', [PatientDFN]); 123 onoff(0); 124 MixedCaseList(RPCBrokerV.Results); 125 FastAssign(RPCBrokerV.Results, allitems); 126 ok := allitems.Count > 0; 127 end; 128 129 procedure rpcFastLabs(const PatientDFN: string; alllabs: TStrings; var ok: boolean); 130 begin 131 onoff(1); 132 CallV('ORWGRPC FASTLABS', [PatientDFN]); 133 onoff(0); 134 FastAssign(RPCBrokerV.Results, alllabs); 135 ok := alllabs.Count > 0; 136 end; 137 138 function rpcFastTask(const PatientDFN, oldDFN: string): string; 139 begin 140 onoff(1); 141 Result := sCallV('ORWGRPC FASTTASK', [PatientDFN, oldDFN]); 142 onoff(0); 111 143 end; 112 144 … … 207 239 end; 208 240 209 function rpcGetGraphProfiles(profiles, permission: string; ext: integer): TStrings; 210 begin 211 onoff(1); 212 CallV('ORWGRPC GETVIEWS', [profiles, permission, ext]); 213 onoff(0); 214 if (profiles = '1') or (ext = 1) then MixedCaseList(RPCBrokerV.Results); 241 function rpcGetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings; 242 begin 243 onoff(1); 244 CallV('ORWGRPC GETVIEWS', [profiles, permission, ext, userx]); 245 onoff(0); 246 if (profiles = '1') or (ext = 1) then 247 MixedCaseList(RPCBrokerV.Results); 215 248 Result := RPCBrokerV.Results; 216 249 end; … … 235 268 CallV('ORWGRPC TESTSPEC', []); 236 269 onoff(0); 270 Result := RPCBrokerV.Results; 271 end; 272 273 function rpcTesting: TStrings; 274 begin 275 onoff(1); 276 CallV('ORWGRPC TESTING', []); 277 onoff(0); 278 Result := RPCBrokerV.Results; 279 end; 280 281 function rpcGetViews(vtype: string; user: int64): TStrings; 282 begin 283 onoff(1); 284 CallV('ORWGRPC ALLVIEWS', [vtype, user]); 285 onoff(0); 286 MixedCaseList(RPCBrokerV.Results); 237 287 Result := RPCBrokerV.Results; 238 288 end; … … 259 309 if x = 1 then 260 310 begin 311 //beep; 261 312 //Screen.Cursor := crHourGlass; 262 313 end 263 314 else 264 315 begin 316 //sleep(3000); 265 317 //Screen.Cursor := crDefault; 318 //sleep(1000); 266 319 end; 267 320 end;
Note:
See TracChangeset
for help on using the changeset viewer.