69. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/13/2017 1:08:10 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.

69.1 Files compared

# Location File Last Modified
1 v31B.zip\v31B\455\OR_30_455V1_SRC\SRC\Encounter fEncounterFrame.pas Fri May 12 14:57:50 2017 UTC
2 v31B.zip\v31B\455\OR_30_455V1_SRC\SRC\Encounter fEncounterFrame.pas Thu Jul 13 14:50:40 2017 UTC

69.2 Comparison summary

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

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

69.4 Active regular expressions

No regular expressions were active.

69.5 Comparison detail

  1   unit fEnco unterFrame ;
  2  
  3   interface
  4  
  5   uses
  6     Windows,  Messages,  SysUtils,  Classes,  Graphics,  Controls,  Forms, Dia logs,
  7     Tabs, Co mCtrls, Ex tCtrls, Me nus, StdCt rls, Butto ns, fPCEBa se,
  8     fVisitTy pe
  9     , fDiagn oses
  10     , fProce dure, fImm unization,  fSkinTest , fPatient Ed,
  11     fHealthF actor, fEx am, uPCE,  rPCE, rTIU , ORCtrls,  ORFn
  12   { $ IFDEF  GROUPNOTES }
  13   { $ ELSE}
  14   //  , fEnc Vitals, rv itals, uGN _Const
  15   { $ ENDIF}
  16     , fBase5 08Form,
  17     VA508Acc essibility Manager, u GN_Const;
  18  
  19   const
  20     //tab na mes
  21     CT_Visit Nm = 'Visi t Type';
  22     CT_DiagN m  = 'Diag noses';
  23     CT_ProcN m  = 'Proc edures';
  24     CT_ImmNm    = 'Immu nizations' ;
  25     CT_SkinN m  = 'Skin  Tests';
  26     CT_PedNm    = 'Pati ent Ed';
  27     CT_HlthN m  = 'Heal th Factors ';
  28     CT_XamNm    = 'Exam s';
  29     CT_VitNm    = 'Vita ls';
  30     CT_GAFNm    = 'GAF' ;
  31  
  32     NUM_TABS        = 3 ;
  33     TAG_VTYP E      = 1 0;
  34     TAG_DIAG        = 2 0;
  35     TAG_PROC        = 3 0;
  36     TAG_IMMU NIZ    = 4 0;
  37     TAG_SKIN        = 5 0;
  38     TAG_PED         = 6 0;
  39     TAG_HF          = 7 0;
  40     TAG_XAM         = 8 0;
  41     TAG_TRT         = 9 0;
  42  
  43     TX_NOSEC TION = '-1 ^No sectio ns found';
  44     TX_PROV_ REQ = 'A p rimary enc ounter pro vider must  be select ed ' + CRL F +
  45                    'bef ore encoun ter data c an be save d.' + CRLF  + CRLF +
  46                    'Sel ect the Pr imary Enco unter Prov ider on th e VISIT TY PE tab.' +  CRLF +
  47                    'Oth erwise, pr ess <Cance l> to quit  without s aving data .';
  48  
  49     TC_PROV_ REQ = 'Mis sing Prima ry Provide r for Enco unter';
  50  
  51   type
  52     TfrmEnco unterFrame  = class(T frmBase508 Form)
  53       Status Bar1: TSta tusBar;
  54       pnlPag e: TPanel;
  55       Bevel1 : TBevel;
  56       TabCon trol: TTab Control;
  57       mmLog:  TMemo;
  58  
  59       proced ure tabPag eChange(Se nder: TObj ect; NewTa b: Integer ;
  60         var  AllowChang e: Boolean );
  61       proced ure FormRe size(Sende r: TObject );
  62       proced ure Sectio nClick(Sen der: TObje ct);
  63       proced ure FormDe stroy(Send er: TObjec t);
  64       proced ure FormCr eate(Sende r: TObject );
  65       proced ure FormCl oseQuery(S ender: TOb ject; var  CanClose:  Boolean);
  66       proced ure TabCon trolChange (Sender: T Object);
  67       proced ure TabCon trolChangi ng(Sender:  TObject;
  68         var  AllowChang e: Boolean );
  69       proced ure FormKe yDown(Send er: TObjec t; var Key : Word;
  70         Shif t: TShiftS tate);
  71       proced ure FormCl ose(Sender : TObject;  var Actio n: TCloseA ction);
  72       proced ure FormCa nResize(Se nder: TObj ect; var N ewWidth,
  73         NewH eight: Int eger; var  Resize: Bo olean);
  74       proced ure FormSh ow(Sender:  TObject);
  75       proced ure TabCon trolEnter( Sender: TO bject);
  76  
  77     private
  78   {$IFDEF DE BUG}
  79       fDebug PCE: TPCED ata;
  80   {$ENDIF}
  81       FAutoS ave: boole an;
  82       FSaveN eeded: boo lean;
  83       FChang eSource: I nteger;
  84       FCance l:  Boolea n; //Indic ates the c ancel butt on has bee n pressed;
  85       FAbort : boolean;  // indica tes that n either OK  or Cancel  has been p ressed
  86       FormLi st: TStrin gList;  // Holds the  types of a ny forms t hat will b e used
  87                                 // in the fra me.  They  must be av ailable at  compile t ime
  88       FLastP age: TfrmP CEBase;
  89       FGiveM ultiTabMes sage: bool ean;
  90       proced ure SynchP CEData;
  91       proced ure Switch ToPage(New Form: Tfrm PCEBase);    //was tf rmPage
  92  
  93       functi on FormLis tContains( item: stri ng): Boole an;
  94       proced ure SendDa ta;
  95       proced ure Update Encounter( PCE: TPCED ata);
  96       proced ure SetFor mFonts;
  97  
  98       proced ure doCrea teForms(aL ocation: I nteger);
  99       functi on pageByN ame(aName: String): T frmPCEBase ;
  100  
  101     public
  102       proced ure Select Tab(NewTab Name: stri ng);
  103       proper ty ChangeS ource:     Integer re ad FChange Source;
  104       proper ty Forms:             tstringlis t read For mList;
  105       proper ty Cancel:            Boolean re ad FCancel  write FCa ncel;
  106       proper ty Abort:           B oolean rea d FAbort w rite FAbor t;
  107  
  108       proced ure _UM_GN _ENCUPDATE (var Messa ge: TMessa ge); messa ge UM_GN_E NCUPDATE;
  109  
  110     end;
  111  
  112   var
  113     frmEncou nterFrame:  TfrmEncou nterFrame;
  114     uSCCond:                TSCCon ditions;
  115     uVisitTy pe:            TPCEPr oc;        // contain s info for  visit typ e page
  116     uEncPCED ata: TPCED ata;
  117     uProvide rs: TPCEPr oviderList ;
  118  
  119   // Returns  true if P CE data st ill needs  to be save d - vitals /gaf are a lways save d
  120   function U pdatePCE(P CEData: TP CEData; Sa veOnExit:  boolean =  TRUE): boo lean;
  121  
  122   implementa tion
  123  
  124   uses
  125     uCore,
  126   //  fGAF,
  127     uConst,
  128     rCore, f PCEProvide r, rMisc,  VA508Acces sibilityRo uter, VAUt ils, fEncV itals,
  129     fGAF;
  130  
  131   {$R *.DFM}
  132  
  133   procedure  TfrmEncoun terFrame.d oCreateFor ms(aLocati on: Intege r);
  134   var
  135     j: Integ er;
  136     s: strin g;
  137   begin
  138     FormList .Clear;
  139  
  140     frmVisit Type  := T frmVisitTy pe.CreateL inked(pnlP age);
  141     frmDiagn oses  := T frmDiagnos es.CreateL inked(pnlP age);
  142     frmProce dures := T frmProcedu res.Create Linked(pnl Page);
  143     if not G roupEdit t hen
  144       frmEnc Vitals :=  TfrmEncVit als.Create Linked(pnl Page);
  145     frmImmun izations : = TfrmImmu nizations. CreateLink ed(pnlPage );
  146     if not G roupEdit t hen
  147       frmSki nTests :=  TfrmSkinTe sts.Create Linked(pnl Page);
  148     frmPatie ntEd := Tf rmPatientE d.CreateLi nked(pnlPa ge);
  149     frmHealt hFactors : = TfrmHEal thFactors. CreateLink ed(pnlPage );
  150     if not G roupEdit t hen
  151       frmExa ms := Tfrm Exams.Crea teLinked(p nlPage);
  152     if not G roupEdit t hen
  153  
  154   {$IFDEF DE BUG_AA}
  155   {$ELSE}
  156       if MHC linic(aLoc ation) the n
  157   {$ENDIF}
  158         frmG AF := Tfrm GAF.Create Linked(pnl Page);
  159  
  160     FormList .AddObject (CT_VisitN m,frmVisit Type);
  161     FormList .AddObject (CT_DiagNm ,frmDiagno ses);
  162     FormList .AddObject (CT_ProcNm ,frmProced ures);
  163     if not G roupEdit t hen
  164       FormLi st.AddObje ct(CT_VitN m,frmEncVi tals);
  165  
  166     FormList .AddObject (CT_ImmNm, frmImmuniz ations);
  167     if not G roupEdit t hen
  168       FormLi st.AddObje ct(CT_Skin Nm,frmSkin Tests);
  169     FormList .AddObject (CT_PedNm, frmPatient Ed);
  170     FormList .AddObject (CT_HlthNm ,frmHealth Factors);
  171     if not G roupEdit t hen
  172       FormLi st.AddObje ct(CT_XamN m,frmExams );
  173     if not G roupEdit t hen
  174   {$IFDEF DE BUG_AA}
  175   {$ELSE}
  176       if MHC linic(aLoc ation) the n
  177   {$ENDIF}
  178         Form List.AddOb ject(CT_GA FNm,frmGAF );
  179  
  180     frmVisit Type.Visib le := True ;
  181     for j  : = 1 to For mList.Coun t - 1 do
  182       TForm( FormList.O bjects[j]) .Visible : = False;
  183  
  184     for s in  FormList  do
  185       tabCon trol.Tabs. Add(s);
  186   end;
  187  
  188   function T frmEncount erFrame.pa geByName(a Name:Strin g): TfrmPC EBase;
  189   var
  190     i: integ er;
  191   begin
  192     Result : = nil;
  193     i := For mList.Inde xOf(aName) ;
  194     if i >=0  then
  195       Result  := TfrmPC EBase(Form List.Objec ts[i]);
  196   end;
  197  
  198   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  199   //Name: fu nction Tfr mEncounter Frame.Form ListContai ns(item: s tring): Bo olean;
  200   //Created:  12/06/98
  201   //By: Robe rt Bott
  202   //Location : ISL
  203   //Descript ion: Retur ns a boole an value i ndicating  if a given  string ex ists in
  204   // the for mlist.
  205   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  206   function T frmEncount erFrame.Fo rmListCont ains(item:  string):  Boolean;
  207   begin
  208     result : = false;
  209     if (Form List.Index Of(item) < > -1 ) the n
  210       result  := true;
  211   end;
  212  
  213   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  214   //Name: Tf rmEncounte rFrame.Swi tchToPage( NewForm: t frmPCEBase );
  215   //Created:  Jan 1999
  216   //By: Robe rt Bott
  217   //Location : ISL
  218   //Descript ion: Bring s the sele cted page  to the fro nt for dis play.
  219   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  220   procedure  TfrmEncoun terFrame.S witchToPag e(NewForm:  tfrmPCEBa se);// was  TfrmPage) ;
  221   { unmerge/ merge menu s, bring p age to top  of z-orde r, call fo rm-specifi c OnDispla y code }
  222   begin
  223     if (NewF orm = nil)  or (FLast Page = New Form) then  Exit;
  224     if Assig ned(FLastP age) then
  225       FLastP age.Hide;
  226     FLastPag e := NewFo rm;
  227   //  KeyPre view := (N ewForm = f rmEncVital s);
  228     NewForm. DisplayPag e;  // thi s calls Br ingToFront  for the f orm
  229   { $ IFDEF  GROUPNOTES }
  230     NewForm. Show;
  231   { $ ENDIF}
  232   end;
  233  
  234   procedure  TfrmEncoun terFrame.t abPageChan ge(Sender:  TObject;  NewTab: In teger; var  AllowChan ge: Boolea n);
  235   { switches  to form l inked to N ewTab }
  236   begin
  237     SwitchTo Page(pageB yName(TabC ontrol.Tab s[NewTab]) );
  238   end;
  239  
  240   { Resize a nd Font-Ch ange proce dures ---- ---------- ---------- ---------- ---------- ---------- --- }
  241  
  242   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  243   //Name: pr ocedure Tf rmEncounte rFrame.For mResize(Se nder: TObj ect);
  244   //Created:  Jan 1999
  245   //By: Robe rt Bott
  246   //Location : ISL
  247   //Descript ion: Resiz es all win dows when  parent cha nges.
  248   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  249   procedure  TfrmEncoun terFrame.F ormResize( Sender: TO bject);
  250   begin
  251     self.rep aint;
  252   end;
  253  
  254  
  255   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  256   //Name: pr ocedure Up datePCE(PC EData: TPC EData);
  257   //Created:  Jan 1999
  258   //By: Robe rt Bott
  259   //Location : ISL
  260   //Descript ion: The m ain call t o open the  encounter  frame and  capture e ncounter
  261   // informa tion.
  262   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  263   function U pdatePCE(P CEData: TP CEData; Sa veOnExit:  boolean =  TRUE): boo lean;
  264   var
  265   //  FontHe ight,
  266   //  FontWi dth: Integ er;
  267     AUser: s tring;
  268  
  269   begin
  270     frmEncou nterFrame  := TfrmEnc ounterFram e.Create(A pplication );
  271     try
  272       frmEnc ounterFram e.FAutoSav e := SaveO nExit;
  273  
  274       uEncPC EData := P CEData;
  275       if(uEn cPCEData.E mpty and ( (uEncPCEDa ta.Locatio n = 0) or  (uEncPCEDa ta.VisitDa teTime = 0 )) and
  276         (not  Encounter .NeedVisit )) then
  277         uEnc PCEData.Us eEncounter  := TRUE;
  278       frmEnc ounterFram e.Caption  := 'Encoun ter Form f or ' + Ext ernalName( uEncPCEDat a.Location , 44) +
  279                                        '  ('  + FormatFM DateTime(' mmm dd,yyy y@hh:nn',  uEncPCEDat a.VisitDat eTime) + ' )';
  280  
  281       uProvi ders.Assig n(uEncPCED ata.Provid ers);
  282       SetDef aultProvid er(uProvid ers, uEncP CEData);
  283       AUser  := IntToSt r(uProvide rs.Pending IEN(FALSE) );
  284       if(AUs er <> '0')  and (uPro viders.Ind exOfProvid er(AUser)  < 0) and
  285          Aut oCheckout( uEncPCEDat a.Location ) then
  286         uPro viders.Add Provider(A User, uPro viders.Pen dingName(F ALSE), FAL SE);
  287  
  288   { $ IFDEF  GROUPNOTES }
  289       frmEnc ounterFram e.doCreate Forms(PCED ata.Locati on);
  290   { $ ELSE}
  291   //    frmE ncounterFr ame.Create ChildForms (frmEncoun terFrame,  PCEData.Lo cation);
  292   { $ ENDIF}
  293       SetFor mPosition( frmEncount erFrame);
  294       Resize AnchoredFo rmToFont(f rmEncounte rFrame);
  295       //SetF ormPositio n(frmEncou nterFrame) ;
  296  
  297       with f rmEncounte rFrame do
  298       begin
  299         SetR PCEncLocat ion(PCEDat a.Location );
  300         Sync hPCEData;
  301         TabC ontrol.Tab index := 0 ;
  302         TabC ontrolChan ge(TabCont rol);
  303  
  304         Show Modal;
  305         Resu lt := FSav eNeeded;
  306       end;
  307     finally
  308       // frm EncounterF rame.Free;    v22.11  (JD and SM )
  309       frmEnc ounterFram e.Release;
  310       //frmE ncounterFr ame := nil ;  access  violation  source?  r emoved 7/2 8/03 RV
  311     end;
  312   end;
  313  
  314   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  315   //Name: Tf rmEncounte rFrame.Sec tionClick( Sender: TO bject);
  316   //Created:  Jan 1999
  317   //By: Robe rt Bott
  318   //Location : ISL
  319   //Descript ion: Call  the proced ure apropr iate for t he selecte d tab
  320   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  321   procedure  TfrmEncoun terFrame.S ectionClic k(Sender:  TObject);
  322   begin
  323     with Sen der as TLi stBox do c ase Tag of
  324     TAG_VTYP E:   if Fo rmListCont ains(CT_Vi sitNm) the n
  325                   begin
  326                     wit h frmVisit Type do
  327                       l stVTypeSec tionClick( Sender);
  328                   end;
  329     end;
  330   end;
  331  
  332   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  333   //Name: pr ocedure Tf rmEncounte rFrame.Syn chPCEData;
  334   //Created:  Jan 1999
  335   //By: Robe rt Bott
  336   //Location : ISL
  337   //Descript ion: Synch ronize any  existing  PCE data w ith what i s displaye d in the f orm.
  338   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  339   procedure  TfrmEncoun terFrame.S ynchPCEDat a;
  340  
  341     procedur e InitList (AListBox:  TORListBo x);
  342     var
  343       DoClic k: Boolean ;
  344  
  345     begin
  346       with A ListBox do
  347       begin
  348         DoCl ick := TRU E;
  349         case  Tag of
  350           TA G_VTYPE:
  351              begin
  352                if FormL istContain s(CT_Visit Nm) then
  353                  ListVi sitTypeSec tions(Item s);
  354                DoClick  := AutoSel ectVisit(P CERPCEncLo cation);
  355              end;
  356         end;
  357         if I tems.Count  > 0 then
  358         begi n
  359           if  DoClick t hen
  360           be gin
  361              ItemIndex  := 0;
  362              SectionCli ck(AListBo x);
  363           en d;
  364         end
  365         else
  366           It ems.Add(TX _NOSECTION );
  367       end;
  368     end;
  369  
  370   begin
  371     if FormL istContain s(CT_Visit Nm) then
  372     with frm VisitType  do
  373       begin
  374         Init List(frmVi sitType.ls tVTypeSect ion);                       // s et up Visi t Type pag e
  375         List SCDisabili ties(memSC Display.Li nes);
  376         uSCC ond := Eli gbleCondit ions;
  377         frmV isitType.f raVisitRel ated.InitA llow(uSCCo nd);
  378       end;
  379     with uEn cPCEData d o                                  // load  any existi ng data fr om PCEData
  380     begin
  381       if For mListConta ins(CT_Vis itNm) then
  382         frmV isitType.f raVisitRel ated.InitR elated(uEn cPCEData);
  383       if For mListConta ins(CT_Dia gNm) then
  384         frmD iagnoses.I nitTab(Cop yDiagnoses , ListDiag nosisSecti ons);
  385       if For mListConta ins(CT_Pro cNm) then
  386         frmP rocedures. InitTab(Co pyProcedur es, ListPr ocedureSec tions);
  387       if For mListConta ins(CT_Imm Nm) then
  388         frmI mmunizatio ns.InitTab (CopyImmun izations,L istImmuniz Sections);
  389       if For mListConta ins(CT_Ski nNm) then
  390         frmS kinTests.I nitTab(Cop ySkinTests , ListSkin Sections);
  391       if For mListConta ins(CT_Ped Nm) then
  392         frmP atientEd.I nitTab(Cop yPatientEd s, ListPat ientSectio ns);
  393       if For mListConta ins(CT_Hlt hNm) then
  394         frmH ealthFacto rs.InitTab (CopyHealt hFactors,  ListHealth Sections);
  395       if For mListConta ins(CT_Xam Nm) then
  396         frmE xams.InitT ab(CopyExa ms, ListEx amsSection s);
  397       uVisit Type.Assig n(VisitTyp e);
  398       if For mListConta ins(CT_Vis itNm) then
  399       with f rmVisitTyp e do
  400       begin
  401         Matc hVType;
  402       end;
  403     end;
  404   end;
  405  
  406  
  407   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  408   //Name: pr ocedure Tf rmEncounte rFrame.For mDestroy(S ender: TOb ject);
  409   //Created:  Jan 1999
  410   //By: Robe rt Bott
  411   //Location : ISL
  412   //Descript ion: Free  up objects  in memory  when dest roying for m.
  413   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  414   procedure  TfrmEncoun terFrame.F ormDestroy (Sender: T Object);
  415   var
  416     i: integ er;
  417  
  418   begin
  419     inherite d;
  420     for i :=  Component Count-1 do wnto 0 do
  421       if(Com ponents[i]  is TForm)  then
  422         TFor m(Componen ts[i]).Fre e;
  423  
  424     formlist .clear;
  425     KillObj( @uProvider s);
  426     uVisitTy pe.Free;
  427     Formlist .free;
  428   {$IFDEF DE BUG}
  429     fDebugPC E.Free;
  430   {$ENDIF}
  431   end;
  432  
  433  
  434   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  435   //Name: pr ocedure Tf rmEncounte rFrame.For mCreate(Se nder: TObj ect);
  436   //Created:  Jan 1999
  437   //By: Robe rt Bott
  438   //Location : ISL
  439   //Descript ion: Creat e instance s of the o bjects nee ded.
  440   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  441   procedure  TfrmEncoun terFrame.F ormCreate( Sender: TO bject);
  442   begin
  443     uProvide rs := TPCE ProviderLi st.Create;
  444     uVisitTy pe := TPCE Proc.creat e;
  445     //uVital Old  := TS tringList. create;
  446     //uVital New  := TS tringList. create;
  447     FormList  := TStrin gList.crea te;
  448     fCancel  := False;
  449     FAbort : = TRUE;
  450     SetFormF onts;
  451     FGiveMul tiTabMessa ge := Scre enReaderSy stemActive ;
  452   {$IFDEF DE BUG}
  453     fDebugPC E := TPCED ata.Create ;
  454    {$ENDIF}
  455   end;
  456  
  457   procedure  TfrmEncoun terFrame.U pdateEncou nter(PCE:  TPCEData);
  458   begin
  459     with PCE  do
  460     begin
  461       if For mListConta ins(CT_Vis itNm) then
  462       begin
  463         Visi tType := u VisitType;
  464         frmV isitType.f raVisitRel ated.GetRe lated(uEnc PCEData);
  465         Prov iders.Merg e(uProvide rs);
  466       end;
  467         // DN S      BELLC
  468       if For mListConta ins(CT_Dia gNm) then
  469         SetD iagnoses(f rmDiagnose s.lstCapti onList.Ite msStrings) ;
  470       if For mListConta ins(CT_Pro cNm) then
  471        SetPr ocedures(f rmProcedur es.lstCapt ionList.It emsStrings );
  472       if For mListConta ins(CT_Imm Nm) then
  473          Set Immunizati ons(frmImm unizations .lstCaptio nList.Item sStrings);
  474       if For mListConta ins(CT_Ski nNm) then
  475          Set SkinTests( frmSkinTes ts.lstCapt ionList.It emsStrings );
  476       if For mListConta ins(CT_Ped Nm) then
  477         SetP atientEds( frmPatient Ed.lstCapt ionList.It emsStrings );
  478       if For mListConta ins(CT_Hlt hNm) then
  479         SetH ealthFacto rs(frmHeal thFactors. lstCaption List.Items Strings);
  480       if For mListConta ins(CT_Xam Nm) then
  481         SetE xams(frmEx ams.lstCap tionList.I temsString s);
  482  
  483       if Gro upEdit the n
  484         Copy PCEData(Ba sePCE);
  485     end;
  486   end;
  487  
  488   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  489   //Name: pr ocedure Tf rmEncounte rFrame.Sen dData;
  490   //Created:  Jan 1999
  491   //By: Robe rt Bott
  492   //Location : ISL
  493   //Descript ion: Send  Data back  to the M s ide sor st oring.
  494   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  495   procedure  TfrmEncoun terFrame.S endData;
  496   //send PCE  data to t he RPC
  497   var
  498   { $ IFDEF  GROUPNOTES }
  499   { $ ELSE}
  500   //  StoreM essage: st ring;
  501   { $ ENDIF}
  502     GAFScore : integer;
  503     GAFDate:  TFMDateTi me;
  504     GAFStaff : Int64;
  505  
  506   begin
  507     inherite d;
  508     // do va lidation f or vitals  & anything  else here
  509   { $ IFDEF  GROUPNOTES }
  510   { $ ELSE}
  511   (*
  512     //proces s vitals
  513     if FormL istContain s(CT_VitNm ) then
  514     begin
  515       with f rmEncVital s do
  516       if Has Data then
  517       begin
  518         if A ssignVital s then
  519         begi n
  520           St oreMessage  := ValAnd StoreVital s(frmEncVi tals.Vital New);
  521           if  (Storemes sage <> 'T rue') then
  522           be gin
  523              ShowMsg(st oremessage );
  524   //         exit;
  525           en d;
  526         end;
  527       end;
  528     end;
  529   *)
  530   { $ ENDIF}
  531  
  532     if(FormL istContain s(CT_GAFNm )) then
  533     begin
  534       frmGAF .GetGAFSco re(GAFScor e, GAFDate , GAFStaff );
  535       if(GAF Score > 0)  then
  536         Save GAFScore(G AFScore, G AFDate, GA FStaff);
  537     end;
  538  
  539     //PCE
  540     UpdateEn counter(uE ncPCEData) ;
  541     with uEn cPCEData d o
  542     begin
  543       if FAu toSave the n
  544         Save
  545       else
  546         FSav eNeeded :=  TRUE;
  547     end;
  548     Close;
  549   end;
  550  
  551   {///////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  552   //Name: pr ocedure Tf rmEncounte rFrame.For mCloseQuer y(Sender:  TObject;
  553   //Created:  Jan 1999
  554   //By: Robe rt Bott
  555   //Location : ISL
  556   //Descript ion: Check  to see if  the Cance l button w as pressed , if not,  call
  557   // procedu re to send  the data  to the ser ver.
  558   ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////}
  559   procedure  TfrmEncoun terFrame.F ormCloseQu ery(Sender : TObject;
  560     var CanC lose: Bool ean);
  561  
  562   const
  563     TXT_SAVE CHANGES =  'Save Chan ges?';
  564  
  565   var
  566     TmpPCEDa ta: TPCEDa ta;
  567     ask, Cha ngeOK: boo lean;
  568  
  569   begin
  570     CanClose  := True;
  571     if(FAbor t) then
  572       FCance l := (Info Box(TXT_SA VECHANGES,  TXT_SAVEC HANGES, MB _YESNO) =  ID_NO);
  573     if FCanc el then Ex it;  //*KC M*
  574  
  575     if(uProv iders.Prim aryIdx >=  0) then
  576       ask :=  TRUE
  577     else
  578     begin
  579       TmpPCE Data := TP CEData.Cre ate;
  580       try
  581         uEnc PCEData.Co pyPCEData( TmpPCEData );
  582         Upda teEncounte r(TmpPCEDa ta);
  583         ask  := TmpPCED ata.NeedPr oviderInfo ;
  584       finall y
  585         TmpP CEData.Fre e;
  586       end;
  587     end;
  588     if ask a nd (NoPrim aryPCEProv ider(uProv iders, uEn cPCEData))  then
  589     begin
  590       InfoBo x(TX_PROV_ REQ, TC_PR OV_REQ, MB _OK or MB_ ICONWARNIN G);
  591       CanClo se := Fals e;
  592       Exit;
  593     end;
  594  
  595     uVisitTy pe.Provide r := uProv iders.Prim aryIEN;  { RV - v20.1 }
  596  
  597   { $ IFDEF  GROUPNOTES }
  598   { $ ELSE}
  599   //  if For mListConta ins(CT_Vit Nm) then
  600   //    CanC lose := fr mEncVitals .OK2SaveVi tals;
  601   { $ ENDIF}
  602     if CanCl ose and Fo rmListCont ains(CT_Pr ocNm) then
  603       begin
  604         CanC lose := fr mProcedure s.OK2SaveP rocedures;
  605         if n ot CanClos e then
  606           be gin
  607              tabPageCha nge(Self,  FormList.I ndexOf(CT_ ProcNm), C hangeOK);
  608   { $ IFDEF  GROUPNOTES }
  609              SwitchToPa ge(pageByN ame(CT_Pro cNm));
  610   { $ ELSE}
  611   //           SwitchTo Page(PageI DToForm(CT _PROCEDURE S));
  612   { $ ENDIF}
  613              TabControl .TabIndex  := FormLis t.IndexOf( CT_ProcNm) ;
  614           en d;
  615       end;
  616  
  617     if CanCl ose then S endData;   //*KCM*
  618  
  619   end;
  620  
  621   procedure  TfrmEncoun terFrame.T abControlC hange(Send er: TObjec t);
  622   begin
  623   //must swi tch based  on caption , as all t abs may no t be prese nt.
  624     if (send er as tTab Control).t abindex =  -1 then ex it;
  625  
  626     if TabCo ntrol.CanF ocus and A ssigned(FL astPage) a nd not Tab Control.Fo cused then
  627       TabCon trol.SetFo cus;  //CQ : 14845
  628  
  629      SwitchT oPage(page ByName(Tab Control.Ta bs[TabCont rol.TabInd ex]));
  630   end;
  631  
  632   procedure  TfrmEncoun terFrame.T abControlC hanging(Se nder: TObj ect;
  633     var Allo wChange: B oolean);
  634   begin
  635     if(assig ned(FLastP age)) then
  636       FLastP age.AllowT abChange(A llowChange );
  637   end;
  638  
  639   procedure  TfrmEncoun terFrame.S electTab(N ewTabName:  string);
  640   var
  641     AllowCha nge: boole an;
  642   begin
  643     AllowCha nge := Tru e;
  644     tabContr ol.TabInde x := FormL ist.IndexO f(NewTabNa me);
  645     tabPageC hange(Self , tabContr ol.TabInde x, AllowCh ange);
  646   end;
  647  
  648   procedure  TfrmEncoun terFrame.T abControlE nter(Sende r: TObject );
  649   begin
  650     if FGive MultiTabMe ssage then  // CQ#154 83
  651     begin
  652       FGiveM ultiTabMes sage := FA LSE;
  653       GetScr eenReader. Speak('Mul ti tab for m');
  654     end;
  655   end;
  656  
  657   procedure  TfrmEncoun terFrame.F ormKeyDown (Sender: T Object; va r Key: Wor d;
  658     Shift: T ShiftState );
  659   var
  660     CanChang e: boolean ;
  661   begin
  662     inherite d;
  663     if (Key  = VK_ESCAP E) then
  664     begin
  665       Key :=  0;
  666       FLastP age.btnCan cel.Click;
  667     end
  668     else if  Key = VK_T AB then
  669     begin
  670       if ssC trl in Shi ft then
  671       begin
  672         CanC hange := T rue;
  673         if A ssigned(Ta bControl.O nChanging)  then
  674           Ta bControl.O nChanging( TabControl , CanChang e);
  675         if C anChange t hen
  676         begi n
  677           if  ssShift i n Shift th en
  678           be gin
  679              if TabCont rol.TabInd ex < 1 the n
  680                TabContr ol.TabInde x := TabCo ntrol.Tabs .Count -1
  681              else
  682                TabContr ol.TabInde x := TabCo ntrol.TabI ndex - 1;
  683           en d
  684           el se
  685              TabControl .TabIndex  := (TabCon trol.TabIn dex + 1) m od TabCont rol.Tabs.C ount;
  686           if  Assigned( TabControl .OnChange)  then
  687              TabControl .OnChange( TabControl );
  688         end;
  689         Key  := 0;
  690       end;
  691     end;
  692   end;
  693  
  694   procedure  TfrmEncoun terFrame.S etFormFont s;
  695   var
  696     i: Integ er;
  697     NewFontS ize: integ er;
  698   begin
  699     NewFontS ize := Mai nFontsize;
  700     for i  : = 0 to For mList.Coun t - 1 do
  701       if ass igned(Form List.Objec ts[i]) and  (FormList .Objects[i ] is TfrmP CEBase) th en
  702         Tfrm PCEBase(Fo rmList.Obj ects[i]).F ont.Size : = NewFontS ize;
  703   end;
  704  
  705   procedure  TfrmEncoun terFrame.F ormClose(S ender: TOb ject;
  706     var Acti on: TClose Action);
  707   begin
  708     SaveUser Bounds(Sel f);
  709   end;
  710  
  711   procedure  TfrmEncoun terFrame.F ormCanResi ze(Sender:  TObject;
  712     var NewW idth, NewH eight: Int eger; var  Resize: Bo olean);
  713   begin
  714     // CQ474 0
  715     if NewWi dth < 200  then
  716     begin
  717       NewWid th := 200;
  718       Resize  := False;
  719     end;
  720   end;
  721  
  722   procedure  TfrmEncoun terFrame.F ormShow(Se nder: TObj ect);
  723   begin
  724     inherite d;
  725     if TabCo ntrol.CanF ocus then
  726       TabCon trol.SetFo cus;
  727   end;
  728  
  729   procedure  TfrmEncoun terFrame._ UM_GN_ENCU PDATE(var  Message: T Message);
  730   {$IFDEF DE BUG}
  731   var
  732     i: integ er;
  733   begin;
  734     UpdateEn counter(fD ebugPCE);
  735     mmLog.Cl ear;
  736     mmLog.Li nes.Add(Fo rmatDateTi me('-- mm/ dd/yyyy hh :nn:ss --' , Now));
  737   {
  738     mmLog.Li nes.Add('- ----- uEnc PCEData -- ----');
  739     uEncPCED ata.AddStr Data(mmLog .Lines);
  740     mmLog.Li nes.Add('- ---------- ---------- ----');
  741     mmLog.Li nes.Add('- ------- Ba sePCE ---- ----');
  742     BasePCE. AddStrData (mmLog.Lin es);
  743     mmLog.Li nes.Add('- ---------- ---------- ----');
  744     mmLog.Li nes.Add('- ------ uDe bugPCE---- ----');
  745   }
  746  
  747     mmLog.Li nes.Add('- ---------- ---------- ----');
  748     fDebugPC E.AddStrDa ta(mmLog.L ines);
  749     i := 1;
  750     while i  <= mmLog.L ines.Count  - 1 do
  751       if Tri m(mmLog.Li nes[i]) =  '' then
  752         mmLo g.Lines.De lete(i)
  753       else
  754         inc( i);
  755     mmLog.Li nes.Add('- ---------- ---------- ----');
  756   {$ELSE}
  757   begin
  758   {$ENDIF}
  759   end;
  760  
  761   end.