39. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/31/2017 10:45:43 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.

39.1 Files compared

# Location File Last Modified
1 CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\VITALSPATIENT fGMV_ReportOptions.pas Tue Dec 13 18:26:14 2016 UTC
2 CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\VITALSPATIENT fGMV_ReportOptions.pas Fri Mar 31 15:01:43 2017 UTC

39.2 Comparison summary

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

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

39.4 Active regular expressions

No regular expressions were active.

39.5 Comparison detail

  1   unit fGMV_ ReportOpti ons;
  2   {
  3   ========== ========== ========== ========== ========== ========== ========== ==========
  4   *
  5   *       Ap plication:   Vitals
  6   *       Re vision:      $Revisio n: 1 $  $M odtime: 2/ 25/09 2:30 p $
  7   *       De veloper:      PII                              
  8   *       Si te:          Hines OI FO
  9   *
  10   *       De scription:   Report s election a nd device  setup opti ons.
  11   *
  12   *       No tes:
  13   *
  14   ========== ========== ========== ========== ========== ========== ========== ==========
  15   *       $A rchive: /V itals/5.0  (Version 5 .0)/5.0.23  (Patch 23 )/VITALS_5 _0_23_8/So urce/VITAL SPATIENT/f GMV_Report Options.pa s $
  16   *
  17   * $History : fGMV_Rep ortOptions .pas $
  18    * 
  19    * ******* **********   Version  1  ******* **********
  20    * User: V haishandri a Date: 8/ 12/09    T ime: 8:29a
  21    * Created  in $/Vita ls/5.0 (Ve rsion 5.0) /5.0.23 (P atch 23)/V ITALS_5_0_ 23_8/Sourc e/VITALSPA TIENT
  22    * 
  23    * ******* **********   Version  1  ******* **********
  24    * User: V haishandri a Date: 3/ 09/09    T ime: 3:39p
  25    * Created  in $/Vita ls/5.0 (Ve rsion 5.0) /5.0.23 (P atch 23)/V ITALS_5_0_ 23_6/Sourc e/VITALSPA TIENT
  26    * 
  27    * ******* **********   Version  1  ******* **********
  28    * User: V haishandri a Date: 1/ 13/09    T ime: 1:26p
  29    * Created  in $/Vita ls/5.0 (Ve rsion 5.0) /5.0.23 (P atch 23)/V ITALS_5_0_ 23_4/Sourc e/VITALSPA TIENT
  30    * 
  31    * ******* **********   Version  5  ******* **********
  32    * User: V haishandri a Date: 6/ 17/08    T ime: 4:04p
  33    * Updated  in $/Vita ls/5.0 (Ve rsion 5.0) /VitalsGUI 2007/Vital s/VITALSPA TIENT
  34    * 
  35    * ******* **********   Version  2  ******* **********
  36    * User: V haishandri a Date: 3/ 03/08    T ime: 4:07p
  37    * Updated  in $/Vita ls Source/ Vitals/VIT ALSPATIENT
  38    * 
  39    * ******* **********   Version  1  ******* **********
  40    * User: V haishandri a Date: 5/ 14/07    T ime: 10:30 a
  41    * Created  in $/Vita ls GUI 200 7/Vitals-5 -0-18/VITA LSPATIENT
  42    * 
  43    * ******* **********   Version  1  ******* **********
  44    * User: V haishandri a Date: 5/ 16/06    T ime: 5:44p
  45    * Created  in $/Vita ls/VITALS- 5-0-18/Vit alsPatient
  46    * GUI v.  5.0.18 upd ates the d efault vit al type IE Ns with th e local
  47    * values.
  48    * 
  49    * ******* **********   Version  1  ******* **********
  50    * User: V haishandri a Date: 5/ 16/06    T ime: 5:33p
  51    * Created  in $/Vita ls/Vitals- 5-0-18/VIT ALS-5-0-18 /VitalsPat ient
  52    * 
  53    * ******* **********   Version  1  ******* **********
  54    * User: V haishandri a Date: 5/ 24/05    T ime: 4:59p
  55    * Created  in $/Vita ls/Vitals  GUI  v 5.0 .2.1 -5.0. 3.1 - Patc h GMVR-5-7  (CASMed,  CCOW) - De lphi 6/Vit alsPatient
  56    * 
  57    * ******* **********   Version  1  ******* **********
  58    * User: V haishandri a Date: 4/ 16/04    T ime: 4:23p
  59    * Created  in $/Vita ls/Vitals  GUI Versio n 5.0.3 (C COW, CPRS,  Delphi 7) /VITALSPAT IENT
  60    *
  61    * ******* **********   Version  1  ******* **********
  62    * User: V haishandri a Date: 1/ 26/04    T ime: 1:08p
  63    * Created  in $/Vita ls/Vitals  GUI Versio n 5.0.3 (C COW, Delph i7)/V5031- D7/VitalsU ser
  64    * 
  65    * ******* **********   Version  1  ******* **********
  66    * User: V haishandri a Date: 10 /29/03   T ime: 4:15p
  67    * Created  in $/Vita ls503/Vita ls User
  68    * Version  5.0.3
  69    * 
  70    * ******* **********   Version  2  ******* **********
  71    * User: V haishandri a Date: 5/ 22/03    T ime: 10:14 a
  72    * Updated  in $/Vita ls GUI Ver sion 5.0/V italsUserN oCCOW
  73    * Prepara tion To CC OW
  74    * Message DLG change t to Messa ge DLGS
  75    *
  76    * ******* **********   Version  1  ******* **********
  77    * User: V haishandri a Date: 5/ 21/03    T ime: 1:18p
  78    * Created  in $/Vita ls GUI Ver sion 5.0/V italsUserN oCCOW
  79    * Pre CCO W Version  of Vitals  User
  80    * 
  81    * ******* **********   Version  12  ****** ********** *
  82    * User: V haishandri a Date: 11 /04/02   T ime: 9:15a
  83    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  84    * Version  5.0.0.0
  85    *
  86    * ******* **********   Version  11  ****** ********** *
  87    * User: V haishandri a Date: 8/ 02/02    T ime: 4:14p
  88    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  89    * Weekly  Backup
  90    * 
  91    * ******* **********   Version  10  ****** ********** *
  92    * User: V haishandri a Date: 7/ 18/02    T ime: 5:57p
  93    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  94    * 
  95    * ******* **********   Version  9  ******* **********
  96    * User: V haishandri a Date: 7/ 12/02    T ime: 5:00p
  97    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  98    * GUI Ver sion T28
  99    *
  100    * ******* **********   Version  8  ******* **********
  101    * User: V haishandri a Date: 7/ 03/02    T ime: 4:59p
  102    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  103    * 
  104    * ******* **********   Version  7  ******* **********
  105    * User: V haishandri a Date: 7/ 02/02    T ime: 11:56 a
  106    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  107    * 
  108    * ******* **********   Version  6  ******* **********
  109    * User: V haishandri a Date: 7/ 01/02    T ime: 5:14p
  110    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  111    *
  112    * ******* **********   Version  5  ******* **********
  113    * User: V haishandri a Date: 6/ 28/02    T ime: 5:19p
  114    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  115    * 
  116    * ******* **********   Version  4  ******* **********
  117    * User: V haishandri a Date: 6/ 17/02    T ime: 4:51p
  118    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  119    * 
  120    * ******* **********   Version  3  ******* **********
  121    * User: V haishandri a Date: 6/ 17/02    T ime: 4:26p
  122    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  123    *
  124    * ******* **********   Version  2  ******* **********
  125    * User: V haishpetit d Date: 6/ 17/02    T ime: 3:47p
  126    * Updated  in $/Vita ls GUI Ver sion 5.0/V itals User
  127    *
  128   *
  129   ========== ========== ========== ========== ========== ========== ========== ==========
  130   }
  131   interface
  132  
  133   uses
  134     Windows,
  135     Messages ,
  136     SysUtils ,
  137     Classes,
  138     Graphics ,
  139     Controls ,
  140     Forms,
  141     Dialogs,
  142     StdCtrls ,
  143     ComCtrls ,
  144     ExtCtrls ,
  145     uGMV_Com mon,
  146     ActnList ,
  147     Buttons
  148     ;
  149  
  150   type
  151     TfrmGMV_ ReportOpti ons = clas s(TForm)
  152       pnlBot tom: TPane l;
  153       OKButt on: TButto n;
  154       Button 2: TButton ;
  155       pnlLef t: TPanel;
  156       Report Combo: TCo mboBox;
  157       Action List1: TAc tionList;
  158       acRepo rtCh: TAct ion;
  159       acScop eChanged:  TAction;
  160       acWard Changed: T Action;
  161       acPrin tReport: T Action;
  162       acStar tDate: TAc tion;
  163       acStop DateChange d: TAction ;
  164       acUPda teDTPColor s: TAction ;
  165       acStar tTimeChang ed: TActio n;
  166       acEndT imeChanged : TAction;
  167       acPrin TimeChange d: TAction ;
  168       acPrin tDateChang ed: TActio n;
  169       tmDevi ce: TTimer ;
  170       Panel1 : TPanel;
  171       Panel2 : TPanel;
  172       acSear ch: TActio n;
  173       GroupB ox3: TGrou pBox;
  174       dtpPri ntDate: TD ateTimePic ker;
  175       dtpPri ntTime: TD ateTimePic ker;
  176       gbDate Range: TGr oupBox;
  177       lblSta rt: TLabel ;
  178       dtpFro mDate: TDa teTimePick er;
  179       dtpFro mTime: TDa teTimePick er;
  180       lblEnd : TLabel;
  181       dtpToD ate: TDate TimePicker ;
  182       dtpToT ime: TDate TimePicker ;
  183       GroupB ox5: TGrou pBox;
  184       edTarg et: TEdit;
  185       lvDevi ces: TList View;
  186       Label3 : TLabel;
  187       edDevi ce: TEdit;
  188       Panel3 : TPanel;
  189       GroupB ox1: TGrou pBox;
  190       WardLa bel: TLabe l;
  191       RoomLa bel: TLabe l;
  192       rbPati ent: TRadi oButton;
  193       rbAllP atients: T RadioButto n;
  194       SpeedB utton2: TS peedButton ;
  195       SpeedB utton1: TS peedButton ;
  196       cmbWar d: TComboB ox;
  197       Panel4 : TPanel;
  198       edRoom List: TEdi t;
  199       btnSel ect: TButt on;
  200       GroupB ox2: TGrou pBox;
  201       gbEnd:  TGroupBox ;
  202       lblEnd Time: TLab el;
  203       lblEnd Date: TLab el;
  204       Label4 : TLabel;
  205       Label5 : TLabel;
  206       proced ure FormCr eate(Sende r: TObject );
  207       proced ure acRepo rtChanged( Sender: TO bject);
  208       proced ure acScop eChangedEx ecute(Send er: TObjec t);
  209       proced ure acWard ChangedExe cute(Sende r: TObject );
  210       proced ure acPrin tReportExe cute(Sende r: TObject );
  211       proced ure acStar tDateChang ed(Sender:  TObject);
  212       proced ure acStop DateChange dExecute(S ender: TOb ject);
  213       proced ure acUPda teDTPColor sExecute(S ender: TOb ject);
  214       proced ure acStar tTimeChang edExecute( Sender: TO bject);
  215       proced ure acEndT imeChanged Execute(Se nder: TObj ect);
  216       proced ure acPrin tDateChang edExecute( Sender: TO bject);
  217       proced ure FormCl oseQuery(S ender: TOb ject; var  CanClose:  Boolean);
  218       proced ure tmDevi ceTimer(Se nder: TObj ect);
  219       proced ure edTarg etChange(S ender: TOb ject);
  220       proced ure edTarg etKeyUp(Se nder: TObj ect; var K ey: Word;
  221         Shif t: TShiftS tate);
  222       proced ure acSear chExecute( Sender: TO bject);
  223       proced ure lvDevi cesChange( Sender: TO bject; Ite m: TListIt em;
  224         Chan ge: TItemC hange);
  225       proced ure SpeedB utton2Clic k(Sender:  TObject);
  226       proced ure FormKe yDown(Send er: TObjec t; var Key : Word;
  227         Shif t: TShiftS tate);
  228       proced ure FormDe stroy(Send er: TObjec t);
  229       proced ure btnSel ectClick(S ender: TOb ject);
  230     private
  231       { Priv ate declar ations }
  232       fWards : TStringL ist;
  233       Curren tTime,
  234       MinTim e,MaxTime,
  235       MinDat e,MaxDate:  TDateTime ;
  236       proced ure SetWar dActive(bS tate: Bool ean);
  237       proced ure SetRoo mActive(bS tate: Bool ean);
  238       proced ure PrintR eport(aRou tine,aRepo rt,aTitle: String);
  239       proced ure Report Pr(const r outine, va lue, Repor t: string) ;
  240       functi on getDevi ceName:Str ing;
  241       functi on getDevi ceIEN:Stri ng;
  242     public
  243       { Publ ic declara tions }
  244       fPtIEN : string;
  245       Patien tInfo: str ing;
  246       Margin : string;
  247       Search Direction:  Integer;
  248       proper ty DeviceI EN:String  read getDe viceIEN;
  249       proper ty DeviceN ame:String  read getD eviceName;
  250     end;
  251  
  252   var
  253     frmGMV_R eportOptio ns: TfrmGM V_ReportOp tions;
  254  
  255   procedure  PrintRepor t2(ReportN umber: int eger = 0;  PatientIEN : string =  ''; PName : string =  '');
  256  
  257   implementa tion
  258  
  259   uses uGMV_ User, uGMV _Engine, f GMV_RoomSe lector
  260     ;
  261  
  262   {$R *.DFM}
  263  
  264   procedure  PrintRepor t2(ReportN umber: int eger = 0;  PatientIEN : string =  ''; PName : string =  '');
  265   begin
  266     with Tfr mGMV_Repor tOptions.C reate(Appl ication) d o
  267       try
  268         if ( ReportNumb er > -1) a nd (Report Number < R eportCombo .Items.Cou nt) then
  269           Re portCombo. ItemIndex  := ReportN umber;
  270  
  271         Pati entInfo :=  PName;
  272         rbPa tient.Capt ion := 'Pa tien&t: '+ Piece(Pati entInfo, '  ');
  273         if r bPatient.C aption = ' Patient: N o' then
  274           rb Patient.Ca ption := ' No Panient  Selected' ;
  275  
  276         fPtI EN := Pati entIEN;
  277         if f PtIEN = ''  then
  278           be gin
  279              // removin g two last  reports t he require  patient I D 2009-02- 20
  280              ReportComb o.Items.De lete(Repor tCombo.Ite ms.Count-1 );
  281              ReportComb o.Items.De lete(Repor tCombo.Ite ms.Count-1 );
  282  
  283              rbPatient. Checked :=  False;
  284              rbPatient. Enabled :=  False;
  285              rbAllPatie nts.Checke d := True;
  286              cmbWard.En abled := T rue;
  287              acScopeCha ngedExecut e(nil);
  288           en d;
  289  
  290         acSc opeChanged Execute(ni l);
  291         acRe portChange d(nil);
  292  
  293         repe at
  294         unti l ShowModa l = mrCanc el;
  295       finall y
  296         Free ;
  297       end;
  298   end;
  299  
  300   procedure  TfrmGMV_Re portOption s.SetWardA ctive(bSta te: Boolea n);
  301   begin
  302     WardLabe l.Enabled  := bState;
  303     cmbWard. Enabled :=  bState;
  304   end;
  305  
  306   procedure  TfrmGMV_Re portOption s.SetRoomA ctive(bSta te: Boolea n);
  307   begin
  308     RoomLabe l.Enabled  := bState;
  309     edRoomLi st.Enabled  := bState ;
  310     if edRoo mList.Enab led then
  311       edRoom List.Color  := clWind ow
  312     else
  313       edRoom List.Color  := clBtnF ace;
  314     btnSelec t.Enabled  := bState;
  315   end;
  316  
  317   procedure  TfrmGMV_Re portOption s.FormCrea te(Sender:  TObject);
  318   var
  319     sDateTim e:String;
  320     ServerTi me: Double ;
  321     SL: TStr ingList;
  322     i: integ er;
  323   begin
  324   {$IFNDEF P ATCH_5_0_2 3}
  325     ReportCo mbo.Items. Add('Vital s Signs Re cord');
  326     ReportCo mbo.Items. Add('B/P P lotting Ch art');
  327     ReportCo mbo.Items. Add('Weigh t Chart');
  328     ReportCo mbo.Items. Add('POx/R espiration s Chart');
  329     ReportCo mbo.Items. Add('Pain  Chart');
  330   {$ENDIF}
  331     ReportCo mbo.Items. Add('Cumul ative Vita ls Report' );
  332     ReportCo mbo.Items. Add('Lates t Vitals b y location ');
  333     ReportCo mbo.Items. Add('Lates t Vitals f or Patient ');
  334     ReportCo mbo.Items. Add('Enter ed in Erro r Patient' );
  335  
  336     SearchDi rection :=  1;
  337     Margin : = '132';
  338     sDateTim e := getCu rrentDateT ime;
  339     ServerTi me := StrT oFloat(sDa teTime);
  340  
  341     dtpPrint Time.DateT ime :=     FMDateTime ToWindowsD ateTime(Se rverTime);
  342     dtpPrint Date.Date  :=    FMDa teTimeToWi ndowsDateT ime(Server Time);
  343     dtpFromD ate.DateTi me := FMDa teTimeToWi ndowsDateT ime(Server Time);
  344     dtpToDat e.DateTime  :=   FMDa teTimeToWi ndowsDateT ime(Server Time);
  345  
  346     CurrentT ime := dtp PrintTime. DateTime;
  347  
  348     MinDate  := dtpFrom Date.Date;
  349     MaxDate  := dtpToDa te.Date;
  350  
  351     dtpFromD ate.MaxDat e := MaxDa te;
  352     dtpToDat e.MinDate  := MinDate ;
  353     dtpToDat e.MaxDate  := MaxDate ;
  354     acUpdate DtpColorsE xecute(Sen der);
  355  
  356     dtpFromT ime.Time : = StrToTim e('00:01') ;
  357     dtpToTim e.Time :=  StrToTime( '23:59');
  358     MinTime  := dtpFrom Time.Time;
  359     MaxTime  := dtpToTi me.Time;
  360  
  361     dtpPrint Date.MinDa te := trun c(FMDateTi meToWindow sDateTime( ServerTime ));
  362  
  363     SL := ge tWardLocat ions('P');  // Wards  with Patie nts Only v haishandri a 060926
  364  
  365     cmbWard. Items.Add( '');
  366     for i :=  0 to SL.C ount - 1 d o
  367       cmbWar d.Items.Ad d(piece(SL [i],'^',2) );
  368  
  369     fWards : = TStringL ist.Create ;
  370     fWards.T ext := #13 #10+SL.Tex t;
  371  
  372     SL.Free;
  373     acWardCh angedExecu te(Sender) ; //AAN 06 /10/02
  374   end;
  375  
  376   procedure  TfrmGMV_Re portOption s.acReport Changed(Se nder: TObj ect);
  377   {$IFDEF PA TCH_5_0_23 }
  378   var
  379     sName: S tring;
  380   {$ENDIF}
  381  
  382     procedur e SetPerio dActive(aS tate:Boole an);
  383     begin
  384       lblSta rt.Enabled  := aState ;
  385       lblEnd .Enabled : = aState;
  386       lblEnd Date.Enabl ed := aSta te;
  387       lblEnd Time.Enabl ed := aSta te;
  388       dtpFro mDate.Enab led := aSt ate;
  389       dtpFro mTime.Enab led := aSt ate;
  390       dtpToD ate.Enable d := aStat e;
  391       dtpToT ime.Enable d := aStat e;
  392  
  393       acUpda teDtpColor sExecute(S ender);
  394     end;
  395  
  396   //0:       Vitals Sig ns Record      - not  supported  5.0.22
  397   //1:       B/P Plotti ng Chart       - not  supported  5.0.22
  398   //2:       Weight Cha rt             - not  supported  5.0.22
  399   //3:       POx/Respir ations Cha rt  - not  supported  5.0.22
  400   //4:       Pain Chart                - not  supported  5.0.22
  401   //5:       Cumulative  Vitals Re port
  402   //6:       Latest Vit als by loc ation
  403   //7:       Latest Vit als for Pa tient
  404   //8:       Entered in  Error Pat ient
  405  
  406     procedur e setPatie ntControls ;
  407     begin
  408       if FPT ien = '' t hen
  409         begi n
  410           Me ssageDlg(' Report nee ds patient  to be sel ected.' +  #13 +
  411              'Select pa tient prio r to print  report',  mtInformat ion, [mbOk ], 0);
  412           rb AllPatient s.Enabled  := True;
  413         end
  414       else
  415         begi n
  416           Se tWardActiv e(False);
  417           rb AllPatient s.Enabled  := False;
  418           rb AllPatient s.Checked  := False;
  419           rb Patient.Ch ecked := T rue;
  420           rb Patient.En abled := T rue;
  421         end;
  422     end;
  423  
  424   begin
  425   {$IFDEF PA TCH_5_0_23 }
  426   // vhaisha ndria 2008 -02-21 === ========== ========== ========== ========== ==== begin
  427     Margin : = '80';
  428     sName :=  ReportCom bo.Text;
  429     if sName  = 'Cumula tive Vital s Report'  then
  430       begin
  431         rbPa tient.Enab led := Tru e;
  432         rbAl lPatients. Enabled :=  True;
  433         SetW ardActive( True);
  434         SetP eriodActiv e(True);
  435  
  436         if F PTien = ''  then
  437           rb Patient.En abled := F alse;
  438       end
  439     else if  sName = 'L atest Vita ls by loca tion' then
  440       begin
  441         rbPa tient.Enab led := Fal se;
  442         rbAl lPatients. Enabled :=  True;
  443         rbAl lPatients. Checked :=  True;
  444         SetP eriodActiv e(False);
  445       end
  446     else if  sName = 'L atest Vita ls for Pat ient' then
  447       begin
  448         SetP eriodActiv e(False);
  449         setP atientCont rols;
  450       end
  451     else if  sName = 'E ntered in  Error Pati ent' then
  452       begin
  453         SetP eriodActiv e(True);
  454         setP atientCont rols;
  455       end;
  456  
  457     cmbWard. Text := '' ;
  458  
  459     acWardCh angedExecu te(Sender) ;
  460     acScopeC hangedExec ute(Sender );
  461   Exit;
  462   // vhaisha ndria 2008 -02-21 === ========== ========== ========== ========== ====== end
  463   {$ENDIF}
  464  
  465     Margin : = '132';
  466     case Rep ortCombo.I temIndex o f
  467       0..6:
  468         begi n
  469           Se tWardActiv e(True); / /AAN 06/10 /02
  470           if  ReportCom bo.ItemInd ex > 4 the n  // vhai shandria 0 60123
  471              Margin :=  '80';
  472  
  473           if  ReportCom bo.ItemInd ex <> 6 th en
  474              begin
  475                rbPatien t.Enabled  := True;
  476                rbAllPat ients.Enab led := Tru e;
  477                SetWardA ctive(True );
  478                SetPerio dActive(Tr ue);
  479              end
  480           el se
  481              begin
  482                rbPatien t.Enabled  := False;
  483                rbAllPat ients.Enab led := Tru e;
  484                rbAllPat ients.Chec ked := Tru e;
  485                SetPerio dActive(Fa lse);
  486              end;
  487           if  FPTien =  '' then
  488              rbPatient. Enabled :=  False;
  489         end;
  490     else
  491       begin
  492         Marg in := '80' ;
  493         if R eportCombo .ItemIndex  = 7 then
  494           Se tPeriodAct ive(False)
  495         else
  496           Se tPeriodAct ive(True);
  497  
  498         if F PTien = ''  then
  499           be gin
  500              MessageDlg ('Report n eeds patie nt to be s elected.'  + #13 +
  501                'Select  patient pr ior to pri nt report' , mtInform ation,
  502                [mbOk],  0);
  503              ReportComb o.ItemInde x := 6;
  504              rbAllPatie nts.Enable d := True;
  505           en d
  506         else
  507           be gin
  508              SetWardAct ive(False) ;
  509              rbAllPatie nts.Enable d := False ;
  510              rbAllPatie nts.Checke d := False ;
  511              rbPatient. Checked :=  True;
  512              rbPatient. Enabled :=  True;
  513           en d;
  514       end;
  515     end;
  516     cmbWard. Text := '' ;
  517     acWardCh angedExecu te(Sender) ;
  518     acScopeC hangedExec ute(Sender );
  519   end;
  520  
  521   procedure  TfrmGMV_Re portOption s.acScopeC hangedExec ute(Sender : TObject) ;
  522   begin
  523     cmbWard. Enabled :=  not rbPat ient.Check ed;
  524     setWardA ctive(not  rbPatient. Checked);
  525  
  526     if rbPat ient.Check ed then
  527       begin
  528         SetR oomActive( False);
  529         acPr intReport. Enabled :=  True;
  530       end
  531     else
  532       acPrin tReport.En abled := ( cmbWard.Te xt <> '')
  533   end;
  534  
  535   procedure  TfrmGMV_Re portOption s.acWardCh angedExecu te(Sender:  TObject);
  536   var
  537     RetList  : TStrings ;
  538     sWard: S tring;
  539   begin
  540     edRoomLi st.Clear;
  541   //  sWard  := WardCom bo.Display Text[WardC ombo.itemi ndex];
  542     sWard :=  cmbWard.T ext;
  543     if sWard  <> '' the n
  544       begin
  545         RetL ist := get RoomBedByW ard(sWard) ;
  546         if R etList.Cou nt > 0 the n
  547           be gin                                                        //AAN  06/10/02
  548              SetRoomAct ive(True);                                      //AAN  06/10/02
  549           en d                                                          //AAN  06/10/02
  550         else                                                            //AAN  06/10/02
  551           Se tRoomActiv e(False);                                       //AAN  06/10/02
  552         acPr intReport. Enabled :=  True;
  553         RetL ist.Free;
  554       end
  555     else                                                                //AAN  06/10/02
  556       begin
  557         SetW ardActive( True);                                          //AAN  06/10/02
  558         SetR oomActive( False);                                         //AAN  06/10/02
  559         acPr intReport. Enabled :=  False;
  560       end;
  561   end;
  562  
  563   procedure  TfrmGMV_Re portOption s.acPrintR eportExecu te(Sender:  TObject);
  564   var
  565     sRoutine ,sReport,s Title: Str ing;
  566   begin
  567   // vhaisha ndria 2008 -02-21 === ========== ========== ========== ========== ==== begin
  568   //PrintER;
  569   (* origina l report l ist
  570   0:      Vi tals Signs  Record
  571   1:      B/ P Plotting  Chart
  572   2:      We ight Chart
  573   3:      PO x/Respirat ions Chart
  574   4:      Pa in Chart
  575   5:      Cu mulative V itals Repo rt
  576   6:      La test Vital s by locat ion
  577   7:      La test Vital s for Pati ent
  578   8:      En tered in E rror Patie nt
  579   *)
  580  
  581   (*
  582     case Rep ortCombo.I temIndex o f
  583       0..4:  sRoutine : = 'GMV PT  GRAPH';
  584       5: sRo utine := ' GMV CUMULA TIVE REPOR T';
  585       6: sRo utine := ' GMV LATEST  VITALS BY  LOCATION' ;
  586       7: sRo utine := ' GMV LATEST  VITALS FO R PATIENT' ;
  587       8: sRo utine := ' GMV ENTERE D IN ERROR -PATIENT';
  588     end;
  589   *)
  590     sRoutine  := Report Combo.Text ;
  591     if sRout ine = 'Vit als Signs  Record' th en
  592       sRouti ne := 'GMV  PT GRAPH'
  593     else if  sRoutine =  'B/P Plot ting Chart ' then
  594       sRouti ne := 'GMV  PT GRAPH'
  595     else if  sRoutine =  'Weight C hart' then
  596       sRouti ne := 'GMV  PT GRAPH'
  597     else if  sRoutine =  'POx/Resp irations C hart' then
  598       sRouti ne := 'GMV  PT GRAPH'
  599     else if  sRoutine =  'Pain Cha rt' then
  600       sRouti ne := 'GMV  PT GRAPH'
  601     else if  sRoutine =  'Cumulati ve Vitals  Report' th en
  602       sRouti ne := 'GMV  CUMULATIV E REPORT'
  603     else if  sRoutine =  'Latest V itals by l ocation' t hen
  604       sRouti ne := 'GMV  LATEST VI TALS BY LO CATION'
  605     else if  sRoutine =  'Latest V itals for  Patient' t hen
  606       sRouti ne := 'GMV  LATEST VI TALS FOR P ATIENT'
  607     else if  sRoutine =  'Entered  in Error P atient' th en
  608       sRouti ne := 'GMV  ENTERED I N ERROR-PA TIENT'
  609     else beg in
  610         Mess ageDLG('Re port: '+#1 3#10+sRout ine+#13#10 #13#10+'is  not suppo rted.',
  611           mt Warning,[m bOK],0);
  612         exit ;
  613       end;
  614  
  615     sReport  := ReportC ombo.Text;
  616     if sRepo rt = 'Vita ls Signs R ecord' the n
  617       sRepor t := '1'
  618     else if  sReport  =  'B/P Plot ting Chart ' then
  619       sRepor t := '2'
  620     else if  sReport  =  'Weight C hart' then
  621       sRepor t := '3'
  622     else if  sReport  =  'POx/Resp irations C hart' then
  623       sRepor t := '4'
  624     else if  sReport  =  'Pain Cha rt' then
  625       sRepor t := '5'
  626     else
  627       sRepor t := '';
  628  
  629     sTitle : = ReportCo mbo.Text;
  630     if sTitl e = 'Cumul ative Vita ls Report'  then
  631       sTitle  := ''
  632     else if  sRoutine =  'Latest V itals by l ocation' t hen
  633       sTitle  := ''
  634     else if  sRoutine =  'Latest V itals for  Patient' t hen
  635       sTitle  := ''
  636     else if  sRoutine =  'Entered  in Error P atient' th en
  637       sTitle  := '';
  638  
  639   //  PrintE R(sRoutine );
  640     PrintRep ort(sRouti ne,sReport ,sTitle);
  641   // vhaisha ndria 2008 -02-21 === ========== ========== ========== ========== ==== begin
  642   end;
  643  
  644   procedure  TfrmGMV_Re portOPtion s.PrintRep ort(aRouti ne,aReport ,aTitle:St ring);
  645   var
  646   //  A: int eger;
  647     PrintDT,
  648     WardStr,
  649     WardIEN,
  650     GraphNam e,
  651     fGraph,
  652     fRoutine ,
  653     fValue,
  654     fRomDate ,
  655     Wardlist ,
  656     ToDate:  string;
  657   begin
  658     if ((fPt IEN = '')  and (cmbWa rd.text =  '')) then
  659       Messag edlg('No P atient sel ected, ple ase select  a patient  to contin ue',
  660         mtin formation, [mbOK],0)
  661     else if  ReportComb o.text = ' ' then
  662       Messag edlg('No R eport sele cted, plea se select  a Report t o continue ',
  663         mtIn formation, [mbOK],0)
  664     else if  lvDevices. ItemIndex  = -1 then
  665       Messag edlg('No D evice sele cted, plea se select  a Device t o continue ',
  666         mtIn formation, [mbOK],0)
  667     else
  668       begin
  669         From Date := Fl oatToStr(W indowsDate TimeToFMDa teTime(tru nc(dtpFrom Date.Date)  + (dtpFro mTime.Time  - trunc(d tpFromTime .Date))));
  670         ToDa te := Floa tToStr(Win dowsDateTi meToFMDate Time(trunc (dtpToDate .Date) + ( dtpToTime. Time - tru nc(dtpToTi me.Date))) );
  671         Prin tDT := Flo atToStr(Wi ndowsDateT imeToFMDat eTime(trun c(dtpPrint Date.Date)  + (dtpPri ntTime.Tim e - trunc( dtpPrintTi me.Date))) );
  672  
  673         Ward str := '';
  674         Ward IEN := '';
  675         if r bAllPatien ts.Checked  and (cmbW ard.Text < > '') then
  676           Wa rdIEN := P iece(fWard s[cmbWard. itemindex] , '^', 1);
  677  
  678         Ward List := '' ;    // Ro omList
  679  
  680         if   rbAllPatie nts.Checke d  then                              // AAN  07/01/200 2
  681           be gin                                                        // AAN  07/01/200 2
  682   //           for  a : = 0 to Roo mcombo.Ite ms.Count -  1 do
  683   //             if Roo mCombo.Che cked[a] =  True then
  684   //               Ward List := Wa rdList + R oomcombo.D isplayText [a] + ',';
  685              WardList : = Trim(edR oomList.Te xt);
  686              if (WardLi st <> '')  then
  687                if copy( WardList,L ength(Ward List),1) =  ',' then
  688                  WardLi st := Copy (WardList,  1, Length (WardList)  - 1);
  689           en d;                                                         // AAN  07/01/200 2
  690  
  691         fGra ph := aRep ort;
  692         Grap hName := a Title;
  693         fRou tine := aR outine; //  vitals re ports are  not suppor ted
  694  
  695         if W ardIEN = ' ' then
  696           fV alue := fP tIEN;
  697  
  698         fVal ue := fVal ue + '^' +  FromDate  + '^' + To Date + '^'  + Fgraph  + '^' +
  699           De viceName +  '^' + Dev iceIEN + ' ^' + Print DT + '^' +  WardIEN +  '^^' + Wa rdList;
  700         Repo rtPr(Frout ine, Fvalu e, GraphNa me);
  701  
  702         Moda lResult :=  mrOk;
  703       end;
  704   end;
  705  
  706   procedure  TfrmGMV_Re portOPtion s.ReportPr (const rou tine, valu e, Report:  string);
  707   begin
  708     Messaged lg(getProc edureResul t(routine, value), mt Informatio n, [mbOK],  0);
  709   end;
  710  
  711   procedure  TfrmGMV_Re portOption s.acStartD ateChanged (Sender: T Object);
  712   begin
  713     MinDate  := dtpFrom Date.Date;
  714     dtpToDat e.MinDate  := MinDate ;
  715     acUpdate DtpColorsE xecute(Sen der);
  716   end;
  717  
  718   procedure  TfrmGMV_Re portOption s.acStopDa teChangedE xecute(Sen der: TObje ct);
  719   begin
  720     MaxDate  := dtpToDa te.Date;
  721     dtpFromD ate.MaxDat e := MaxDa te;
  722     acUpdate DtpColorsE xecute(Sen der);
  723   end;
  724  
  725   procedure  TfrmGMV_Re portOption s.acUPdate DTPColorsE xecute(Sen der: TObje ct);
  726   begin
  727   //  dtpToD ate.Enable d := (trun c(dtpToDat e.MinDate)  <> trunc( dtpToDate. MaxDate));
  728   //  dtpFro mDate.Enab led := (tr unc(dtpFro mDate.MinD ate) <> tr unc(dtpFro mDate.MaxD ate));
  729     lblStart .Enabled : = dtpFromD ate.Enable d;
  730     lblEnd.E nabled :=  dtpToDate. Enabled;
  731   end;
  732  
  733   procedure  TfrmGMV_Re portOption s.acStartT imeChanged Execute(Se nder: TObj ect);
  734   begin
  735     if dtpFr omTime.Tim e > dtpToT ime.Time T hen
  736        dtpFr omTime.Tim e := dtpTo Time.Time;
  737   end;
  738  
  739   procedure  TfrmGMV_Re portOption s.acEndTim eChangedEx ecute(Send er: TObjec t);
  740   begin
  741     if dtpTo Time.Time  < dtpFromT ime.Time T hen
  742        dtpTo Time.Time  := dtpFrom Time.Time;
  743   end;
  744  
  745   procedure  TfrmGMV_Re portOption s.acPrintD ateChanged Execute(Se nder: TObj ect);
  746   var
  747     DT: TDat eTime;
  748   begin
  749     DT := tr unc(dtpPri ntDate.Dat e)+ frac(d tpPrintTim e.Time);
  750     if DT <  CurrentTim e then
  751       dtpPri ntTime.Tim e := frac( CurrentTim e);
  752   end;
  753  
  754   procedure  TfrmGMV_Re portOption s.FormClos eQuery(Sen der: TObje ct;
  755     var CanC lose: Bool ean);
  756   begin
  757     try
  758       if Dev iceIEN <>  '' then
  759         GMVU ser.Settin g[usLastVi stAPrinter ] := Devic eIEN;
  760     except
  761     end;
  762     CanClose  := True;
  763   end;
  764  
  765   function T frmGMV_Rep ortOptions .getDevice Name:Strin g;
  766   begin
  767     Result : = lvDevice s.Items[lv Devices.It emIndex].S ubItems[0] ;
  768   end;
  769  
  770   function T frmGMV_Rep ortOptions .getDevice IEN:String ;
  771   begin
  772     Result : = '';
  773     if lvDev ices.ItemI ndex >= 0  then
  774       Result  := lvDevi ces.Items[ lvDevices. ItemIndex] .Caption;
  775   end;
  776  
  777   procedure  TfrmGMV_Re portOption s.tmDevice Timer(Send er: TObjec t);
  778   var
  779     s: Strin g;
  780       i: Int eger;
  781     sl: TStr ingList;
  782     LI: TLis tItem;
  783   begin
  784     tmDevice .Enabled : = False;
  785     SL := TS tringList. Create;
  786     try
  787       s := g etDeviceLi st(upperca se(edTarge t.Text),Ma rgin,Searc hDirection );
  788       SL.Tex t := S;
  789       lvDevi ces.Items. Clear;
  790       if sl. Count <> 0  then
  791         for  i := 0 to  SL.Count d o
  792           be gin
  793              if piece(S L[i],'^',1 ) = '' the n continue ;
  794              LI := lvDe vices.Item s.Add;
  795              LI.Caption  := piece( SL[i],'^', 1);
  796              LI.SubItem s.Add(piec e(SL[i],'^ ',2));
  797              LI.SubItem s.Add(piec e(SL[i],'^ ',4));
  798              LI.SubItem s.Add(piec e(SL[i],'^ ',5));
  799              LI.SubItem s.Add(piec e(SL[i],'^ ',6));
  800           en d;
  801     except
  802     end;
  803     SL.Free;
  804   end;
  805  
  806   procedure  TfrmGMV_Re portOption s.edTarget Change(Sen der: TObje ct);
  807   begin
  808     tmDevice .Enabled : = True;
  809   end;
  810  
  811   procedure  TfrmGMV_Re portOption s.edTarget KeyUp(Send er: TObjec t;
  812     var Key:  Word; Shi ft: TShift State);
  813   begin
  814     if Key =  VK_RETURN  then
  815       tmDevi ceTimer(ni l);
  816   end;
  817  
  818   procedure  TfrmGMV_Re portOption s.acSearch Execute(Se nder: TObj ect);
  819   begin
  820     tmDevice .Enabled : = True;
  821   end;
  822  
  823   procedure  TfrmGMV_Re portOption s.lvDevice sChange(Se nder: TObj ect;
  824     Item: TL istItem; C hange: TIt emChange);
  825   begin
  826     try
  827       edDevi ce.Text :=  lvDevices .ItemFocus ed.SubItem s[0]+'  '+
  828         lvDe vices.Item Focused.Su bItems[1]+ ' ' +
  829         lvDe vices.Item Focused.Su bItems[2]+ 'x' + lvDe vices.Item Focused.Su bItems[3];
  830     except
  831       edDevi ce.Text :=  'Not sele cted';
  832     end;
  833   end;
  834  
  835   procedure  TfrmGMV_Re portOption s.SpeedBut ton2Click( Sender: TO bject);
  836   begin
  837     if lvDev ices.Items .Count <=  0 then Exi t;
  838     try
  839       edTarg et.Text :=
  840         Copy (lvDevices .Items[lvD evices.Ite ms.Count-1 ].SubItems [0],1,1{i- 1});
  841       tmDevi ceTimer(ni l);
  842     except
  843     end;
  844   end;
  845  
  846   procedure  TfrmGMV_Re portOption s.FormKeyD own(Sender : TObject;  var Key:  Word;
  847     Shift: T ShiftState );
  848   begin
  849     if Key =  VK_ESCAPE  then
  850       ModalR esult := m rCancel;
  851   end;
  852  
  853   procedure  TfrmGMV_Re portOption s.FormDest roy(Sender : TObject) ;
  854   begin
  855     fWards.F ree;
  856     Inherite d;
  857   end;
  858  
  859   procedure  TfrmGMV_Re portOption s.btnSelec tClick(Sen der: TObje ct);
  860   var
  861     sWard: S tring;
  862   begin
  863     sWard :=  cmbWard.T ext;
  864     if sWard  = '' then  Exit;
  865     sWard :=  getWardRo oms(sWard, edRoomList .Text);
  866     if sWard  <> '' the n
  867       edRoom List.Text  := sWard;
  868   end;
  869  
  870   end.
  871