Index: cprs/trunk/CPRS-Chart/BA/fBALocalDiagnoses.pas
===================================================================
--- cprs/trunk/CPRS-Chart/BA/fBALocalDiagnoses.pas	(revision 456)
+++ cprs/trunk/CPRS-Chart/BA/fBALocalDiagnoses.pas	(revision 829)
@@ -7,5 +7,5 @@
   Dialogs, fAutoSz, StdCtrls, ORCtrls, ExtCtrls,fPCELex, uConsults, ORFn,
   rPCE,DBCtrls, DB, DBClient, uPCE, fEncounterFrame, ComCtrls, Grids, UBAGlobals,
-  Buttons, Menus, UBACore, UCore;
+  Buttons, Menus, UBACore, UCore, VA508AccessibilityManager;
 
 type
@@ -23,5 +23,4 @@
     lbSections: TORListBox;
     pnlBottom: TORAutoPanel;
-    lvDxGrid: TListView;
     cbAddToPDList: TCheckBox;
     cbAddToPL: TCheckBox;
@@ -33,9 +32,9 @@
     btnOther: TButton;
     lbDiagnosis: TORListBox;
-    ORStaticText1: TORStaticText;
-    ORStaticText2: TORStaticText;
-    ORStaticText3: TORStaticText;
-    ORStaticText4: TORStaticText;
+    lblDiagSect: TLabel;
+    lblDiagCodes: TLabel;
     lblPatientName: TStaticText;
+    gbProvDiag: TGroupBox;
+    lvDxGrid: TListView;
     procedure buOKClick(Sender: TObject);
     procedure buCancelClick(Sender: TObject);
@@ -65,8 +64,5 @@
     procedure lbOrdersMouseMove(Sender: TObject; Shift: TShiftState; X,
       Y: Integer);
-    procedure ORStaticText1Enter(Sender: TObject);
-    procedure ORStaticText1Exit(Sender: TObject);
-    procedure ORStaticText3Enter(Sender: TObject);
-    procedure ORStaticText3Exit(Sender: TObject);
+    procedure FormKeyPress(Sender: TObject; var Key: Char);
 
   private
@@ -105,4 +101,6 @@
     function  PersonalListDxFound(pDxCode:string):boolean;
     procedure ReSetCheckBoxStatus(pDxCode:String);
+    procedure DeleteSelectedDx;
+    function  IsCtrlDown: boolean;
 
   public
@@ -110,4 +108,5 @@
      procedure Enter(theCaller: smallint; pOrderIDList: TStringList);
      procedure LoadTempRec(var thisRec: TBADxRecord; thisOrderID: string);
+
   end;
 
@@ -137,6 +136,6 @@
 
 uses rCore, rODMeds, rODBase, rOrders, fRptBox, fODMedOIFA,
-  uAccessibleStringGrid,ORNet, fProbs, fOrdersSign, UBAConst,
-  UBAMessages, fReview, uSignItems, fODConsult, fFrame;
+  ORNet, fProbs, fOrdersSign, UBAConst,
+  UBAMessages, fReview, uSignItems, fODConsult, fFrame, VAUtils;
 
 var
@@ -176,4 +175,15 @@
 end;
 
