Index: cprs/trunk/CPRS-Chart/uCore.pas
===================================================================
--- cprs/trunk/CPRS-Chart/uCore.pas	(revision 830)
+++ cprs/trunk/CPRS-Chart/uCore.pas	(revision 1679)
@@ -7,5 +7,5 @@
 interface
 
-uses SysUtils, Windows, Classes, Forms, ORFn, rCore, uConst, ORClasses;
+uses SysUtils, Windows, Classes, Forms, ORFn, rCore, uConst, ORClasses, uCombatVet;
 
 type
@@ -86,4 +86,5 @@
     FRestricted: Boolean;                        // True if this is a restricted record
     FInpatient:  Boolean;                        // True if that patient is an inpatient
+    FStatus:     string;                         // Patient status indicator (Inpatient or Outpatient)
     FLocation:   Integer;                        // IEN in Hosp Loc if inpatient
     FWardService: string;
@@ -95,14 +96,14 @@
     FPrimProv:   string;                         // name of primary care provider
     FAttending:  string;                         // if inpatient, name of attending
+    FAssociate:  string;                         // if inpatient, name of associate
     FDateDied: TFMDateTime;                      // Date of Patient Death (<=0 or still alive)
     FDateDiedLoaded: boolean;                    // Used to determine of DateDied has been loaded
-    //vwpt  HRN
-    FHRN:  string ;                              //HRN
-    FAltHRN : string ;                           //alternate HRN (future)
-    //end vwpt
+    FCombatVet : TCombatVet;                     // Object Holding CombatVet Data
     procedure SetDFN(const Value: string);
-    function GetDateDied: TFMDateTime;       // *DFN*
+    function GetDateDied: TFMDateTime;
+    function GetCombatVet: TCombatVet;       // *DFN*
   public
     procedure Clear;
+    destructor Destroy; override;
     property DFN:              string      read FDFN write SetDFN;  //*DFN*
     property ICN:              string      read FICN;
@@ -114,4 +115,5 @@
     property CWAD:             string      read FCWAD;
     property Inpatient:        Boolean     read FInpatient;
+    property Status:           string      read FStatus;
     property Location:         Integer     read FLocation;
     property WardService:      string      read FWardService;
@@ -124,8 +126,6 @@
     property PrimaryProvider:  string      read FPrimProv;
     property Attending:        string      read FAttending;
-    //vwpt HRN AltHRN
-    property HRN:              string      read FHRN ;
-    property AltHRN:           string      read FAltHRN;
-    //end vwpt
+    property Associate:        string      read FAssociate;
+    property CombatVet:        TCombatVet  read GetCombatVet;
   end;
 
@@ -183,5 +183,5 @@
     FParentID : string;
     FUser     : Int64;
-    FOrderDG  : String;
+    FOrderDG   : String;
     FDCOrder  : boolean;
     FDelay    : boolean;
@@ -218,5 +218,5 @@
     destructor Destroy; override;
     procedure Add(ItemType: Integer; const AnID, ItemText, GroupName: string; SignState: Integer; AParentID: string = '';
-                  User: int64 = 0; OrderDG: String = ''; DCOrder: boolean = FALSE; Delay: boolean = FALSE);
+                  User: int64 = 0; OrderDG: String = ''; DCOrder: boolean = FALSE; Delay: boolean = False);
     procedure Clear;
     function CanSign: Boolean;
@@ -246,4 +246,5 @@
     //AlertData: string;
     RecordID: string;
+    HighLightSection: String;
   end;
 
@@ -257,4 +258,5 @@
     function GetFollowUp: Integer;
     function GetAlertData: string;
+    function GetHighLightSection: String; //CB
     function GetRecordID: string;
     function GetText: string;
@@ -262,5 +264,5 @@
     constructor Create;
     destructor Destroy; override;
-    procedure Add(const ADFN: string; AFollowUp: Integer; const ARecordID: string);  //*DFN*
+    procedure Add(const ADFN: string; AFollowUp: Integer; const ARecordID: string; AHighLightSection : string = '');  //*DFN*  CB
     procedure Clear;
     procedure Next;
