Module

fGraphData

Path

C:\CPRS\CPRS30\fGraphData.pas

Last Modified

7/15/2014 3:26:36 PM

Units Used in Interface

Name Comments
fBase508Form -

Units Used in Implementation

Name Comments
rGraphs -
uCore -
uGraphs -

Classes

Name Comments
TfrmGraphData -

Procedures

Name Owner Declaration Scope Comments
btnDataClick TfrmGraphData procedure btnDataClick(Sender: TObject); Public/Published ----------------------------- displays when testing
btnRefreshClick TfrmGraphData procedure btnRefreshClick(Sender: TObject); Public/Published -
btnTestingClick TfrmGraphData procedure btnTestingClick(Sender: TObject); Public/Published -
ClearGtsl TfrmGraphData procedure ClearGtsl; Public -
ClearMemos TfrmGraphData procedure ClearMemos; Private -
ClearPtData TfrmGraphData procedure ClearPtData; Public -
FillMemos TfrmGraphData procedure FillMemos; Private -
FormClose TfrmGraphData procedure FormClose(Sender: TObject; var Action: TCloseAction); Public/Published ---------------------------------------------------
FormCreate TfrmGraphData procedure FormCreate(Sender: TObject); Public/Published
Procedure GraphDataForm;            // not used - perhaps with separate object for data
var
  frmGraphData: TfrmGraphData;
begin
  frmGraphData := TfrmGraphData.Create(Application);
  try
    with frmGraphData do
    begin
      ResizeAnchoredFormToFont(frmGraphData);
      ShowModal;
    end;
  finally
    frmGraphData.Release;
  end;
end;
FormDestroy TfrmGraphData procedure FormDestroy(Sender: TObject); Public/Published -
FreeGtsl TfrmGraphData procedure FreeGtsl; Public -
GraphDataOnPatient - procedure GraphDataOnPatient(var allitems, alldata: boolean); Interfaced -
GraphDataOnUser - procedure GraphDataOnUser; Interfaced Procedure GraphDataForm; // perhaps use this to create only when displayed??
MakeGraphActivity TfrmGraphData procedure MakeGraphActivity; Public -
MakeGtsl TfrmGraphData procedure MakeGtsl; Public ----------------------------- Gtsl* are tstringlists used to hold data - global in scope
MakeMemos TfrmGraphData procedure MakeMemos(aName: string; aList: TStrings; aTag, left, top, width, height: integer); Private -
MakeUserSettings TfrmGraphData procedure MakeUserSettings; Public -
SetCurrentSetting - procedure SetCurrentSetting(aString: string); Interfaced -
SetGraphStatus - procedure SetGraphStatus(aString: string); Interfaced -
SetOldDFN - procedure SetOldDFN(aString: string); Interfaced -
SetPersonalSetting - procedure SetPersonalSetting(aString: string); Interfaced -
SetPublicSetting - procedure SetPublicSetting(aString: string); Interfaced -

Functions

Name Owner Declaration Scope Comments
AllowContextChange TfrmGraphData function AllowContextChange(var WhyNot: string): Boolean; Public -
GetATestGroup - function GetATestGroup(testgroup: Integer; userx: int64): TStrings; Interfaced Atype, auser: string;
GetCurrentSetting - function GetCurrentSetting: string; Interfaced ---------------------------------------------------
GetGraphProfiles - function GetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings; Interfaced Auser: string;
GetGraphStatus - function GetGraphStatus: string; Interfaced -
GetOldDFN - function GetOldDFN: string; Interfaced -
GetPersonalSetting - function GetPersonalSetting: string; Interfaced -
GetPublicSetting - function GetPublicSetting: string; Interfaced -
GraphPublicEditor - function GraphPublicEditor: boolean; Interfaced -
GraphTurboOn - function GraphTurboOn: boolean; Interfaced -

Global Variables

