Index: cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODLab.pas
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODLab.pas	(revision 1676)
+++ cprs/branches/HealthSevak-CPRS/CPRS-Chart/Orders/fODLab.pas	(revision 1693)
@@ -6,5 +6,5 @@
   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
   Forms, Dialogs, StdCtrls, ORCtrls, ORfn, fODBase, ExtCtrls, ComCtrls, uConst,
-  ORDtTm, Buttons, Menus, VA508AccessibilityManager;
+  ORDtTm, Buttons, Menus, VA508AccessibilityManager, VA508AccessibilityRouter;
 
 type
@@ -57,4 +57,8 @@
     MessagePopup: TPopupMenu;
     ViewinReportWindow1: TMenuItem;
+    Frequencylbl508: TVA508StaticText;
+    HowManyDayslbl508: TVA508StaticText;
+    specimenlbl508: TVA508StaticText;
+    CollSamplbl508: TVA508StaticText;
     procedure FormCreate(Sender: TObject);
     procedure ControlChange(Sender: TObject);
@@ -107,4 +111,5 @@
     procedure ReadServerVariables;
     procedure DisplayChangedOrders(ACollType: string);
+    procedure setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl; lbl2: string);
   public
     procedure SetupDialog(OrderAction: Integer; const ID: string); override;
@@ -206,5 +211,5 @@
 procedure TfrmODLab.FormCreate(Sender: TObject);
 var
-  i, n: integer;
+  i, n, HMD508: integer;
   AList: TStringList;
 begin
@@ -263,5 +268,8 @@
       if cboAvailTest.Items.Count > 0 then cboAvailTest.InsertSeparator;
       cboAvailTest.InitLongList('');
+      //TDP - CQ#19396 HMD508 added to guarantee 508 label did not change width
+      HMD508 := HowManyDayslbl508.Width;
       SetControl(cboFrequency, 'Schedules');
+      HowManydayslbl508.Width := HMD508;
       with cboFrequency do
         begin
@@ -271,4 +279,6 @@
       lblHowManyDays.Enabled := False;                 { have this call change event in case }
       txtDays.Enabled := False;                         { the default is not 'one time'?      }
+      //TDP - CQ#19396 Following line does not appear to be needed
+      //setup508Label(HowManyText, HowManyDayslbl508, txtDays, lblHowManyDays.Caption);
     end;
     if EvTDelayLoc>0 then
@@ -283,4 +293,5 @@
         Font.Color := clGrayText;
         lblFrequency.Enabled := False;
+        setup508Label(Text, Frequencylbl508, cboFrequency, lblFrequency.Caption);
       end;
     PreserveControl(cboAvailTest);
@@ -294,4 +305,20 @@
     AList.Free;
   end;
+end;
+
+{TDP - CQ#19396 Added to address 508 related changes. I modified slightly to
+       change lbl.Caption and retain lbl.Width}
+procedure TfrmODLab.setup508Label(text: string; lbl: TVA508StaticText; ctrl: TControl; lbl2: string);
+var
+Width: integer;
+begin
+  if ScreenReaderSystemActive and not ctrl.Enabled then begin
+    lbl.Enabled := True;
+    lbl.Visible := True;
+    Width := lbl.Width;
+    lbl.Caption := lbl2 +'. Read Only. Value is ' + Text;
+    lbl.Width := Width;
+  end else
+    lbl.Visible := false;
 end;
 
@@ -745,16 +772,26 @@
 procedure TLabTest.LoadUrgency(CollType: string; AComboBox:TORComboBox);
 var
-  i: integer;
+  i, PreviousSelectionIndex: integer;
+  PreviousSelectionString: String;
 begin
   with AComboBox do
     begin
+    PreviousSelectionIndex := -1;
+    PreviousSelectionString := SelText;
+
       Clear;
-      for i := 0 to UrgencyList.Count - 1 do
+      for i := 0 to UrgencyList.Count - 1 do begin
          if (CollType = 'LC') and (Piece(UrgencyList[i], U, 3) = '') then
            Continue
          else
            Items.Add(UrgencyList[i]);
+         if (PreviousSelectionString <> '') and (PreviousSelectionString = Piece(UrgencyList[i], U, 2)) then
+           PreviousSelectionIndex := i;
+      end;
+
       if (LRFURG <> '') and (ALabTest.ObtainUrgency) then
         SelectByID(LRFURG)
+      else if PreviousSelectionIndex > -1 then
+        ItemIndex := PreviousSelectionIndex
       else
         SelectByIEN(uDfltUrgency);
@@ -1292,4 +1329,6 @@
         lblCollSamp.Enabled := True;
         cboCollSamp.Enabled := True;
+        //TDP - CQ#19396 Added cboCollSamp 508 changes
+        setup508Label(cboCollSamp.Text, collsamplbl508, cboCollSamp, lblCollSamp.Caption);
       end
     else
@@ -1306,4 +1345,6 @@
         lblCollSamp.Enabled := False;
         cboCollSamp.Enabled := False;
+        //TDP - CQ#19396 Added cboCollSamp 508 changes
+        setup508Label(cboCollSamp.Text, collsamplbl508, cboCollSamp, lblCollSamp.Caption);
       end;
     if ObtainSpecimen then
@@ -1311,8 +1352,10 @@
       lblSpecimen.Enabled:= True;
       cboSpecimen.Enabled:= True;
+      setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption);
     end else
     begin
       lblSpecimen.Enabled:= False;
       cboSpecimen.Enabled:= False;
+      setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption);
     end;
     if ObtainUrgency then
@@ -1360,8 +1403,10 @@
       lblSpecimen.Enabled:= True;
       cboSpecimen.Enabled:= True;
+      setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption);
      end else
      begin
       lblSpecimen.Enabled:= False;
       cboSpecimen.Enabled:= False;
+      setup508Label(cboSpecimen.Text, specimenlbl508, cboSpecimen, lblSpecimen.Caption);
      end;
     if ObtainComment then
@@ -1419,5 +1464,5 @@
 procedure TfrmODLab.cboFrequencyChange(Sender: TObject);
 var
-  x: string;
+  x, HowManyText: string;
 const
   HINT_TEXT1 = 'Enter a number of days';
@@ -1434,4 +1479,8 @@
           txtDays.Hint := '';
         txtDays.Enabled := True;
+        //TDP - txtDays 508 changes
+        if txtDays.Text = '' then HowManyText := 'no value'
+        else HowManyText := txtDays.Text;
+        setup508Label(HowManyText, HowManyDayslbl508, txtDays, lblHowManyDays.Caption);
         txtDays.Showhint := True;
       end
@@ -1441,4 +1490,7 @@
         lblHowManyDays.Enabled := False;
         txtDays.Enabled := False;
+        //TDP - txtDays 508 changes
+        HowManyText := 'no value';
+        setup508Label(HowManyText, HowManyDayslbl508, txtDays, lblHowManyDays.Caption);
         txtDays.ShowHint := False;
       end;
@@ -2025,4 +2077,2 @@
 
 end.
-
-