@@ -274,4 +276,5 @@
     property RecordID: string  read GetRecordID;
     property Text:     string  read GetText;
+    property HighLightSection: String read GetHighLightSection; //cb
   end;
 
@@ -727,4 +730,5 @@
   FRestricted  := False;
   FInpatient   := False;
+  FStatus      := '';
   FLocation    := 0;
   FWardService := '';
@@ -736,8 +740,18 @@
   FPrimProv    := '';
   FAttending   := '';
-  //vwpt hrn althrn
-  FHRN         := '';
-  FAltHRN      := '';
-  //end vwpt
+  FreeAndNil(FCombatVet);
+end;
+
+destructor TPatient.Destroy;
+begin
+  FreeAndNil(FCombatVet);
+  inherited;
+end;
+
+function TPatient.GetCombatVet: TCombatVet;
+begin
+  if FCombatVet = nil then
+    FCombatVet := TCombatVet.Create(FDFN);
+  Result := FCombatVet;
 end;
 
@@ -770,4 +784,6 @@
   FRestricted := PtSelect.Restricted;
   FInpatient  := Length(PtSelect.Location) > 0;
+  if FInpatient then FStatus := ' (INPATIENT)'
+  else FStatus := ' (OUTPATIENT)';
   FWardService :=PtSelect.WardService;
   FLocation   := PtSelect.LocationIEN;
@@ -779,8 +795,5 @@
   FPrimProv   := PtSelect.PrimaryProvider;
   FAttending  := PtSelect.Attending;
-  //vwpt HRN ALTHRN
-  FHRN        := PtSelect.HRN;
-  FAltHRN     := PtSelect.AltHRN;
-  //end vwpt
+  FAssociate  := PtSelect.Associate;
 end;
 
@@ -1287,7 +1300,8 @@
   i, CanSign(*, OrderUser*): Integer;
   OrderUser: int64;
-  AnID: string;
+  AnID, Display: string;
   HaveOrders, OtherOrders: TStringList;
   AChangeItem: TChangeItem;
+  IsDiscontinue, IsDelay: boolean;
 begin
   if Patient.DFN = '' then Exit;
@@ -1311,5 +1325,11 @@
       if Piece(OtherOrders[i],U,2) = '' then OrderUser := 0
       else OrderUser := StrtoInt64(Piece(OtherOrders[i],U,2));
-      Add(CH_ORD, AnID, TextForOrder(AnID), 'Other Unsigned', CanSign,'', OrderUser);
+      //agp change the M code to pass back the value for the new order properties
+      Display := Piece(OtherOrders[i],U,3);
+      if Piece(OtherOrders[i],U,4) = '1' then  IsDiscontinue := True
+      else IsDiscontinue := False;
+      if Piece(OtherOrders[i],U,5) = '1' then  IsDelay := True
+      else IsDelay := False;
+      Add(CH_ORD, AnID, TextForOrder(AnID), 'Other Unsigned', CanSign,'', OrderUser, Display, IsDiscontinue, IsDelay);
     end;
   finally
@@ -1336,5 +1356,5 @@
 end;
 
-procedure TNotifications.Add(const ADFN: string; AFollowUp: Integer; const ARecordID: string);  //*DFN*
+procedure TNotifications.Add(const ADFN: string; AFollowUp: Integer; const ARecordID: string; AHighLightSection : string = '');  //*DFN*
 var
   NotifyItem: TNotifyItem;
@@ -1344,4 +1364,5 @@
   NotifyItem.FollowUp := AFollowUp;
   NotifyItem.RecordID := ARecordId;
+  If AHighLightSection <> '' then NotifyItem.HighLightSection := AHighLightSection;
   FList.Add(NotifyItem);
   FActive := True;
@@ -1387,4 +1408,10 @@
     else Result := '';
 end;
+
+function TNotifications.GetHighLightSection: String; //CB
+begin
+  if FNotifyItem <> nil then Result := FNotifyItem.HighLightSection else Result := '';
+end;
+
 
 procedure TNotifications.Next;