Name Type Declaration Comments
FGraphActivity TGraphActivity FGraphActivity: TGraphActivity; -
frmGraphData TfrmGraphData frmGraphData: TfrmGraphData; -
GtslAllTypes TStringList GtslAllTypes: TStringList; -
GtslAllViews TStringList GtslAllViews: TStringList; -
GtslCheck TStringList GtslCheck: TStringList; -
GtslData TStringList GtslData: TStringList; -
GtslDrugClass TStringList GtslDrugClass: TStringList; -
GtslItems TStringList GtslItems: TStringList; -
GtslLabGroup TStringList GtslLabGroup: TStringList; -
GtslMultiSpec TStringList GtslMultiSpec: TStringList; -
GtslNonNum TStringList GtslNonNum: TStringList; -
GtslNonNumDates TStringList GtslNonNumDates: TStringList; -
GtslScratchLab TStringList GtslScratchLab: TStringList; -
GtslScratchSwap TStringList GtslScratchSwap: TStringList; -
GtslScratchTemp TStringList GtslScratchTemp: TStringList; -
GtslSelCopyBottom TStringList GtslSelCopyBottom: TStringList; -
GtslSelCopyTop TStringList GtslSelCopyTop: TStringList; -
GtslSelPrevBottomFloat TStringList GtslSelPrevBottomFloat: TStringList; -
GtslSelPrevBottomReport TStringList GtslSelPrevBottomReport: TStringList; -
GtslSelPrevTopFloat TStringList GtslSelPrevTopFloat: TStringList; -
GtslSelPrevTopReport TStringList GtslSelPrevTopReport: TStringList; -
GtslSpec1 TStringList GtslSpec1: TStringList; -
GtslSpec2 TStringList GtslSpec2: TStringList; -
GtslSpec3 TStringList GtslSpec3: TStringList; -
GtslSpec4 TStringList GtslSpec4: TStringList; -
GtslTemp TStringList GtslTemp: TStringList; -
GtslTempCheck TStringList GtslTempCheck: TStringList; -
GtslTestSpec TStringList GtslTestSpec: TStringList; -
GtslTypes TStringList GtslTypes: TStringList; -
GtslViewPersonal TStringList GtslViewPersonal: TStringList; -
GtslViewPublic TStringList GtslViewPublic: TStringList; -
GtslViews TStringList GtslViews: TStringList; -
GtslZoomHistoryFloat TStringList GtslZoomHistoryFloat: TStringList; -
GtslZoomHistoryReport TStringList GtslZoomHistoryReport: TStringList; -


Module Source

