Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fDiagnoses.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fDiagnoses.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fDiagnoses.dfm	(revision 460)
@@ -1,5 +1,5 @@
 inherited frmDiagnoses: TfrmDiagnoses
-  Left = 306
-  Top = 183
+  Left = 304
+  Top = 169
   Caption = 'Encounter Diagnoses'
   PixelsPerInch = 96
@@ -76,7 +76,5 @@
       inherited lbSection: TORListBox
         Tag = 20
-        Style = lbOwnerDrawFixed
         TabOrder = 0
-        OnDrawItem = lbSectionDrawItem
       end
       inherited btnOther: TButton
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fDiagnoses.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fDiagnoses.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fDiagnoses.pas	(revision 460)
@@ -218,10 +218,8 @@
 var
   i: integer;
-  dxString: string;
   dxCode, dxName: string;
   ADiagnosis: TPCEItem;
 begin
    inherited;
-  ADiagnosis := TPCEItem.Create;
   UBAGlobals.BAPCEDiagList.Clear;
   with lbGrid do for i := 0 to Items.Count - 1 do
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncVitals.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncVitals.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncVitals.dfm	(revision 460)
@@ -1,5 +1,5 @@
 inherited frmEncVitals: TfrmEncVitals
-  Left = 400
-  Top = 227
+  Left = 353
+  Top = 210
   Caption = 'Vitals'
   KeyPreview = True
@@ -8,16 +8,42 @@
   OnKeyDown = FormKeyDown
   OnResize = FormResize
-  OnShow = FormShow
   PixelsPerInch = 96
   TextHeight = 13
+  object lvVitals: TCaptionListView [0]
+    Left = 0
+    Top = 0
+    Width = 624
+    Height = 368
+    Hint = 'To sort, click on column headers|'
+    Align = alClient
+    Columns = <>
+    Constraints.MinHeight = 50
+    HideSelection = False
+    MultiSelect = True
+    ReadOnly = True
+    RowSelect = True
+    ParentShowHint = False
+    ShowHint = True
+    TabOrder = 1
+    ViewStyle = vsReport
+  end
+  object pnlBottom: TPanel [1]
+    Left = 0
+    Top = 368
+    Width = 624
+    Height = 32
+    Align = alBottom
+    BevelOuter = bvNone
+    TabOrder = 5
+  end
   inherited btnOK: TBitBtn
     Left = 444
     Top = 377
-    TabOrder = 1
+    TabOrder = 3
   end
   inherited btnCancel: TBitBtn
     Left = 524
     Top = 377
-    TabOrder = 2
+    TabOrder = 4
   end
   object pnlmain: TPanel
@@ -27,4 +53,5 @@
     Height = 217
     TabOrder = 0
+    Visible = False
     object lblVitPointer: TOROffsetLabel
       Left = 506
@@ -383,4 +410,5 @@
       ListItemsOnly = True
       LongList = False
+      LookupPiece = 0
       MaxLength = 0
       Pieces = '1,2'
@@ -390,4 +418,5 @@
       TabStop = True
       OnEnter = SetVitPointer
+      CharsNeedMatch = 1
     end
     object txtMeasPulse: TCaptionEdit
@@ -414,3 +443,12 @@
     end
   end
+  object btnEnterVitals: TButton
+    Left = 8
+    Top = 377
+    Width = 75
+    Height = 21
+    Caption = 'Enter Vitals'
+    TabOrder = 2
+    OnClick = btnEnterVitalsClick
+  end
 end
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.
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncounterFrame.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncounterFrame.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncounterFrame.dfm	(revision 460)
@@ -1,6 +1,6 @@
 object frmEncounterFrame: TfrmEncounterFrame
-  Left = 366
-  Top = 181
-  Width = 612
+  Left = 290
+  Top = 108
+  Width = 640
   Height = 451
   Caption = 'Encounter Frame'
@@ -16,4 +16,5 @@
   Position = poScreenCenter
   OnCanResize = FormCanResize
+  OnClose = FormClose
   OnCloseQuery = FormCloseQuery
   OnCreate = FormCreate
@@ -26,5 +27,5 @@
     Left = 0
     Top = 0
-    Width = 604
+    Width = 632
     Height = 2
     Align = alTop
@@ -32,6 +33,6 @@
   object StatusBar1: TStatusBar
     Left = 0
-    Top = 424
-    Width = 604
+    Top = 417
+    Width = 632
     Height = 0
     Panels = <>
@@ -41,6 +42,6 @@
     Left = 0
     Top = 24
-    Width = 604
-    Height = 400
+    Width = 632
+    Height = 393
     Align = alClient
     BevelOuter = bvNone
@@ -52,10 +53,9 @@
     ParentFont = False
     TabOrder = 1
-    TabStop = True
   end
   object TabControl: TTabControl
     Left = 0
     Top = 2
-    Width = 604
+    Width = 632
     Height = 22
     Align = alTop
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncounterFrame.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncounterFrame.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fEncounterFrame.pas	(revision 460)
@@ -75,4 +75,5 @@
     procedure FormKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormCanResize(Sender: TObject; var NewWidth,
       NewHeight: Integer; var Resize: Boolean);
@@ -123,5 +124,5 @@
   uCore,
   fGAF, uConst,
-  rCore, fPCEProvider;
+  rCore, fPCEProvider, rMisc;
 
 {$R *.DFM}
