Index: cprs/trunk/CPRS-Chart/Encounter/mVisitRelated.pas
===================================================================
--- cprs/trunk/CPRS-Chart/Encounter/mVisitRelated.pas	(revision 456)
+++ cprs/trunk/CPRS-Chart/Encounter/mVisitRelated.pas	(revision 829)
@@ -9,8 +9,5 @@
 type
   TfraVisitRelated = class(TFrame)
-    lblSCYes: TStaticText;
-    lblSCNo: TStaticText;
-    lblSCSelect: TStaticText;
-    bvlSCFrame: TBevel;
+    gbVisitRelatedTo: TGroupBox;
     chkSCYes: TCheckBox;
     chkAOYes: TCheckBox;
@@ -27,4 +24,8 @@
     chkCVYes: TCheckBox;
     chkCVNo: TCheckBox;
+    chkSHDYes: TCheckBox;
+    chkSHDNo: TCheckBox;
+    lblSCNo: TStaticText;
+    lblSCYes: TStaticText;
     procedure chkClick(Sender: TObject);
   private
@@ -33,16 +34,20 @@
     procedure SetCheckState(CheckYes, CheckNo: TCheckBox; CheckState: Integer);
     function GetCheckState(CheckYes, CheckNo: TCheckBox): Integer;
+
   public
     constructor Create(AOwner: TComponent); override;
     procedure GetRelated(PCEData: TPCEData); overload;
     procedure GetRelated(var ASCRelated, AAORelated, AIRRelated,
-                                AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer); overload;
+                                AECRelated, AMSTRelated, AHNCRelated, ACVRelated,ASHDRelated: integer); overload;
     procedure InitAllow(SCCond: TSCConditions);
     procedure InitRelated(PCEData: TPCEData); overload;
     procedure InitRelated(const ASCRelated, AAORelated, AIRRelated,
-                                AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer); overload;
+                                AECRelated, AMSTRelated, AHNCRelated, ACVRelated,ASHDRelated: integer); overload;
+
   end;
 
 implementation
+
+uses VA508AccessibilityRouter;
 
 {$R *.DFM}
@@ -56,4 +61,5 @@
   TAG_HNCYES     = 6;
   TAG_CVYES      = 7;
+  TAG_SHDYES     = 8;
   TAG_SCNO       = 11;
   TAG_AONO       = 12;
@@ -63,4 +69,6 @@
   TAG_HNCNO      = 16;
   TAG_CVNO       = 17;
+  TAG_SHDNO      = 18;
+
 
 procedure TfraVisitRelated.chkClick(Sender: TObject);
@@ -74,18 +82,20 @@
   inherited;
   if Sender is TCheckBox then with TCheckBox(Sender) do case Tag of
-    TAG_SCYES:  if Checked then chkSCNo.Checked   := False;
-    TAG_AOYES:  if Checked then chkAONo.Checked   := False;
-    TAG_IRYES:  if Checked then chkIRNo.Checked   := False;
-    TAG_ECYES:  if Checked then chkECNo.Checked   := False;
-    TAG_MSTYES: if Checked then chkMSTNo.Checked  := False;
-    TAG_HNCYES: if Checked then chkHNCNo.Checked  := False;
-    TAG_CVYES:  if Checked then chkCVNo.Checked   := False;
-    TAG_SCNO:   if Checked then chkSCYes.Checked  := False;
-    TAG_AONO:   if Checked then chkAOYes.Checked  := False;
-    TAG_IRNO:   if Checked then chkIRYes.Checked  := False;
-    TAG_ECNO:   if Checked then chkECYes.Checked  := False;
-    TAG_MSTNO:  if Checked then chkMSTYes.Checked := False;
-    TAG_HNCNO:  if Checked then chkHNCYes.Checked := False;
-    TAG_CVNO:   if Checked then chkCVYes.Checked  := False;
+    TAG_SCYES:   if Checked then chkSCNo.Checked    := False;
+    TAG_AOYES:   if Checked then chkAONo.Checked    := False;
+    TAG_IRYES:   if Checked then chkIRNo.Checked    := False;
+    TAG_ECYES:   if Checked then chkECNo.Checked    := False;
+    TAG_MSTYES:  if Checked then chkMSTNo.Checked   := False;
+    TAG_HNCYES:  if Checked then chkHNCNo.Checked   := False;
+    TAG_CVYES:   if Checked then chkCVNo.Checked    := False;
+    TAG_SHDYES:  if Checked then chkSHDNo.Checked   := False;
+    TAG_SCNO:    if Checked then chkSCYes.Checked   := False;
+    TAG_AONO:    if Checked then chkAOYes.Checked   := False;
+    TAG_IRNO:    if Checked then chkIRYes.Checked   := False;
+    TAG_ECNO:    if Checked then chkECYes.Checked   := False;
+    TAG_MSTNO:   if Checked then chkMSTYes.Checked  := False;
+    TAG_HNCNO:   if Checked then chkHNCYes.Checked  := False;
+    TAG_CVNO:    if Checked then chkCVYes.Checked   := False;
+    TAG_SHDNO:   if Checked then chkSHDYes.Checked := False;
   end;
   if chkSCYes.Checked then
@@ -94,8 +104,10 @@
     DisableCheck(chkIRYes);
     DisableCheck(chkECYes);
