Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncVitals.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncVitals.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncVitals.pas	(revision 460)
@@ -6,5 +6,20 @@
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   fPCEBase, ORDtTm, StdCtrls, ORCtrls, ExtCtrls, Buttons, fAutoSz, ORFn,
-  rvitals, ComCtrls;
+  rvitals, ComCtrls, ORNet, uVitals
+  , TRPCB // Vitals Lite 2004-05-21 ===========================================
+  ;
+{== Vitals Lite 2004-05-21 ===================================================}
+type
+  TGMV_GetInputPanel = function(
+    var anApp: TApplication;
+    aB: TRPCBroker;
+    aP,         // Patient DFN
+    aL,         // Hospitals IEN
+    aSig,       // Application signature
+    aTemplate   // Vitals Input template
+        : String;
+    aNow        // Input Date/Time
+        :TDateTime):TCustomForm;
+{== Vitals Lite 2004-05-21 ===================================================}
 
 type
@@ -47,4 +62,7 @@
     txtMeasPulse: TCaptionEdit;
     txtMeasHt: TCaptionEdit;
+    pnlBottom: TPanel;
+    btnEnterVitals: TButton;
+    lvVitals: TCaptionListView;
     procedure SetVitPointer(Sender: TObject);
     procedure txtMeasBPExit(Sender: TObject);
@@ -71,4 +89,5 @@
     procedure FormKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
+    procedure btnEnterVitalsClick(Sender: TObject); //vitals lite
   private
     FDataLoaded: boolean;
@@ -82,4 +101,6 @@
     procedure ChangeFocus(Control: TWinControl);
     procedure ClearData;
+    procedure LoadVitalView(VitalsList : TStringList); //Vitals Lite
+    procedure LoadVitalsList;
   public
     function OK2SaveVitals: boolean;
@@ -97,5 +118,7 @@
 
 uses UCore, rCore, rPCE, fPCELex, fPCEOther, fVitals,fVisit, fFrame, fEncnt,
-  uVitals, fEncounterFrame;
+     fEncounterFrame, uInit
+  //   , fGMV_InputTemp // Vitals Lite 2004-05-21
+     ;
 
 const
@@ -373,7 +396,8 @@
 end;
 
+
 procedure TfrmEncVitals.FormCreate(Sender: TObject);
-
-begin
+begin
+
   inherited;
   FTabName := CT_VitNm;
@@ -389,8 +413,12 @@
 
 begin
-  inherited;
   //uVisitType.Free;
   uVitalOld.Free;
   uVitalNew.free;
+
+{== Vitals Lite 2004-05-21 ===================================================}
+  FreeLibrary(VitalsDLLHandle);
+{== Vitals Lite 2004-05-21 ===================================================}
+  inherited;
 end;
 
@@ -412,6 +440,18 @@
 
 procedure TfrmEncVitals.FormShow(Sender: TObject);
-begin
-  inherited;
+var
+  GMV_LibName: String;
+begin
+  inherited;
+  //Begin Vitals Lite
+  {Visit is Assumed to Be selected when Opening Encounter Dialog}
+  GMV_LibName :='GMV_VitalsViewEnter.dll';
+  GMV_LibName := GetProgramFilesPath + SHARE_DIR + GMV_LibName;
+  VitalsDLLHandle := LoadLibrary(PChar(GMV_LibName));
+  if VitalsDLLHandle = 0 then // No Handle found
+    MessageDLG('Can''t find library "'+GMV_LibName+'".',mtError,[mbok],0)
+  else
+    LoadVitalsList;
+  //End Vitals Lite
 //  frmEncVitals.caption := 'Vital entry for - '+ patient.name; {RAB 6/15/98}
   FormActivate(Sender);
@@ -540,3 +580,87 @@
 end;
 
+//Begin Vitals Lite
+procedure TfrmEncVitals.LoadVitalView(VitalsList: TStringList);
+var
+  i : integer;
+  curCol : TListColumn;
+  curItem : TListItem;
+  HeadingList,tmpList : TStringList;
+begin
+  HeadingList := TStringList.Create;
+  tmpList := TStringList.Create;
+  lvVitals.ShowColumnHeaders := false;                //CQ: 10069 - the column display becomes squished.
+  lvVitals.Items.Clear;
+  lvVitals.Columns.Clear;
+  PiecesToList(VitalsList[0],U,HeadingList);
+  for i := 0 to HeadingList.Count-1 do
+  begin
+    curCol := lvVitals.Columns.Add;
+    curCol.Caption := HeadingList[i];
+    curCol.AutoSize := true;
+  end;
+  for i := 1 to VitalsList.Count-1 do
+  begin
+    curItem := lvVitals.Items.Add;
+    PiecesToList(VitalsList[i],U,tmpList);
+    curItem.Caption := tmpList[0];
+    tmpList.Delete(0);
+    curItem.SubItems.Assign(tmpList);
+  end;
+  lvVitals.ShowColumnHeaders := true;                 //CQ: 10069 - the column display becomes squished.
+  HeadingList.Free;
+  tmpList.Free;
+end;
+
+procedure TfrmEncVitals.btnEnterVitalsClick(Sender: TObject);
+var
+  VLPtVitals : TGMV_VitalsEnterDLG;
+  GMV_FName : String;
+begin
+  inherited;
+  if VitalsDLLHandle = 0 then Exit;//The DLL was initialized on Create, but just in case....
+  GMV_FName := 'GMV_VitalsEnterDLG';
+  @VLPtVitals := GetProcAddress(VitalsDLLHandle,PChar(GMV_FName));
+  if assigned(VLPtVitals) then
+  begin
+    VLPtVitals(
+      RPCBrokerV,
+      Patient.DFN,
+      FloatToStr(uEncPCEData.Location),
+      GMV_DEFAULT_TEMPLATE,
+      GMV_APP_SIGNATURE,
+      FMDateTimeToDateTime(uEncPCEData.DateTime),
+      Patient.Name,
+      frmFrame.lblPtSSN.Caption + '    ' + frmFrame.lblPtAge.Caption
+    );
+  end
+  else
+    MessageDLG('Can not find function "'+GMV_FName+'".',mtError,[mbok],0);
+  @VLPtVitals := nil;
+  LoadVitalsList;
+end;
+
+procedure TfrmEncVitals.LoadVitalsList;
+var
+  VitalsList : TStringList;
+  VLPtVitals : TGMV_LatestVitalsList;
+  GMV_FName : String;
+begin
+  if VitalsDLLHandle = 0 then Exit;//The DLL was initialized on Create, but just in case....
+  GMV_FName := 'GMV_LatestVitalsList';
+  @VLPtVitals := GetProcAddress(VitalsDLLHandle,PChar(GMV_FName));
+  if assigned(VLPtVitals) then
+  begin
+    frmFrame.VitalsDLLActive := True;  // need this flag for CCOW (RV)
+    VitalsList := VLPtVitals(RPCBrokerV,Patient.DFN,U,false);
+    if assigned(VitalsList) then
+      LoadVitalView(VitalsList);
+  end
+  else
+    MessageDLG('Can''t find function "'+GMV_FName+'".',mtError,[mbok],0);
+  @VLPtVitals := nil;
+  frmFrame.VitalsDLLActive := False;  // need this flag for CCOW (RV)
+end;
+//End Vitals Lite
+
 end.
