Produced by Araxis Merge on 9/25/2018 2:12:58 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\Delphi\MHA | uMHA_Instrument_IO.pas | Thu Sep 6 11:30:28 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\Delphi\MHA | uMHA_Instrument_IO.pas | Wed Sep 12 16:02:26 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 556 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | unit uMHA_ Instrument _IO; | |
2 | {* functio ns unique to Instrum ent object in MHA. M any are sh ared in | |
3 | uIA_Ins trument_IO . | |
4 | ||
5 | *} | |
6 | ||
7 | interface | |
8 | ||
9 | uses | |
10 | Trpcb, | |
11 | SysUtils , | |
12 | System.C ontnrs, | |
13 | classes, | |
14 | uIA_Inst rument; | |
15 | ||
16 | function R eadListOfA vailableIn struments( UserKeys: string; | |
17 | Broker: TRPCBroker ): string; | |
18 | ||
19 | function ReadInstr umentDetai lsVista(Wh ichInstrum ent: strin g; | |
20 | Broker: TRPCBroker ): string; | |
21 | ||
22 | implementa tion | |
23 | ||
24 | uses | |
25 | uIA_Cons t, | |
26 | uMHA_Con st, | |
27 | fIA_dial ogs, Dialo gs, | |
28 | uIA_Util s, | |
29 | uIA_Ques tion, | |
30 | uIA_Avai lableInstr ument, | |
31 | uMHA_Ins trument_OP S, | |
32 | uMHA_Loc alFiles; | |
33 | ||
34 | function R eadInstrum entDetails Vista(Whic hInstrumen t: string; | |
35 | Broker: TRPCBroker ): string; | |
36 | ||
37 | // Yields string wit h DaysToRe start: int eger (Rang e is -1 to 99 | |
38 | // where -1 is no l imit, 0 is not allow ed) ^ | |
39 | // Generat eProgNote: Boolean ^ | |
40 | // ProgNot eTitle: st ring ^ | |
41 | // Consult Title: str ing | |
42 | ||
43 | // Result of YTQ TSL IST1 is" | |
44 | // [DATA] | |
45 | // IEN=5 | |
46 | // NAME=AU DC | |
47 | // PRINT T ITLE=Alcoh ol Use Dis orders Ide ntificatio n Test Con sumption | |
48 | // VERSION = | |
49 | // AUTHOR= Bradley; M cDonell; B ush; Kivla han; Diehr ; Fihn | |
50 | // PUBLISH ER=Alcohol ism:Clinic al & Exper imental Re search | |
51 | // PUBLICA TION DATE= 1998 | |
52 | // REFEREN CE=Alcohol ism: Clini cal & Expe rimental R esearch. 2 2(8):1842, November 1998 | |
53 | // A PRIVI LEGE= | |
54 | // R PRIVI LEGE= | |
55 | // OPERATI ONAL=Yes | |
56 | // HAS BEE N OPERATIO NAL=Yes | |
57 | // REQUIRE S LICENSE= No | |
58 | // PURPOSE =Alcohol S creening. 3 items f rom WHO AU DIT test d ealing wit h consumpt ion of alc ohol. | |
59 | // N D R N SA P E | |
60 | // TARGET POPULATION = | |
61 | // ENTERED BY=A FINK ELSTEIN | |
62 | // ENTRY D ATE=FEB 26 , 2004 | |
63 | // LAST ED ITED BY=FI NKELSTEIN, ALLAN | |
64 | // LAST ED IT DATE=30 90409 | |
65 | // IS NATI ONAL TEST= Yes | |
66 | // LICENSE CURRENT=N o | |
67 | // COPYRIG HT TEXT= | |
68 | // REQUIRE S SIGNATUR E=No | |
69 | // IS LEGA CY=No | |
70 | // SUBMIT TO NATIONA L DB=Yes | |
71 | // IS COPY RIGHTED=No | |
72 | // WRITE F ULL TEXT=Y es | |
73 | // DAYS TO RESTART=2 | |
74 | // GENERAT E PNOTE=Ye s | |
75 | // TIU TIT LE=MENTAL HEALTH DIA GNOSTIC ST UDY NOTE | |
76 | // Consult Title=MEN TAL HELATH CONSULT N OTE | |
77 | ||
78 | begin | |
79 | Result : = BAD_DATA ; | |
80 | ||
81 | with Bro ker do | |
82 | begin | |
83 | //* LocalFiles .UpdateAPI Log('Call to YTQ TSL IST1: CODE =' + Which Instrument ); | |
84 | ||
85 | Clea rParameter s := True; | |
86 | Clea rResults : = True; | |
87 | Crea teContext( 'YS BROKER 1'); | |
88 | Remo teProcedur e := 'YTQ TSLIST1'; | |
89 | Para m[0].Mult[ '"CODE"'] := WhichIn strument; | |
90 | Para m[0].PType := List; | |
91 | ||
92 | try | |
93 | Ca ll; | |
94 | ||
95 | exce pt | |
96 | on E: EBroke rError do | |
97 | begin | |
98 | //* Loca lFiles.Upd ateAPILog( 'Call to Y TQ TSLIST1 : Error ') ; | |
99 | //* Loca lFiles.Upd ateAPILog( ' ' + 'B roker Erro r: ' + E.m essage); | |
100 | exit; | |
101 | end; | |
102 | on E: EAcces sViolation do | |
103 | begin | |
104 | //* Loca lFiles.Upd ateAPILog( 'Call to Y TQ TSLIST1 : Error ') ; | |
105 | //* Loca lFiles.Upd ateAPILog( ' ' + 'A ccess Viol ation: ' + E.message ); | |
106 | exit; | |
107 | end; | |
108 | end; // try | |
109 | ||
110 | if ( Results[0] = DATA) t hen | |
111 | be gin | |
112 | //* LocalF iles.Updat eAPILog('C all to YTQ TSLIST1: Successful '); | |
113 | Result := Piece(Resu lts[29], E Q, 2) + U + | |
114 | Piece(Re sults[30], EQ, 2) + U + | |
115 | Piece(Re sults[31], EQ, 2) + U + | |
116 | Piece(Re sults[32], EQ, 2); | |
117 | en d; | |
118 | //* else | |
119 | // * LocalFil es.UpdateA PILog('Cal l to YTQ T SLIST1: Er ror ' + re sults[0]); | |
120 | end; | |
121 | end; | |
122 | ||
123 | ||
124 | function R eadListOfA vailableIn struments( UserKeys: string; | |
125 | Broker: TRPCBroker ): string; | |
126 | ||
127 | function ParseSrNa me(AName: string): s tring; | |
128 | begin | |
129 | AName := Piece(A Name, '.', 1); | |
130 | Result := Piece( AName, FIL E_NAME_DEL IMITER, 1) + '=' + P iece(AName , | |
131 | FILE _NAME_DELI MITER, 2) + '^YES'; | |
132 | end; | |
133 | ||
134 | var | |
135 | TempStr, TempStr1, TempStr2, | |
136 | Temp_A _Privilege : string; | |
137 | i : integer; | |
138 | sr : TSearchR ec; | |
139 | aAvail : TAvailab leInstrume nt; | |
140 | begin | |
141 | Result : = OK; | |
142 | Instrume nt_OPS.Lis tOfInstrum ents.Clear ; | |
143 | ||
144 | case Dat aBaseMode of | |
145 | dbVist a: | |
146 | begi n | |
147 | wi th Broker do | |
148 | begin | |
149 | ClearPar ameters := True; | |
150 | ClearRes ults := Tr ue; | |
151 | CreateCo ntext('YS BROKER1'); | |
152 | //* Loca lFiles.Upd ateAPILog( 'Call to Y TQ TSLIST' ); | |
153 | RemotePr ocedure := 'YTQ TSLI ST'; | |
154 | try | |
155 | Call; | |
156 | ||
157 | except | |
158 | on E: EBrokerErr or do | |
159 | begi n | |
160 | // * LocalFil es.UpdateA PILog('Cal l to YTQ T SLIST: Err or '); | |
161 | // * LocalFil es.UpdateA PILog(' ' + 'Broke r Error: ' + E.messa ge); | |
162 | ex it; | |
163 | end; | |
164 | on E: EAccessVio lation do | |
165 | begi n | |
166 | // * LocalFil es.UpdateA PILog('Cal l to YTQ T SLIST: Err or '); | |
167 | // * LocalFil es.UpdateA PILog(' ' + 'Acces s Violatio n: ' + E.m essage); | |
168 | ex it; | |
169 | end; | |
170 | end; // try | |
171 | ||
172 | if Resul ts[0] <> D ATA then | |
173 | begin | |
174 | // Re sult := BA D_DATA; | |
175 | Resu lt := 'ERR OR ' + Res ults[1]; | |
176 | //* LocalFiles .UpdateAPI Log('Call to YTQ TSL IST: Error ' + Resul ts[1]); | |
177 | Exit ; | |
178 | end; / /if bad da ta | |
179 | ||
180 | for i := 1 to Resu lts.Count - 1 do | |
181 | begin | |
182 | aAva il := TAva ilableInst rument.Cre ate; | |
183 | with aAvail do | |
184 | be gin | |
185 | TempStr := Results[i ]; | |
186 | AvailInstr umentName := Piece(T empStr, EQ , 1); | |
187 | TempStr := Piece(Tem pStr, EQ, 2); | |
188 | LastEditDa te := Piec e(TempStr, U, 1); | |
189 | IsOperatio nal := 'U' ; // Defau lt | |
190 | TempStr1 : = Piece(Te mpStr, U, 2); // Cou ld be Y, N or U | |
191 | if Length( TempStr1) <> 0 then | |
192 | if CharI nSet(TempS tr1[1], [' Y', 'N', ' U']) then | |
193 | IsOper ational := TempStr1[ 1]; | |
194 | RequiresLi cense := S trToBool(P iece(TempS tr, U, 3)) ; | |
195 | LicenseIsC urrent := StrToBool( Piece(Temp Str, U, 4) ); | |
196 | IsLegacy : = StrToBoo l(Piece(Te mpStr, U, 5)); | |
197 | AvailInstr umentID := Piece(Tem pStr, U, 6 ); | |
198 | R_Privileg e := Piece (TempStr, U, 7); | |
199 | IsNational Instrument := StrToB ool(Piece( TempStr, U , 8)); | |
200 | HasBeenOpe rational : = StrToBoo l(Piece(Te mpStr, U, 9)); | |
201 | Temp_A_Pri vilege := Piece(Temp Str, U, 10 ); | |
202 | ||
203 | if Require sLicense t hen | |
204 | Copyrigh tStatusIsO K := Licen seIsCurren t | |
205 | else | |
206 | Copyrigh tStatusIsO K := True; | |
207 | ||
208 | CanBeAdmin istered := (IsOperat ional = 'Y ') and Cop yrightStat usIsOK; | |
209 | ||
210 | if aAvail. AvailInstr umentName = 'WAS' th en | |
211 | begin | |
212 | gvUpda teSeries : = R_Privil ege; | |
213 | R_Priv ilege := ' '; | |
214 | end; | |
215 | ||
216 | // Check f or permiss ion to adm inister | |
217 | if Temp_A_ Privilege <> '' then | |
218 | if Pos(T emp_A_Priv ilege, Use rKeys) = 0 then | |
219 | CanBeA dministere d := False ; | |
220 | en d; // with aAvail | |
221 | ||
222 | if a Avail.CanB eAdministe red then | |
223 | In strument_O PS.ListOfI nstruments .Add(aAvai l); | |
224 | ||
225 | // l lh testing -- need t o comment when done | |
226 | //if aAvail.Av ailInstrum entName = 'YBOCSII' THEN Instr ument_OPS. ListOfInst ruments.Ad d(aAvail); | |
227 | //if aAvail.Av ailInstrum entName = 'BSL-23' T HEN Instru ment_OPS.L istOfInstr uments.Add (aAvail); | |
228 | //if aAvail.Av ailInstrum entName = 'KTZADL' T HEN Instru ment_OPS.L istOfInstr uments.Add (aAvail); | |
229 | end; | |
230 | ||
231 | //* Loca lFiles.Upd ateAPILog( 'Call to Y TQ TSLIST: Successfu l'); | |
232 | end; //wit h DataModu le1.RPCBro ker1 | |
233 | end; //dbVista | |
234 | ||
235 | dbOffL ine: | |
236 | begi n | |
237 | if (FindFirs t(LocalFil es.Instrum entFilesPa th + '\*.' + RESOURC E_FILE_EXT , faAnyFil e, sr) | |
238 | = 0) then | |
239 | begin | |
240 | TempStr := ParseSr Name(sr.Na me) + RECO RD_END; | |
241 | while (F indNext(sr ) = 0) do | |
242 | TempSt r := TempS tr + Parse SrName(sr. Name) + RE CORD_END; | |
243 | FindClos e(sr); | |
244 | end | |
245 | el se | |
246 | begin | |
247 | FindClos e(sr); | |
248 | Result : = BAD_DATA ; | |
249 | Exit; | |
250 | end; //if bad data | |
251 | ||
252 | if Length(Te mpStr) > 1 then | |
253 | // Remove la st delimit er | |
254 | Delete(Tem pStr, Leng th(TempStr ), 1) | |
255 | el se | |
256 | Exit; | |
257 | ||
258 | fo r i := 1 t o NumberOf Pieces(Tem pStr, RECO RD_END) do | |
259 | begin | |
260 | aAvail : = TAvailab leInstrume nt.Create; | |
261 | with aAv ail do | |
262 | begin | |
263 | Temp Str1 := Pi ece(TempSt r, RECORD_ END, i); | |
264 | Avai lInstrumen tName := P iece(TempS tr1, EQ, 1 ); | |
265 | Temp Str2 := Pi ece(TempSt r, EQ, 2); | |
266 | Last EditDate : = Piece(Te mpStr2, U, 1); | |
267 | IsOp erational := 'U'; // Default | |
268 | CanB eAdministe red := Tru e; | |
269 | end; / / with aAv ail | |
270 | ||
271 | Instrume nt_OPS.Lis tOfInstrum ents.Add(a Avail); | |
272 | end; | |
273 | end; //dbOffLi ne | |
274 | end; //c ase DataBa seMode.... . | |
275 | end; | |
276 | ||
277 | ||
278 | end. | |
279 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.