+    DisableCheck(chkSHDYes);
 //    DisableCheck(chkMSTYes);
     DisableCheck(chkAONo);
     DisableCheck(chkIRNo);
     DisableCheck(chkECNo);
+    DisableCheck(chkSHDNo);
 //    DisableCheck(chkMSTNo);
   end else
@@ -105,12 +117,17 @@
     SetCheckEnable(chkIRYes,  chkIRNo,  FSCCond.IRAllow);
     SetCheckEnable(chkECYes,  chkECNo,  FSCCond.ECAllow);
+    SetCheckEnable(chkSHDYEs, chkSHDNo, FSCCond.SHDAllow);
   end;
   SetCheckEnable(chkMSTYes, chkMSTNo, FSCCond.MSTAllow);
   SetCheckEnable(chkHNCYes, chkHNCNo, FSCCond.HNCAllow);
-  SetCheckEnable(chkCVYes, chkCVNo, FSCCond.CVAllow);
-  if chkAOYes.Checked or chkIRYes.Checked or chkECYes.Checked then //or chkMSTYes.Checked then
-  begin
-    chkSCYes.Checked := False;
-    chkSCNo.Checked := True;
+  SetCheckEnable(chkCVYes, chkCVNo,   FSCCond.CVAllow);
+
+  if chkAOYes.Checked or chkIRYes.Checked or chkECYes.Checked or chkSHDYes.Checked then //or chkMSTYes.Checked then
+  begin
+    if FSCCond.SCAllow then
+    begin
+       chkSCYes.Checked := False;
+       chkSCNo.Checked := True;
+    end;
   end;
 end;
@@ -118,15 +135,8 @@
 constructor TfraVisitRelated.Create(AOwner: TComponent);
 begin
-  inherited;
-
+  inherited Create(AOwner);
+  TabStop := FALSE;
   lblSCYes.Height := 13;
   lblSCNo.Height := 13;
-//  chkHNCYes.Visible := HNCOK;
-//  chkHNCNo.Visible := HNCOK;
-//  if not HNCOK then
-//  begin
-//    height := height - chkHNCYes.height + 1;
-//    bvlSCFrame.height := bvlSCFrame.height - chkHNCYes.height + 1;
-//  end;
 end;
 
@@ -147,8 +157,9 @@
   PCEData.HNCRelated := GetCheckState(chkHNCYes, chkHNCNo);
   PCEData.CVRelated  := GetCheckState(chkCVYes,  chkCVNo);
+  PCEData.SHADRelated := GetCheckState(chkSHDYes, chkSHDNo);
 end;
 
 procedure TfraVisitRelated.GetRelated(var ASCRelated, AAORelated,
-  AIRRelated, AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer);
+  AIRRelated, AECRelated, AMSTRelated, AHNCRelated, ACVRelated, ASHDRelated: integer);
 begin
   ASCRelated  := GetCheckState(chkSCYes,  chkSCNo);
@@ -159,4 +170,5 @@
   AHNCRelated := GetCheckState(chkHNCYes, chkHNCNo);
   ACVRelated  := GetCheckState(chkCVYes,  chkCVNo);
+  ASHDRelated := GetCheckState(chkSHDYes, chkSHDNo);
 end;
 
@@ -173,4 +185,5 @@
     SetCheckEnable(chkHNCYes, chkHNCNo, HNCAllow);
     SetCheckEnable(chkCVYes,  chkCVNo,  CVAllow);
+    SetCheckEnable(chkSHDYes, chkSHDNo, SHDAllow);
   end;
 end;
@@ -185,8 +198,16 @@
   SetCheckState(chkHNCYes, chkHNCNo, PCEData.HNCRelated);
   SetCheckState(chkCVYes,  chkCVNo,  PCEData.CVRelated);
+  SetCheckState(chkSHDYes, chkSHDNo, PCEData.SHADRelated);
+   //HDS00015356: GWOT Default, if Related no specified default to "Yes"
+  // -1=Null, 0=No, 1 = Yes
+  if FSCCond.CVAllow then
+  begin
+    if PCEData.CVRelated = SCC_NA then
+       chkCVYes.Checked := True;
+  end;
 end;
 
 procedure TfraVisitRelated.InitRelated(const ASCRelated, AAORelated, AIRRelated,
-  AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer);
+  AECRelated, AMSTRelated, AHNCRelated, ACVRelated, ASHDRelated: integer);
 begin
   SetCheckState(chkSCYes,  chkSCNo,  ASCRelated);
@@ -197,4 +218,12 @@
   SetCheckState(chkHNCYes, chkHNCNo, AHNCRelated);
   SetCheckState(chkCVYes,  chkCVNo,  ACVRelated);
+  SetCheckState(chkSHDYes, chkSHDNo, ASHDRelated);
+   //HDS00015356: GWOT Default, if Related no specified default to "Yes"
+   // -1=Null, 0=No, 1 = Yes
+  if FSCCond.CVAllow then
+  begin
+    if ACVRelated = SCC_NA then
+       chkCVYes.Checked := True;
+  end;
 end;
 
@@ -226,3 +255,7 @@
 end;
 
+
+initialization
+  SpecifyFormIsNotADialog(TfraVisitRelated);
+
 end.
