26. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 5/10/2019 1:00:04 PM Eastern 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.

26.1 Files compared

# Location File Last Modified
1 CPRS_v32_64_P2.zip\OR_30_405V64_SRC.zip\Cover Sheet mCoverSheetDisplayPanel_CPRS.pas Wed Apr 3 19:32:16 2019 UTC
2 CPRS_v32_64_P2.zip\OR_30_405V64_SRC.zip\Cover Sheet mCoverSheetDisplayPanel_CPRS.pas Thu May 9 00:51:19 2019 UTC

26.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1200
Changed 1 2
Inserted 0 0
Removed 0 0

26.3 Comparison options

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

26.4 Active regular expressions

No regular expressions were active.

26.5 Comparison detail

  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              lvData.Set Focus;
  401           en d
  402         else
  403           lv DataEnter( Sender);
  404       end;
  405   end;
  406  
  407   procedure  TfraCoverS heetDispla yPanel_CPR S.lvDataSe lectItem(S ender: TOb ject; Item : TListIte m; Selecte d: boolean );
  408   begin
  409     if Selec ted then
  410       fLastI temIndex : = Item.Ind ex;
  411   end;
  412  
  413   procedure  TfraCoverS heetDispla yPanel_CPR S.OnPopupM enu(Sender : TObject) ;
  414   begin
  415     inherite d;
  416     pmnRefre sh.Enabled  := (Patie nt.DFN <>  '');
  417   end;
  418  
  419   procedure  TfraCoverS heetDispla yPanel_CPR S.OnPopupM enuInit(Se nder: TObj ect);
  420   begin
  421     inherite d;
  422     pmnRefre sh.Visible  := True;
  423     pmnRefre sh.Enabled  := True;
  424   end;
  425  
  426   procedure  TfraCoverS heetDispla yPanel_CPR S.OnRefres hDisplay(S ender: TOb ject);
  427   var
  428     aRet: TS tringList;
  429     aRPC: st ring;
  430   begin
  431     inherite d;
  432  
  433     ClearLis tView(lvDa ta);
  434  
  435     if Patie nt.DFN = ' ' then
  436       begin
  437         lvDa ta.Items.A dd.Caption  := 'No Pa tient Sele cted.';
  438         lvDa ta.Repaint ;
  439         Exit ;
  440       end;
  441  
  442     if CPRSP arams.Load InBackgrou nd then
  443       begin
  444         OnSt artBackgro undLoad(Se lf);
  445         fBac kgroundLoa dTry := 0;
  446         fBac kgroundLoa ding := Tr ue;
  447         tmr. Enabled :=  True; //  Start up t he timer!
  448         CPRS Params.Loa dInBackgro und := fal se; // Onl y loads ba ckground w hen the co versheet s ays so.
  449         Appl ication.Pr ocessMessa ges;
  450         Exit ;
  451       end;
  452  
  453     try
  454       try
  455         Clea rLoadError ;
  456  
  457         OnBe ginUpdate( Sender);
  458  
  459         aRet  := TStrin gList.Crea te;
  460         aRPC  := CPRSPa rams.MainR PC;
  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         if C PRSParams. Param1 <>  '' then
  465           Ca llVistA(aR PC, [Patie nt.DFN, CP RSParams.P aram1], aR et)
  466         else
  467           Ca llVistA(aR PC, [Patie nt.DFN], a Ret);
  468  
  469         Clea rListView( lvData); / / Must be  re-cleared  to flush  anything f rom the On BeginUpdat e messages .
  470         OnAd dItems(aRe t);
  471       except
  472         on E : Exceptio n do
  473           On LoadError( Self, E);
  474       end;
  475     finally
  476       OnEndU pdate(Send er);
  477       FreeAn dNil(aRet) ;
  478     end;
  479   end;
  480  
  481   procedure  TfraCoverS heetDispla yPanel_CPR S.OnSetFon tSize(Send er: TObjec t; aNewSiz e: integer );
  482   begin
  483     inherite d;
  484     lvData.F ont.Size : = aNewSize ;
  485   end;
  486  
  487   procedure  TfraCoverS heetDispla yPanel_CPR S.SetListV iewColumn( aIndex: in teger; aCa ption: str ing; aAuto Size: bool ean; aWidt h: integer );
  488   begin
  489     while lv Data.Colum ns.Count <  (aIndex +  1) do
  490       lvData .Columns.A dd;
  491  
  492     lvData.S howColumnH eaders :=  True;
  493  
  494     with lvD ata.Column s[aIndex]  do
  495       begin
  496         Capt ion := aCa ption;
  497         Auto Size := aA utoSize;
  498         Widt h := aWidt h;
  499       end;
  500     lvData.C olumnClick  := false;  // This i s a defaul t on setup . If setti ng up a so rt, enable  it.
  501   end;
  502  
  503   procedure  TfraCoverS heetDispla yPanel_CPR S.OnShowDe tail(aText : TStrings ; aTitle:  string = ' '; aPrinta ble: boole an = false );
  504   begin
  505     if aTitl e = '' the n
  506       aTitle  := getTit le + ' Ite m Detail:  ' + lvData .Selected. Caption;
  507     ReportBo x(aText, a Title, aPr intable);
  508   end;
  509  
  510   procedure  TfraCoverS heetDispla yPanel_CPR S.OnShowEr ror(Sender : TObject) ;
  511   begin
  512     ShowMess age('CPRS  does this  by itself  with a cop y to clipb oard optio n' + #13 +  getLoadEr rorMessage );
  513   end;
  514  
  515   procedure  TfraCoverS heetDispla yPanel_CPR S.OnStartB ackgroundL oad(Sender : TObject) ;
  516   begin
  517     ClearLis tView(lvDa ta);
  518     lvData.I tems.Add.C aption :=  UPDATING_B ACKGROUND;
  519     Applicat ion.Proces sMessages;
  520   end;
  521  
  522   procedure  TfraCoverS heetDispla yPanel_CPR S.tmrTimer (Sender: T Object);
  523   var
  524     aLst: TS tringList;
  525     aParam:  ICoverShee tParam_CPR S;
  526     i: integ er;
  527   begin
  528     tmr.Inte rval := UP DATING_WAI T_TIME;
  529     tmr.Enab led := fBa ckgroundLo ading;
  530  
  531     // if tr y = 0 then  it just h it from ge tting set  to fire, g ive server  a free lo op
  532     if fBack groundLoad Try = 0 th en
  533       begin
  534         Clea rListView( lvData);
  535         lvDa ta.Items.A dd.Caption  := UPDATI NG_BACKGRO UND;
  536         inc( fBackgroun dLoadTry);
  537         Appl ication.Pr ocessMessa ges;
  538         Exit ;
  539       end;
  540  
  541     ClearLis tView(lvDa ta);
  542  
  543     if not t mr.Enabled  then
  544       begin
  545         lvDa ta.Items.A dd.Caption  := 'Exit,  timer not  enabled';
  546         Exit ;
  547       end;
  548  
  549     if getPa ram.QueryI nterface(I CoverSheet Param_CPRS , aParam)  <> 0 then
  550       begin
  551         lvDa ta.Items.A dd.Caption  := 'Inval id param s et for dis play.';
  552         tmr. Enabled :=  false;
  553         Exit ;
  554       end
  555     else if  aParam.Pol lingID = ' ' then
  556       begin
  557         lvDa ta.Items.A dd.Caption  := 'Inval id Polling ID in para m set.';
  558         tmr. Enabled :=  false;
  559         Exit ;
  560       end;
  561  
  562     // Do th e call her e and dete rmine if w e can load  anything
  563     try
  564       aLst : = TStringL ist.Create ;
  565       CallVi stA('ORWCV  POLL', [P atient.DFN , CoverShe et.IPAddre ss, CoverS heet.Uniqu eID, aPara m.PollingI D], aLst);
  566       if aLs t.Count >  0 then
  567         begi n
  568           fo r i := aLs t.Count -  1 downto 0  do
  569              begin
  570                if Copy( aLst[i], 1 , 1) = '~'  then
  571                  aLst.D elete(i)
  572                else if  Copy(aLst[ i], 1, 1)  = 'i' then
  573                  aLst[i ] := Copy( aLst[i], 2 , Length(a Lst[i]));
  574              end;
  575  
  576           Cl earListVie w(lvData);
  577  
  578           On AddItems(a Lst);
  579           tm r.Enabled  := false;
  580           On CompleteBa ckgroundLo ad(Self);
  581           Ex it;
  582         end;
  583     finally
  584       FreeAn dNil(aLst) ;
  585     end;
  586  
  587     inc(fBac kgroundLoa dTry);
  588     fBackgro undLoading  := (fBack groundLoad Try <= UPD ATING_ATTE MPTS);
  589  
  590     if fBack groundLoad ing then
  591       lvData .Items.Add .Caption : = Format(U PDATING_BA CKGROUND +  '%s', [Co py('...... ....', 1,  fBackgroun dLoadTry)] )
  592     else
  593       begin
  594         tmr. Enabled :=  false;
  595         lvDa ta.Items.A dd.Caption  := UPDATI NG_FAILURE ;
  596       end;
  597  
  598     Applicat ion.Proces sMessages;
  599   end;
  600  
  601   end.