source: cprs/branches/HealthSevak-CPRS/CPRS-Chart/rGraphs.pas@ 1683

Last change on this file since 1683 was 830, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

File size: 9.0 KB
Line 
1unit rGraphs;
2
3interface
4
5uses SysUtils, Classes, Controls, Forms, ORNet, ORFn, Graphics;
6
7function rpcPublicEdit: Boolean;
8function rpcReportParams(ien: integer): String;
9
10procedure onoff(x: integer);
11
12function rpcTestGroups(user: int64): TStrings;
13function rpcATest(test: integer): TStrings;
14function rpcATestGroup(testgroup: Integer; user: int64): TStrings;
15function rpcClass(itemtype: string): TStrings;
16function rpcTaxonomy(alltax: boolean; taxonomies: TStrings): TStrings;
17procedure rpcDetailDay(Dest: TStrings; const PatientDFN: string; ADate1, ADate2: TFMDateTime;
18 ATypeItem: string; complete: boolean); //*DFN*
19function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime;
20 tests: TStringList; complete: boolean): TStrings; //*DFN*
21procedure rpcFastData(const PatientDFN: string; alldata: TStrings; var ok: boolean);
22procedure rpcFastItems(const PatientDFN: string; allitems: TStrings; var ok: boolean);
23procedure rpcFastLabs(const PatientDFN: string; alllabs: TStrings; var ok: boolean);
24function rpcFastTask(const PatientDFN, oldDFN: string): string;
25function rpcGetAllItems(const PatientDFN: string): TStrings;
26function rpcGetItems(typeitem: string; const PatientDFN: string): TStrings;
27function rpcGetItemData(itemdata, timestamp: string; const PatientDFN: string): TStrings;
28function rpcGetTypes(const PatientDFN: string; subtypes: boolean): TStrings;
29function rpcGetTestSpec: TStrings;
30function rpcTesting: TStrings;
31function rpcGetViews(vtype: string; user: int64): TStrings;
32
33function rpcGetGraphDateRange(reportid: string): TStrings;
34function rpcGetGraphSettings: TStrings;
35procedure rpcSetGraphSettings(paramsetting, permission: string);
36function rpcGetGraphSizing: TStrings;
37procedure rpcSetGraphSizing(values: TStrings);
38
39function rpcGetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings;
40procedure rpcSetGraphProfile(paramname, permission: string; paramvalues: TStrings);
41procedure rpcDeleteGraphProfile(paramname, permission: string);
42
43function rpcLookupItems(const filename, startfrom: string; direction: integer): TStrings;
44function rpcDateItem(oldestdate, newestdate: double; filenum: string; const PatientDFN: string): TStrings;
45
46implementation
47
48//-------- RPCs copied from rLabs -------------
49function rpcTestGroups(user: int64): TStrings;
50begin
51 CallV('ORWLRR TG', [user]);
52 MixedCaseList(RPCBrokerV.Results);
53 Result := RPCBrokerV.Results;
54end;
55
56function rpcATest(test: integer): TStrings;
57begin
58 CallV('ORWLRR ATESTS', [test]);
59 MixedCaseList(RPCBrokerV.Results);
60 Result := RPCBrokerV.Results;
61end;
62
63function rpcATestGroup(testgroup: Integer; user: int64): TStrings;
64begin
65 CallV('ORWLRR ATG', [testgroup, user]);
66 MixedCaseList(RPCBrokerV.Results);
67 Result := RPCBrokerV.Results;
68end;
69//------------------------------------------
70
71function rpcPublicEdit: Boolean;
72begin
73 onoff(1);
74 Result := sCallV('ORWGRPC PUBLIC', [nil]) = '1';
75 //Result := false; //************* for testing turn on
76 onoff(0);
77end;
78
79function rpcReportParams(ien: integer): String;
80begin
81 onoff(1);
82 Result := sCallV('ORWGRPC RPTPARAM', [ien]);
83 onoff(0);
84end;
85
86procedure rpcDetailDay(Dest: TStrings; const PatientDFN: string; ADate1, ADate2: TFMDateTime;
87 ATypeItem: string; complete: boolean); //*DFN*
88var
89 includecomplete: string;
90begin
91 if complete then includecomplete := '1' else includecomplete := '0';
92 onoff(1);
93 CallV('ORWGRPC DETAILS', [PatientDFN, ADate1, ADate2, ATypeItem, includecomplete]);
94 onoff(0);
95 FastAssign(RPCBrokerV.Results, Dest);
96end;
97
98function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime;
99 tests: TStringList; complete: boolean): TStrings; //*DFN*
100var
101 includecomplete: string;
102begin
103 if complete then includecomplete := '1' else includecomplete := '0';
104 onoff(1);
105 CallV('ORWGRPC DETAIL', [PatientDFN, ADate1, ADate2, tests, includecomplete]);
106 onoff(0);
107 Result := RPCBrokerV.Results;
108end;
109
110procedure rpcFastData(const PatientDFN: string; alldata: TStrings; var ok: boolean);
111begin
112 onoff(1);
113 CallV('ORWGRPC FASTDATA', [PatientDFN]);
114 onoff(0);
115 FastAssign(RPCBrokerV.Results, alldata);
116 ok := alldata.Count > 0;
117end;
118
119procedure rpcFastItems(const PatientDFN: string; allitems: TStrings; var ok: boolean);
120begin
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;
127end;
128
129procedure rpcFastLabs(const PatientDFN: string; alllabs: TStrings; var ok: boolean);
130begin
131 onoff(1);
132 CallV('ORWGRPC FASTLABS', [PatientDFN]);
133 onoff(0);
134 FastAssign(RPCBrokerV.Results, alllabs);
135 ok := alllabs.Count > 0;
136end;
137
138function rpcFastTask(const PatientDFN, oldDFN: string): string;
139begin
140 onoff(1);
141 Result := sCallV('ORWGRPC FASTTASK', [PatientDFN, oldDFN]);
142 onoff(0);
143end;
144
145function rpcGetAllItems(const PatientDFN: string): TStrings;
146begin
147 onoff(1);
148 CallV('ORWGRPC ALLITEMS', [PatientDFN]);
149 onoff(0);
150 MixedCaseList(RPCBrokerV.Results);
151 Result := RPCBrokerV.Results;
152end;
153
154function rpcGetTypes(const PatientDFN: string; subtypes: boolean): TStrings;
155var
156 includesubtypes: string;
157begin
158 if subtypes then includesubtypes := '1' else includesubtypes := '0';
159 onoff(1);
160 CallV('ORWGRPC TYPES', [PatientDFN, includesubtypes]);
161 onoff(0);
162 MixedCaseList(RPCBrokerV.Results);
163 Result := RPCBrokerV.Results;
164end;
165
166function rpcGetItems(typeitem: string; const PatientDFN: string): TStrings;
167begin
168 onoff(1);
169 CallV('ORWGRPC ITEMS', [PatientDFN, typeitem]);
170 onoff(0);
171 MixedCaseList(RPCBrokerV.Results);
172 Result := RPCBrokerV.Results;
173end;
174
175function rpcClass(itemtype: string): TStrings;
176begin
177 onoff(1);
178 CallV('ORWGRPC CLASS', [itemtype]);
179 onoff(0);
180 MixedCaseList(RPCBrokerV.Results);
181 Result := RPCBrokerV.Results;
182end;
183
184function rpcTaxonomy(alltax: boolean; taxonomies: TStrings): TStrings;
185var
186 getall: string;
187begin
188 if alltax then getall := '1' else getall := '0';
189 onoff(1);
190 CallV('ORWGRPC TAX', [getall, taxonomies]);
191 onoff(0);
192 Result := RPCBrokerV.Results;
193end;
194
195function rpcGetItemData(itemdata, timestamp: string; const PatientDFN: string): TStrings;
196begin
197 onoff(1);
198 CallV('ORWGRPC ITEMDATA', [itemdata, timestamp, PatientDFN]);
199 onoff(0);
200 Result := RPCBrokerV.Results;
201end;
202
203function rpcGetGraphDateRange(reportid: string): TStrings;
204begin
205 onoff(1);
206 CallV('ORWGRPC GETDATES', [reportid]);
207 onoff(0);
208 Result := RPCBrokerV.Results;
209end;
210
211function rpcGetGraphSettings: TStrings;
212begin
213 onoff(1);
214 CallV('ORWGRPC GETPREF', [nil]);
215 onoff(0);
216 Result := RPCBrokerV.Results;
217end;
218
219procedure rpcSetGraphSettings(paramsetting, permission: string);
220begin
221 onoff(1);
222 CallV('ORWGRPC SETPREF', [paramsetting, permission]);
223 onoff(0);
224end;
225
226function rpcGetGraphSizing: TStrings;
227begin
228 onoff(1);
229 CallV('ORWGRPC GETSIZE', [nil]);
230 onoff(0);
231 Result := RPCBrokerV.Results;
232end;
233
234procedure rpcSetGraphSizing(values: TStrings);
235begin
236 onoff(1);
237 CallV('ORWGRPC SETSIZE', [values]);
238 onoff(0);
239end;
240
241function rpcGetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings;
242begin
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);
248 Result := RPCBrokerV.Results;
249end;
250
251procedure rpcSetGraphProfile(paramname, permission: string; paramvalues: TStrings);
252begin
253 onoff(1);
254 CallV('ORWGRPC SETVIEWS', [paramname, permission, paramvalues]);
255 onoff(0);
256end;
257
258procedure rpcDeleteGraphProfile(paramname, permission: string);
259begin
260 onoff(1);
261 CallV('ORWGRPC DELVIEWS', [paramname, permission]);
262 onoff(0);
263end;
264
265function rpcGetTestSpec: TStrings;
266begin
267 onoff(1);
268 CallV('ORWGRPC TESTSPEC', []);
269 onoff(0);
270 Result := RPCBrokerV.Results;
271end;
272
273function rpcTesting: TStrings;
274begin
275 onoff(1);
276 CallV('ORWGRPC TESTING', []);
277 onoff(0);
278 Result := RPCBrokerV.Results;
279end;
280
281function rpcGetViews(vtype: string; user: int64): TStrings;
282begin
283 onoff(1);
284 CallV('ORWGRPC ALLVIEWS', [vtype, user]);
285 onoff(0);
286 MixedCaseList(RPCBrokerV.Results);
287 Result := RPCBrokerV.Results;
288end;
289
290function rpcLookupItems(const filename, StartFrom: string; Direction: integer): TStrings;
291begin
292 onoff(1);
293 CallV('ORWGRPC LOOKUP', [filename, StartFrom, Direction]);
294 onoff(0);
295 MixedCaseList(RPCBrokerV.Results);
296 Result := RPCBrokerV.Results;
297end;
298
299function rpcDateItem(oldestdate, newestdate: double; filenum: string; const PatientDFN: string): TStrings;
300begin
301 onoff(1);
302 CallV('ORWGRPC DATEITEM', [oldestdate, newestdate, filenum, PatientDFN]);
303 onoff(0);
304 Result := RPCBrokerV.Results;
305end;
306
307procedure onoff(x: integer);
308begin
309 if x = 1 then
310 begin
311 //beep;
312 //Screen.Cursor := crHourGlass;
313 end
314 else
315 begin
316 //sleep(3000);
317 //Screen.Cursor := crDefault;
318 //sleep(1000);
319 end;
320end;
321
322end.
Note: See TracBrowser for help on using the repository browser.