29. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 8/3/2017 10:10:46 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.

29.1 Files compared

# Location File Last Modified
1 V31A.zip\V31A\448\OR_30_448V7_SRC\UI\Encounter fPCEBaseMain.pas Thu Mar 2 16:33:30 2017 UTC
2 V31A.zip\V31A\448\OR_30_448V7_SRC\UI\Encounter fPCEBaseMain.pas Thu Aug 3 13:30:34 2017 UTC

29.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 6 1232
Changed 5 14
Inserted 0 0
Removed 0 0

29.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

29.4 Active regular expressions

No regular expressions were active.

29.5 Comparison detail

  1   unit fPCEB aseMain;
  2  
  3   interface
  4  
  5   uses
  6     Windows,  Messages,  SysUtils,  Classes,  Graphics,  Controls,  Forms, Dia logs,
  7     fPCEBase Grid, ComC trls, StdC trls, ORCt rls, ExtCt rls, Butto ns, rPCE,  uPCE,
  8       CheckLst,  ORFn, rmis c; // DN S      BELLC adde d rMISC as  per [spec 30.3.3]
  9  
  10   type
  11     TCopyIte msMethod =  procedure (Dest: TSt rings) of  object;
  12     TListSec tionsProc  = procedur e(Dest: TS trings);
  13  
  14     TfrmPCEB aseMain =  class(Tfrm PCEBaseGri d)
  15       lbSect ion: TORLi stBox;
  16       edtCom ment: TCap tionEdit;
  17       lblSec tion: TLab el;
  18       lblLis t: TLabel;
  19       lblCom ment: TLab el;
  20       btnRem ove: TButt on;
  21       btnOth er: TButto n;
  22       bvlMai n: TBevel;
  23       btnSel ectAll: TB utton;
  24       lbxSec tion: TORL istBox;
  25       pnlMai n: TPanel;
  26       pnlLef t: TPanel;
  27       splLef t: TSplitt er;
  28       cbICD1 0DebugRPC:  TCheckBox ;
  29       SpeedB utton1: TS peedButton ;
  30       SpeedB utton2: TS peedButton ;
  31       proced ure lbSect ionClick(S ender: TOb ject);
  32       proced ure btnOth erClick(Se nder: TObj ect);
  33       proced ure edtCom mentExit(S ender: TOb ject);
  34       proced ure edtCom mentChange (Sender: T Object);
  35       proced ure btnRem oveClick(S ender: TOb ject);
  36       proced ure clbLis tClick(Sen der: TObje ct);
  37       proced ure lbGrid Select(Sen der: TObje ct);
  38       proced ure FormDe stroy(Send er: TObjec t);
  39       proced ure btnSel ectAllClic k(Sender:  TObject);
  40       proced ure FormRe size(Sende r: TObject ); virtual ;
  41       proced ure clbLis tMouseDown (Sender: T Object; Bu tton: TMou seButton;
  42         Shif t: TShiftS tate; X, Y : Integer) ;
  43       proced ure lbxSec tionClickC heck(Sende r: TObject ; Index: I nteger);
  44       proced ure splLef tMoved(Sen der: TObje ct);
  45       proced ure edtCom mentKeyPre ss(Sender:  TObject;  var Key: C har);
  46       proced ure FormCr eate(Sende r: TObject );
  47       proced ure cbICD1 0DebugRPCC lick(Sende r: TObject );
  48       proced ure SpeedB utton1Clic k(Sender:  TObject);
  49       proced ure SpeedB utton2Clic k(Sender:  TObject);
  50     private
  51       FComme ntItem: in teger;
  52       FComme ntChanged:  boolean;
  53       FUpdat eCount: in teger;
  54       //FUpd atingGrid:  boolean;   moved to  'protected ' so frmDi agnoses ca n see it   (RV)
  55     protecte d
  56       FUpdat ingGrid: b oolean;
  57       FPCELi stCodesPro c: TPCELis tCodesProc ;
  58       FPCEIt emClass: T PCEItemCla ss;
  59       FPCECo de: string ;
  60       FSplit terMove: b oolean;
  61       functi on GetCat:  string;
  62       proced ure Update NewItemStr (var x: st ring); vir tual;
  63   //    proc edure Upda teNewItem( APCEItem:  TPCEItem);  virtual;
  64       proced ure GridCh anged; vir tual;
  65       proced ure Update Controls;  override;
  66       proced ure BeginU pdate;
  67       proced ure EndUpd ate;
  68       functi on NotUpda ting: bool ean;
  69       proced ure CheckO ffEntries;
  70       proced ure Update TabPos;
  71       proced ure Sync2G rid;
  72       proced ure Sync2S ection;
  73     public
  74       proced ure AllowT abChange(v ar AllowCh ange: bool ean); over ride;
  75       proced ure InitTa b(ACopyPro c: TCopyIt emsMethod;  AListProc : TListSec tionsProc) ;
  76     end;
  77  
  78   var
  79     frmPCEBa seMain: Tf rmPCEBaseM ain;
  80  
  81   const
  82     LBCheckW idthSpace  = 18;
  83  
  84   implementa tion
  85  
  86   uses fPCEL ex, fPCEOt her, fEnco unterFrame , fHFSearc h,
  87   {$IFDEF IC D10TEST01}
  88     fxBroker , uUtils,
  89   {$ENDIF}
  90     uCore;   // rpk 2/1 4/2012
  91  
  92   {$R *.DFM}
  93  
  94   procedure  TfrmPCEBas eMain.lbSe ctionClick (Sender: T Object);
  95   // OR_30_3 50 ------- ---------- ---------- ---------- ---------- ---------- ---- begin
  96   {
  97   var
  98     SecItems  : TString s;
  99   const
  100     DX_PROBL EM_LIST_TX T     = 'P roblem Lis t Items';
  101   }
  102   // OR_30_3 50 ------- ---------- ---------- ---------- ---------- ---------- ------ end
  103   begin
  104     inherite d;
  105     ClearGri d;
  106     FPCEList CodesProc( lbxSection .Items, lb Section.It emIEN);
  107     CheckOff Entries;
  108   // OR_30_3 50 ------- ---------- ---------- ---------- ---------- ---------- ---- begin
  109   //  FSecti onPopulate d := TRUE;
  110     if (lbSe ction.Item s.Count >  0) then
  111       lblLis t.Caption  := StringR eplace(lbS ection.Dis playText[l bSection.I temIndex],
  112         '&',  '&&', [rf ReplaceAll ] );
  113   {
  114     if (lbSe ction.Disp layText[lb Section.It emIndex] =  DX_PROBLE M_LIST_TXT ) then
  115     begin
  116       SecIte ms := lbxS ection.Ite ms;
  117       FastAs sign(SecIt ems, FProb lems);
  118     end;
  119   }
  120   // OR_30_3 50 ------- ---------- ---------- ---------- ---------- ---------- ------ end
  121   end;
  122  
  123   procedure  TfrmPCEBas eMain.Upda teNewItemS tr(var x:  string);
  124   begin
  125   end;
  126  
  127   procedure  TfrmPCEBas eMain.Grid Changed;
  128   var
  129     i: integ er;
  130     tmpList:  TStringLi st;
  131   begin
  132     tmpList  := TString List.Creat e;
  133     BeginUpd ate;
  134     try
  135       SaveGr idSelected ;
  136       tmpLis t.Assign(l bGrid.Item s);
  137       for i  := 0 to lb Grid.Items .Count-1 d o
  138       begin
  139         //lb Grid.Items [i] := TPC EItem(lbGr id.Items.O bjects[i]) .ItemStr;    v22.5 -  RV
  140         tmpL ist[i] :=  TPCEItem(l bGrid.Item s.Objects[ i]).ItemSt r;
  141         tmpL ist.Object s[i] := lb Grid.Items .Objects[i ];
  142       end;
  143       lbGrid .Items.Ass ign(tmpLis t);
  144       Restor eGridSelec ted;
  145       SyncGr idData;
  146     finally
  147       EndUpd ate;
  148       tmpLis t.Free;
  149     end;
  150     UpdateCo ntrols;
  151   end;
  152  
  153   //procedur e TfrmPCEB aseMain.Up dateNewIte m(APCEItem : TPCEItem );
  154   //begin
  155   //end;
  156  
  157   procedure  TfrmPCEBas eMain.btnO therClick( Sender: TO bject);
  158   var
  159     x, Code:  string;
  160     APCEItem : TPCEItem ;
  161     SrchCode : integer;
  162   begin
  163     inherite d;
  164     ClearGri d;
  165     SrchCode  := (Sende r as TButt on).Tag;
  166     if(SrchC ode <= LX_ Threshold)  then begi n
  167       if Ass igned(uEnc PCEData) t hen
  168         Lexi conLookup( Code, Srch Code, Trun c(uEncPCED ata.DateTi me) )  //  rpk 2/15/2 012  ICD-1 0. SDD 3.3 .50
  169       else
  170         Lexi conLookup( Code, Srch Code)
  171   {$IFDEF IC D10DEBUG23 5}
  172       ;
  173       x :=        'Code :       '+ Code+CRLF;
  174       x := x  +   'Sear chCode: '+ IntToStr(S rchCode) +  CRLF;
  175       if Ass igned(uEnc PCEData) t hen
  176         x :=  x + 'Date Time:   '+ FormatFMDa teTime('mm m dd,yyyy  hh:nn',Tru nc(uEncPCE Data.DateT ime))+CRLF
  177       else
  178         x :=  x + 'Date Time:   N/ A (no uEnc PceData as signed)'+C RLF;
  179       AddLog Line(x,'Le xiconLooku p (TfrmPCE BaseMain.b tnOtherCli ck)');
  180   {$ENDIF}
  181     end
  182     else
  183     if(SrchC ode = PCE_ HF) then
  184       HFLook up(Code)
  185     else
  186       OtherL ookup(Code , SrchCode );
  187     btnOther .SetFocus;
  188     if Code  <> '' then
  189     begin
  190       x := F PCECode +  U + Piece( Code, U, 1 ) + U + U  + Piece(Co de, U, 2);
  191       if FPC EItemClass  = TPCEPro c then
  192         SetP iece(x, U,  pnumProvi der, IntTo Str(uProvi ders.PCEPr ovider));
  193   {$IFDEF IC D10DEBUG23 5}
  194       AddLog Line('Addi ng Procedu re:'+CRLF+  x + CRLF+ CRLF+
  195         'Pro viders: '+ CRLF+ uPro viders.toS tring,'Tfr mPCEBaseMa in.btnOthe rClick 2') ;
  196   {$ENDIF}
  197       Update NewItemStr (x);
  198       if FPC EItemClass  = TPCEDia g then x : = x + U +  Piece(Code , U, 4);              // ICD-10  ? SDD 3.3. 50
  199       APCEIt em := FPCE ItemClass. Create;
  200       APCEIt em.SetFrom String(x);
  201   //    Upda teNewItem( APCEItem);
  202       GridIn dex := lbG rid.Items. AddObject( APCEItem.I temStr, AP CEItem);
  203       SyncGr idData;
  204     end;
  205     UpdateCo ntrols;
  206   end;
  207  
  208   procedure  TfrmPCEBas eMain.edtC ommentExit (Sender: T Object);
  209   begin
  210     inherite d;
  211     if(FComm entChanged ) then
  212     begin
  213       FComme ntChanged  := FALSE;
  214       if(FCo mmentItem  >= 0) then
  215         TPCE Item(lbGri d.Items.Ob jects[FCom mentItem]) .Comment : = edtComme nt.text;
  216     end;
  217   end;
  218  
  219   procedure  TfrmPCEBas eMain.Allo wTabChange (var Allow Change: bo olean);
  220   begin
  221     edtComme ntExit(Sel f);
  222   end;
  223  
  224   procedure  TfrmPCEBas eMain.edtC ommentChan ge(Sender:  TObject);
  225   begin
  226     inherite d;
  227     FComment Item := Gr idIndex;
  228     FComment Changed :=  TRUE;
  229   end;
  230  
  231   procedure  TfrmPCEBas eMain.btnR emoveClick (Sender: T Object);
  232   var
  233     i, j: In teger;
  234     APCEItem : TPCEItem ;
  235     CurCateg ory: strin g;
  236  
  237   begin
  238     inherite d;
  239     FUpdatin gGrid := T RUE;
  240     try
  241       for i  := lbGrid. Items.Coun t-1 downto  0 do if(l bGrid.Sele cted[i]) t hen
  242       begin
  243         CurC ategory :=  GetCat;
  244         APCE Item := TP CEDiag(lbG rid.Items. Objects[i] );
  245         if A PCEItem.Ca tegory = C urCategory  then
  246         begi n
  247           wi th APCEIte m do for j  := 0 to l bxSection. Items.Coun t - 1 do
  248              if ORFn.Pi eces(lbxSe ction.Item s[j], U, 1 , 2) = Cod e + U + Na rrative th en
  249                lbxSecti on.Checked [j] := Fal se;
  250         end;
  251         APCE Item.Free;
  252         lbGr id.Items.D elete(i);
  253       end;
  254       ClearG rid;
  255     finally
  256       FUpdat ingGrid :=  FALSE;
  257     end;
  258   end;
  259  
  260   procedure  TfrmPCEBas eMain.Upda teControls ;
  261   var
  262     CommentO K: boolean ;
  263  
  264   begin
  265     btnSelec tAll.Enabl ed := (lbG rid.Items. Count > 0) ;
  266     btnRemov e.Enabled  := (lbGrid .SelCount  > 0);
  267     if(NotUp dating) th en
  268     begin
  269       BeginU pdate;
  270       try
  271         inhe rited;
  272         Comm entOK := ( lbGrid.Sel Count = 1) ;
  273         lblC omment.Ena bled := Co mmentOK;
  274         edtC omment.Ena bled := Co mmentOK;
  275         if(C ommentOK)  then
  276           ed tComment.T ext := TPC EItem(lbGr id.Items.O bjects[Gri dIndex]).C omment
  277         else
  278           ed tComment.T ext := '';
  279       finall y
  280         EndU pdate;
  281       end;
  282     end;
  283   end;
  284  
  285   procedure  TfrmPCEBas eMain.clbL istClick(S ender: TOb ject);
  286   begin
  287     inherite d;
  288   //  with c lbList do
  289   //  if(Ite mIndex >=  0) and (no t(Checked[ ItemIndex] )) then
  290   //    Clea rGrid;
  291   end;
  292  
  293   procedure  TfrmPCEBas eMain.lbGr idSelect(S ender: TOb ject);
  294   begin
  295     inherite d;
  296   //  clbLis t.ItemInde x := -1;
  297     UpdateCo ntrols;
  298   end;
  299  
  300   procedure  TfrmPCEBas eMain.Form Create(Sen der: TObje ct);
  301   begin
  302     inherite d;
  303   {$IFDEF IC D10TEST01}
  304     cbICD10D ebugRPC.Vi sible := T rue;
  305   {$ENDIF}
  306   {$IFDEF RP CLOG}
  307     SpeedBut ton1.Visib le := True ;
  308     SpeedBut ton2.Visib le := True ;
  309   {$ENDIF}
  310   end;
  311  
  312   procedure  TfrmPCEBas eMain.Form Destroy(Se nder: TObj ect);
  313   var
  314     i:intege r;
  315  
  316   begin
  317     inherite d;
  318     with lbG rid.Items  do for i : = 0 to Cou nt - 1 do  TPCEItem(O bjects[i]) .Free;
  319   end;
  320  
  321   procedure  TfrmPCEBas eMain.Init Tab(ACopyP roc: TCopy ItemsMetho d; AListPr oc: TListS ectionsPro c);
  322   begin
  323     AListPro c(lbSectio n.Items);
  324     ACopyPro c(lbGrid.I tems);
  325     lbSectio n.ItemInde x := 0;
  326     lbSectio nClick(lbS ection);
  327     ClearGri d;
  328     GridChan ged;
  329   //  CheckO ffEntries;
  330   end;
  331  
  332   procedure  TfrmPCEBas eMain.Begi nUpdate;
  333   begin
  334     inc(FUpd ateCount);
  335   end;
  336  
  337   procedure  TfrmPCEBas eMain.EndU pdate;
  338   begin
  339     if(FUpda teCount >  0) then
  340       dec(FU pdateCount );
  341   end;
  342  
  343   function T frmPCEBase Main.NotUp dating: bo olean;
  344   begin
  345     Result : = (FUpdate Count = 0) ;
  346   end;
  347  
  348   procedure  TfrmPCEBas eMain.Spee dButton1Cl ick(Sender : TObject) ;
  349   begin
  350     inherite d;
  351   {$IFDEF RP CLOG}
  352     fxBroker .PrevCall;
  353   {$ENDIF}
  354   end;
  355  
  356   procedure  TfrmPCEBas eMain.Spee dButton2Cl ick(Sender : TObject) ;
  357   begin
  358     inherite d;
  359   {$IFDEF RP CLOG}
  360     fxBroker .NextCall;
  361   {$ENDIF}
  362  
  363   end;
  364  
  365   procedure  TfrmPCEBas eMain.Chec kOffEntrie s;
  366  
  367   (*const
  368     TX_INACT IVE_ICD_CO DE1 = 'The  diagnosis  of "';
  369     TX_INACT IVE_ICD_CO DE2 = '" e ntered for  this enco unter' + # 13#10 + 'c ontains an  inactive  ICD code o f "';
  370     TX_INACT IVE_ICD_CO DE3 = '" a s of the e ncounter d ate, and w ill be rem oved.' + # 13#10#13#1 0 +
  371                               'Ple ase select  another d iagnosis.' ;
  372     TC_INACT IVE_ICD_CO DE = 'Diag nosis Cont ains Inact ive Code'; *)
  373   var
  374     i, j: In teger;
  375     CurCateg ory, CodeN arr: strin g;
  376     APCEItem : TPCEItem ;
  377   begin
  378     FUpdatin gGrid := T RUE;
  379     try
  380       if(lbS ection.Ite ms.Count <  1) then e xit;
  381       CurCat egory := G etCat;
  382       for i  := lbGrid. Items.Coun t - 1 down to 0 do
  383       begin
  384         APCE Item := TP CEItem(lbG rid.Items. Objects[i] );
  385         if A PCEItem.Ca tegory = C urCategory  then
  386         begi n
  387           Co deNarr :=  APCEItem.C ode + U +  APCEItem.N arrative;
  388           fo r j := 0 t o lbxSecti on.Items.C ount - 1 d o
  389              if ORFn.Pi eces(lbxSe ction.Item s[j], U, 1 , 2) = Cod eNarr then
  390                begin
  391  
  392   (*               if ( CurCategor y = 'Probl em List It ems') and  (Piece(lbx Section.It ems[j], U,  5) = '#')  then
  393                    begi n
  394                      In foBox(TX_I NACTIVE_IC D_CODE1 +  APCEItem.N arrative +  TX_INACTI VE_ICD_COD E2 +
  395                              APCEI tem.Code +  TX_INACTI VE_ICD_COD E3, TC_INA CTIVE_ICD_ CODE, MB_I CONWARNING  or MB_OK) ;
  396                      lb xSection.C hecked[j]  := False;
  397                      AP CEItem.Fre e;
  398                      lb Grid.Items .Delete(i) ;
  399                    end
  400                  else*)
  401                    lbxS ection.Che cked[j] :=  True;
  402                end;
  403         end;
  404       end;
  405     finally
  406       FUpdat ingGrid :=  FALSE;
  407     end;
  408   end;
  409  
  410   procedure  TfrmPCEBas eMain.btnS electAllCl ick(Sender : TObject) ;
  411   var
  412     i: integ er;
  413  
  414   begin
  415     inherite d;
  416     BeginUpd ate;
  417     try
  418       for i  := 0 to lb Grid.Items .Count-1 d o
  419         lbGr id.Selecte d[i] := TR UE;
  420     finally
  421       EndUpd ate;
  422     end;
  423     UpdateCo ntrols;
  424   end;
  425  
  426   procedure  TfrmPCEBas eMain.cbIC D10DebugRP CClick(Sen der: TObje ct);
  427   begin
  428     inherite d;
  429   {$IFDEF IC D10TEST01}
  430     gDebugPr oblemList  := cbICD10 DebugRPC.C hecked;
  431   {$ENDIF}
  432   end;
  433  
  434   procedure  TfrmPCEBas eMain.Form Resize(Sen der: TObje ct);
  435   begin
  436     if FSpli tterMove t hen
  437       FSplit terMove :=  FALSE
  438     else
  439       inheri ted;
  440   end;
  441  
  442   procedure  TfrmPCEBas eMain.clbL istMouseDo wn(Sender:  TObject;
  443     Button:  TMouseButt on; Shift:  TShiftSta te; X, Y:  Integer);
  444   begin
  445     inherite d;
  446   //  if(But ton <> mbL eft) then
  447   //    clbL ist.Itemin dex := clb List.itemA tPos(Point (X,Y), TRU E);
  448   end;
  449  
  450   function T frmPCEBase Main.GetCa t: string;
  451   begin
  452     Result : = '';
  453     if(lbSec tion.Items .Count > 0 ) and (lbS ection.Ite mIndex >=  0) then
  454       Result  := Piece( lbSection. Items[lbSe ction.Item Index], U,  2);
  455   end;
  456  
  457   procedure  TfrmPCEBas eMain.lbxS ectionClic kCheck(Sen der: TObje ct;
  458     Index: I nteger);
  459   var
  460     i, j: In teger;
  461     sCode: S tring;
  462       x, x0, Cod eCatNarr,  LongDesc:  string;    // DN S      BELLC [spe c30.3.3]
  463     APCEItem : TPCEItem ;
  464     Found, D oSync: boo lean;
  465  
  466   begin
  467     inherite d;
  468     if FUpda tingGrid o r FClosing  then exit ;
  469     DoSync : = FALSE;
  470   //  BeginU pdate; //  Commented  to address  CodeCR CP RS172
  471     x0 := Ge tCat;
  472   {$IFDEF IC D10DEBUG23 5}
  473   AddLogLine ('lbxSecti on.Items:  '+#13#10+l bxSection. Items.Text ,'TfrmPCEB aseMain.lb xSectionCl ickCheck:  1');
  474   {$ENDIF}
  475     for i :=  0 to lbxS ection.Ite ms.Count-1  do
  476     begin
  477       x := x 0 + U + OR Fn.Pieces( lbxSection .Items[i],  U, 1, 2);
  478       CodeCa tNarr := P iece(x, U,  2) + U +  Piece(x, U , 1) + U +  Piece(x,  U, 3);
  479       sCode  := Piece(x , U, 2);
  480   // ICD10.  CodeCR CPR S162 ----- ---------- ---------- ---------- ---------- ---- BEGIN
  481   // No need  to add co de to the  descriptio n
  482   //      if Trunc(u EncPCEData .DateTime)  >= Trunc( StrToFloat (GImplemen tationDate )) then    // DN S      BELLC [spe c30.3.3]
  483   //        CodeCatNar r := CodeC atNarr + # 9 + sCode    // DN S      BELLC [spe c30.3.3]
  484   // ICD10.  CodeCR CPR S162 ----- ---------- ---------- ---------- ---------- ------ END
  485         LongDesc : = ORFn.Pie ce(lbxSect ion.Items[ i], U, 6);  // DN S      BELLC [spe c30.3.3]
  486  
  487       Found  := FALSE;
  488       for j  := lbGrid. Items.Coun t - 1 down to 0 do
  489       begin
  490         APCE Item := TP CEItem(lbG rid.Items. Objects[j] );
  491         with  APCEItem  do if Code CatNarr =  Code + U +  Category  + U + Narr ative then  // ICD10- R. CodeCR  CPRS162.
  492         begi n
  493           Fo und := TRU E;
  494           if (lbxSectio n.Checked[ i]) then b reak;
  495           AP CEItem.Fre e;
  496           lb Grid.Items .Delete(j) ;
  497         end;
  498       end;
  499       if(lbx Section.Ch ecked[i] a nd (not Fo und)) then
  500       begin
  501         x :=  FPCECode  + U + Code CatNarr;
  502         if F PCEItemCla ss = TPCEP roc then
  503           Se tPiece(x,  U, pnumPro vider, Int ToStr(uPro viders.PCE Provider)) ;
  504  
  505         Upda teNewItemS tr(x);
  506   // ICD10.  CodeCR 235  --------- ---------- ---------- ---------- ---------- ---- begin
  507   //      Se tPiece(x,  U, 6, Long Desc);  <- - override s the Prov ider ID
  508   //                                       pi ece 6 of t he PCE ite ms is
  509   //                                       re served for  Provider  ID
  510   //                                       Lo ngDesc is  added to t he item ca ption
  511   // ICD10.  CodeCR 235  --------- ---------- ---------- ---------- ---------- ------ end
  512  
  513         APCE Item := FP CEItemClas s.Create;
  514  
  515         APCE Item.SetFr omString(x );
  516   // ICD10.  CodeCR CPR S162 ----- ---------- ---------- ---------- ---------- ---- BEGIN
  517   // No need  to add co de to the  descriptio n
  518   //        if Trunc(u EncPCEData .DateTime)  >= Trunc( StrToFloat (GImplemen tationDate )) then    // DN S      BELLC [spe c30.3.3]
  519   //          APCEItem.N arrative : = APCEItem .Narrative  + #9 + AP CEItem.Cod e;    // DN S      BELLC [spe c30.3.3]
  520   // ICD10.  CodeCR CPR S162 ----- ---------- ---------- ---------- ---------- ------ END
  521         Grid Index := l bGrid.Item s.AddObjec t(APCEItem .ItemStr +  U + LongD esc, APCEI tem);
  522         DoSy nc := TRUE ;
  523       end;
  524     end;
  525   {$IFDEF IC D10DEBUG23 5}
  526   AddLogLine ('lbxSecti on.Items:  '+#13#10+l bxSection. Items.Text ,'TfrmPCEB aseMain.lb xSectionCl ickCheck:  2');
  527   {$ENDIF}
  528     if(DoSyn c) then
  529       SyncGr idData;
  530     UpdateCo ntrols;
  531   end;
  532  
  533   procedure  TfrmPCEBas eMain.Upda teTabPos;
  534   begin
  535     lbxSecti on.TabPosi tions := S ectionStri ng;
  536   end;
  537  
  538   procedure  TfrmPCEBas eMain.splL eftMoved(S ender: TOb ject);
  539   begin
  540     inherite d;
  541     lblList. Left := lb xSection.L eft + pnlM ain.Left;
  542     FSplitte rMove := T RUE;
  543     FormResi ze(Sender) ;
  544   end;
  545  
  546   procedure  TfrmPCEBas eMain.Sync 2Grid;
  547   var
  548     i, idx,  cnt, NewId x: Integer ;
  549     CodeNarr : string;
  550     APCEItem : TPCEItem ;
  551  
  552   begin
  553     if(FUpda tingGrid o r FClosing ) then exi t;
  554     FUpdatin gGrid := T RUE;
  555     try
  556       cnt :=  0;
  557       idx :=  -1;
  558       for i  := 0 to lb Grid.Items .Count - 1  do
  559       begin
  560         if(l bGrid.Sele cted[i]) t hen
  561         begi n
  562           if (idx < 0)  then idx : = i;
  563           in c(cnt);
  564           if (cnt > 1)  then break ;
  565         end;
  566       end;
  567       NewIdx  := -1;
  568       if(cnt  = 1) then
  569       begin
  570         APCE Item := TP CEItem(lbG rid.Items. Objects[id x]);
  571         if A PCEItem.Ca tegory = G etCat then
  572         begi n
  573           Co deNarr :=  APCEItem.C ode + U +  APCEItem.N arrative;
  574           fo r i := 0 t o lbxSecti on.Items.C ount - 1 d o
  575           be gin
  576              if Pieces( lbxSection .Items[i],  U, 1, 2)  = CodeNarr  then
  577              begin
  578                NewIdx : = i;
  579                break;
  580              end;
  581           en d;
  582         end;
  583       end;
  584       lbxSec tion.ItemI ndex := Ne wIdx;
  585     finally
  586       FUpdat ingGrid :=  FALSE;
  587     end;
  588   end;
  589  
  590   procedure  TfrmPCEBas eMain.Sync 2Section;
  591   var
  592     i, idx:  Integer;
  593     ACode: s tring;
  594  
  595   begin
  596     if(FUpda tingGrid o r FClosing ) then exi t;
  597     FUpdatin gGrid := T RUE;
  598     try
  599       idx :=  lbxSectio n.ItemInde x;
  600       if(idx  >= 0) the n
  601         ACod e := GetCa t + U + Pi eces(lbxSe ction.Item s[idx], U,  1, 2)
  602       else
  603         ACod e := '~@^~ @^@~';
  604       for i  := 0 to lb Grid.Items .Count - 1  do
  605       begin
  606         with  TPCEItem( lbGrid.Ite ms.Objects [i]) do
  607           lb Grid.Selec ted[i] :=  (ACode = ( Category +  U + Code  + U + Narr ative));
  608       end;
  609     finally
  610       FUpdat ingGrid :=  FALSE;
  611     end;
  612   end;
  613  
  614   procedure  TfrmPCEBas eMain.edtC ommentKeyP ress(Sende r: TObject ;
  615     var Key:  Char);
  616   begin
  617     inherite d;
  618     if (Key  = '?') and
  619        ((edt Comment.Te xt = '') o r (edtComm ent.SelSta rt = 0)) t hen
  620       Key :=  #0;
  621   end;
  622  
  623   end.