1 | //kt -- Modified with SourceScanner on 8/8/2007
|
---|
2 | ////////////////////////////////////////////////////////////////////////////////
|
---|
3 | //Modifed: 9/18/98
|
---|
4 | //By: Robert Bott
|
---|
5 | //Location: ISL
|
---|
6 | //Description of Mod:
|
---|
7 | // Changed function ValAndStoreVitals to return the string indicating the value
|
---|
8 | // that failed.
|
---|
9 | ////////////////////////////////////////////////////////////////////////////////
|
---|
10 |
|
---|
11 | unit rVitals;
|
---|
12 |
|
---|
13 | {$OPTIMIZATION OFF} // REMOVE AFTER UNIT IS DEBUGGED
|
---|
14 |
|
---|
15 | interface
|
---|
16 |
|
---|
17 | uses SysUtils, Classes, ORNet, ORFn;
|
---|
18 |
|
---|
19 | procedure SaveVitals(VitalList: TStringList);
|
---|
20 | Procedure GetLastVital(Dest: TStrings; const PatientID: string); //*DFN*
|
---|
21 | function VerifyVital(typ,rte,unt: String):boolean;
|
---|
22 | function ValAndStoreVitals(VitalList: TStringList):string; //9/18/98
|
---|
23 | Procedure GetVitalFromNoteIEN(Dest: TStrings; const PatientID: string; NoteIEN: Integer); //*DFN*
|
---|
24 | Procedure GetVitalsFromEncDateTime(Dest: TStrings; const PatientID: string; datetime: TFMDateTime); //*DFN*
|
---|
25 | procedure LoadUserVitalPreferences;
|
---|
26 | procedure SaveUserVitalPreferences;
|
---|
27 | function GetVList(Loc: integer): TStringList;
|
---|
28 |
|
---|
29 | var
|
---|
30 | uVitalsMetric: boolean = FALSE;
|
---|
31 | uVitCVPmmHg: boolean = FALSE;
|
---|
32 |
|
---|
33 | implementation
|
---|
34 |
|
---|
35 | Uses DKLang; //kt
|
---|
36 | var
|
---|
37 | uOldVitalsMetric: boolean = FALSE;
|
---|
38 | uOldVitCVPmmHg: boolean = FALSE;
|
---|
39 | uVitalList: TStringList = nil;
|
---|
40 | uLastVitalLoc: integer = -1;
|
---|
41 |
|
---|
42 | procedure SaveVitals(VitalList: TStringList);
|
---|
43 | begin
|
---|
44 | CallV('ORWVITALS SAVE', [VitalList]);
|
---|
45 | end;
|
---|
46 |
|
---|
47 | procedure GetLastVital(Dest: TStrings; const PatientID: string); //*DFN*
|
---|
48 | var
|
---|
49 | IDString: String;
|
---|
50 | begin
|
---|
51 | IDString := patientid; //*DFN*
|
---|
52 | CallV('ORQQVI VITALS', [IDString]);
|
---|
53 | Dest.assign(RPCBrokerV.Results);
|
---|
54 | end;
|
---|
55 |
|
---|
56 | function VerifyVital(typ,rte,unt: String):boolean;
|
---|
57 | begin
|
---|
58 | result := False;
|
---|
59 | CallV('ORQQVI2 VITALS RATE CHECK',[typ,rte,unt]);
|
---|
60 | if RPCBrokerV.results[0] = '1' then
|
---|
61 | result := True;
|
---|
62 | end;
|
---|
63 |
|
---|
64 |
|
---|
65 | ////////////////////////////////////////////////////////////////////////////////
|
---|
66 | //Modifed: 9/18/98
|
---|
67 | //By: Robert Bott
|
---|
68 | //Location: ISL
|
---|
69 | //Description of Mod:
|
---|
70 | // Changed function ValAndStoreVitals to return the string indicating the value
|
---|
71 | // that failed.
|
---|
72 | ////////////////////////////////////////////////////////////////////////////////
|
---|
73 | function ValAndStoreVitals(VitalList: TStringList):string;
|
---|
74 | begin
|
---|
75 | CallV('ORQQVI2 VITALS VAL & STORE',[VitalList]);
|
---|
76 | if RPCBrokerV.results[0] >= '0' then
|
---|
77 | // result := 'True' //stored ok <-- original line. //kt 8/8/2007
|
---|
78 | result := DKLangConstW('rVitals_True') //stored ok //kt added 8/8/2007
|
---|
79 | else
|
---|
80 | result := Piece(RPCBrokerV.results[1],U,2) + ': '+Piece(RPCBrokerV.results[1],U,3)+' Value: '+
|
---|
81 | Piece(RPCBrokerV.results[1],U,4);
|
---|
82 | end;
|
---|
83 |
|
---|
84 | Procedure GetVitalFromNoteIEN(Dest: TStrings; const PatientID: string; NoteIEN: Integer); //*DFN*
|
---|
85 | var
|
---|
86 | NoteIENStr,IDString: String;
|
---|
87 | begin
|
---|
88 | IDString := patientid; //*DFN*
|
---|
89 | NoteIENStr := IntToStr(NoteIen);
|
---|
90 | CallV('ORQQVI NOTEVIT', [IDString, NoteIENStr]);
|
---|
91 | Dest.assign(RPCBrokerV.Results);
|
---|
92 | end;
|
---|
93 |
|
---|
94 | Procedure GetVitalsFromEncDateTime(Dest: TStrings; const PatientID: string; DateTime: TFMDateTime); //*DFN*
|
---|
95 | var
|
---|
96 | EncDate,IDString: String;
|
---|
97 | begin
|
---|
98 | IDString := patientid; //*DFN*
|
---|
99 | EncDate := FloatToStr(DateTime);
|
---|
100 | CallV('ORQQVI VITALS', [IDString, EncDate]);
|
---|
101 | Dest.assign(RPCBrokerV.Results);
|
---|
102 | end;
|
---|
103 |
|
---|
104 | procedure LoadUserVitalPreferences;
|
---|
105 | var
|
---|
106 | Tmp: string;
|
---|
107 | begin
|
---|
108 | Tmp := sCallV('ORQQVI3 GETVPREF', []);
|
---|
109 | uVitalsMetric := (Piece(Tmp,U,1) = '1');
|
---|
110 | uVitCVPmmHg := (Piece(Tmp,U,2) = '1');
|
---|
111 | uOldVitalsMetric := uVitalsMetric;
|
---|
112 | uOldVitCVPmmHg := uVitCVPmmHg;
|
---|
113 | end;
|
---|
114 |
|
---|
115 | procedure SaveUserVitalPreferences;
|
---|
116 | var
|
---|
117 | P1, P2: string;
|
---|
118 |
|
---|
119 | begin
|
---|
120 | // Don't same same value loaded, since saving is at user level,
|
---|
121 | // and loading may be at a different level
|
---|
122 | if(uOldVitalsMetric = uVitalsMetric) then P1 := '' else P1 := BOOLCHAR[uVitalsMetric];
|
---|
123 | if(uOldVitCVPmmHg = uVitCVPmmHg) then P2 := '' else P2 := BOOLCHAR[uVitCVPmmHg];
|
---|
124 | CallV('ORQQVI3 SETVPREF', [P1, P2]);
|
---|
125 | end;
|
---|
126 |
|
---|
127 | function GetVList(Loc: integer): TStringList;
|
---|
128 | var
|
---|
129 | GetList: boolean;
|
---|
130 |
|
---|
131 | begin
|
---|
132 | GetList := TRUE;
|
---|
133 | if not assigned(uVitalList) then
|
---|
134 | uVitalList := TStringList.Create
|
---|
135 | else
|
---|
136 | if Loc = uLastVitalLoc then
|
---|
137 | GetList := FALSE;
|
---|
138 | if(GetList) then
|
---|
139 | begin
|
---|
140 | uLastVitalLoc := Loc;
|
---|
141 | CallV('ORQQVI3 GETVLIST', [Loc]);
|
---|
142 | if(RPCBrokerV.Results.Count > 0) then
|
---|
143 | RPCBrokerV.Results.Delete(0);
|
---|
144 | uVitalList.assign(RPCBrokerV.Results);
|
---|
145 | end;
|
---|
146 | Result := uVitalList;
|
---|
147 | end;
|
---|
148 |
|
---|
149 | initialization
|
---|
150 |
|
---|
151 | finalization
|
---|
152 | KillObj(@uVitalList);
|
---|
153 |
|
---|
154 | end.
|
---|