+procedure TfrmBALocalDiagnoses.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+  inherited;
+   if frmBALocalDiagnoses.IsCtrlDown then
+   begin
+     if ( Key = #10 ) then
+        frmBALocalDiagnoses.buOK.Click;
+   end;
+   
+end;
+
 procedure TfrmBALocalDiagnoses.ListDiagnosisSections(Dest: TStrings);
 { return section names in format: ListIndex^SectionName (sections begin with '^') }
@@ -195,5 +205,5 @@
     ECFDiagnosis := TStringList.Create;
     uProblems := TStringList.Create;
-    lblPatientName.Caption := Patient.Name;
+    lblPatientName.Caption := Patient.Name + ' Selected Orders';
     DeselectGridItems;
     
@@ -501,5 +511,5 @@
       begin
          a :=  Piece(BADiagnosis[j], U, 2) + U + Piece(BADiagnosis[j], U, 1) + U + '        ' + Piece(BADiagnosis[j], U, 3) ;
-         if a = '' then showmessage('found nothing');
+         if a = '' then ShowMsg('found nothing');
             lbDiagnosis.Items.Add(a);
       end;
@@ -578,10 +588,10 @@
   inherited;
   deleteDX := True;
-  lvDxGrid.DeleteSelected;
+  frmBALocalDiagnoses.DeleteSelectedDX;
   ClearAndDisableCBoxes;
   DeselectGridItems;
   EnsurePrimary;
   deleteDX := False;
-                                // if all dx's removed, clear out displaycode
+  // if all dx's removed, clear out displaycode
   if lvDxGrid.items.Count = 0 then FODConsult.displayDXCode := '';
 end;
@@ -627,5 +637,5 @@
     begin
        DeselectGridItems;
-       ShowMessage(BA_MAX_DX); //** max  4 diagnoses per order
+       ShowMsg(BA_MAX_DX); //** max  4 diagnoses per order
     end;
 end;
@@ -812,5 +822,5 @@
     NewList.Clear;
     // ** Add Diagnosis to Problem List if flagged with 'Add' in First Col.
-    with lvDxGrid do
+    with frmBALocalDiagnoses.lvDxGrid do
     begin
        for i := 0 to Items.Count-1 do
@@ -861,5 +871,5 @@
    i : integer;
    tempStr1,tempStr2, tempStr3: string;
-   tempFactor1,x: string;
+   tempFactor1: string;
    tempStrList: TStringList;
 begin
@@ -877,12 +887,12 @@
    tempFactor1 := '';
 
-   if lvDxGrid.Items.Count > 0 then
-   with lvDxGrid do
+   if frmBALocalDiagnoses.lvDxGrid.Items.Count > 0 then
+   with frmBALocalDiagnoses.lvDxGrid do
    begin
       for i := 0 to Items.Count-1 do
       begin
-         x := lvDxGrid.Items[i].Subitems[0];
-         x := lvDxGrid.Items[i].Subitems[1];
-         x:= lvDxGrid.Items[i].Subitems[0] + '^' + lvDxGrid.Items[i].Subitems[1];
+     //    x := lvDxGrid.Items[i].Subitems[0];
+     //    x := lvDxGrid.Items[i].Subitems[1];
+     //    x:= lvDxGrid.Items[i].Subitems[0] + '^' + lvDxGrid.Items[i].Subitems[1];
          tempStrList.Add(lvDxGrid.Items[i].Subitems[0] + '^' + lvDxGrid.Items[i].Subitems[1]);
       end;
@@ -1121,5 +1131,5 @@
       on EListError do
          begin
-         {$ifdef debug}ShowMessage('EListError in frmBALocalDiagnoses.ListSelectedOrders()');{$endif}
+         {$ifdef debug}Show508Message('EListError in frmBALocalDiagnoses.ListSelectedOrders()');{$endif}
          raise;
          end;
@@ -1148,5 +1158,5 @@
       on EListError do
          begin
-         {$ifdef debug}ShowMessage('EListError in frmBALocalDiagnoses.AddDiagnosisToPersonalDiagnosesListClick()');{$endif}
+         {$ifdef debug}Show508Message('EListError in frmBALocalDiagnoses.AddDiagnosisToPersonalDiagnosesListClick()');{$endif}
          raise;
          end;
@@ -1156,5 +1166,5 @@
        if UBACore.rpcAddToPersonalDxList(User.DUZ,selectedList) then
        begin
-          ShowMessage(UBAMessages.BA_PERSONAL_LIST_UPDATED);
+          ShowMsg(UBAMessages.BA_PERSONAL_LIST_UPDATED);
           LoadEncounterForm;
           Refresh;
@@ -1179,5 +1189,5 @@
   if UBACore.rpcAddToPersonalDxList(User.DUZ,selectedList) then
   begin
-     ShowMessage(UBAMessages.BA_PERSONAL_LIST_UPDATED);
+     ShowMsg(UBAMessages.BA_PERSONAL_LIST_UPDATED);
      LoadEncounterForm;
      Refresh;
@@ -1267,4 +1277,5 @@
   (Control as TListBox).Canvas.TextOut(Rect.Left+2, Rect.Top+1, (Control as
               TListBox).Items[Index]); {** display the text }
+
 end;
 
@@ -1526,28 +1537,4 @@
 end;
 
-procedure TfrmBALocalDiagnoses.ORStaticText1Enter(Sender: TObject);
-begin
-  inherited;
-  (Sender as TORStaticText).Font.Style := [fsBold];
-end;
-
-procedure TfrmBALocalDiagnoses.ORStaticText1Exit(Sender: TObject);
-begin
-  inherited;
-  (Sender as TORStaticText).Font.Style := [];
-end;
-
-procedure TfrmBALocalDiagnoses.ORStaticText3Enter(Sender: TObject);
-begin
-  inherited;
-  (Sender as TORStaticText).Font.Style := [fsBold];
-end;
-
-procedure TfrmBALocalDiagnoses.ORStaticText3Exit(Sender: TObject);
-begin
-  inherited;
-  (Sender as TORStaticText).Font.Style := [];
-end;
-
 procedure TfrmBALocalDiagnoses.ResetCheckBoxStatus(pDxCode:string);
 begin
@@ -1556,7 +1543,30 @@
  if  Not PersonalListDxFound(pDxCode) then
     cbAddToPDList.Enabled  := True;
-
-
-end;
+end;
+
+procedure TfrmBALocalDiagnoses.DeleteSelectedDx;
+var
+  I: Integer;
+begin
+  frmBALocalDiagnoses.lvDxGrid.Items.BeginUpdate;
+  try
+    for I := frmBALocalDiagnoses.lvDxGrid.Items.Count - 1 downto 0 do
+      if  frmBALocalDiagnoses.lvDxGrid.Items[I].Selected then
+        frmBALocalDiagnoses.lvdxGrid.Items[I].delete;
+  finally
+    lvDxGrid.Items.EndUpdate;
+  end;
+
+end;
+
+function  TfrmBALocalDiagnoses.IsCtrlDown: boolean;
+var
+  State: TKeyboardState;
+begin { isCtrlDown }
+  GetKeyboardState(State);
+  Result := ((State[VK_CONTROL] and 128)<>0); // Ctrl-button
+end; { isCtrlDown }
+
+
 
 