1     unit fGraphData;
2     
3     interface
4     
5     uses
6       Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7       Dialogs, StdCtrls, ExtCtrls, ORFn, fBase508Form, VA508AccessibilityManager;
8     
9     type
10      TfrmGraphData = class(TfrmBase508Form)
11        btnData: TButton;
12        btnRefresh: TButton;
13        btnTesting: TButton;
14        lblCurrent: TLabel;
15        lblInfo: TLabel;
16        lblInfoCurrent: TLabel;
17        lblInfoPersonal: TLabel;
18        lblInfoPublic: TLabel;
19        lblPersonal: TLabel;
20        lblPublic: TLabel;
21        memTesting: TMemo;
22        pnlData: TPanel;
23        pnlInfo: TPanel;
24    
25        procedure FormCreate(Sender: TObject);
26        procedure FormClose(Sender: TObject; var Action: TCloseAction);
27        procedure FormDestroy(Sender: TObject);
28    
29        procedure btnDataClick(Sender: TObject);
30        procedure btnRefreshClick(Sender: TObject);
31        procedure btnTestingClick(Sender: TObject);
32      private
33        procedure ClearMemos;
34        procedure FillMemos;
35        procedure MakeMemos(aName: string; aList: TStrings; aTag, left, top, width, height: integer);
36      public
37        procedure ClearGtsl;
38        procedure ClearPtData;
39        procedure FreeGtsl;
40        procedure MakeGtsl;
41        procedure MakeUserSettings;
42        procedure MakeGraphActivity;
43    
44        function AllowContextChange(var WhyNot: string): Boolean;
45      end;
46    
47    var
48      frmGraphData: TfrmGraphData;
49      GtslData: TStringList;
50      GtslItems: TStringList;
51      GtslTypes: TStringList;
52      GtslAllTypes: TStringList;
53      GtslAllViews: TStringList;
54      GtslTestSpec: TStringList;
55      GtslDrugClass: TStringList;
56      GtslViews: TStringList;
57      GtslCheck: TStringList;
58      GtslNonNum: TStringList;
59      GtslNonNumDates: TStringList;
60      GtslScratchSwap: TStringList;
61      GtslScratchTemp: TStringList;
62      GtslScratchLab: TStringList;
63      GtslSpec1: TStringList;
64      GtslSpec2: TStringList;
65      GtslSpec3: TStringList;
66      GtslSpec4: TStringList;
67      GtslMultiSpec: TStringList;
68      GtslTempCheck: TStringList;
69      GtslTemp: TStringList;
70      GtslSelCopyTop: TStringList;
71      GtslSelCopyBottom: TStringList;
72      GtslZoomHistoryFloat: TStringList;
73      GtslZoomHistoryReport: TStringList;
74      GtslSelPrevTopFloat: TStringList;
75      GtslSelPrevTopReport: TStringList;
76      GtslSelPrevBottomFloat: TStringList;
77      GtslSelPrevBottomReport: TStringList;
78      GtslViewPersonal: TStringList;
79      GtslViewPublic: TStringList;
80      GtslLabGroup: TStringList;
81    
82      //procedure GraphDataForm;      // perhaps use this to create only when displayed??
83    
84      procedure GraphDataOnUser;
85      procedure GraphDataOnPatient(var allitems, alldata: boolean);
86    
87      function GetATestGroup(testgroup: Integer; userx: int64): TStrings;
88      function GetCurrentSetting: string;
89      function GetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings;
90      function GetGraphStatus: string;
91      function GetOldDFN: string;
92      function GetPersonalSetting: string;
93      function GetPublicSetting: string;
94      function GraphPublicEditor: boolean;
95      function GraphTurboOn: boolean;
96    
97      procedure SetCurrentSetting(aString: string);
98      procedure SetGraphStatus(aString: string);
99      procedure SetOldDFN(aString: string);
100     procedure SetPersonalSetting(aString: string);
101     procedure SetPublicSetting(aString: string);
102   
103   implementation
104   
105   {$R *.dfm}
106   
107   uses
108     uCore, rGraphs, uGraphs;
109   
110   var
111     FGraphActivity: TGraphActivity;
112   
113   {procedure GraphDataForm;            // not used - perhaps with separate object for data
114   var
115     frmGraphData: TfrmGraphData;
116   begin
117     frmGraphData := TfrmGraphData.Create(Application);
118     try
119       with frmGraphData do
120       begin
121         ResizeAnchoredFormToFont(frmGraphData);
122         ShowModal;
123       end;
124     finally
125       frmGraphData.Release;
126     end;
127   end;}
128   
129   procedure TfrmGraphData.FormCreate(Sender: TObject);
130   begin                                      // called from fFrame after user signon
131     if GtslData <> nil then
132       exit;                                  // only create one time
133     MakeGraphActivity;
134     MakeUserSettings;
135     MakeGtsl;
136   end;
137   
138   procedure TfrmGraphData.MakeGraphActivity;
139   begin
140     FGraphActivity := TGraphActivity.Create;
141     with FGraphActivity do
142     begin
143       CurrentSetting := '';
144       OldDFN := '';
145       PublicSetting := '';
146       PersonalSetting := '';
147       PublicEditor := false;
148       Status := '';
149       //TurboOn := true; 
150       //Cache := true;
151       TurboOn := false;   //*v29* turbo turned off
152       Cache := false;     //*v29* cache turned off
153     end;
154   end;
155   
156   procedure TfrmGraphData.MakeUserSettings;
157   var
158     setting, turbo: string;
159     aList: TStrings;
160   begin
161     aList := TStringList.Create;
162     FastAssign(rpcGetGraphSettings, aList);
163     if aList.Count > 0 then
164     begin
165       setting := aList[0];
166       FGraphActivity.PublicSetting := aList[1];
167       FGraphActivity.Cache := not (Piece(aList[2], '^', 1) = '-1');
168       if length(setting) > 0 then
169       begin                                  // maxselectmax - system max selection limit
170         SetPiece(setting, '|', 8, Piece(FGraphActivity.PublicSetting, '|', 8));
171         turbo := Piece(FGraphActivity.PublicSetting, '|', 6);
172         if (turbo = '0') or (not FGraphActivity.Cache) then // deactivate users if public turbo (6th piece) is off
173         begin
174           SetPiece(setting, '|', 6, '0');
175           FGraphActivity.TurboOn := false;
176         end
177         else
178           FGraphActivity.TurboOn := true;
179         FGraphActivity.PersonalSetting := setting;
180       end
181       else
182         FGraphActivity.PersonalSetting := FGraphActivity.PublicSetting;
183       FGraphActivity.CurrentSetting := FGraphActivity.PersonalSetting;
184       FGraphActivity.PublicEditor := rpcPublicEdit;    // use this as PublicEdit permission for user
185     end;
186     FreeAndNil(aList);
187   end;
188   
189   procedure GraphDataOnUser;
190   var                                        // called from fFrame after this form is created
191     i: integer;                              // gets static info
192     dfntype, listline: string;
193   begin
194     if GtslData = nil then
195       exit;                                  // do not setup if graphing is off
196     FastAssign(rpcGetTypes('0', false), GtslAllTypes);
197     for i := 0 to GtslAllTypes.Count - 1 do  // uppercase all filetypes
198     begin
199       listline := GtslAllTypes[i];
200       dfntype := UpperCase(Piece(listline, '^', 1));
201       SetPiece(listline, '^', 1, dfntype);
202       GtslAllTypes[i] := listline;
203     end;
204     FastAssign(rpcGetTestSpec, GtslTestSpec);
205     FastAssign(rpcGetViews(VIEW_PUBLIC, 0), GtslAllViews);
206     FastAddStrings(rpcGetViews(VIEW_PERSONAL, User.DUZ), GtslAllViews);
207     FastAddStrings(rpcGetViews(VIEW_LABS, User.DUZ), GtslAllViews);
208   end;
209   
210   procedure TfrmGraphData.ClearPtData;
211   var                                        // called when patient is selected
212     faststatus, oldDFN: string;
213   begin
214     inherited;
215     if FGraphActivity.CurrentSetting = '' then
216       exit;                                  // if graphing is turned off, don't process
217     ClearMemos;
218     ClearGtsl;
219     pnlData.Hint := '';
220     oldDFN := FGraphActivity.OldDFN;         // cleanup any previous patient cache
221     FastAssign(rpcGetTypes(Patient.DFN, false), GtslTypes);
222     faststatus := rpcFastTask(Patient.DFN, oldDFN);
223     FGraphActivity.Cache := (faststatus = '1');
224     FGraphActivity.OldDFN := Patient.DFN;
225   end;
226   
227   procedure GraphDataOnPatient(var allitems, alldata: boolean);
228   begin
229                                              // need to call this when patient is selected
230   end;
231   
232   function TfrmGraphData.AllowContextChange(var WhyNot: string): Boolean;
233   begin
234     Result := true;                          // perhaps add logic in the future
235   end;
236   
237   //----------------------------- Gtsl* are tstringlists used to hold data - global in scope
238   
239   procedure TfrmGraphData.MakeGtsl;
240   begin
241     GtslData := TStringList.Create;
242     GtslItems := TStringList.Create;
243     GtslTypes := TStringList.Create;
244     GtslAllTypes := TStringList.Create;
245     GtslAllViews := TStringList.Create;
246     GtslTestSpec := TStringList.Create;
247     GtslDrugClass := TStringList.Create;
248     GtslViews := TStringList.Create;
249     GtslCheck := TStringList.Create;
250     GtslNonNum := TStringList.Create;
251     GtslNonNumDates := TStringList.Create;
252     GtslScratchSwap := TStringList.Create;
253     GtslScratchTemp := TStringList.Create;
254     GtslScratchLab := TStringList.Create;
255     GtslSpec1 := TStringList.Create;
256     GtslSpec2 := TStringList.Create;
257     GtslSpec3 := TStringList.Create;
258     GtslSpec4 := TStringList.Create;
259     GtslMultiSpec := TStringList.Create;
260     GtslTempCheck := TStringList.Create;
261     GtslTemp := TStringList.Create;
262     GtslSelCopyTop := TStringList.Create;
263     GtslSelCopyBottom := TStringList.Create;
264     GtslZoomHistoryFloat := TStringList.Create;
265     GtslZoomHistoryReport := TStringList.Create;
266     GtslSelPrevTopFloat := TStringList.Create;
267     GtslSelPrevTopReport := TStringList.Create;
268     GtslSelPrevBottomFloat := TStringList.Create;
269     GtslSelPrevBottomReport := TStringList.Create;
270     GtslViewPersonal := TStringList.Create;
271     GtslViewPublic := TStringList.Create;
272     GtslLabGroup := TStringList.Create;
273   end;
274   
275   procedure TfrmGraphData.ClearGtsl;
276   begin
277     if GtslData = nil then exit;
278     //GtslAllTypes.Clear;            // these types are not patient specific
279     //GtslTestSpec.Clear;
280     //GtslAllViews.Clear;
281     GtslData.Clear;
282     GtslItems.Clear;
283     GtslTypes.Clear;
284     GtslDrugClass.Clear;
285     GtslViews.Clear;
286     GtslCheck.Clear;
287     GtslNonNum.Clear;
288     GtslNonNumDates.Clear;
289     GtslScratchSwap.Clear;
290     GtslScratchTemp.Clear;
291     GtslScratchLab.Clear;
292     GtslSpec1.Clear;
293     GtslSpec2.Clear;
294     GtslSpec3.Clear;
295     GtslSpec4.Clear;
296     GtslMultiSpec.Clear;
297     GtslTempCheck.Clear;
298     GtslTemp.Clear;
299     GtslSelCopyTop.Clear;
300     GtslSelCopyBottom.Clear;
301     GtslZoomHistoryFloat.Clear;
302     GtslZoomHistoryReport.Clear;
303     GtslSelPrevTopFloat.Clear;
304     GtslSelPrevTopReport.Clear;
305     GtslSelPrevBottomFloat.Clear;
306     GtslSelPrevBottomReport.Clear;
307     GtslViewPersonal.Clear;
308     GtslViewPublic.Clear;
309     GtslLabGroup.Clear;
310   end;
311   
312   procedure TfrmGraphData.FreeGtsl;
313   begin
314     FreeAndNil(GtslData);
315     FreeAndNil(GtslItems);
316     FreeAndNil(GtslTypes);
317     FreeAndNil(GtslAllTypes);
318     FreeAndNil(GtslAllViews);
319     FreeAndNil(GtslTestSpec);
320     FreeAndNil(GtslDrugClass);
321     FreeAndNil(GtslNonNum);
322     FreeAndNil(GtslNonNumDates);
323     FreeAndNil(GtslScratchSwap);
324     FreeAndNil(GtslScratchTemp);
325     FreeAndNil(GtslScratchLab);
326     FreeAndNil(GtslSpec1);
327     FreeAndNil(GtslSpec2);
328     FreeAndNil(GtslSpec3);
329     FreeAndNil(GtslSpec4);
330     FreeAndNil(GtslMultiSpec);
331     FreeAndNil(GtslTempCheck);
332     FreeAndNil(GtslSelCopyTop);
333     FreeAndNil(GtslSelCopyBottom);
334     FreeAndNil(GtslZoomHistoryFloat);
335     FreeAndNil(GtslZoomHistoryReport);
336     FreeAndNil(GtslSelPrevTopFloat);
337     FreeAndNil(GtslSelPrevTopReport);
338     FreeAndNil(GtslSelPrevBottomFloat);
339     FreeAndNil(GtslSelPrevBottomReport);
340     FreeAndNil(GtslViewPersonal);
341     FreeAndNil(GtslViewPublic);
342     FreeAndNil(GtslLabGroup);
343   end;
344   
345   //----------------------------- displays when testing
346   
347   procedure TfrmGraphData.btnDataClick(Sender: TObject);
348   var
349     height, left, top, width: integer;
350   begin
351     height := pnlData.Height div 8;
352     height := height - lblInfo.Height;
353     top := lblInfo.Height;
354     left := 1;
355     width := pnlData.Width - 2;
356     MakeMemos('GtslData', GtslData, 1, left, top, width, height);
357     top := top + height + lblInfo.Height;
358     MakeMemos('GtslItems', GtslItems, 2, left, top, width, height);
359     top := top + height + lblInfo.Height;
360     MakeMemos('GtslTypes', GtslTypes, 3, left, top, width, height);
361     width := width div 6;
362     top := top + height + lblInfo.Height;
363     left := 1;
364     MakeMemos('GtslAllTypes', GtslAllTypes, 4, left, top, width, height);
365     left := left + width;
366     MakeMemos('GtslTestSpec', GtslTestSpec, 5, left, top, width, height);
367     left := left + width;
368     MakeMemos('GtslDrugClass', GtslDrugClass, 6, left, top, width, height);
369     left := left + width;
370     MakeMemos('GtslViews', GtslViews, 7, left, top, width, height);
371     left := left + width;
372     MakeMemos('GtslCheck', GtslCheck, 8, left, top, width, height);
373     left := left + width;
374     MakeMemos('GtslNonNum', GtslNonNum, 9, left, top, width, height);
375     top := top + height + lblInfo.Height;
376     left := 1;
377     MakeMemos('GtslNonNumDates', GtslNonNumDates, 10, left, top, width, height);
378     left := left + width;
379     MakeMemos('GtslScratchSwap', GtslScratchSwap, 11, left, top, width, height);
380     left := left + width;
381     MakeMemos('GtslScratchTemp', GtslScratchTemp, 12, left, top, width, height);
382     left := left + width;
383     MakeMemos('GtslScratchLab', GtslScratchLab, 13, left, top, width, height);
384     left := left + width;
385     MakeMemos('GtslSpec1', GtslSpec1, 14, left, top, width, height);
386     left := left + width;
387     MakeMemos('GtslSpec2', GtslSpec2, 15, left, top, width, height);
388     top := top + height + lblInfo.Height;
389     left := 1;
390     MakeMemos('GtslSpec3', GtslSpec3, 16, left, top, width, height);
391     left := left + width;
392     MakeMemos('GtslSpec4', GtslSpec4, 17, left, top, width, height);
393     left := left + width;
394     MakeMemos('GtslMultiSpec', GtslMultiSpec, 18, left, top, width, height);
395     left := left + width;
396     MakeMemos('GtslTempCheck', GtslTempCheck, 19, left, top, width, height);
397     left := left + width;
398     MakeMemos('GtslTemp', GtslTemp, 20, left, top, width, height);
399     left := left + width;
400     MakeMemos('GtslSelCopyTop', GtslSelCopyTop, 21, left, top, width, height);
401     top := top + height + lblInfo.Height;
402     left := 1;
403     MakeMemos('GtslSelCopyBottom', GtslSelCopyBottom, 22, left, top, width, height);
404     left := left + width;
405     MakeMemos('GtslZoomHistoryFloat', GtslZoomHistoryFloat, 23, left, top, width, height);
406     left := left + width;
407     MakeMemos('GtslZoomHistoryReport', GtslZoomHistoryReport, 24, left, top, width, height);
408     left := left + width;
409     MakeMemos('GtslSelPrevTopFloat', GtslSelPrevTopFloat, 25, left, top, width, height);
410     left := left + width;
411     MakeMemos('GtslSelPrevTopReport', GtslSelPrevTopReport, 26, left, top, width, height);
412     left := left + width;
413     MakeMemos('GtslSelPrevBottomFloat', GtslSelPrevBottomFloat, 27, left, top, width, height);
414     top := top + height + lblInfo.Height;
415     left := 1;
416     MakeMemos('GtslSelPrevBottomReport', GtslSelPrevBottomReport, 28, left, top, width, height);
417     left := left + width;
418     MakeMemos('GtslViewPersonal', GtslViewPersonal, 29, left, top, width, height);
419     left := left + width;
420     MakeMemos('GtslViewPublic', GtslViewPublic, 30, left, top, width, height);
421     left := left + width;
422     MakeMemos('GtslLabGroup', GtslLabGroup, 31, left, top, width, height);
423     left := left + width;
424     MakeMemos('GtslAllViews', GtslAllViews, 32, left, top, width, height);
425     btnData.Enabled := false;
426     btnRefresh.Enabled := true;
427     lblCurrent.Caption := FGraphActivity.CurrentSetting;
428     lblPersonal.Caption := FGraphActivity.PersonalSetting;
429     lblPublic.Caption := FGraphActivity.PublicSetting;
430   end;
431   
432   procedure TfrmGraphData.btnRefreshClick(Sender: TObject);
433   begin
434     frmGraphData.WindowState := wsMaximized;
435     ClearMemos;
436     FillMemos;
437   end;
438   
439   procedure TfrmGraphData.btnTestingClick(Sender: TObject);
440   begin
441     FastAssign(rpcTesting, memTesting.Lines);
442   end;
443   
444   procedure TfrmGraphData.MakeMemos(aName: string; aList: TStrings; aTag, left, top, width, height: integer);
445   var
446     aMemo: TMemo;
447     aLabel: TLabel;
448   begin
449     aMemo := TMemo.Create(self);
450     aMemo.Parent := pnlData;
451     aMemo.Name := 'mem' + aName;
452     aMemo.Tag := aTag;
453     aMemo.Left := left; aMemo.Top := top; aMemo.Width := width; aMemo.Height := height;
454     aMemo.ScrollBars := ssVertical;
455     aMemo.WordWrap := false;
456     FastAssign(aList, aMemo.Lines);
457     aLabel := TLabel.Create(self);
458     aLabel.Parent := pnlData;
459     aLabel.Caption := aName + ' (' + inttostr(aList.Count) + ')';
460     aLabel.Left := left; aLabel.Top := top - lblInfo.Height; aLabel.Width := width; aLabel.Height := lblInfo.height;
461   end;
462   
463   procedure TfrmGraphData.ClearMemos;
464   var
465     i: integer;
466     ChildControl: TControl;
467   begin
468     for i := 0 to pnlData.ControlCount - 1 do
469     begin
470       ChildControl := pnlData.Controls[i];
471       if ChildControl is TMemo then
472         (ChildControl as TMemo).Clear;
473     end;
474   end;
475   
476   procedure TfrmGraphData.FillMemos;
477   var
478     i: integer;
479     aMemo: TMemo;
480     ChildControl: TControl;
481   begin
482     for i := 0 to pnlData.ControlCount - 1 do
483     begin
484       ChildControl := pnlData.Controls[i];
485       if ChildControl is TMemo then
486       begin
487         aMemo := (ChildControl as TMemo);
488         case aMemo.Tag of
489          1: FastAssign(GtslData, aMemo.Lines);
490          2: FastAssign(GtslItems, aMemo.Lines);
491          3: FastAssign(GtslTypes, aMemo.Lines);
492          4: FastAssign(GtslAllTypes, aMemo.Lines);
493          5: FastAssign(GtslTestSpec, aMemo.Lines);
494          6: FastAssign(GtslDrugClass, aMemo.Lines);
495          7: FastAssign(GtslViews, aMemo.Lines);
496          8: FastAssign(GtslCheck, aMemo.Lines);
497          9: FastAssign(GtslNonNum, aMemo.Lines);
498         10: FastAssign(GtslNonNumDates, aMemo.Lines);
499         11: FastAssign(GtslScratchSwap, aMemo.Lines);
500         12: FastAssign(GtslScratchTemp, aMemo.Lines);
501         13: FastAssign(GtslScratchLab, aMemo.Lines);
502         14: FastAssign(GtslSpec1, aMemo.Lines);
503         15: FastAssign(GtslSpec2, aMemo.Lines);
504         16: FastAssign(GtslSpec3, aMemo.Lines);
505         17: FastAssign(GtslSpec4, aMemo.Lines);
506         18: FastAssign(GtslMultiSpec, aMemo.Lines);
507         19: FastAssign(GtslTempCheck, aMemo.Lines);
508         20: FastAssign(GtslTemp, aMemo.Lines);
509         21: FastAssign(GtslSelCopyTop, aMemo.Lines);
510         22: FastAssign(GtslSelCopyBottom, aMemo.Lines);
511         23: FastAssign(GtslZoomHistoryFloat, aMemo.Lines);
512         24: FastAssign(GtslZoomHistoryReport, aMemo.Lines);
513         25: FastAssign(GtslSelPrevTopFloat, aMemo.Lines);
514         26: FastAssign(GtslSelPrevTopReport, aMemo.Lines);
515         27: FastAssign(GtslSelPrevBottomFloat, aMemo.Lines);
516         28: FastAssign(GtslSelPrevBottomReport, aMemo.Lines);
517         29: FastAssign(GtslViewPersonal, aMemo.Lines);
518         30: FastAssign(GtslViewPublic, aMemo.Lines);
519         31: FastAssign(GtslLabGroup, aMemo.Lines);
520         32: FastAssign(GtslAllViews, aMemo.Lines);
521         end;
522       end;
523     end;
524   end;
525   
526   //---------------------------------------------------
527   
528   function GetCurrentSetting: string;
529   begin
530     Result := FGraphActivity.CurrentSetting;
531   end;
532   
533   function GetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings;
534   var      // temporary fix - converting definitions in GtslAllViews to rpc format
535     allviews, fulltext: boolean;
536     i: integer;
537     aitem, aline, aname, atype, avc, avnum, avtype, bigline, partsnum, vtype: string;
538     //auser: string;
539   begin
540     if (userx > 0) and (userx <> User.DUZ) then
541       Result := rpcGetGraphProfiles(profiles, permission, ext, userx)
542     else
543     begin
544       profiles := UpperCase(profiles);
545       if permission = '1' then vtype := '-2'
546       else vtype := '-1';
547       allviews := (profiles = '1');
548       fulltext := (ext = 1);
549       partsnum := '0';
550       bigline := '';
551       GtslScratchTemp.Clear;
552       for i := 0 to GtslAllViews.Count - 1 do
553       begin
554         aline  := GtslAllViews[i];
555         avtype := Piece(aline, '^', 1);
556         avc    := Piece(aline, '^', 2);
557         avnum  := Piece(aline, '^', 3);
558         aname  := UpperCase(Piece(aline, '^', 4));
559         atype  := UpperCase(Piece(aline, '^', 5));
560         aitem  := Piece(aline, '^', 6);
561         //auser  := Piece(aline, '^', 7);
562         if partsnum <> '0' then
563         begin                                                 //AddLine(ext, aname, atype, aitem);
564           if (avc = 'C') and (partsnum = avnum) then
565           begin
566             if ext <> 1 then
567             begin
568                if aitem = '0' then bigline := bigline + '0~' + atype + '~|'
569                else bigline := bigline + atype + '~' + aitem  + '~|'
570             end
571             else
572             begin
573                if aitem = '0' then
574                  GtslScratchTemp.Add('0^' + atype + '^' + aname)
575                else
576                  GtslScratchTemp.Add(atype + '^' + aitem  + '^' + aname)
577             end;
578           end
579           else
580           begin
581             if length(bigline) > 0 then
582               GtslScratchTemp.Add(bigline);
583             break;
584           end;
585         end
586         else
587         if avtype = vtype then
588         begin
589           if allviews and (avc = 'V') then
590           begin
591             GtslScratchTemp.Add(aname);
592           end
593           else if (avc = 'V') and (aname = profiles) then
594             partsnum := avnum;
595         end;
596       end;
597       if allviews or fulltext then
598         MixedCaseList(GtslScratchTemp);
599       Result := GtslScratchTemp;
600     end;
601   end;
602   
603   function GetATestGroup(testgroup: Integer; userx: int64): TStrings;
604   var      // temporary fix - converting definitions in GtslAllViews to rpc format
605     i: integer;
606     aitem, aline, aname, avc, avnum, avtype, partsnum: string;
607     //atype, auser: string;
608   begin
609     if (userx > 0) and (userx <> User.DUZ) then
610       Result := rpcATestGroup(testgroup, userx)
611     else
612     begin
613       partsnum := '0';
614       GtslScratchTemp.Clear;
615       for i := 0 to GtslAllViews.Count - 1 do
616       begin
617         aline  := GtslAllViews[i];
618         avtype := Piece(aline, '^', 1);
619         avc    := Piece(aline, '^', 2);
620         avnum  := Piece(aline, '^', 3);
621         aname  := Piece(aline, '^', 4);
622         //atype  := UpperCase(Piece(aline, '^', 5));
623         aitem  := Piece(aline, '^', 6);
624         //auser  := Piece(aline, '^', 7);
625         if avtype = VIEW_LABS then
626         begin
627           if (avc = 'V') and (partsnum <> '0') then
628             break;
629           if (avc = 'C') and (partsnum = avnum) then
630             GtslScratchTemp.Add(aitem  + '^' + aname)
631           else if (avc = 'V')
632               and (testgroup = strtointdef(Piece(aname, ')', 1), BIG_NUMBER)) then
633                 partsnum := avnum;
634         end;
635       end;
636       //MixedCaseList(GtslScratchTemp);
637       Result := GtslScratchTemp;
638     end;
639   end;
640   
641   function GetGraphStatus: string;
642   begin
643     Result := FGraphActivity.Status;
644   end;
645   
646   function GetOldDFN: string;
647   begin
648     Result := FGraphActivity.OldDFN;
649   end;
650   
651   function GetPersonalSetting: string;
652   begin
653     Result := FGraphActivity.PersonalSetting;
654   end;
655   
656   function GetPublicSetting: string;
657   begin
658     Result := FGraphActivity.PublicSetting;
659   end;
660   
661   function GraphPublicEditor: boolean;
662   begin
663     Result := FGraphActivity.PublicEditor;
664   end;
665   
666   function GraphTurboOn: boolean;
667   begin
668     Result := (FGraphActivity.TurboOn and FGraphActivity.Cache);
669   end;
670   
671   procedure SetCurrentSetting(aString: string);
672   begin
673     FGraphActivity.CurrentSetting := aString;
674   end;
675   
676   procedure SetGraphStatus(aString: string);
677   begin
678     FGraphActivity.Status := aString;
679   end;
680   
681   procedure SetOldDFN(aString: string);
682   begin
683     FGraphActivity.OldDFN := aString;
684   end;
685   
686   procedure SetPersonalSetting(aString: string);
687   begin
688     FGraphActivity.PersonalSetting := aString;
689   end;
690   
691   procedure SetPublicSetting(aString: string);
692   begin
693     FGraphActivity.PublicSetting := aString;
694   end;
695   //---------------------------------------------------
696   
697   procedure TfrmGraphData.FormClose(Sender: TObject; var Action: TCloseAction);
698   var
699     faststatus: string;
700   begin
701     if FGraphActivity.Cache then
702     begin
703       faststatus := rpcFastTask('0', Patient.DFN);           // cleanup patient cache
704       if faststatus = '-1' then
705         FGraphActivity.Cache := false;
706     end;
707   end;
708   
709   procedure TfrmGraphData.FormDestroy(Sender: TObject);
710   begin
711     FreeGtsl;
712   end;
713   
714   end.

