source: cprs/trunk/CPRS-Chart/rGraphs.pas@ 776

Last change on this file since 776 was 456, checked in by Kevin Toppenberg, 16 years ago

Initial Upload of Official WV CPRS 1.0.26.76

File size: 7.3 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 FastAdd(source: TStrings; destination: TStrings); // not used
11procedure FastAssign(source: TStrings; destination: TStrings);
12 // example: FastAssign(rpcDrugClass, lstDrugClass.Items)
13
14function rpcClass(itemtype: string): TStrings;
15function rpcTaxonomy(alltax: boolean; taxonomies: TStrings): TStrings;
16procedure rpcDetailDay(Dest: TStrings; const PatientDFN: string; ADate1, ADate2: TFMDateTime;
17 ATypeItem: string; complete: boolean); //*DFN*
18function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime;
19 tests: TStrings; complete: boolean): TStrings; //*DFN*
20function rpcGetAllItems(const PatientDFN: string): TStrings;
21function rpcGetItems(typeitem: string; const PatientDFN: string): TStrings;
22function rpcGetItemData(itemdata, timestamp: string; const PatientDFN: string): TStrings;
23function rpcGetTypes(const PatientDFN: string; subtypes: boolean): TStrings;
24function rpcGetTestSpec: TStrings;
25
26function rpcGetGraphDateRange(reportid: string): TStrings;
27function rpcGetGraphSettings: TStrings;
28procedure rpcSetGraphSettings(paramsetting, permission: string);
29function rpcGetGraphSizing: TStrings;
30procedure rpcSetGraphSizing(values: TStrings);
31
32function rpcGetGraphProfiles(profiles, permission: string; ext: integer): TStrings;
33procedure rpcSetGraphProfile(paramname, permission: string; paramvalues: TStrings);
34procedure rpcDeleteGraphProfile(paramname, permission: string);
35
36function rpcLookupItems(const filename, startfrom: string; direction: integer): TStrings;
37function rpcDateItem(oldestdate, newestdate: double; filenum: string; const PatientDFN: string): TStrings;
38procedure onoff(x: integer);
39
40implementation
41
42function rpcPublicEdit: Boolean;
43begin
44 onoff(1);
45 Result := sCallV('ORWGRPC PUBLIC', [nil]) = '1';
46 //Result := false; //************* for testing turn on
47 onoff(0);
48end;
49
50function rpcReportParams(ien: integer): String;
51begin
52 onoff(1);
53 Result := sCallV('ORWGRPC RPTPARAM', [ien]);
54 onoff(0);
55end;
56
57procedure FastAssign(source: TStrings; destination: TStrings);
58var
59 ms: TMemoryStream;
60begin
61 destination.Clear;
62 ms := TMemoryStream.Create;
63 try
64 source.SaveToStream(ms);
65 ms.Seek(0, soFromBeginning);
66 destination.LoadFromStream(ms);
67 finally
68 ms.Free;
69 end;
70end;
71
72procedure FastAdd(source: TStrings; destination: TStrings);
73var
74 ms: TMemoryStream;
75begin
76 destination.Clear;
77 ms := TMemoryStream.Create;
78 try
79 destination.SaveToStream(ms);
80 ms.Seek(soFromEnd, 0);
81 source.SaveToStream(ms);
82 ms.Seek(0, soFromBeginning);
83 destination.LoadFromStream(ms);
84 finally
85 ms.Free;
86 end;
87end;
88
89procedure rpcDetailDay(Dest: TStrings; const PatientDFN: string; ADate1, ADate2: TFMDateTime;
90 ATypeItem: string; complete: boolean); //*DFN*
91var
92 includecomplete: string;
93begin
94 if complete then includecomplete := '1' else includecomplete := '0';
95 onoff(1);
96 CallV('ORWGRPC DETAILS', [PatientDFN, ADate1, ADate2, ATypeItem, includecomplete]);
97 onoff(0);
98 QuickCopy(RPCBrokerV.Results, Dest);
99end;
100
101function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime;
102 tests: TStrings; complete: boolean): TStrings; //*DFN*
103var
104 includecomplete: string;
105begin
106 if complete then includecomplete := '1' else includecomplete := '0';
107 onoff(1);
108 CallV('ORWGRPC DETAIL', [PatientDFN, ADate1, ADate2, tests, includecomplete]);
109 onoff(0);
110 Result := RPCBrokerV.Results;
111end;
112
113function rpcGetAllItems(const PatientDFN: string): TStrings;
114begin
115 onoff(1);
116 CallV('ORWGRPC ALLITEMS', [PatientDFN]);
117 onoff(0);
118 MixedCaseList(RPCBrokerV.Results);
119 Result := RPCBrokerV.Results;
120end;
121
122function rpcGetTypes(const PatientDFN: string; subtypes: boolean): TStrings;
123var
124 includesubtypes: string;
125begin
126 if subtypes then includesubtypes := '1' else includesubtypes := '0';
127 onoff(1);
128 CallV('ORWGRPC TYPES', [PatientDFN, includesubtypes]);
129 onoff(0);
130 MixedCaseList(RPCBrokerV.Results);
131 Result := RPCBrokerV.Results;
132end;
133
134function rpcGetItems(typeitem: string; const PatientDFN: string): TStrings;
135begin
136 onoff(1);
137 CallV('ORWGRPC ITEMS', [PatientDFN, typeitem]);
138 onoff(0);
139 MixedCaseList(RPCBrokerV.Results);
140 Result := RPCBrokerV.Results;
141end;
142
143function rpcClass(itemtype: string): TStrings;
144begin
145 onoff(1);
146 CallV('ORWGRPC CLASS', [itemtype]);
147 onoff(0);
148 MixedCaseList(RPCBrokerV.Results);
149 Result := RPCBrokerV.Results;
150end;
151
152function rpcTaxonomy(alltax: boolean; taxonomies: TStrings): TStrings;
153var
154 getall: string;
155begin
156 if alltax then getall := '1' else getall := '0';
157 onoff(1);
158 CallV('ORWGRPC TAX', [getall, taxonomies]);
159 onoff(0);
160 Result := RPCBrokerV.Results;
161end;
162
163function rpcGetItemData(itemdata, timestamp: string; const PatientDFN: string): TStrings;
164begin
165 onoff(1);
166 CallV('ORWGRPC ITEMDATA', [itemdata, timestamp, PatientDFN]);
167 onoff(0);
168 Result := RPCBrokerV.Results;
169end;
170
171function rpcGetGraphDateRange(reportid: string): TStrings;
172begin
173 onoff(1);
174 CallV('ORWGRPC GETDATES', [reportid]);
175 onoff(0);
176 Result := RPCBrokerV.Results;
177end;
178
179function rpcGetGraphSettings: TStrings;
180begin
181 onoff(1);
182 CallV('ORWGRPC GETPREF', [nil]);
183 onoff(0);
184 Result := RPCBrokerV.Results;
185end;
186
187procedure rpcSetGraphSettings(paramsetting, permission: string);
188begin
189 onoff(1);
190 CallV('ORWGRPC SETPREF', [paramsetting, permission]);
191 onoff(0);
192end;
193
194function rpcGetGraphSizing: TStrings;
195begin
196 onoff(1);
197 CallV('ORWGRPC GETSIZE', [nil]);
198 onoff(0);
199 Result := RPCBrokerV.Results;
200end;
201
202procedure rpcSetGraphSizing(values: TStrings);
203begin
204 onoff(1);
205 CallV('ORWGRPC SETSIZE', [values]);
206 onoff(0);
207end;
208
209function rpcGetGraphProfiles(profiles, permission: string; ext: integer): TStrings;
210begin
211 onoff(1);
212 CallV('ORWGRPC GETVIEWS', [profiles, permission, ext]);
213 onoff(0);
214 if (profiles = '1') or (ext = 1) then MixedCaseList(RPCBrokerV.Results);
215 Result := RPCBrokerV.Results;
216end;
217
218procedure rpcSetGraphProfile(paramname, permission: string; paramvalues: TStrings);
219begin
220 onoff(1);
221 CallV('ORWGRPC SETVIEWS', [paramname, permission, paramvalues]);
222 onoff(0);
223end;
224
225procedure rpcDeleteGraphProfile(paramname, permission: string);
226begin
227 onoff(1);
228 CallV('ORWGRPC DELVIEWS', [paramname, permission]);
229 onoff(0);
230end;
231
232function rpcGetTestSpec: TStrings;
233begin
234 onoff(1);
235 CallV('ORWGRPC TESTSPEC', []);
236 onoff(0);
237 Result := RPCBrokerV.Results;
238end;
239
240function rpcLookupItems(const filename, StartFrom: string; Direction: integer): TStrings;
241begin
242 onoff(1);
243 CallV('ORWGRPC LOOKUP', [filename, StartFrom, Direction]);
244 onoff(0);
245 MixedCaseList(RPCBrokerV.Results);
246 Result := RPCBrokerV.Results;
247end;
248
249function rpcDateItem(oldestdate, newestdate: double; filenum: string; const PatientDFN: string): TStrings;
250begin
251 onoff(1);
252 CallV('ORWGRPC DATEITEM', [oldestdate, newestdate, filenum, PatientDFN]);
253 onoff(0);
254 Result := RPCBrokerV.Results;
255end;
256
257procedure onoff(x: integer);
258begin
259 if x = 1 then
260 begin
261 //Screen.Cursor := crHourGlass;
262 end
263 else
264 begin
265 //Screen.Cursor := crDefault;
266 end;
267end;
268
269end.
Note: See TracBrowser for help on using the repository browser.