@@ -397,4 +398,5 @@
     frmEncounterFrame.CreateChildForms(frmEncounterFrame, PCEData.Location);
     ResizeAnchoredFormToFont(frmEncounterFrame);
+    SetFormPosition(frmEncounterFrame);
 
     with frmEncounterFrame do
@@ -714,11 +716,11 @@
     if FormListContains(CT_ImmNm) then
       SetImmunizations(frmImmunizations.lbGrid.Items);
-    if FormListContains(CT_ImmNm) then
+    if FormListContains(CT_SkinNm) then
       SetSkinTests(frmSkinTests.lbGrid.Items);
     if FormListContains(CT_PedNm) then
       SetPatientEds(frmPatientEd.lbGrid.Items);
-    if FormListContains(CT_ImmNm) then
+    if FormListContains(CT_HlthNm) then
       SetHealthFactors(frmHealthFactors.lbGrid.Items);
-    if FormListContains(CT_ImmNm) then
+    if FormListContains(CT_XamNm) then
       SetExams(frmExams.lbGrid.Items);
   end;
@@ -817,5 +819,12 @@
 end;
 
-procedure TfrmEncounterFrame.FormCanResize(Sender: TObject; var NewWidth, NewHeight: Integer; var Resize: Boolean);
+procedure TfrmEncounterFrame.FormClose(Sender: TObject;
+  var Action: TCloseAction);
+begin
+  SaveUserBounds(Self);
+end;
+
+procedure TfrmEncounterFrame.FormCanResize(Sender: TObject; var NewWidth,
+  NewHeight: Integer; var Resize: Boolean);
 begin
   //CQ4740
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fHealthFactor.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fHealthFactor.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fHealthFactor.dfm	(revision 460)
@@ -1,5 +1,5 @@
 inherited frmHealthFactors: TfrmHealthFactors
-  Left = 434
-  Top = 354
+  Left = 374
+  Top = 205
   Caption = 'Health Factor page'
   PixelsPerInch = 96
@@ -46,4 +46,5 @@
   end
   inherited edtComment: TCaptionEdit
+    MaxLength = 245
     TabOrder = 3
   end
@@ -90,4 +91,5 @@
     ListItemsOnly = False
     LongList = False
+    LookupPiece = 0
     MaxLength = 0
     Pieces = '2'
@@ -96,4 +98,5 @@
     TabOrder = 4
     OnChange = cboHealthLevelChange
+    CharsNeedMatch = 1
   end
 end
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fPCELex.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fPCELex.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fPCELex.dfm	(revision 460)
@@ -1,5 +1,5 @@
 inherited frmPCELex: TfrmPCELex
-  Left = 386
-  Top = 204
+  Left = 639
+  Top = 480
   BorderIcons = []
   BorderStyle = bsDialog
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/fPCEProvider.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/fPCEProvider.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/fPCEProvider.dfm	(revision 460)
@@ -71,4 +71,5 @@
     OnChange = cboPrimaryChange
     OnNeedData = cboPrimaryNeedData
+    CharsNeedMatch = 1
   end
   object btnYes: TButton
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/rPCE.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/rPCE.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/rPCE.pas	(revision 460)
@@ -150,4 +150,5 @@
 function IsUserAProvider(AUser: Int64; ADate: TFMDateTime): boolean;
 function IsCancelOrNoShow(ANote: integer): boolean;
+function IsNonCountClinic(ALocation: integer): boolean;
 
 // HNC Flag
@@ -173,5 +174,4 @@
   uVTypeForLoc:   TStringList;
   uProblems:      TStringList;
-  
   uModifiers:     TORStringList = nil;
   uGAFOK:         boolean;
@@ -1438,4 +1438,9 @@
 end;
 
+function IsNonCountClinic(ALocation: integer): boolean;
+begin
+  Result := (sCallV('ORWPCE1 NONCOUNT', [ALocation]) = '1');
+end;
+
 function DefaultProvider(ALocation: integer; AUser: Int64; ADate: TFMDateTime;
                                              ANoteIEN: integer): string;
Index: cprs/branches/foia-cprs/CPRS-Chart/Encounter/uPCE.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Encounter/uPCE.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Encounter/uPCE.pas	(revision 460)
@@ -1375,8 +1375,7 @@
   Result := inherited DelimitedStr;
   if Provider > 0 then tmpProv := IntToStr(Provider) else tmpProv := '';
-  //Result := 'CPT' + Result + U + IntToStr(Quantity) + U + IntToStr(Provider) +
   Result := 'CPT' + Result + U + IntToStr(Quantity) + U + tmpProv
-  //Result := 'CPT' + Result + U + IntToStr(Quantity) + U +
-  + U + U + U + IntToStr(cnt) + Mods + U + IntToStr(UNxtCommSeqNum) + U;
+             + U + U + U + IntToStr(cnt) + Mods + U + IntToStr(UNxtCommSeqNum) + U;
+  if Length(Result) > 250 then SetPiece(Result, U, 4, '');
 end;
 
@@ -1554,4 +1553,5 @@
     BOOLCHAR[AddProb] + U + U + U;
   if(SaveComment) then Result := Result + IntToStr(UNxtCommSeqNum);
+  if Length(Result) > 250 then SetPiece(Result, U, 4, '');
 end;
 
@@ -2988,4 +2988,9 @@
 begin
   if not CanEditPCE(Self) then
+  begin
+    Result := TRUE;
+    exit;
+  end;
+  if IsNonCountClinic(FEncLocation) then
   begin
     Result := TRUE;