Module Calls (2 levels)


fGraphData
 ├fBase508Form
 │ ├uConst
 │ └uHelpManager
 ├uCore
 │ ├rCore
 │ ├uConst
 │ ├uCombatVet
 │ ├rTIU
 │ ├rOrders
 │ ├rConsults
 │ └uOrders
 ├rGraphs
 └uGraphs

Module Called-By (2 levels)


                 fGraphData
                   fFrame┤ 
              CPRSChart┤ │ 
                  fPage┤ │ 
                uOrders┤ │ 
                fODBase┤ │ 
                UBACore┤ │ 
                fOrders┤ │ 
                   uPCE┤ │ 
      fBALocalDiagnoses┤ │ 
             fEncVitals┤ │ 
                fVitals┤ │ 
                 fCover┤ │ 
                 rCover┤ │ 
              fPtSelMsg┤ │ 
                 fPtSel┤ │ 
            fOrdersSign┤ │ 
         fPrintLocation┤ │ 
                  fMeds┤ │ 
                fRptBox┤ │ 
                 fNotes┤ │ 
               fReports┤ │ 
                 fEncnt┤ │ 
                 fProbs┤ │ 
          fReportsPrint┤ │ 
                fGraphs┤ │ 
              fConsults┤ │ 
                fDCSumm┤ │ 
        fReminderDialog┤ │ 
                  fLabs┤ │ 
              fLabPrint┤ │ 
                fReview┤ │ 
            fIconLegend┤ │ 
           fOrdersPrint┤ │ 
               fSurgery┤ │ 
uVA508CPRSCompatibility┤ │ 
           fOrdersRenew┤ │ 
             fODConsult┤ │ 
                fODProc┤ │ 
                 fODRad┤ │ 
                 fODLab┤ │ 
                fODMeds┤ │ 
               fODMedIV┤ │ 
              fODVitals┤ │ 
                fODAuto┤ │ 
                 fOMSet┤ │ 
         fOrdersRelease┤ │ 
              fODMedNVA┤ │ 
         fOrdersOnChart┤ │ 
             fOCSession┤ │ 
              fODActive┤ │ 
               fPCEEdit┘ │ 
              fReports...┤ 
               fGraphs...┤ 
           fGraphSettings┤ 
             fGraphs...┤ │ 
               fOptions┘ │ 
           fGraphProfiles┘ 
             fGraphs...┤   
            fOptions...┘