Index: cprs/branches/foia-cprs/CPRS-Chart/fReminderDialog.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/fReminderDialog.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/fReminderDialog.pas	(revision 460)
@@ -11,5 +11,10 @@
   TfrmRemDlg = class(TForm)
     sb1: TScrollBox;
+    sb2: TScrollBox;
+    splTxtData: TSplitter;
+    Label1: TLabel;
+    pnlFrmBottom: TPanel;
     pnlBottom: TPanel;
+    splText: TSplitter;
     reData: TRichEdit;
     reText: TRichEdit;
@@ -20,11 +25,7 @@
     btnNext: TButton;
     btnFinish: TButton;
-    sb2: TScrollBox;
-    splTxtData: TSplitter;
-    splText: TSplitter;
     btnClinMaint: TButton;
+    btnVisit: TButton;
     lblFootnotes: TStaticText;
-    btnVisit: TButton;
-    Label1: TLabel;
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -368,8 +369,8 @@
   reData.Color := ReadOnlyColor;
   reText.Color := ReadOnlyColor;
- (* FSCCond := EligbleConditions;
-  FSCRelated  := SCC_NA;              AGP Change 25.2
+  FSCCond := EligbleConditions;
+ (* FSCRelated  := SCC_NA;
   FAORelated  := SCC_NA;
-  FIRRelated  := SCC_NA;
+  FIRRelated  := SCC_NA;       AGP Change 25.2
   FECRelated  := SCC_NA;
   FMSTRelated := SCC_NA;
@@ -377,5 +378,5 @@
   FCVRelated  := SCC_NA;
   with FSCCond do
-    FSCPrompt := (SCAllow or AOAllow or IRAllow or ECAllow or MSTAllow or HNCAllow or CVAllow);  *)
+    FSCPrompt := (SCAllow or AOAllow or IRAllow or ECAllow or MSTAllow or HNCAllow or CVAllow); *)
   NotifyWhenRemindersChange(RemindersChanged);
   RemForm.Drawers.NotifyWhenRemTreeChanges(RemindersChanged);
@@ -504,5 +505,5 @@
   begin
     Box := GetBox(TRUE);
-    if Box.ControlCount > 0 then ClearControls; //AGP Change 25.7 this change should
+    if Box.ControlCount > 0 then ClearControls; //AGP Change 26.1 this change should
                                                 //resolve the problem with Duplicate CheckBoxes
                                                 //appearing on some reminder dialogs CQ #2843
@@ -754,6 +755,7 @@
   msg, RemWipe: string;
 
-begin
- //AGP 25.11 Move RemWipe section to cancel button to
+
+begin
+ //AGP 25.11 Added RemWipe section to cancel button to
  //flag the patient specific dialog to be destroy if not in process.
  RemWipe := '';
@@ -761,5 +763,5 @@
     begin
       Result := TRUE;
-      if Piece(FReminder.DlgData,U,3)='1' then RemWipe := Piece(FReminder.DlgData,U,1);
+      if FReminder.RemWipe = 1 then RemWipe := Piece(FReminder.DlgData,U,1);
     end
   else
@@ -769,5 +771,6 @@
     for i := 0 to RemindersInProcess.Count-1 do
     begin
-      if Piece(TReminder(RemindersInProcess.Objects[i]).RemData,U,11)='1' then
+      //if Piece(TReminder(RemindersInProcess.Objects[i]).RemData,U,11)='1' then
+      if TReminderDialog(TReminder(RemindersInProcess.Objects[i])).RemWipe = 1 then
           begin
              if RemWipe ='' then RemWipe := TReminder(RemindersInProcess.Objects[i]).IEN
@@ -1040,5 +1043,5 @@
               begin
                  Rem := FReminder;
-                 if Piece(Rem.DlgData,U,3)='1' then
+                 if Rem.RemWipe = 1 then
                      RemWipe := Piece(Rem.DlgData,U,1);
               end
@@ -1046,5 +1049,5 @@
               begin
                 Rem := TReminder(RemindersInProcess.Objects[i]);
-                if Piece(TReminder(RemindersInProcess.Objects[i]).RemData,U,11)='1' then
+                if TReminderDialog(TReminder(RemindersInProcess.Objects[i])).RemWipe = 1 then
                    begin
                      if RemWipe ='' then RemWipe := TReminder(RemindersInProcess.Objects[i]).IEN
@@ -1158,6 +1161,6 @@
         begin
           PCEObj := RemForm.PCEObj;
-      (* AGP Change 25.2 Remove this section base on the Clinical Workgroup decision
-         if FSCPrompt and (ndSC in PCEObj.NeededPCEData) then
+        (* AGP CHANGE 23.2 Remove this section base on the Clinical Workgroup decision
+          if FSCPrompt and (ndSC in PCEObj.NeededPCEData) then
             btnVisitClick(nil);
           PCEObj.SCRelated  := FSCRelated;
@@ -1167,5 +1170,5 @@
           PCEObj.MSTRelated := FMSTRelated;
           PCEObj.HNCRelated := FHNCRelated;
-          PCEObj.CVRelated  := FCVRelated;  *)
+          PCEObj.CVRelated  := FCVRelated; *)
           if not FProcessingTemplate then
           begin
@@ -1283,6 +1286,6 @@
                                     if(FVitalsDate = 0) then
                                     begin
-                                      FVitalsDate := RemForm.PCEObj.VisitDateTime;
-                                      StoreVitals := ValidVitalsDate(FVitalsDate, TRUE);
+                                      FVitalsDate := TRemData(TmpData.Objects[i]).Parent.VitalDateTime;
+                                      StoreVitals := ValidVitalsDate(FVitalsDate, TRUE, FALSE);  //AGP Change 26.1
                                       if (not StoreVitals) then break;
                                     end;
@@ -1350,5 +1353,8 @@
                   VitalList.Insert(0, VitalDateStr     + FloatToStr(FVitalsDate));
                   VitalList.Insert(1, VitalPatientStr  + Patient.DFN);
-                  VitalList.Insert(2, VitalLocationStr + IntToStr(Encounter.Location));
+                  if IntToStr(Encounter.Location) <> '0' then //AGP change 26.9
+                     VitalList.Insert(2, VitalLocationStr + IntToStr(Encounter.Location))
+                  else
+                     VitalList.Insert(2, VitalLocationStr + IntToStr(RemForm.PCEObj.Location));;
                   Tmp := ValAndStoreVitals(VitalList);
                   if (Tmp <> 'True') then
@@ -1587,5 +1593,5 @@
 begin
   if FVitalsDate = 0 then
-    VitalsDate := RemForm.PCEObj.VisitDateTime
+    VitalsDate := FMNow  //AGP Change 26.1
   else
     VitalsDate := FVitalsDate;
