Produced by Araxis Merge on 5/15/2018 2:43:27 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 | CPRS_V32_COMBINED_BUILD_V45.zip\OR_30_405V45_src\Cover Sheet | mCoverSheetDisplayPanel_CPRS.pas | Thu Mar 29 21:15:52 2018 UTC |
| 2 | CPRS_V32_COMBINED_BUILD_V45.zip\OR_30_405V45_src\Cover Sheet | mCoverSheetDisplayPanel_CPRS.pas | Thu May 10 20:23:40 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1202 |
| 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 mCove rSheetDisp layPanel_C PRS; | |
| 2 | { | |
| 3 | ======== ========== ========== ========== ========== ========== ========== ========== == | |
| 4 | * | |
| 5 | * Applicatio n: CPRS - CoverShee t | |
| 6 | * Developer: PII | |
| 7 | * Site: Salt L ake City I SC | |
| 8 | * Date: 2015-1 2-04 | |
| 9 | * | |
| 10 | * Descriptio n: Inheri ted from T fraCoverSh eetDisplay Panel. Thi s display | |
| 11 | * panel provides t he minimum functiona lity for d isplaying | |
| 12 | * CPRS d ata in the CoverShee t. | |
| 13 | * | |
| 14 | * Notes: This f rame is an ancestor object and heavily i nherited f rom. | |
| 15 | * ABSOLU TELY NO CH ANGES SHOU LD BE MADE WITHOUT F IRST | |
| 16 | * CONFER RING WITH THE CPRS D EVELOPMENT TEAM ABOU T POSSIBLE | |
| 17 | * RAMIFI CATIONS WI TH DESCEND ANT FRAMES . | |
| 18 | * | |
| 19 | ======== ========== ========== ========== ========== ========== ========== ========== == | |
| 20 | } | |
| 21 | ||
| 22 | interface | |
| 23 | ||
| 24 | uses | |
| 25 | Winapi.W indows, | |
| 26 | Winapi.M essages, | |
| 27 | System.S ysUtils, | |
| 28 | System.V ariants, | |
| 29 | System.C lasses, | |
| 30 | System.U ITypes, | |
| 31 | System.I mageList, | |
| 32 | Vcl.Grap hics, | |
| 33 | Vcl.Cont rols, | |
| 34 | Vcl.Form s, | |
| 35 | Vcl.Dial ogs, | |
| 36 | Vcl.Menu s, | |
| 37 | Vcl.ImgL ist, | |
| 38 | Vcl.StdC trls, | |
| 39 | Vcl.Butt ons, | |
| 40 | Vcl.ExtC trls, | |
| 41 | Vcl.ComC trls, | |
| 42 | mCoverSh eetDisplay Panel, | |
| 43 | iCoverSh eetIntf, | |
| 44 | iGridPan elIntf, | |
| 45 | oDelimit edString, | |
| 46 | mGridPan elFrame; | |
| 47 | ||
| 48 | type | |
| 49 | TfraCove rSheetDisp layPanel_C PRS = clas s(TfraCove rSheetDisp layPanel, ICoverShee tDisplayPa nel) | |
| 50 | tmr: T Timer; | |
| 51 | lvData : TListVie w; | |
| 52 | proced ure lvData Enter(Send er: TObjec t); | |
| 53 | proced ure lvData Exit(Sende r: TObject ); | |
| 54 | proced ure lvData MouseDown( Sender: TO bject; But ton: TMous eButton; S hift: TShi ftState; X , Y: integ er); | |
| 55 | proced ure lvData SelectItem (Sender: T Object; It em: TListI tem; Selec ted: boole an); | |
| 56 | proced ure tmrTim er(Sender: TObject); | |
| 57 | private | |
| 58 | { Priv ate declar ations } | |
| 59 | protecte d | |
| 60 | fBackg roundLoadi ng: boolea n; | |
| 61 | fBackg roundLoadT ry: intege r; | |
| 62 | fFinis hed: boole an; | |
| 63 | fColum ns: TStrin gList; | |
| 64 | fLastI temIndex: integer; | |
| 65 | fAllow DetailDisp lay: boole an; | |
| 66 | ||
| 67 | { Over ridden eve nts - Tfra GridPanelF rame } | |
| 68 | proced ure OnSetF ontSize(Se nder: TObj ect; aNewS ize: integ er); overr ide; | |
| 69 | proced ure OnPopu pMenu(Send er: TObjec t); overri de; | |
| 70 | proced ure OnPopu pMenuInit( Sender: TO bject); ov erride; | |
| 71 | proced ure OnRefr eshDisplay (Sender: T Object); o verride; f inal; | |
| 72 | proced ure OnLoad Error(Send er: TObjec t; E: Exce ption); ov erride; fi nal; | |
| 73 | proced ure OnShow Error(Send er: TObjec t); overri de; final; | |
| 74 | ||
| 75 | { Over ridden eve nts - Tfra CoverSheet DisplayPan el } | |
| 76 | proced ure OnBegi nUpdate(Se nder: TObj ect); over ride; | |
| 77 | proced ure OnClea rPtData(Se nder: TObj ect); over ride; | |
| 78 | proced ure OnEndU pdate(Send er: TObjec t); overri de; | |
| 79 | ||
| 80 | { Over ridden met hods - Tfr aCoverShee tDisplayPa nel } | |
| 81 | functi on getIsFi nishedLoad ing: boole an; overri de; | |
| 82 | ||
| 83 | { Intr oduced eve nts } | |
| 84 | proced ure OnStar tBackgroun dLoad(Send er: TObjec t); virtua l; | |
| 85 | proced ure OnComp leteBackgr oundLoad(S ender: TOb ject); vir tual; | |
| 86 | proced ure OnAddI tems(aList : TStrings ); virtual ; | |
| 87 | proced ure OnGetD etail(aRec : TDelimit edString; aResult: T Strings); virtual; | |
| 88 | proced ure OnShow Detail(aTe xt: TStrin gs; aTitle : string = ''; aPrin table: boo lean = fal se); virtu al; | |
| 89 | ||
| 90 | { Intr oduced met hods } | |
| 91 | functi on AddColu mn(aIndex: integer; aCaption: string): i nteger; vi rtual; fin al; | |
| 92 | functi on ClearLi stView(aLi stView: TL istView): boolean; v irtual; | |
| 93 | functi on Collaps eColumns: integer; v irtual; fi nal; | |
| 94 | functi on ExpandC olumns: in teger; vir tual; fina l; | |
| 95 | functi on ListVie wItemIEN: integer; v irtual; | |
| 96 | functi on ListVie wItemRec: TDelimited String; vi rtual; | |
| 97 | functi on CPRSPar ams: ICove rSheetPara m_CPRS; vi rtual; fin al; | |
| 98 | ||
| 99 | proced ure SetLis tViewColum n(aIndex: integer; a Caption: s tring; aAu toSize: bo olean; aWi dth: integ er); virtu al; | |
| 100 | public | |
| 101 | constr uctor Crea te(aOwner: TComponen t); overri de; | |
| 102 | destru ctor Destr oy; overri de; | |
| 103 | end; | |
| 104 | ||
| 105 | var | |
| 106 | fraCover SheetDispl ayPanel_CP RS: TfraCo verSheetDi splayPanel _CPRS; | |
| 107 | ||
| 108 | implementa tion | |
| 109 | ||
| 110 | {$R *.dfm} | |
| 111 | ||
| 112 | { fraCover SheetDispl ayPanel_CP RS } | |
| 113 | ||
| 114 | uses | |
| 115 | uCore, | |
| 116 | uConst, | |
| 117 | fRptBox, | |
| 118 | DateUtil s, | |
| 119 | ORNet; | |
| 120 | ||
| 121 | const | |
| 122 | UPDATING _FOREGROUN D = 'Updat ing ...'; | |
| 123 | UPDATING _BACKGROUN D = 'Loadi ng in Back ground ... '; | |
| 124 | UPDATING _FAILURE = 'Updat e failed.' ; | |
| 125 | UPDATING _ATTEMPTS = 10; // Max try t o get data from back ground job | |
| 126 | UPDATING _WAIT_TIME = 3000; // millise conds | |
| 127 | ||
| 128 | constructo r TfraCove rSheetDisp layPanel_C PRS.Create (aOwner: T Component) ; | |
| 129 | begin | |
| 130 | inherite d Create(a Owner); | |
| 131 | with lvD ata do | |
| 132 | begin | |
| 133 | Show ColumnHead ers := fal se; | |
| 134 | View Style := v sReport; | |
| 135 | read only := Tr ue; | |
| 136 | RowS elect := T rue; | |
| 137 | Colu mns.Add.Au toSize := True; | |
| 138 | end; | |
| 139 | ||
| 140 | fColumns := TStrin gList.Crea te; | |
| 141 | fLastIte mIndex := -1; | |
| 142 | fAllowDe tailDispla y := True; | |
| 143 | ||
| 144 | tmr.Inte rval := UP DATING_WAI T_TIME; | |
| 145 | tmr.Enab led := fal se; | |
| 146 | end; | |
| 147 | ||
| 148 | destructor TfraCover SheetDispl ayPanel_CP RS.Destroy ; | |
| 149 | begin | |
| 150 | ClearLis tView(lvDa ta); | |
| 151 | FreeAndN il(fColumn s); | |
| 152 | inherite d; | |
| 153 | end; | |
| 154 | ||
| 155 | function T fraCoverSh eetDisplay Panel_CPRS .ClearList View(aList View: TLis tView): bo olean; | |
| 156 | begin | |
| 157 | aListVie w.Items.Be ginUpdate; | |
| 158 | try | |
| 159 | while aListView. Items.Coun t > 0 do | |
| 160 | begi n | |
| 161 | if aListView .Items[0]. Data <> ni l then | |
| 162 | try | |
| 163 | TObject( aListView. Items[0].D ata).Free; | |
| 164 | finally | |
| 165 | aListVie w.Items[0] .Data := n il; | |
| 166 | end; | |
| 167 | aL istView.It ems.Delete (0); | |
| 168 | end; | |
| 169 | aListV iew.Items. EndUpdate; | |
| 170 | fLastI temIndex : = -1; | |
| 171 | Result := True; | |
| 172 | except | |
| 173 | Result := false; | |
| 174 | end; | |
| 175 | end; | |
| 176 | ||
| 177 | procedure TfraCoverS heetDispla yPanel_CPR S.OnClearP tData(Send er: TObjec t); | |
| 178 | begin | |
| 179 | ClearLis tView(lvDa ta); | |
| 180 | end; | |
| 181 | ||
| 182 | procedure TfraCoverS heetDispla yPanel_CPR S.OnComple teBackgrou ndLoad(Sen der: TObje ct); | |
| 183 | begin | |
| 184 | // virtu al method for child frames; | |
| 185 | end; | |
| 186 | ||
| 187 | function T fraCoverSh eetDisplay Panel_CPRS .CollapseC olumns: in teger; | |
| 188 | begin | |
| 189 | try | |
| 190 | lvData .Columns.B eginUpdate ; | |
| 191 | lvData .Columns.C lear; | |
| 192 | if fCo lumns.Coun t = 0 then | |
| 193 | with lvData.Co lumns.Add do | |
| 194 | be gin | |
| 195 | Caption := ''; | |
| 196 | AutoSize : = True; | |
| 197 | Width := l vData.Clie ntWidth; | |
| 198 | lvData.Sho wColumnHea ders := fa lse; | |
| 199 | en d | |
| 200 | else | |
| 201 | with lvData.Co lumns.Add do | |
| 202 | be gin | |
| 203 | Caption := fColumns[ 0]; | |
| 204 | AutoSize : = True; | |
| 205 | Width := l vData.Clie ntWidth; | |
| 206 | lvData.Sho wColumnHea ders := Tr ue; | |
| 207 | en d; | |
| 208 | ||
| 209 | finally | |
| 210 | lvData .Columns.E ndUpdate; | |
| 211 | end; | |
| 212 | ||
| 213 | Result : = lvData.C olumns.Cou nt; | |
| 214 | end; | |
| 215 | ||
| 216 | function T fraCoverSh eetDisplay Panel_CPRS .CPRSParam s: ICoverS heetParam_ CPRS; | |
| 217 | begin | |
| 218 | // Suppo rts(fParam , ICoverSh eetParam_C PRS, Resul t); | |
| 219 | getParam .QueryInte rface(ICov erSheetPar am_CPRS, R esult); | |
| 220 | end; | |
| 221 | ||
| 222 | function T fraCoverSh eetDisplay Panel_CPRS .AddColumn (aIndex: i nteger; aC aption: st ring): int eger; | |
| 223 | begin | |
| 224 | while fC olumns.Cou nt < (aInd ex + 1) do | |
| 225 | fColum ns.Add('') ; | |
| 226 | fColumns [aIndex] : = aCaption ; | |
| 227 | Result : = fColumns .Count; | |
| 228 | end; | |
| 229 | ||
| 230 | procedure TfraCoverS heetDispla yPanel_CPR S.OnAddIte ms(aList: TStrings); | |
| 231 | var | |
| 232 | aRec: TD elimitedSt ring; | |
| 233 | aStr: st ring; | |
| 234 | begin | |
| 235 | if aList .Count = 0 then | |
| 236 | aList. Add('^No d ata found. ^'); | |
| 237 | ||
| 238 | for aStr in aList do | |
| 239 | with l vData.Item s.Add do | |
| 240 | begi n | |
| 241 | aR ec := TDel imitedStri ng.Create( aStr); | |
| 242 | Ca ption := a Rec.GetPie ce(2); | |
| 243 | Da ta := aRec ; | |
| 244 | end; | |
| 245 | end; | |
| 246 | ||
| 247 | procedure TfraCoverS heetDispla yPanel_CPR S.OnBeginU pdate(Send er: TObjec t); | |
| 248 | begin | |
| 249 | ClearLis tView(lvDa ta); | |
| 250 | Collapse Columns; | |
| 251 | ||
| 252 | if CPRSP arams.High lightText then | |
| 253 | begin | |
| 254 | lvDa ta.Font.Co lor := clH ighlight; | |
| 255 | lvDa ta.Font.St yle := [fs Bold]; | |
| 256 | end; | |
| 257 | ||
| 258 | with lvD ata.Items. Add do | |
| 259 | if CPR SParams.Lo adInBackgr ound then | |
| 260 | Capt ion := UPD ATING_BACK GROUND | |
| 261 | else | |
| 262 | Capt ion := UPD ATING_FORE GROUND; | |
| 263 | ||
| 264 | Applicat ion.Proces sMessages; | |
| 265 | fFinishe d := false ; | |
| 266 | end; | |
| 267 | ||
| 268 | procedure TfraCoverS heetDispla yPanel_CPR S.OnEndUpd ate(Sender : TObject) ; | |
| 269 | begin | |
| 270 | fFinishe d := True; | |
| 271 | end; | |
| 272 | ||
| 273 | function T fraCoverSh eetDisplay Panel_CPRS .ExpandCol umns: inte ger; | |
| 274 | var | |
| 275 | aStr: st ring; | |
| 276 | begin | |
| 277 | try | |
| 278 | lvData .Columns.B eginUpdate ; | |
| 279 | lvData .Columns.C lear; | |
| 280 | if fCo lumns.Coun t = 0 then | |
| 281 | with lvData.Co lumns.Add do | |
| 282 | be gin | |
| 283 | Caption := ''; | |
| 284 | AutoSize : = True; | |
| 285 | Width := l vData.Clie ntWidth; | |
| 286 | lvData.Sho wColumnHea ders := fa lse; | |
| 287 | en d | |
| 288 | else | |
| 289 | for aStr in fC olumns do | |
| 290 | wi th lvData. Columns.Ad d do | |
| 291 | begin | |
| 292 | Caption := aStr; | |
| 293 | AutoSize := True; | |
| 294 | Width := lvData.Cl ientWidth div fColum ns.Count; | |
| 295 | lvData.S howColumnH eaders := True; | |
| 296 | end; | |
| 297 | ||
| 298 | finally | |
| 299 | lvData .Columns.E ndUpdate; | |
| 300 | end; | |
| 301 | Result : = lvData.C olumns.Cou nt; | |
| 302 | end; | |
| 303 | ||
| 304 | function T fraCoverSh eetDisplay Panel_CPRS .getIsFini shedLoadin g: boolean ; | |
| 305 | begin | |
| 306 | Result : = fFinishe d and (not tmr.Enabl ed) | |
| 307 | end; | |
| 308 | ||
| 309 | procedure TfraCoverS heetDispla yPanel_CPR S.OnGetDet ail(aRec: TDelimited String; aR esult: TSt rings); | |
| 310 | begin | |
| 311 | try | |
| 312 | CallVi stA(CPRSPa rams.Detai lRPC, [Pat ient.DFN, aRec.GetPi ece(1)], a Result); | |
| 313 | except | |
| 314 | on E: Exception do | |
| 315 | Show Message('D efault Det ail Failed . ' + E.Me ssage); | |
| 316 | end; | |
| 317 | end; | |
| 318 | ||
| 319 | procedure TfraCoverS heetDispla yPanel_CPR S.OnLoadEr ror(Sender : TObject; E: Except ion); | |
| 320 | begin | |
| 321 | inherite d; | |
| 322 | ||
| 323 | lvData.I tems.Clear ; | |
| 324 | with lvD ata.Items. Add do | |
| 325 | Captio n := '** E rror Loadi ng Data ** '; | |
| 326 | lvData.E nabled := True; | |
| 327 | lvData.H int := get LoadErrorM essage; | |
| 328 | lvData.S howHint := True; | |
| 329 | end; | |
| 330 | ||
| 331 | function T fraCoverSh eetDisplay Panel_CPRS .ListViewI temIEN: in teger; | |
| 332 | begin | |
| 333 | if lvDat a.Selected <> nil th en | |
| 334 | if lvD ata.Select ed.Data <> nil then | |
| 335 | Resu lt := TDel imitedStri ng(lvData. Selected.D ata).GetPi eceAsInteg er(1) | |
| 336 | else | |
| 337 | Resu lt := -1 | |
| 338 | else | |
| 339 | Result := -1; | |
| 340 | end; | |
| 341 | ||
| 342 | function T fraCoverSh eetDisplay Panel_CPRS .ListViewI temRec: TD elimitedSt ring; | |
| 343 | begin | |
| 344 | if lvDat a.Selected <> nil th en | |
| 345 | if lvD ata.Select ed.Data <> nil then | |
| 346 | Resu lt := TDel imitedStri ng(lvData. Selected.D ata) | |
| 347 | else | |
| 348 | Resu lt := nil | |
| 349 | else | |
| 350 | Result := nil; | |
| 351 | end; | |
| 352 | ||
| 353 | procedure TfraCoverS heetDispla yPanel_CPR S.lvDataEn ter(Sender : TObject) ; | |
| 354 | begin | |
| 355 | if (fLas tItemIndex > -1) and (lvData.I tems.Count > fLastIt emIndex) t hen | |
| 356 | begin | |
| 357 | lvDa ta.Items[f LastItemIn dex].Selec ted := Tru e; | |
| 358 | lvDa ta.Items[f LastItemIn dex].Focus ed := True ; | |
| 359 | end | |
| 360 | else if lvData.Ite ms.Count > 0 then | |
| 361 | begin | |
| 362 | lvDa ta.Items[0 ].Selected := True; | |
| 363 | lvDa ta.Items[0 ].Focused := True; | |
| 364 | end; | |
| 365 | end; | |
| 366 | ||
| 367 | procedure TfraCoverS heetDispla yPanel_CPR S.lvDataEx it(Sender: TObject); | |
| 368 | begin | |
| 369 | lvData.S elected := nil; | |
| 370 | end; | |
| 371 | ||
| 372 | procedure TfraCoverS heetDispla yPanel_CPR S.lvDataMo useDown(Se nder: TObj ect; Butto n: TMouseB utton; Shi ft: TShift State; X, Y: integer ); | |
| 373 | var | |
| 374 | aDetail: TStringLi st; | |
| 375 | aItem: T ListItem; | |
| 376 | aParam: ICoverShee tParam_CPR S; | |
| 377 | begin | |
| 378 | if fAllo wDetailDis play then | |
| 379 | begin | |
| 380 | aIte m := lvDat a.GetItemA t(X, Y); | |
| 381 | if a Item <> ni l then | |
| 382 | be gin | |
| 383 | fLastItemI ndex := aI tem.Index; | |
| 384 | if (Button = mbLeft) and (aIte m.Data <> nil) then | |
| 385 | if TDeli mitedStrin g(aItem.Da ta).GetPie ce(1) <> ' ' then | |
| 386 | try | |
| 387 | // G et the det ail text | |
| 388 | aDet ail := TSt ringList.C reate; | |
| 389 | OnGe tDetail(TD elimitedSt ring(aItem .Data), aD etail); | |
| 390 | ||
| 391 | // C heck to se e if it's printable | |
| 392 | if g etParam.Qu eryInterfa ce(ICoverS heetParam_ CPRS, aPar am) = 0 th en | |
| 393 | On ShowDetail (aDetail, '', aParam .AllowDeta ilPrint) | |
| 394 | else | |
| 395 | On ShowDetail (aDetail); | |
| 396 | finall y | |
| 397 | Free AndNil(aDe tail); | |
| 398 | end; | |
| 399 | { Make it look like we never l ost focus :-) } | |
| 400 | aItem.Sele cted := Tr ue; | |
| 401 | aItem.Focu sed := Tru e; | |
| 402 | lvData.Set Focus; | |
| 403 | en d | |
| 404 | else | |
| 405 | lv DataEnter( Sender); | |
| 406 | end; | |
| 407 | end; | |
| 408 | ||
| 409 | procedure TfraCoverS heetDispla yPanel_CPR S.lvDataSe lectItem(S ender: TOb ject; Item : TListIte m; Selecte d: boolean ); | |
| 410 | begin | |
| 411 | if Selec ted then | |
| 412 | fLastI temIndex : = Item.Ind ex; | |
| 413 | end; | |
| 414 | ||
| 415 | procedure TfraCoverS heetDispla yPanel_CPR S.OnPopupM enu(Sender : TObject) ; | |
| 416 | begin | |
| 417 | inherite d; | |
| 418 | pmnRefre sh.Enabled := (Patie nt.DFN <> ''); | |
| 419 | end; | |
| 420 | ||
| 421 | procedure TfraCoverS heetDispla yPanel_CPR S.OnPopupM enuInit(Se nder: TObj ect); | |
| 422 | begin | |
| 423 | inherite d; | |
| 424 | pmnRefre sh.Visible := True; | |
| 425 | pmnRefre sh.Enabled := True; | |
| 426 | end; | |
| 427 | ||
| 428 | procedure TfraCoverS heetDispla yPanel_CPR S.OnRefres hDisplay(S ender: TOb ject); | |
| 429 | var | |
| 430 | aRet: TS tringList; | |
| 431 | begin | |
| 432 | inherite d; | |
| 433 | ||
| 434 | ClearLis tView(lvDa ta); | |
| 435 | ||
| 436 | if Patie nt.DFN = ' ' then | |
| 437 | begin | |
| 438 | lvDa ta.Items.A dd.Caption := 'No Pa tient Sele cted.'; | |
| 439 | lvDa ta.Repaint ; | |
| 440 | Exit ; | |
| 441 | end; | |
| 442 | ||
| 443 | if CPRSP arams.Load InBackgrou nd then | |
| 444 | begin | |
| 445 | OnSt artBackgro undLoad(Se lf); | |
| 446 | fBac kgroundLoa dTry := 0; | |
| 447 | fBac kgroundLoa ding := Tr ue; | |
| 448 | tmr. Enabled := True; // Start up t he timer! | |
| 449 | CPRS Params.Loa dInBackgro und := fal se; // Onl y loads ba ckground w hen the co versheet s ays so. | |
| 450 | Appl ication.Pr ocessMessa ges; | |
| 451 | Exit ; | |
| 452 | end; | |
| 453 | ||
| 454 | try | |
| 455 | try | |
| 456 | Clea rLoadError ; | |
| 457 | ||
| 458 | OnBe ginUpdate( Sender); | |
| 459 | ||
| 460 | aRet := TStrin gList.Crea te; | |
| 461 | ||
| 462 | { to do - move these call s into a G etList met hod that c an then be overridde n by the i nheritors } | |
| 463 | // G etList(aRe t); Every inheritor will have the params and acces s to Patie nt.DFN | |
| 464 | ||
| 465 | if C PRSParams. Param1 <> '' then | |
| 466 | Ca llVistA(CP RSParams.M ainRPC, [P atient.DFN , CPRSPara ms.Param1] , aRet) | |
| 467 | else | |
| 468 | Ca llVistA(CP RSParams.M ainRPC, [P atient.DFN ], aRet); | |
| 469 | ||
| 470 | Clea rListView( lvData); / / Must be re-cleared to flush anything f rom the On BeginUpdat e messages . | |
| 471 | OnAd dItems(aRe t); | |
| 472 | except | |
| 473 | on E : Exceptio n do | |
| 474 | On LoadError( Self, E); | |
| 475 | end; | |
| 476 | finally | |
| 477 | OnEndU pdate(Send er); | |
| 478 | FreeAn dNil(aRet) ; | |
| 479 | end; | |
| 480 | end; | |
| 481 | ||
| 482 | procedure TfraCoverS heetDispla yPanel_CPR S.OnSetFon tSize(Send er: TObjec t; aNewSiz e: integer ); | |
| 483 | begin | |
| 484 | inherite d; | |
| 485 | lvData.F ont.Size : = aNewSize ; | |
| 486 | end; | |
| 487 | ||
| 488 | procedure TfraCoverS heetDispla yPanel_CPR S.SetListV iewColumn( aIndex: in teger; aCa ption: str ing; aAuto Size: bool ean; aWidt h: integer ); | |
| 489 | begin | |
| 490 | while lv Data.Colum ns.Count < (aIndex + 1) do | |
| 491 | lvData .Columns.A dd; | |
| 492 | ||
| 493 | lvData.S howColumnH eaders := True; | |
| 494 | ||
| 495 | with lvD ata.Column s[aIndex] do | |
| 496 | begin | |
| 497 | Capt ion := aCa ption; | |
| 498 | Auto Size := aA utoSize; | |
| 499 | Widt h := aWidt h; | |
| 500 | end; | |
| 501 | lvData.C olumnClick := false; // This i s a defaul t on setup . If setti ng up a so rt, enable it. | |
| 502 | end; | |
| 503 | ||
| 504 | procedure TfraCoverS heetDispla yPanel_CPR S.OnShowDe tail(aText : TStrings ; aTitle: string = ' '; aPrinta ble: boole an = false ); | |
| 505 | begin | |
| 506 | if aTitl e = '' the n | |
| 507 | aTitle := getTit le + ' Ite m Detail: ' + lvData .Selected. Caption; | |
| 508 | ReportBo x(aText, a Title, aPr intable); | |
| 509 | end; | |
| 510 | ||
| 511 | procedure TfraCoverS heetDispla yPanel_CPR S.OnShowEr ror(Sender : TObject) ; | |
| 512 | begin | |
| 513 | ShowMess age('CPRS does this by itself with a cop y to clipb oard optio n' + #13 + getLoadEr rorMessage ); | |
| 514 | end; | |
| 515 | ||
| 516 | procedure TfraCoverS heetDispla yPanel_CPR S.OnStartB ackgroundL oad(Sender : TObject) ; | |
| 517 | begin | |
| 518 | ClearLis tView(lvDa ta); | |
| 519 | lvData.I tems.Add.C aption := UPDATING_B ACKGROUND; | |
| 520 | Applicat ion.Proces sMessages; | |
| 521 | end; | |
| 522 | ||
| 523 | procedure TfraCoverS heetDispla yPanel_CPR S.tmrTimer (Sender: T Object); | |
| 524 | var | |
| 525 | aLst: TS tringList; | |
| 526 | aParam: ICoverShee tParam_CPR S; | |
| 527 | i: integ er; | |
| 528 | begin | |
| 529 | tmr.Inte rval := UP DATING_WAI T_TIME; | |
| 530 | tmr.Enab led := fBa ckgroundLo ading; | |
| 531 | ||
| 532 | // if tr y = 0 then it just h it from ge tting set to fire, g ive server a free lo op | |
| 533 | if fBack groundLoad Try = 0 th en | |
| 534 | begin | |
| 535 | Clea rListView( lvData); | |
| 536 | lvDa ta.Items.A dd.Caption := UPDATI NG_BACKGRO UND; | |
| 537 | inc( fBackgroun dLoadTry); | |
| 538 | Appl ication.Pr ocessMessa ges; | |
| 539 | Exit ; | |
| 540 | end; | |
| 541 | ||
| 542 | ClearLis tView(lvDa ta); | |
| 543 | ||
| 544 | if not t mr.Enabled then | |
| 545 | begin | |
| 546 | lvDa ta.Items.A dd.Caption := 'Exit, timer not enabled'; | |
| 547 | Exit ; | |
| 548 | end; | |
| 549 | ||
| 550 | if getPa ram.QueryI nterface(I CoverSheet Param_CPRS , aParam) <> 0 then | |
| 551 | begin | |
| 552 | lvDa ta.Items.A dd.Caption := 'Inval id param s et for dis play.'; | |
| 553 | tmr. Enabled := false; | |
| 554 | Exit ; | |
| 555 | end | |
| 556 | else if aParam.Pol lingID = ' ' then | |
| 557 | begin | |
| 558 | lvDa ta.Items.A dd.Caption := 'Inval id Polling ID in para m set.'; | |
| 559 | tmr. Enabled := false; | |
| 560 | Exit ; | |
| 561 | end; | |
| 562 | ||
| 563 | // Do th e call her e and dete rmine if w e can load anything | |
| 564 | try | |
| 565 | aLst : = TStringL ist.Create ; | |
| 566 | CallVi stA('ORWCV POLL', [P atient.DFN , CoverShe et.IPAddre ss, CoverS heet.Uniqu eID, aPara m.PollingI D], aLst); | |
| 567 | if aLs t.Count > 0 then | |
| 568 | begi n | |
| 569 | fo r i := aLs t.Count - 1 downto 0 do | |
| 570 | begin | |
| 571 | if Copy( aLst[i], 1 , 1) = '~' then | |
| 572 | aLst.D elete(i) | |
| 573 | else if Copy(aLst[ i], 1, 1) = 'i' then | |
| 574 | aLst[i ] := Copy( aLst[i], 2 , Length(a Lst[i])); | |
| 575 | end; | |
| 576 | ||
| 577 | Cl earListVie w(lvData); | |
| 578 | ||
| 579 | On AddItems(a Lst); | |
| 580 | tm r.Enabled := false; | |
| 581 | On CompleteBa ckgroundLo ad(Self); | |
| 582 | Ex it; | |
| 583 | end; | |
| 584 | finally | |
| 585 | FreeAn dNil(aLst) ; | |
| 586 | end; | |
| 587 | ||
| 588 | inc(fBac kgroundLoa dTry); | |
| 589 | fBackgro undLoading := (fBack groundLoad Try <= UPD ATING_ATTE MPTS); | |
| 590 | ||
| 591 | if fBack groundLoad ing then | |
| 592 | lvData .Items.Add .Caption : = Format(U PDATING_BA CKGROUND + '%s', [Co py('...... ....', 1, fBackgroun dLoadTry)] ) | |
| 593 | else | |
| 594 | begin | |
| 595 | tmr. Enabled := false; | |
| 596 | lvDa ta.Items.A dd.Caption := UPDATI NG_FAILURE ; | |
| 597 | end; | |
| 598 | ||
| 599 | Applicat ion.Proces sMessages; | |
| 600 | end; | |
| 601 | ||
| 602 | end. |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.