Produced by Araxis Merge on 3/31/2017 10:45:42 AM 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 | CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\ROR | uROR_RPCBroker.pas | Tue Dec 13 18:26:06 2016 UTC |
2 | CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\ROR | uROR_RPCBroker.pas | Fri Mar 31 15:30:43 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 4 | 588 |
Changed | 3 | 10 |
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 uROR_ RPCBroker; | |
2 | { | |
3 | ========== ========== ========== ========== ========== ========== ========== ========== | |
4 | * | |
5 | * Pa ckage: ROR - Clinical C ase Regist ries | |
6 | * Da te Created : $Revis ion: 1 $ $Modtime: 2/27/09 9: 38a $ | |
7 | * Si te: Hines OIFO | |
8 | * De velopers: PII | |
9 | * | |
10 | * De scription: RPC ca ll and RPC Error Win dow | |
11 | * | |
12 | * No tes: | |
13 | * | |
14 | ========== ========== ========== ========== ========== ========== ========== ========== | |
15 | * $ Archive: / Vitals GUI 2007/Vita ls-5-0-18/ ROR/uROR_R PCBroker.p as $ | |
16 | * | |
17 | * $ Histor y: uROR_RP CBroker.pa s $ | |
18 | * | |
19 | ========== ========== ========== ========== ========== ========== ========== ========== | |
20 | } | |
21 | interface | |
22 | ||
23 | uses | |
24 | SysUtils , Classes | |
25 | , Contro ls | |
26 | , TRPCB | |
27 | , CCOWRP CBroker | |
28 | , RpcCon f1 | |
29 | , VERGEN CECONTEXTO RLib_TLB | |
30 | , Dialog s | |
31 | , Forms | |
32 | ; | |
33 | ||
34 | function S electBroke r(Context: String; a Contextor: TContexto rControl = nil): TCC OWRPCBroke r; | |
35 | function g etBroker(a Context: S tring): TR PCBroker; | |
36 | ||
37 | implementa tion | |
38 | ||
39 | uses uGMV_ Common, uG MV_Engine, fROR_PCal l, uGMV_RP C_Names, u GMV_Log; | |
40 | ||
41 | type | |
42 | TRPCBrok erParams = record | |
43 | Server : String; //BROKERSE RVER; | |
44 | Listen erPort: In teger;//92 00; | |
45 | ClearR esults: Bo olean; //T rue; | |
46 | ClearP arameters: Boolean; //True; | |
47 | Access VerifyCode s: String; // | |
48 | DebugM ode: Boole an; | |
49 | end; | |
50 | ||
51 | var | |
52 | BrokerPa rams: TRPC BrokerPara ms; | |
53 | ||
54 | function G etBrokerPa rameters(v ar ParamRe cord: TRPC BrokerPara ms): boole an; | |
55 | var | |
56 | sUser:St ring; | |
57 | UseServe rList : Bo olean; | |
58 | i: Integ er; | |
59 | SLServer , SLPort: string; | |
60 | begin | |
61 | ParamRec ord.Server := 'BROKE RSERVER'; | |
62 | ParamRec ord.Listen erPort := 9200; | |
63 | ParamRec ord.ClearP arameters := True; | |
64 | ParamRec ord.ClearR esults := True; | |
65 | ||
66 | sUser := ''; | |
67 | UseServe rList := T rue; | |
68 | for i := 1 to Para mCount do | |
69 | begin | |
70 | if I nString(Pa ramStr(i), ['s='], F alse) or | |
71 | I nString(Pa ramStr(i), ['/server =', '-serv er='], Fal se) | |
72 | then | |
73 | be gin | |
74 | ParamRecor d.Server : = Piece(Pa ramStr(i), '=', 2); | |
75 | UseServerL ist := Fal se; | |
76 | en d; | |
77 | ||
78 | if I nString(Pa ramStr(i), ['p='], F alse) or | |
79 | I nString(Pa ramStr(i), ['/port=' , '-port=' ], False) | |
80 | then | |
81 | be gin | |
82 | ParamRecor d.Listener Port := St rToIntDef( Piece(Para mStr(i), ' =', 2), 92 00); | |
83 | UseServerL ist := Fal se; | |
84 | en d; | |
85 | ||
86 | if I nString(Pa ramStr(i), ['/debug' , '-debug' ], False) then | |
87 | Pa ramRecord. DebugMode := True; | |
88 | ||
89 | if I nString(Pa ramStr(i), ['/demo', '-demo'], False) th en | |
90 | be gin | |
91 | UseServerL ist := Fal se; | |
92 | if Message Dlg( | |
93 | 'This is a demo ve rsion of t he' + #13 + | |
94 | ExtractF ileName(Ap plication. Exename) + ' program .' + #13#1 3 + | |
95 | 'It will attempt c onnection to the' + #13 + | |
96 | 'Hines O IFO Develo pment serv er at' + # 13#13 + | |
97 | 'IP Addres s: IP ' + #13 + | |
98 | 'Listener Port: PORT ' + #13 + #13 + | |
99 | 'Do you wish to co ntinue?', mtConfirma tion, [mbY es, mbNo], 0) = mrYe s then | |
100 | begin | |
101 | ParamRecor d.Server : = ' IP '; | |
102 | ParamRecor d.Listener Port := PORT ; | |
103 | end | |
104 | en d; | |
105 | (**) | |
106 | end; | |
107 | if UseS erverList then | |
108 | begin | |
109 | if G etServerIn fo(SLServe r, SLPort) <> 1 then | |
110 | be gin | |
111 | MessageDlg ('Sign-On Cancelled while sett ing connec tion param eters', mt Informatio n, [mbok], 0); | |
112 | Result := False; | |
113 | Exit; | |
114 | en d | |
115 | else | |
116 | be gin | |
117 | ParamRecor d.Server : = SLServer ; | |
118 | ParamRecor d.Listener Port := St rToIntDef( SLPort, 92 00); | |
119 | Applicatio n.ProcessM essages; { Refresh sc reen prior to connec ting} | |
120 | en d; | |
121 | end; | |
122 | Result : = True; | |
123 | end; | |
124 | ||
125 | function S etBrokerPa rameters(P aramRecord : TRPCBrok erParams; var RPCB: TCCOWRPCBr oker; var ErrorStrin g:String): boolean; | |
126 | begin | |
127 | RPCB.Ser ver := Par amRecord.S erver; | |
128 | RPCB.Lis tenerPort := ParamRe cord.Liste nerPort; | |
129 | RPCB.Cle arParamete rs := Para mRecord.Cl earParamet ers; | |
130 | RPCB.Cle arResults := ParamRe cord.Clear Results; | |
131 | RPCB.Acc essVerifyC odes := Pa ramRecord. AccessVeri fyCodes; | |
132 | RPCB.Deb ugMode := ParamRecor d.DebugMod e; | |
133 | ||
134 | ErrorStr ing := ''; | |
135 | ||
136 | if RPCB. Socket > 0 then // ? ?? | |
137 | begin | |
138 | Resu lt := True ; | |
139 | exit ; | |
140 | end; | |
141 | ||
142 | try | |
143 | RPCB.C onnected : = True; | |
144 | Applic ation.Proc essMessage s; | |
145 | Result := True; | |
146 | except | |
147 | on E: EBrokerErr or do | |
148 | begi n | |
149 | Er rorString := E.Messa ge; | |
150 | Re sult := Fa lse; | |
151 | Ex it; | |
152 | end; | |
153 | else | |
154 | raise; | |
155 | end; | |
156 | ||
157 | end; | |
158 | ||
159 | function S electBroke r(Context: String; aC ontextor: TContextor Control): TCCOWRPCBr oker; | |
160 | var | |
161 | s: Strin g; | |
162 | RPCB:TCC OWRPCBroke r; | |
163 | NewAttem pt:Boolean ; | |
164 | AttemptC ount: Inte ger; | |
165 | aTime: T DateTime; | |
166 | b: Boole an; | |
167 | const | |
168 | AttemptL imit = 3; | |
169 | ||
170 | procedur e ErrorRep ort; | |
171 | begin | |
172 | Messag eDlg('Erro r Encounte red' + #13 + #13 + | |
173 | 'Use r Sign-on is not com plete.' + #13 + | |
174 | 'Att empted con nection us ing the fo llowing:' + #13 + | |
175 | 'Vis tA Server: ' + RPCB. Server + # 13 + | |
176 | 'Lis tener Port : ' + IntT oStr(RPCB. ListenerPo rt) + #13 + | |
177 | 'Err or Message : ' + #13 + s, | |
178 | mtEr ror, | |
179 | [mbo k], | |
180 | 0); | |
181 | end; | |
182 | ||
183 | begin | |
184 | if not G etBrokerPa rameters(B rokerParam s) then// process pa rameter st ring | |
185 | begin | |
186 | Resu lt := nil; | |
187 | Exit ; | |
188 | end; | |
189 | ||
190 | AttemptC ount := 0; | |
191 | repeat | |
192 | NewAtt empt := Fa lse; | |
193 | { | |
194 | if i < = ParamCou nt then // force use of nonsha red broker | |
195 | begi n | |
196 | RP CB := TCCO WRPCBroker .Create(Ap plication) ; | |
197 | if not SetBr okerParame ters(Broke rParams,RP CB,s) then | |
198 | begin | |
199 | ErrorRep ort; | |
200 | FreeAndN il(RPCB); | |
201 | end; | |
202 | end | |
203 | else / /try share d broker f irst | |
204 | begi n | |
205 | RPCB := TS haredRPCBr oker.Creat e(Applicat ion); | |
206 | TSharedRPC Broker(RPC B).AllowSh ared := Tr ue; | |
207 | if not Set BrokerPara meters(Bro kerParams, RPCB,s) th en | |
208 | if (pos( 'Class not registere d',s)<>0) then // sh ared broke r is not a vailable | |
209 | begin | |
210 | FreeA ndNil(RPCB ); | |
211 | RPCB := TRPCBro ker.Create (Applicati on); // tr y nonshare d broker | |
212 | if no t SetBroke rParameter s(BrokerPa rams,RPCB, s) then | |
213 | beg in | |
214 | E rrorReport ; | |
215 | F reeAndNil( RPCB); | |
216 | end ; | |
217 | end | |
218 | else // unknown er ror type - just repo rt and sto p | |
219 | begin | |
220 | Erro rReport; | |
221 | Free AndNil(RPC B); | |
222 | end; | |
223 | end; | |
224 | } | |
225 | aTim e := Now; | |
226 | RPCB := TCCOWR PCBroker.C reate(Appl ication); | |
227 | Even tAdd('Crea te Broker Object','' ,aTime); | |
228 | ||
229 | aTim e := Now; | |
230 | RPCB .Contextor := aConte xtor; | |
231 | Even tAdd('Assi gn Context or','',aTi me); | |
232 | if n ot SetBrok erParamete rs(BrokerP arams, RPC B, s) then | |
233 | be gin | |
234 | ErrorRepor t; | |
235 | FreeAndNil (RPCB); | |
236 | en d; | |
237 | ||
238 | if R PCB <> nil then | |
239 | tr y | |
240 | aTime := N ow; | |
241 | b := RPCB. CreateCont ext(Contex t); | |
242 | EventAdd(' Create Con text','',a Time); | |
243 | if not b t hen | |
244 | begin | |
245 | Messag eDlg('Sorr y, but you need the "'+Context +'" option .'+#13#10+ | |
246 | 'Ple ase contac t your IRM .',mtInfor mation,[mb OK],0); | |
247 | FreeAn dNil(RPCB) ; | |
248 | end; | |
249 | ex cept | |
250 | on E: Exce ption do | |
251 | begin | |
252 | FreeAn dNil(RPCB) ; | |
253 | Inc(At temptCount ); | |
254 | if Att emptCount > AttemptL imit then | |
255 | Mess ageDlg( | |
256 | 'Y ou exceede d the limi t of conne ction atte mpts.' + | |
257 | #1 3+#13+ 'Tr y again la ter.', | |
258 | mt Error, [mb ok], 0) | |
259 | else | |
260 | NewA ttempt := MessageDlg ( | |
261 | 'U ser Sign-o n is not c omplete.' + #13 + #1 3+ | |
262 | 'E rror Messa ge: ' + #1 3 + E.Mess age+#13+#1 3+ | |
263 | 'D o you want to repeat the attem pt?', | |
264 | mt Error, [mb ok,mbCance l], 0) = m rOK; | |
265 | end; | |
266 | en d | |
267 | ||
268 | until (RPCB <> n il) or (At temptCount > Attempt Limit) or not NewAtt empt; | |
269 | ||
270 | Result : = RPCB; | |
271 | end; | |
272 | ||
273 | function g etBroker(a Context: S tring): TR PCBroker; | |
274 | begin | |
275 | // Result := nil; | |
276 | if Assig ned(RPCBro ker) then | |
277 | begin | |
278 | { Di sconnect a nd destroy the RPC B roker } | |
279 | RPCB roker.Conn ected := F alse; | |
280 | Free AndNil(RPC Broker); | |
281 | end; | |
282 | ||
283 | if CmdLi neSwitch([ '/NOCCOW'] ) then | |
284 | begin | |
285 | // cc rContextor .Enabled : = False; | |
286 | RPCB roker := S electBroke r(RPC_CREA TECONTEXT, nil); | |
287 | end | |
288 | else | |
289 | begin | |
290 | // cc rContextor .Enabled : = True; | |
291 | // if CmdLineSw itch(['CCO W=PATIENTO NLY','/PAT IENTONLY'] ) then | |
292 | RP CBroker := SelectBro ker(RPC_CR EATECONTEX T, nil) | |
293 | // el se | |
294 | // RPCBroker := SelectB roker(RPC_ CREATECONT EXT, ccrCo ntextor.Co ntextor); | |
295 | end; | |
296 | Result : = RPCBroke r; | |
297 | end; | |
298 | ||
299 | end. |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.