Index: cprs/branches/HealthSevak-CPRS/CPRS-Chart/fAllgyFind.pas
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Chart/fAllgyFind.pas	(revision 1676)
+++ cprs/branches/HealthSevak-CPRS/CPRS-Chart/fAllgyFind.pas	(revision 1693)
@@ -6,5 +6,5 @@
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   fAutoSz, StdCtrls, ORFn, ORCtrls, ComCtrls, ImgList, VA508AccessibilityManager,
-  VA508ImageListLabeler;
+  VA508ImageListLabeler, ExtCtrls;
 
 type
@@ -23,4 +23,5 @@
     lblSearchCaption: TLabel;
     imgLblAllgyFindTree: TVA508ImageListLabeler;
+    NoAllergylbl508: TVA508StaticText;
     procedure cmdSearchClick(Sender: TObject);
     procedure cmdCancelClick(Sender: TObject);
@@ -42,5 +43,5 @@
 {$R *.DFM}
 
-uses rODAllergy, fARTFreeTextMsg;
+uses rODAllergy, fARTFreeTextMsg, VA508AccessibilityRouter;
 
 const
@@ -87,4 +88,5 @@
 var
   uFileCount: integer;
+  ScreenReader: boolean;
 
 procedure AllergyLookup(var Allergy: string; NKAEnabled: boolean);
@@ -95,5 +97,25 @@
   try
     ResizeFormToFont(TForm(frmAllgyFind));
+    //TDP - CQ#19731 Need adjust 508StaticText label slightly when font 12 or larger
+    case frmAllgyFind.Font.Size of
+      18: frmAllgyFind.NoAllergylbl508.Left := frmAllgyFind.NoAllergylbl508.Left - 10;
+      14: frmAllgyFind.NoAllergylbl508.Left := frmAllgyFind.NoAllergylbl508.Left - 6;
+      12: frmAllgyFind.NoAllergylbl508.Left := frmAllgyFind.NoAllergylbl508.Left - 3;
+    end;
     frmAllgyFind.ckNoKnownAllergies.Enabled := NKAEnabled;
+    //TDP - CQ#19731 make sure NoAllergylbl508 is enabled and visible if
+    //      ckNoKnownAllergies is disabled
+    if (ScreenReaderSystemActive) and (frmAllgyFind.ckNoKnownAllergies.Enabled = False) then
+    begin
+      frmAllgyFind.NoAllergylbl508.Enabled := True;
+      frmAllgyFind.NoAllergylbl508.Visible := True;
+    end;
+    //TDP - CQ#19731 make sure NoAllergylbl508 is not enabled or visible if
+    //      ckNoKnownAllergies is enabled
+    if frmAllgyFind.ckNoKnownAllergies.Enabled = True then
+    begin
+      frmAllgyFind.NoAllergylbl508.Enabled := False;
+      frmAllgyFind.NoAllergylbl508.Visible := False;
+    end;
     frmAllgyFind.ShowModal;
     Allergy := frmAllgyFind.FAllergy;
@@ -108,4 +130,12 @@
   FAllergy := '';
   cmdOK.Enabled := False;
+  //TDP - CQ#19731 Allow tab to empty search results (tvAgent) when JAWS running
+  //      and provide 508 hint
+  if ScreenReaderSystemActive then
+  begin
+    tvAgent.TabStop := True;
+    amgrMain.AccessText[tvAgent] := 'No Search Items to Display';
+    ScreenReader := True;
+  end;
 end;
 
@@ -147,4 +177,10 @@
       cmdSearch.Default := True;
       stsFound.SimpleText := ST_NONE_FOUND;
+
+      //TDP - CQ#19731 Provide 508 hint for empty search results (tvAgent) when JAWS active.
+      if ScreenReader then amgrMain.AccessText[tvAgent] := 'No Search Items to Display'
+      //TDP - CQ#19731 Stop tab to empty search results (tvAgent) when JAWS not active.
+      else tvAgent.TabStop := False;
+
       cmdOKClick(Self);
     end else
@@ -193,4 +229,10 @@
         end;
       lblSelect.Visible := True;
+
+      //TDP - CQ#19731 Clear 508 hint when JAWS active.
+      if ScreenReader then amgrMain.AccessText[tvAgent] := ''
+      //TDP - CQ#19731 Allow tab to search results (tvAgent) when JAWS not active.
+      else tvAgent.TabStop := True;
+
       tvAgent.SetFocus;
       cmdSearch.Default := False;
@@ -201,4 +243,6 @@
     AList.Free;
     StatusText('');
+    if stsFound.SimpleText = ''  then stsFound.TabStop := False
+    else if ScreenReaderSystemActive then stsFound.TabStop := True;
   end;
 end;
@@ -300,5 +344,11 @@
       lblSelect.Enabled := not Checked;
       tvAgent.Enabled   := not Checked;
-      cmdOK.Enabled := Checked;
+
+      // CQ #15770 - Allow OK button again if unchecked and items exist - JCS
+      //cmdOK.Enabled := Checked;
+      if Checked then
+        cmdOK.Enabled := True
+      else
+        cmdOK.Enabled := (tvAgent.Items.Count > 0);
     end;
 end;
