Produced by Araxis Merge on 11/2/2017 7:18:07 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 | CAPRI_CIF.zip\CAPRI_CIF\Source | frmVlerGetExamDocs.pas | Wed Nov 1 18:09:36 2017 UTC |
2 | CAPRI_CIF.zip\CAPRI_CIF\Source | frmVlerGetExamDocs.pas | Wed Nov 1 19:14:26 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 972 |
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 frmVl erGetExamD ocs; | |
2 | ||
3 | interface | |
4 | ||
5 | uses | |
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
7 | Dialogs, StdCtrls, VA508Acce ssibilityM anager, VA 508Accessi bilityRout er, | |
8 | Grids, S hellAPI, e Crud, XMLD oc, IdHTTP , | |
9 | xmldom, XMLIntf, I dBaseCompo nent, IdCo mponent, I dTCPConnec tion, IdTC PClient, | |
10 | msxmldom ; | |
11 | ||
12 | type | |
13 | ||
14 | TfrmVler RetrievalE xamDocs = class(TFor m) | |
15 | gbPati ent: TGrou pBox; | |
16 | lblPat ientName: TLabel; | |
17 | lblCla imNum: TLa bel; | |
18 | lblDOB : TLabel; | |
19 | edbPat ientName: TEdit; | |
20 | edbCla imNum: TEd it; | |
21 | edbDOB : TEdit; | |
22 | gbSort By: TGroup Box; | |
23 | lblCol umn: TLabe l; | |
24 | lblDir ection: TL abel; | |
25 | cbSort Column: TC omboBox; | |
26 | cbSort Direction: TComboBox ; | |
27 | strgrd CollectRes ults: TStr ingGrid; | |
28 | VA508A ccessibili tyManager1 : TVA508Ac cessibilit yManager; | |
29 | btnClo se: TButto n; | |
30 | btnVie wSelectedD ocument: T Button; | |
31 | XMLDoc VLERExamRE ST: TXMLDo cument; | |
32 | aIDHTT PVLERExamR EST: TIdHT TP; | |
33 | lblDoc CntMsg: TS taticText; | |
34 | VA508C ompAccessS gCollResul ts: TVA508 ComponentA ccessibili ty; | |
35 | proced ure FormSh ow(Sender: TObject); | |
36 | proced ure strgrd CollectRes ultsClick( Sender: TO bject); | |
37 | proced ure strgrd CollectRes ultsDblCli ck(Sender: TObject); | |
38 | proced ure btnVie wSelectedD ocumentCli ck(Sender: TObject); | |
39 | proced ure strgrd CollectRes ultsSelect Cell(Sende r: TObject ; ACol, | |
40 | ARow : Integer; var CanSe lect: Bool ean); | |
41 | proced ure FormCl ose(Sender : TObject; var Actio n: TCloseA ction); | |
42 | proced ure cbSort ColumnClos eUp(Sender : TObject) ; | |
43 | proced ure cbSort DirectionC loseUp(Sen der: TObje ct); | |
44 | proced ure VA508C ompAccessS gCollResul tsItemQuer y(Sender: TObject; | |
45 | var Item: TObj ect); | |
46 | proced ure VA508C ompAccessS gCollResul tsValueQue ry(Sender: TObject; | |
47 | var Text: stri ng); | |
48 | ||
49 | private | |
50 | { Priv ate declar ations } | |
51 | // Exam Attachment sList: TeC rud; | |
52 | GridRo wSelected: integer; | |
53 | proced ure Patien tHeader(); | |
54 | proced ure Assign SortColumn s(); | |
55 | proced ure SortSt ringgridAn dOrder(Gri d: TString Grid; byCo lumn: Long Int; ascen ding: Bool ean); | |
56 | proced ure Exchan geGridRows (Grid: TSt ringGrid; i, j: Inte ger); | |
57 | proced ure QuickS ort(Grid: TStringGri d; SortCol : integer; L, R: Int eger); | |
58 | proced ure Invert Grid(Grid: TStringGr id); | |
59 | public | |
60 | class procedure Initialize ExamDocsGr idHeader(i nfrmVlerRt rvExamDocs : TfrmVler RetrievalE xamDocs); | |
61 | class procedure FillExamDo csFromResu ltList(inf rmVlerRtrv ExamDocs: TfrmVlerRe trievalExa mDocs; que ryResult: TStringLis t); | |
62 | { Publ ic declara tio ns } | |
63 | end; | |
64 | ||
65 | var | |
66 | frmVlerR etrievalEx amDocs: Tf rmVlerRetr ievalExamD ocs; | |
67 | Selected X: integer ; | |
68 | Selected Y: integer ; | |
69 | ||
70 | implementa tion | |
71 | uses main, FrmVlerGe tExam, Uni tDocumentM ethods; | |
72 | ||
73 | {$R *.dfm} | |
74 | ||
75 | var | |
76 | // aAttac hNodeList: TList; | |
77 | // recExa mAttachmen ts: PVLERA ttachNodeV al; | |
78 | svrHttpE CRUD: TeCR UD; | |
79 | aOpenDoc List: TOpe nDocList; | |
80 | ||
81 | procedure TfrmVlerRe trievalExa mDocs.Assi gnSortColu mns; | |
82 | var | |
83 | i: integ er; | |
84 | ||
85 | begin | |
86 | // with f rmVlerRetr ievalExamD ocs do | |
87 | // begin | |
88 | for i := 0 to strg rdCollectR esults.Col Count - 1 do | |
89 | begin | |
90 | //Se t cbSortC olumn valu es | |
91 | cbSort Column.Ite ms.Add(str grdCollect Results.Ce lls[i, 0]) ; | |
92 | end; | |
93 | // end; | |
94 | ||
95 | end; | |
96 | ||
97 | class proc edure Tfrm VlerRetrie valExamDoc s.Initiali zeExamDocs GridHeader (infrmVler RtrvExamDo cs: TfrmVl erRetrieva lExamDocs) ; | |
98 | //var | |
99 | // frmVle rRtrvExamD ocs: TfrmV lerRetriev alExamDocs ; // rpk 8 /26/2014 | |
100 | begin | |
101 | if infrm VlerRtrvEx amDocs <> nil then b egin | |
102 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Count := 1 6; | |
103 | //Ad d column n ames | |
104 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[0, 0] : = 'Pt. Fir st Name'; | |
105 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[1, 0] : = 'Pt. Mid dle Name'; | |
106 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[2, 0] : = 'Pt. Las t Name'; | |
107 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[3, 0] : = 'Pt. DOB '; | |
108 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[4, 0] : = 'Pt. SSN '; | |
109 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[5, 0] : = 'Documen t ID (UUID )'; | |
110 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[6, 0] : = 'Exam ID '; | |
111 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[7, 0] : = 'DBQ Doc ument Type '; | |
112 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[8, 0] : = 'Creatio n Date'; | |
113 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[9, 0] : = 'Status Date'; | |
114 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[10, 0] := 'VA Fac ility Info rmation'; | |
115 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[11, 0] := 'Phys. First Name '; | |
116 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[12, 0] := 'Phys. Middle Nam e'; | |
117 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[13, 0] := 'Phys. Last Name' ; | |
118 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[14, 0] := 'Status of Exam'; | |
119 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[15, 0] := 'Attach ment ID'; | |
120 | // s etup custo m column w idths | |
121 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[0] := 140; // Pt. First Name | |
122 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[1] := 140; // Pt. Middl e Name | |
123 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[2] := 150; // Pt. Last Name | |
124 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[3] := 77; // Pt. DOB | |
125 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[4] := 100; // Pt. SSN | |
126 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[5] := 300; // Document ID | |
127 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[6] := 120; // Exam ID | |
128 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[7] := 300; // DBQ Docum ent Type | |
129 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[8] := 145; // Creation Date | |
130 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[9] := 145; // Status Da te | |
131 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[10] := 180; / / VA Facil ity Inform ation | |
132 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[11] := 140; / / Phys. Fi rst Name | |
133 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[12] := 140; / / Phys. Mi ddle Name | |
134 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[13] := 150; / / Phys. La st Name | |
135 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Widths[14] := 120; / / Status o f Exam | |
136 | end; | |
137 | ||
138 | (* D efined for future us e | |
139 | frmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[12,0]:= 'Claim ID' ; | |
140 | frmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[14,0]:= 'File Cont rol ID'; | |
141 | frmV lerRtrvExa mDocs.strg rdCollectR esults.Cel ls[15,0]:= 'DBQ Docum ent Type'; | |
142 | *) | |
143 | end; // In itializeEx amDocsGrid Header | |
144 | ||
145 | class proc edure Tfrm VlerRetrie valExamDoc s.FillExam DocsFromRe sultList(i nfrmVlerRt rvExamDocs : TfrmVler RetrievalE xamDocs; q ueryResult : TStringL ist); | |
146 | var | |
147 | i: Integ er; | |
148 | begin | |
149 | if infrm VlerRtrvEx amDocs <> nil then b egin | |
150 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Row Count := i nfrmVlerRt rvExamDocs .strgrdCol lectResult s.RowCount + queryRe sult.Count ; | |
151 | for i := 0 to qu eryResult. Count - 1 do | |
152 | begin | |
153 | infr mVlerRtrvE xamDocs.st rgrdCollec tResults.R ows[i + 1] .Delimiter := ','; | |
154 | infr mVlerRtrvE xamDocs.st rgrdCollec tResults.R ows[i + 1] .CommaText := queryR esult.Stri ngs[i]; | |
155 | end; | |
156 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Col Count := ( infrmVlerR trvExamDoc s.strgrdCo llectResul ts.ColCoun t - 1); | |
157 | infrmV lerRtrvExa mDocs.lblD ocCntMsg.C aption := infrmVlerR trvExamDoc s.lblDocCn tMsg.Capti on + IntTo Str((query Result.Cou nt)) + ' D ocuments'; | |
158 | infrmV lerRtrvExa mDocs.strg rdCollectR esults.Row Count := i nfrmVlerRt rvExamDocs .strgrdCol lectResult s.RowCount - 1; | |
159 | end; | |
160 | end; | |
161 | ||
162 | procedure TfrmVlerRe trievalExa mDocs.btnV iewSelecte dDocumentC lick(Sende r: TObject ); | |
163 | var | |
164 | I: Integ er; | |
165 | // svrHtt pECRUD: Te CRUD; | |
166 | recExamA ttachments : PVLERAtt achNodeVal ; | |
167 | //OpenBi naryAttach ments: TOp enDocList; | |
168 | ncBinary DescTxt, | |
169 | ncBina ryFormatSt ndrdName, | |
170 | ncBina ryLocURI, | |
171 | ncBina rySzValue, | |
172 | ncBina ryCtgryTxt , | |
173 | FileNM : string; | |
174 | strSQLAt tachment: string; | |
175 | begin | |
176 | // this wi ll open al l attachme nts associ ated with selected r ecord | |
177 | ||
178 | //Searc h TList to find Docu mentFileCo ntrolID fr om strgrdC ollectResu lts | |
179 | // VLERAt tachNodeLi st.First; | |
180 | ||
181 | //Show co lumn conta ining File Attachmen t id | |
182 | // frmVle rRetrieval ExamDocs.s trgrdColle ctResults. ColCount : = | |
183 | // (frm VlerRetrie valExamDoc s.strgrdCo llectResul ts.ColCoun t + 1); | |
184 | strgrdCo llectResul ts.ColCoun t := strgr dCollectRe sults.ColC ount + 1; | |
185 | ||
186 | // svrHtt pECRUD := TeCRUD.Cre ate(self, frmMain.RP CBroker1); // IdHTTP VLERExamRE STful,XMLD ocumentVLE RExamRESTf ul); // T ODO | |
187 | // try | |
188 | // svrHtt pECRUD.set OpenDocume ntList(aOp enDocList) ; | |
189 | // for I := 0 to (frmVlerGe tExams.aAt tachNodeLi st.Count - 1) do | |
190 | if Assig ned(aAttac hNodeList) then begi n | |
191 | for I := 0 to (a AttachNode List.Count - 1) do | |
192 | begin | |
193 | // re cExamAttac hments := frmVlerGet Exams.aAtt achNodeLis t.Items[I] ; | |
194 | recE xamAttachm ents := aA ttachNodeL ist.Items[ I]; | |
195 | if T rim(recExa mAttachmen ts.strncDo cumentFile ControlID) = | |
196 | Tr im(strgrdC ollectResu lts.Cells[ 15, GridRo wSelected] ) then | |
197 | begi n | |
198 | // Prepare to get attac hments fro m "fs" col lection | |
199 | nc BinaryDesc Txt := rec ExamAttach ments.strn cBinaryDes criptionTe xt; | |
200 | nc BinaryForm atStndrdNa me := recE xamAttachm ents.strnc BinaryForm atStandard Name; | |
201 | nc BinaryLocU RI := recE xamAttachm ents.strnc BinaryLoca tionURI; | |
202 | nc BinarySzVa lue := rec ExamAttach ments.strn cBinarySiz eValue; | |
203 | nc BinaryCtgr yTxt := re cExamAttac hments.str ncBinaryCa tegoryText ; | |
204 | ||
205 | // set file n ame | |
206 | // FileNM:= n cBinaryDes cTxt + ncB inaryCtgry Txt + ncBi naryLocURI ; | |
207 | / /FileNM:= Trim(ncBi naryDescTx t)+FormatD ateTime('m mddyyyyhhm mss',now); | |
208 | ||
209 | ||
210 | // ***Prepare HTTP Serv er Seeting s***// | |
211 | // *** RESTfu l call to VLER eCRUD ***// | |
212 | // Create TeC rud object . This obj ect sets U RL, Query and issues RESTful G ET | |
213 | ||
214 | //svrHtt pECRUD:=Te CRUD.Creat e(self, fr mMain.RPCB roker1 ); // IdHTTPV LERExamRES Tful,XMLDo cumentVLER ExamRESTfu l); // TO DO | |
215 | //svrHtt pECRUD.XML Document : = XMLDocum entVLERExa mRESTful; | |
216 | ||
217 | ||
218 | sv rHttpECRUD .XMLDocume nt := XMLD ocVLERExam REST; // X MLDocument VLERExamRE STful; | |
219 | ||
220 | ||
221 | // svrHttpECR UD:=TeCRUD .Create(aI DHTTPVLERE xamREST,XM LDocVLEREx amREST); | |
222 | // svrHttpECR UD.VlerDas Token:='XU SBSE958-47 0149_6^500 ^9560'; | |
223 | { | |
224 | svrHttpE CRUD.HTTPA cceptHeade rXML:=ncBi naryFormat StndrdName ; | |
225 | sv rHttpECRUD .HTTPConte ntType:= n cBinaryFor matStndrdN ame; | |
226 | sv rHttpECRUD .HTTPConte ntEncoding := 'utf-8' ; | |
227 | svrHttpECR UD.Host:=' DNS .vaco. DNS '; | |
228 | sv rHttpECRUD .Port:=''; //must p refix port with ':' if Port is assigned | |
229 | } | |
230 | ||
231 | sv rHttpECRUD .eCRUDVers ion := 'v1 '; | |
232 | sv rHttpECRUD .dbName := 'core'; | |
233 | sv rHttpECRUD .collectio nName := ' fs'; | |
234 | sv rHttpECRUD .maxRecord s := ''; | |
235 | sv rHttpECRUD .SpecifyRe sponseFiel ds := ''; | |
236 | sv rHttpECRUD .Sort := ' '; | |
237 | ||
238 | ||
239 | sv rHttpECRUD .getExamAt tachments( ncBinaryLo cURI, strS QLAttachme nt); | |
240 | ||
241 | ||
242 | //C all OpenDo cumentFrom XMLNode() | |
243 | //P aramters: ancBinaryL ocationURI :String; a Filename: String; aF ileType: S tring | |
244 | //P rocedure w ill execut e RESTFUL qry to obt ain binary attachmen t, Save to a file an d open and clear up | |
245 | //m emory of o pen files | |
246 | sv rHttpECRUD .OpenDocum entFromXML Node(ncBin aryLocURI, FileNM, n cBinaryFor matStndrdN ame, | |
247 | strSQLAtta chment, St rToInt(ncB inarySzVal ue)); | |
248 | end; | |
249 | ||
250 | end; | |
251 | //hid e column c ontaining File Attac hment id | |
252 | // frmV lerRetriev alExamDocs .strgrdCol lectResult s.ColCount := | |
253 | // (f rmVlerRetr ievalExamD ocs.strgrd CollectRes ults.ColCo unt - 1); | |
254 | end; | |
255 | ||
256 | strgrdCo llectResul ts.ColCoun t := strgr dCollectRe sults.ColC ount - 1; | |
257 | // finall y | |
258 | // svrH ttpECRUD.F ree; | |
259 | // end; | |
260 | ||
261 | end; | |
262 | ||
263 | procedure TfrmVlerRe trievalExa mDocs.cbSo rtColumnCl oseUp(Send er: TObjec t); | |
264 | var | |
265 | SortColI ndx: integ er; | |
266 | SortAsce nding: Boo lean; | |
267 | begin | |
268 | if (cbSo rtColumn.I temIndex - 1) < 0 th en | |
269 | SortCo lIndx := 0 | |
270 | else | |
271 | SortCo lIndx := ( cbSortColu mn.ItemInd ex - 1); | |
272 | ||
273 | if cbSor tDirection .ItemIndex = 0 then | |
274 | SortAs cending := True | |
275 | else | |
276 | SortAs cending := False; | |
277 | ||
278 | //Enable for sort c olumn cont aining Fil e Attachme nt id | |
279 | // frmVle rRetrieval ExamDocs.s trgrdColle ctResults. ColCount : = | |
280 | // (frm VlerRetrie valExamDoc s.strgrdCo llectResul ts.ColCoun t + 1); | |
281 | strgrdCo llectResul ts.ColCoun t := strgr dCollectRe sults.ColC ount + 1; | |
282 | ||
283 | //Sort th e Grid | |
284 | // SortSt ringgridAn dOrder(frm VlerRetrie valExamDoc s.strgrdCo llectResul ts, SortCo lIndx, Sor tAscending ); | |
285 | SortStri nggridAndO rder(strgr dCollectRe sults, Sor tColIndx, SortAscend ing); | |
286 | ||
287 | //hide me tadata col umn contai ning File Attachment id | |
288 | // frmVle rRetrieval ExamDocs.s trgrdColle ctResults. ColCount : = | |
289 | // (frm VlerRetrie valExamDoc s.strgrdCo llectResul ts.ColCoun t - 1); | |
290 | strgrdCo llectResul ts.ColCoun t := strgr dCollectRe sults.ColC ount - 1; | |
291 | ||
292 | end; | |
293 | ||
294 | procedure TfrmVlerRe trievalExa mDocs.cbSo rtDirectio nCloseUp(S ender: TOb ject); | |
295 | begin | |
296 | cbSortCo lumnCloseU p(Sender); | |
297 | end; | |
298 | ||
299 | procedure TfrmVlerRe trievalExa mDocs.Form Close(Send er: TObjec t; | |
300 | var Acti on: TClose Action); | |
301 | var | |
302 | I: Integ er; | |
303 | begin | |
304 | // ExamAt tachmentsL ist.CloseO penAttachm ents; | |
305 | try | |
306 | if Ass igned(svrH ttpECRUD) then | |
307 | svrH ttpECRUD.C loseOpenAt tachments; | |
308 | for I := 0 to aO penDocList .Count - 1 do | |
309 | TOpe nDoc(aOpen DocList[i] ).Free; | |
310 | finally | |
311 | FreeAn dNil(aOpen DocList); | |
312 | end; | |
313 | end; | |
314 | ||
315 | procedure TfrmVlerRe trievalExa mDocs.Form Show(Sende r: TObject ); | |
316 | begin | |
317 | //Refres h Patient Header Inf o | |
318 | PatientH eader(); | |
319 | //Set so rt columns | |
320 | AssignSo rtColumns( ); | |
321 | ||
322 | //Get re ference to Exam Atta chment Lis t | |
323 | // aAttac hNodeList := TList.c reate; //D estroy at close of f orm. Must be persist ant | |
324 | // ExamAt tachmentsL ist.getExa mAttachmen tList(aAtt achNodeLis t, recExam Attachment s); | |
325 | // aAtt achNodeLis t := ExamA ttachments List.getEx amAttachme ntList; | |
326 | aOpenDoc List := TO penDocList .Create; | |
327 | svrHttpE CRUD := Te CRUD.Creat e(self, fr mMain.RPCB roker1); / / IdHTTPVL ERExamREST ful,XMLDoc umentVLERE xamRESTful ); // TOD O | |
328 | // try | |
329 | if Assig ned(svrHtt pECRUD) th en | |
330 | svrHtt pECRUD.set OpenDocume ntList(aOp enDocList) ; | |
331 | end; | |
332 | ||
333 | ||
334 | procedure TfrmVlerRe trievalExa mDocs.Pati entHeader; | |
335 | var | |
336 | PatientF nm, Patien tMnm, Pati entLnm: st ring; | |
337 | // concat Name: stri ng; | |
338 | begin | |
339 | // with f rmVlerRetr ievalExamD ocs do | |
340 | // begin | |
341 | if strgr dCollectRe sults.Row <> 0 then | |
342 | begin | |
343 | //Se t edbPati entName | |
344 | Patien tFnm := st rgrdCollec tResults.C ells[0, st rgrdCollec tResults.R ow]; | |
345 | Patien tMnm := st rgrdCollec tResults.C ells[1, st rgrdCollec tResults.R ow]; | |
346 | Patien tLnm := st rgrdCollec tResults.C ells[2, st rgrdCollec tResults.R ow]; | |
347 | edbPat ientName.T ext := Pat ientFnm + ' ' + Pati entMnm + ' ' + Patie ntLnm; | |
348 | ||
349 | //Pa tient Clai mID | |
350 | edbCla imNum.Text := strgrd CollectRes ults.Cells [4, strgrd CollectRes ults.Row]; | |
351 | ||
352 | //Pa tient DOB | |
353 | edbDOB .Text := s trgrdColle ctResults. Cells[3, s trgrdColle ctResults. Row]; | |
354 | end; | |
355 | // end; | |
356 | end; | |
357 | ||
358 | procedure TfrmVlerRe trievalExa mDocs.strg rdCollectR esultsClic k(Sender: TObject); | |
359 | begin | |
360 | //Refresh Patient He ader Info | |
361 | PatientH eader(); | |
362 | end; | |
363 | ||
364 | procedure TfrmVlerRe trievalExa mDocs.strg rdCollectR esultsDblC lick( | |
365 | Sender: TObject); | |
366 | begin | |
367 | //Open Att achment(S) | |
368 | btnViewS electedDoc umentClick (Sender); | |
369 | //Refresh Patient He ader Info | |
370 | PatientH eader(); | |
371 | end; | |
372 | ||
373 | procedure TfrmVlerRe trievalExa mDocs.strg rdCollectR esultsSele ctCell( | |
374 | Sender: TObject; A Col, ARow: Integer; var CanSel ect: Boole an); | |
375 | begin | |
376 | GridRowS elected := ARow; | |
377 | Selected X := ACol; | |
378 | Selected Y := ARow; | |
379 | end; | |
380 | ||
381 | procedure TfrmVlerRe trievalExa mDocs.VA50 8CompAcces sSgCollRes ultsItemQu ery( | |
382 | Sender: TObject; v ar Item: T Object); | |
383 | var | |
384 | i, j: In teger; | |
385 | begin | |
386 | j := Int eger(Item) ; | |
387 | i := (10 0 * Select edY) + Sel ectedX; | |
388 | if i <> j then beg in | |
389 | j := i ; | |
390 | Item : = TObject( j); | |
391 | end; | |
392 | end; | |
393 | ||
394 | procedure TfrmVlerRe trievalExa mDocs.VA50 8CompAcces sSgCollRes ultsValueQ uery( | |
395 | Sender: TObject; v ar Text: s tring); | |
396 | var | |
397 | sg: TStr ingGrid; | |
398 | ca: TVA5 08Componen tAccessibi lity; | |
399 | PatientF nm, Patien tMnm, Pati entLnm: st ring; | |
400 | begin | |
401 | ca := TV A508Compon entAccessi bility(Sen der); // r pk 9/21/20 11 | |
402 | sg := TS tringGrid( ca.compone nt); // rp k 9/21/201 1 | |
403 | ||
404 | if strgr dCollectRe sults.Row <> 0 then | |
405 | begin | |
406 | //Set edbPatien tName | |
407 | Patien tFnm := st rgrdCollec tResults.C ells[0, Se lectedY]; | |
408 | Patien tMnm := st rgrdCollec tResults.C ells[1, Se lectedY]; | |
409 | Patien tLnm := st rgrdCollec tResults.C ells[2, Se lectedY]; | |
410 | edbPat ientName.T ext := Pat ientFnm + ' ' + Pati entMnm + ' ' + Patie ntLnm; | |
411 | Text : = ' Patien t ' + edbP atientName .Text + ' ' + // rpk 9/16/2011 | |
412 | 'Col umn ' + sg .Cells[Sel ectedX, 0] + ', ' + // rpk 9/1 6/2011 | |
413 | sg.Cel ls[Selecte dX, Select edY]; // r pk 9/16/20 11 | |
414 | end; | |
415 | ||
416 | end; | |
417 | ||
418 | {********* ***** Sort Grid ***** ********} | |
419 | ||
420 | procedure TfrmVlerRe trievalExa mDocs.Sort Stringgrid AndOrder(G rid: TStri ngGrid; by Column: In teger; asc ending: Bo olean); | |
421 | begin | |
422 | Screen.C ursor := c rHourglass ; | |
423 | Grid.Per form(WM_SE TREDRAW, 0 , 0); | |
424 | try | |
425 | QuickS ort(Grid, byColumn, Grid.Fixed Rows, Grid .Rowcount - 1); | |
426 | if not ascending then | |
427 | Inve rtGrid(Gri d); | |
428 | finally | |
429 | Grid.P erform(WM_ SETREDRAW, 1, 0); | |
430 | Grid.R efresh; | |
431 | Screen .Cursor := crDefault ; | |
432 | end; | |
433 | end; | |
434 | ||
435 | procedure TfrmVlerRe trievalExa mDocs.Exch angeGridRo ws(Grid: T StringGrid ; i, j: In teger); | |
436 | var | |
437 | k: Integ er; | |
438 | begin | |
439 | with Gri d do | |
440 | for k := 0 to Co lCount - 1 do | |
441 | Cols [k].Exchan ge(i, j); | |
442 | end; | |
443 | ||
444 | procedure TfrmVlerRe trievalExa mDocs.Quic kSort(Grid : TStringG rid; SortC ol: intege r; L, R: I nteger); | |
445 | var | |
446 | I, J: In teger; | |
447 | P: strin g; | |
448 | begin | |
449 | repeat | |
450 | I := L ; | |
451 | J := R ; | |
452 | P := G rid.Cells[ SortCol, ( L + R) shr 1]; | |
453 | repeat | |
454 | whil e CompareS tr(Grid.Ce lls[SortCo l, I], P) < 0 do Inc (I); | |
455 | whil e CompareS tr(Grid.Ce lls[SortCo l, J], P) > 0 do Dec (J); | |
456 | if I <= J then | |
457 | begi n | |
458 | if I <> J th en | |
459 | ExchangeGr idRows(Gri d, I, J); | |
460 | In c(I); | |
461 | De c(J); | |
462 | end; | |
463 | until I > J; | |
464 | if L < J then Qu ickSort(Gr id, SortCo l, L, J); | |
465 | L := I ; | |
466 | until I >= R; | |
467 | end; | |
468 | ||
469 | procedure TfrmVlerRe trievalExa mDocs.Inve rtGrid(Gri d: TString Grid); | |
470 | var | |
471 | i, j: In teger; | |
472 | begin | |
473 | i := Gri d.Fixedrow s; | |
474 | j := Gri d.Rowcount - 1; | |
475 | while i < j do | |
476 | begin | |
477 | Exchan geGridRows (Grid, I, J); | |
478 | Inc(i) ; | |
479 | Dec(j) ; | |
480 | end; { W hile } | |
481 | end; | |
482 | ||
483 | initializa tion | |
484 | SpecifyFor mIsNotADia log(TfrmVl erRetrieva lExamDocs) ; | |
485 | ||
486 | end. | |
487 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.