Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/FormResize.txt
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/FormResize.txt	(revision 460)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/FormResize.txt	(revision 460)
@@ -0,0 +1,8 @@
+procedure TfrmODCslt.FormResize(Sender: TObject);
+begin
+  inherited;
+  memOrder.Top := pnlReason.Top + pnlReason.Height + 2;
+  pnlMessage.Top := memOrder.Top + 2;
+  cmdAccept.Top := pnlMessage.Top;
+  cmdQuit.Top := cmdAccept.Top;
+end;
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsultAct.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsultAct.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsultAct.dfm	(revision 460)
@@ -107,4 +107,5 @@
         TabOrder = 3
         OnNeedData = NewPersonNeedData
+        CharsNeedMatch = 1
       end
       object cboUrgency: TORComboBox
@@ -129,4 +130,5 @@
         SynonymChars = '<>'
         TabOrder = 2
+        CharsNeedMatch = 1
       end
       object treService: TORTreeView
@@ -167,4 +169,5 @@
         OnKeyPause = cboServiceSelect
         OnMouseClick = cboServiceSelect
+        CharsNeedMatch = 1
       end
     end
@@ -352,4 +355,5 @@
           TabStop = True
           OnNeedData = NewPersonNeedData
+          CharsNeedMatch = 1
         end
       end
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsultAct.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsultAct.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsultAct.pas	(revision 460)
@@ -465,5 +465,5 @@
     FUrgency       := cboUrgency.ItemIEN ;
     if (FActionType = CN_ACT_SIGFIND) or (FActionType = CN_ACT_ADMIN_COMPLETE) then
-      FSigFind       := Copy(grpSigFindings.Items[grpSigFindings.ItemIndex],1,1);
+      FSigFind       := Copy(grpSigFindings.Items[grpSigFindings.ItemIndex],2,1);
     LimitEditWidth(memComments, 74);
     FComments := memComments.Lines ;
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.dfm	(revision 460)
@@ -1,6 +1,6 @@
 inherited frmConsults: TfrmConsults
-  Left = 327
-  Top = 169
-  Width = 660
+  Left = 247
+  Top = 174
+  Width = 723
   Height = 467
   HelpContext = 6000
@@ -15,5 +15,5 @@
   inherited shpPageBottom: TShape
     Top = 416
-    Width = 652
+    Width = 715
   end
   inherited sptHorz: TSplitter
@@ -25,5 +25,5 @@
   inherited pnlRight: TPanel [2]
     Left = 85
-    Width = 567
+    Width = 630
     Height = 416
     OnResize = pnlRightResize
@@ -31,5 +31,5 @@
       Left = 0
       Top = 350
-      Width = 567
+      Width = 630
       Height = 4
       Cursor = crVSplit
@@ -39,5 +39,5 @@
       Left = 0
       Top = 0
-      Width = 567
+      Width = 630
       Height = 350
       Align = alClient
@@ -48,5 +48,5 @@
         Left = 0
         Top = 0
-        Width = 567
+        Width = 630
         Height = 19
         Align = alTop
@@ -68,5 +68,5 @@
         Left = 0
         Top = 19
-        Width = 567
+        Width = 630
         Height = 331
         Align = alClient
@@ -97,5 +97,5 @@
       Left = 0
       Top = 354
-      Width = 567
+      Width = 630
       Height = 62
       Align = alBottom
@@ -107,5 +107,5 @@
       Left = 0
       Top = 0
-      Width = 567
+      Width = 630
       Height = 350
       Align = alClient
@@ -117,5 +117,5 @@
         Left = 0
         Top = 67
-        Width = 567
+        Width = 630
         Height = 283
         Align = alClient
@@ -137,5 +137,5 @@
         Left = 0
         Top = 0
-        Width = 567
+        Width = 630
         Height = 67
         Align = alTop
@@ -144,5 +144,5 @@
         OnResize = pnlFieldsResize
         DesignSize = (
-          567
+          630
           67)
         object bvlNewTitle: TBevel
@@ -166,5 +166,5 @@
         end
         object lblAuthor: TStaticText
-          Left = 339
+          Left = 402
           Top = 6
           Width = 152
@@ -189,5 +189,5 @@
         end
         object lblCosigner: TStaticText
-          Left = 244
+          Left = 307
           Top = 21
           Width = 243
@@ -232,5 +232,5 @@
         end
         object cmdChange: TButton
-          Left = 493
+          Left = 556
           Top = 6
           Width = 58
@@ -245,5 +245,5 @@
           Left = 48
           Top = 40
-          Width = 503
+          Width = 566
           Height = 21
           Hint = 'Subject is limited to a maximum of 80 characters.'
@@ -435,5 +435,4 @@
         Height = 142
         Align = alClient
-        Color = clWhite
         HideSelection = False
         Indent = 15
@@ -675,4 +674,54 @@
         end
       end
+      object mnuViewInformation: TMenuItem
+        Caption = 'Information'
+        OnClick = mnuViewInformationClick
+        object mnuViewDemo: TMenuItem
+          Tag = 1
+          Caption = 'De&mographics...'
+          OnClick = ViewInfo
+        end
+        object mnuViewVisits: TMenuItem
+          Tag = 2
+          Caption = 'Visits/Pr&ovider...'
+          OnClick = ViewInfo
+        end
+        object mnuViewPrimaryCare: TMenuItem
+          Tag = 3
+          Caption = 'Primary &Care...'
+          OnClick = ViewInfo
+        end
+        object mnuViewMyHealtheVet: TMenuItem
+          Tag = 4
+          Caption = 'MyHealthe&Vet...'
+          OnClick = ViewInfo
+        end
+        object mnuInsurance: TMenuItem
+          Tag = 5
+          Caption = '&Insurance...'
+          OnClick = ViewInfo
+        end
+        object mnuViewFlags: TMenuItem
+          Tag = 6
+          Caption = '&Flags...'
+          OnClick = ViewInfo
+        end
+        object mnuViewRemoteData: TMenuItem
+          Tag = 7
+          Caption = 'Remote &Data...'
+          OnClick = ViewInfo
+        end
+        object mnuViewReminders: TMenuItem
+          Tag = 8
+          Caption = '&Reminders...'
+          Enabled = False
+          OnClick = ViewInfo
+        end
+        object mnuViewPostings: TMenuItem
+          Tag = 9
+          Caption = '&Postings...'
+          OnClick = ViewInfo
+        end
+      end
       object Z3: TMenuItem
         Caption = '-'
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.pas	(revision 460)
@@ -162,4 +162,14 @@
     popNoteMemoInsTemplate: TMenuItem;
     popNoteMemoEncounter: TMenuItem;
+    mnuViewInformation: TMenuItem;
+    mnuViewDemo: TMenuItem;
+    mnuViewVisits: TMenuItem;
+    mnuViewPrimaryCare: TMenuItem;
+    mnuViewMyHealtheVet: TMenuItem;
+    mnuInsurance: TMenuItem;
+    mnuViewFlags: TMenuItem;
+    mnuViewReminders: TMenuItem;
+    mnuViewRemoteData: TMenuItem;
+    mnuViewPostings: TMenuItem;
     procedure mnuChartTabClick(Sender: TObject);
     procedure lstConsultsClick(Sender: TObject);
@@ -267,4 +277,6 @@
     procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
       Y: Integer);
+    procedure ViewInfo(Sender: TObject);
+    procedure mnuViewInformationClick(Sender: TObject);
   private
     FEditingIndex: Integer;      // TIU index of document being currently edited
@@ -296,5 +308,5 @@
     procedure frmDrawerPnlEncounterButtonExit(Sender: TObject);
     procedure frmDrawerEdtSearchExit(Sender: TObject);
-    procedure DoAutoSave;
+    procedure DoAutoSave(Suppress: integer = 1);
     function GetTitleText(AnIndex: Integer): string;
     //function MakeTitleText(IsAddendum: Boolean = False): string;
@@ -870,9 +882,5 @@
             lstNotesClick(Self);  // will make pnlWrite visible
             if timAutoSave.Interval <> 0 then EnableAutosave := TRUE;
-
-            if txtSubject.Visible then
-              txtSubject.SetFocus
-            else
-              memResults.SetFocus;
+            if txtSubject.Visible then txtSubject.SetFocus else memResults.SetFocus;
           end
         else  //  CreatedNote.ErrorText <> ''
@@ -947,5 +955,6 @@
     else HaveRequired := True;
   // lock the consult request if there is a consult
-  if FEditNote.PkgIEN > 0 then HaveRequired := LockConsultRequest(FEditNote.PkgIEN);
+  if HaveRequired and (FEditNote.PkgIEN > 0) then
+    HaveRequired := LockConsultRequest(FEditNote.PkgIEN);
   if HaveRequired then
   begin
@@ -1529,5 +1538,5 @@
       CompleteConsult(IS_ID_CHILD, 0, UseClinProcTitles);
     end
-  else if NoteIEN = -1 then Exit;
+  else if NoteIEN = -1 then Exit
 end;
 
@@ -2003,8 +2012,11 @@
 procedure TfrmConsults.SaveSignItem(const ItemID, ESCode: string);
 { saves and optionally signs a progress note or addendum }
+const
+  SIG_COSIGN = 'COSIGNATURE';
+  SIG_SIGN   = 'SIGNATURE';
 var
   AnIndex, IEN, i: Integer;
   Saved, ContinueSign: Boolean;  {*RAB* 8/26/99}
-  SignSts: TActionRec;
+  ActionSts, SignSts: TActionRec;
   APCEObject: TPCEData;
   OK: boolean;
@@ -2012,4 +2024,5 @@
   tmpNode: TORTreeNode;
   ErrMsg: string;
+  ActionType, SignTitle: string;
 begin
   AnIndex := -1;
@@ -2039,15 +2052,20 @@
   if Length(ESCode) > 0 then
   begin
-(*    if LacksClinProcFieldsForSignature(IEN, ErrMsg) then
-       begin
-         InfoBox(ErrMsg, TC_CLIN_PROC, MB_OK);
-         ContinueSign := False;
-       end
-    else ContinueSign := True;
-    if not LastSaveClean(IEN) and
-      (InfoBox(TX_ABSAVE, TC_ABSAVE, MB_YESNO or MB_DEFBUTTON2) <> IDYES)
-       then ContinueSign := False;
-       //else ContinueSign := True;*)
-    if LacksClinProcFieldsForSignature(IEN, ErrMsg) then
+    if CosignDocument(IEN) then
+    begin
+      SignTitle := TX_COSIGN;
+      ActionType := SIG_COSIGN;
+    end else
+    begin
+      SignTitle := TX_SIGN;
+      ActionType := SIG_SIGN;
+    end;
+    ActOnDocument(ActionSts, IEN, ActionType);
+    if not ActionSts.Success then
+      begin
+        InfoBox(ActionSts.Reason, TX_IN_AUTH, MB_OK);
+        ContinueSign := False;
+      end
+    else if LacksClinProcFieldsForSignature(IEN, ErrMsg) then
       begin
        InfoBox(ErrMsg, TC_CLIN_PROC, MB_OK);
@@ -2063,5 +2081,4 @@
        then ContinueSign := False
     else ContinueSign := True;
-
     if ContinueSign then
     begin
@@ -2753,9 +2770,11 @@
 begin
   inherited;
-  DoAutoSave;
+  DoAutoSave(0);
   timAutoSave.Enabled := False;
   try
     SpellCheckForControl(memResults);
   finally
+    FChanged := True;
+    DoAutoSave(0);
     timAutoSave.Enabled := True;
   end;
@@ -2765,9 +2784,11 @@
 begin
   inherited;
-  DoAutoSave;
+  DoAutoSave(0);
   timAutoSave.Enabled := False;
   try
     GrammarCheckForControl(memResults);
   finally
+    FChanged := True;
+    DoAutoSave(0);
     timAutoSave.Enabled := True;
   end;
@@ -2985,4 +3006,5 @@
   SigAction: integer;
   SavedDocID, SavedCsltID: string;
+  ARefDate: TFMDateTime;
 begin
   inherited;
@@ -3017,7 +3039,11 @@
     end;
 
-  if not LockConsultRequestAndNote(lstNotes.ItemIEN) then Exit;
-  Exclusions := GetCurrentSigners(lstNotes.ItemIEN);
-  SelectAdditionalSigners(Font.Size, lstNotes.ItemIEN, SigAction, Exclusions, SignerList, CT_CONSULTS);
+  with lstNotes do
+    begin
+      if not LockConsultRequestAndNote(ItemIEN) then Exit;
+      Exclusions := GetCurrentSigners(ItemIEN);
+      ARefDate := StrToFloat(Piece(Items[ItemIndex], U, 3));
+      SelectAdditionalSigners(Font.Size, ItemIEN, SigAction, Exclusions, SignerList, CT_CONSULTS, ARefDate);
+    end;
   with SignerList do
     begin
@@ -3556,5 +3582,5 @@
     begin
       if Title > 0 then CurTitle := Title else CurTitle := DocType;
-      if AskCosignerForTitle(CurTitle, Author) and (Cosigner <= 0) then Result := True;
+      if AskCosignerForTitle(CurTitle, Author, DateTime) and (Cosigner <= 0) then Result := True;
     end;
   end;
@@ -3572,5 +3598,5 @@
           ErrMsg := TX_NO_AUTHOR;
         end;
-      if AskCosignerForTitle(Title, Author) and (Cosigner = 0) then
+      if AskCosignerForTitle(Title, Author, DateTime) and (Cosigner = 0) then
         begin
           Result := True;
@@ -3665,5 +3691,5 @@
 end;
 
-procedure TfrmConsults.DoAutoSave;
+procedure TfrmConsults.DoAutoSave(Suppress: integer = 1);
 var
   ErrMsg: string;
@@ -3672,8 +3698,8 @@
   begin
     StatusText('Autosaving note...');
-    //PutTextOnly(ErrMsg, memNewNote.Lines, lstNotes.GetIEN(EditingIndex));
+    //PutTextOnly(ErrMsg, memResults.Lines, lstNotes.GetIEN(EditingIndex));
     timAutoSave.Enabled := False;
     try
-      SetText(ErrMsg, memResults.Lines, lstNotes.GetIEN(EditingIndex),1);
+      SetText(ErrMsg, memResults.Lines, lstNotes.GetIEN(EditingIndex), Suppress);
     finally
       timAutoSave.Enabled := True;
@@ -4682,6 +4708,11 @@
         (Screen.ActiveControl = txtSubject) or
         (Screen.ActiveControl = memResults) then
-      //frmFrame.pnlPatient.SetFocus  //COMMENTED OUT FOR CQ6498
-      memResults.SetFocus //ADDED THIS LINE FOR CQ6498
+      begin
+        //frmFrame.pnlPatient.SetFocus  //COMMENTED OUT FOR CQ6498
+        if memResults.CanFocus then
+          memResults.SetFocus //ADDED THIS LINE FOR CQ6498
+        else
+          memConsult.SetFocus;
+      end
     else
     if (Screen.ActiveControl = tvConsults) then
@@ -4729,5 +4760,6 @@
   {Below is a fix for ClearQuest Defect HDS0000948, Kind of Kloogy I looked
   and looked for side effects and a better solution and this was the best!}
-  frmDrawers.Hide;
+  if (EditingIndex = -1) or (lstNotes.ItemIndex <> EditingIndex) then
+    frmDrawers.Hide;
   {This TStaticText I am looking for doesn't have a Name! So
    I have to loop through the panel's controls and disable the TStaticText.}
@@ -4768,4 +4800,24 @@
 end;
 
+procedure TfrmConsults.ViewInfo(Sender: TObject);
+begin
+  inherited;
+  frmFrame.ViewInfo(Sender);
+end;
+
+procedure TfrmConsults.mnuViewInformationClick(Sender: TObject);
+begin
+  inherited;
+  mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled;
+  mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled;
+  mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled;
+  mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No');
+  mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No');
+  mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled;
+  mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled;
+  mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled;
+  mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled;
+end;
+
 initialization
   uPCEEdit := TPCEData.Create;
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fEditConsult.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fEditConsult.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fEditConsult.dfm	(revision 460)
@@ -1,6 +1,6 @@
 object frmEditCslt: TfrmEditCslt
   Tag = 110
-  Left = 119
-  Top = 94
+  Left = 409
+  Top = 225
   Width = 569
   Height = 367
@@ -174,4 +174,5 @@
     SynonymChars = '<>'
     TabOrder = 0
+    CharsNeedMatch = 1
   end
   object cboUrgency: TORComboBox
@@ -197,4 +198,5 @@
     TabOrder = 1
     OnChange = ControlChange
+    CharsNeedMatch = 1
   end
   object radInpatient: TRadioButton
@@ -239,4 +241,5 @@
     TabOrder = 7
     OnChange = ControlChange
+    CharsNeedMatch = 1
   end
   object txtProvDiag: TCaptionEdit
@@ -246,4 +249,5 @@
     Height = 21
     Anchors = [akLeft, akTop, akRight]
+    MaxLength = 180
     ParentShowHint = False
     PopupMenu = mnuPopProvDx
@@ -277,4 +281,5 @@
     OnChange = ControlChange
     OnNeedData = txtAttnNeedData
+    CharsNeedMatch = 1
   end
   object cboCategory: TORComboBox
@@ -298,4 +303,5 @@
     TabOrder = 14
     Visible = False
+    CharsNeedMatch = 1
   end
   object cmdAccept: TButton
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fEditProc.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fEditProc.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fEditProc.dfm	(revision 460)
@@ -18,6 +18,6 @@
   Position = poScreenCenter
   DesignSize = (
-    545
-    289)
+    561
+    308)
   PixelsPerInch = 96
   TextHeight = 13
@@ -166,4 +166,5 @@
     TabOrder = 2
     OnChange = ControlChange
+    CharsNeedMatch = 1
   end
   object radInpatient: TRadioButton
@@ -208,4 +209,5 @@
     TabOrder = 6
     OnChange = ControlChange
+    CharsNeedMatch = 1
   end
   object txtProvDiag: TCaptionEdit
@@ -215,4 +217,5 @@
     Height = 21
     Anchors = [akLeft, akTop, akRight]
+    MaxLength = 180
     ParentShowHint = False
     PopupMenu = mnuPopProvDx
@@ -246,4 +249,5 @@
     OnChange = ControlChange
     OnNeedData = txtAttnNeedData
+    CharsNeedMatch = 1
   end
   object cboProc: TORComboBox
@@ -277,4 +281,5 @@
     OnChange = cboProcSelect
     OnNeedData = cboProcNeedData
+    CharsNeedMatch = 1
   end
   object cboCategory: TORComboBox
@@ -299,4 +304,5 @@
     Visible = False
     OnChange = ControlChange
+    CharsNeedMatch = 1
   end
   object cboService: TORComboBox
@@ -329,4 +335,5 @@
     TabOrder = 1
     OnChange = ControlChange
+    CharsNeedMatch = 1
   end
   object memComment: TRichEdit
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fODConsult.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fODConsult.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fODConsult.dfm	(revision 460)
@@ -1,14 +1,13 @@
 inherited frmODCslt: TfrmODCslt
   Tag = 110
-  Left = 377
-  Top = 11
-  Width = 536
-  Height = 321
-  HorzScrollBar.Range = 528
-  HorzScrollBar.Visible = True
-  VertScrollBar.Range = 294
-  VertScrollBar.Visible = True
-  AutoScroll = False
+  Left = 430
+  Top = 203
+  Width = 606
+  Height = 376
+  HorzScrollBar.Range = 590
+  VertScrollBar.Range = 340
   Caption = 'Order a Consult'
+  Constraints.MinHeight = 376
+  Constraints.MinWidth = 606
   Font.Charset = ANSI_CHARSET
   PixelsPerInch = 96
@@ -23,8 +22,8 @@
   object pnlReason: TPanel [1]
     Left = 3
-    Top = 117
-    Width = 516
-    Height = 132
-    Anchors = [akLeft, akTop, akRight, akBottom]
+    Top = 154
+    Width = 585
+    Height = 135
+    Anchors = [akLeft, akTop, akRight]
     BevelOuter = bvNone
     TabOrder = 11
@@ -32,5 +31,5 @@
       Left = 0
       Top = 0
-      Width = 516
+      Width = 585
       Height = 13
       Align = alTop
@@ -40,6 +39,6 @@
       Left = 0
       Top = 13
-      Width = 516
-      Height = 119
+      Width = 585
+      Height = 122
       Align = alClient
       Font.Charset = ANSI_CHARSET
@@ -48,4 +47,5 @@
       Font.Name = 'Courier New'
       Font.Style = []
+      Constraints.MinHeight = 40
       ParentFont = False
       PopupMenu = popReason
@@ -61,5 +61,5 @@
   end
   object lblUrgency: TStaticText [2]
-    Left = 239
+    Left = 309
     Top = 2
     Width = 44
@@ -70,5 +70,5 @@
   end
   object lblPlace: TStaticText [3]
-    Left = 384
+    Left = 454
     Top = 43
     Width = 104
@@ -79,5 +79,5 @@
   end
   object lblAttn: TStaticText [4]
-    Left = 384
+    Left = 454
     Top = 2
     Width = 46
@@ -88,5 +88,5 @@
   end
   object lblProvDiag: TStaticText [5]
-    Left = 239
+    Left = 309
     Top = 81
     Width = 104
@@ -98,8 +98,7 @@
   inherited memOrder: TCaptionMemo
     Left = 3
-    Top = 255
-    Width = 347
-    Height = 36
-    Anchors = [akLeft, akRight, akBottom]
+    Top = 305
+    Width = 417
+    Height = 41
     Lines.Strings = (
       'The order text...'
@@ -110,24 +109,22 @@
   end
   inherited cmdAccept: TButton
-    Left = 357
-    Top = 265
-    Anchors = [akRight, akBottom]
+    Left = 427
+    Top = 315
     TabOrder = 12
   end
   inherited cmdQuit: TButton
-    Left = 453
-    Top = 265
+    Left = 531
+    Top = 315
     Width = 61
-    Anchors = [akRight, akBottom]
     TabOrder = 13
   end
   inherited pnlMessage: TPanel
-    Left = 61
-    Top = 245
-    Width = 277
+    Left = 13
+    Top = 295
+    Width = 377
     Anchors = [akLeft, akRight, akBottom]
     TabOrder = 14
     inherited memMessage: TRichEdit
-      Width = 227
+      Width = 292
     end
   end
@@ -135,6 +132,6 @@
     Left = 0
     Top = 16
-    Width = 204
-    Height = 73
+    Width = 274
+    Height = 113
     Anchors = [akLeft, akTop, akRight]
     Style = orcsSimple
@@ -156,4 +153,5 @@
     OnChange = ControlChange
     OnClick = cboServiceSelect
+    OnExit = cboServiceExit
     OnKeyDown = cboServiceKeyDown
     OnKeyUp = cboServiceKeyUp
@@ -161,5 +159,5 @@
   end
   object cboUrgency: TORComboBox
-    Left = 239
+    Left = 309
     Top = 16
     Width = 133
@@ -187,5 +185,5 @@
   end
   object cboPlace: TORComboBox
-    Left = 384
+    Left = 454
     Top = 56
     Width = 136
@@ -212,9 +210,10 @@
   end
   object txtProvDiag: TCaptionEdit
-    Left = 239
+    Left = 309
     Top = 94
     Width = 231
     Height = 21
     Anchors = [akTop, akRight]
+    MaxLength = 180
     ParentShowHint = False
     PopupMenu = mnuPopProvDx
@@ -225,5 +224,5 @@
   end
   object txtAttn: TORComboBox
-    Left = 384
+    Left = 454
     Top = 16
     Width = 136
@@ -252,7 +251,7 @@
   object treService: TORTreeView
     Left = 0
-    Top = 37
-    Width = 228
-    Height = 201
+    Top = 38
+    Width = 298
+    Height = 220
     Anchors = [akLeft, akTop, akRight, akBottom]
     Font.Charset = DEFAULT_CHARSET
@@ -299,12 +298,19 @@
   end
   object pnlServiceTreeButton: TKeyClickPanel
-    Left = 204
+    Left = 274
     Top = 14
-    Width = 25
-    Height = 24
+    Width = 26
+    Height = 26
     Hint = 'View services/specialties hierarchically'
     Anchors = [akTop, akRight]
     BevelOuter = bvNone
+    BevelWidth = 2
     Caption = 'View services/specialties hierarchically'
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clBtnFace
+    Font.Height = -11
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    ParentFont = False
     TabOrder = 2
     TabStop = True
@@ -313,7 +319,7 @@
     OnExit = pnlServiceTreeButtonExit
     object btnServiceTree: TSpeedButton
-      Left = 1
-      Top = 1
-      Width = 23
+      Left = 2
+      Top = 2
+      Width = 22
       Height = 22
       Glyph.Data = {
@@ -360,12 +366,13 @@
         FFFFFFFFFFFFFFFFFFFF00FB00FF0404040404FFFFFFFFFFFFFF070007FFFFFF
         FFFFFFFFFFFFFFFFFFFF}
+      Margin = 0
       OnClick = btnServiceTreeClick
     end
   end
   object cmdLexSearch: TButton
-    Left = 473
-    Top = 96
+    Left = 543
+    Top = 94
     Width = 49
-    Height = 17
+    Height = 21
     Anchors = [akTop, akRight]
     Caption = 'Lexicon'
@@ -374,5 +381,5 @@
   end
   object gbInptOpt: TGroupBox
-    Left = 239
+    Left = 309
     Top = 35
     Width = 140
@@ -401,7 +408,7 @@
   end
   object btnDiagnosis: TButton
-    Left = 473
+    Left = 543
     Top = 95
-    Width = 52
+    Width = 49
     Height = 20
     Anchors = [akTop, akRight]
@@ -421,5 +428,5 @@
     OnPopup = popReasonPopup
     Left = 411
-    Top = 169
+    Top = 188
     object popReasonCut: TMenuItem
       Caption = 'Cu&t'
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fODConsult.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fODConsult.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fODConsult.pas	(revision 460)
@@ -85,4 +85,5 @@
     procedure btnDiagnosisClick(Sender: TObject);
     procedure cmdQuitClick(Sender: TObject);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
 
   private
@@ -97,5 +98,5 @@
     procedure SetupReasonForRequest(OrderAction: integer);
     procedure GetProvDxandValidateCode(AResponses: TResponses);
-    function  ShowPrerequisites: boolean;
+    function ShowPrerequisites: boolean;
     procedure DoSetFontSize(FontSize: integer);
     procedure SetUpQuickOrderDX;
@@ -106,4 +107,5 @@
     procedure Validate(var AnErrMsg: string); override;
     function DefaultReasonForRequest(Service: string; Resolve: Boolean): TStrings;
+    
   public
     procedure SetupDialog(OrderAction: Integer; const ID: string); override;
@@ -123,5 +125,5 @@
 uses
     rODBase, rConsults, uCore, uConsults, rCore, fConsults, fPCELex, rPCE, fPreReq,
-    ORClasses, clipbrd, uTemplates;
+    ORClasses, clipbrd, uTemplates, fFrame, uODBase;
 
 var
@@ -131,5 +133,5 @@
   BADxUpdated: boolean;
   quickCode: string;
-  
+
 
 
@@ -153,4 +155,5 @@
 procedure TfrmODCslt.FormCreate(Sender: TObject);
 begin
+  frmFrame.pnlVisit.Enabled := false;
   AutoSizeDisabled := True;
   inherited;
@@ -223,5 +226,7 @@
   cboService.Enabled := True;
   cboService.Font.Color := clWindowText;
+  cboService.Height := 25 + (7 * cboService.ItemHeight);
   btnServiceTree.Enabled := True;
+  pnlServiceTreeButton.Enabled := True;
   ActiveControl := cboService;
   SetProvDiagPromptingMode;
@@ -271,4 +276,5 @@
       cboService.Font.Color := clGrayText;
       btnServiceTree.Enabled := False;
+      pnlServiceTreeButton.Enabled := False;
       if (OrderAction in [ORDER_COPY, ORDER_QUICK]) and (not ShowPrerequisites) then
         begin
@@ -286,5 +292,4 @@
     begin
       if QuickList.Count > 0 then BuildQuickTree(QuickList, '0', nil) ;
-      //SvcList.Assign(LoadServiceList(CN_SVC_LIST_ORD))   ;
       SvcList.Assign(LoadServiceListWithSynonyms(CN_SVC_LIST_ORD));           {RV}
       AList.Assign(SvcList);
@@ -512,4 +517,5 @@
         cboService.Font.Color := clGrayText;
         btnServiceTree.Enabled := False;
+        pnlServiceTreeButton.Enabled := False;
         Changing := False;
       end;
@@ -645,8 +651,6 @@
  begin
  inherited;
-
- //if NOT BILLING_AWARE then
-    if treService.Selected <> nil then
-       LastNode := treService.Selected.AbsoluteIndex;
+ if treService.Selected <> nil then
+    LastNode := treService.Selected.AbsoluteIndex;
 
  if  BILLING_AWARE and CIDCOkToSave  then
@@ -657,5 +661,4 @@
        begin
           uBACore.CompleteConsultOrderRec(uBAGlobals.BAOrderID,UBAGlobals.BAConsultDxList);
-       //   if ProvDx.Reqd = 'R' then UBAGlobals.BAConsultOrdersRequireDx.Add(uBAGlobals.BAOrderID); //allow special handling of non cidc consults that require dx .
           uBAGlobals.BAConsultDxList.Clear;
        end;
@@ -743,4 +746,5 @@
           Font.Color := clGrayText;
           btnServiceTree.Enabled := False;
+          pnlServiceTreeButton.Enabled := False;
           Changing := False;
           with Responses do if QuickOrder > 0 then
@@ -945,5 +949,8 @@
   with ProvDx do if (Reqd = '') or (PromptMode = '') then Exit;
   if ProvDx.Reqd = 'R' then
-    lblProvDiag.Caption := TX_PROVDX_REQD
+  begin
+    lblProvDiag.Caption := TX_PROVDX_REQD;
+    if (BILLING_AWARE)  and (ProvDx.PromptMode[1] = '') then btnDiagnosis.Enabled := True;
+  end
   else
     lblProvDiag.Caption := TX_PROVDX_OPT;
@@ -1066,6 +1073,5 @@
                   Result := False;
                   AbortOrder := True;
-                  //cmdQuitClick(Self);
-                end
+               end
               else Result := True;
             end;
@@ -1076,7 +1082,4 @@
 end;
 
-////////// NOTE THIS FUNCTION IS NO LONGER ASSIGNED TO OnExit EVENT
-///////// Calling this with enter making a selection had serious errors
-///////// No ill effect can be seen for not calling it.
 procedure TfrmODCslt.cboServiceExit(Sender: TObject);
 begin
@@ -1086,5 +1089,7 @@
   if cboService.ItemID = FLastServiceID then Exit;
   cboServiceSelect(cboService);
-  cboService.SetFocus;
+  // CQ #7490, following line commented out v26.24 (RV)
+  // CQ #9610 and 10074 - uncommented and "if" added v26.54 (RV)
+  if cboService.Enabled then cboService.SetFocus;
   PostMessage(Handle, WM_NEXTDLGCTL, 0, 0);
 end;
@@ -1141,6 +1146,8 @@
   TmpSL: TStringList;
   DocInfo: string;
-
-begin
+  x: string;
+  HasObjects: boolean;
+begin
+  Resolve := FALSE ;  // override value passed in - resolve on client - PSI-05-093
   DocInfo := '';
   TmpSL := TStringList.Create;
@@ -1148,5 +1155,10 @@
     Result := GetDefaultReasonForRequest(Service + CSLT_PTR, Resolve);
     TmpSL.Assign(Result);
+    x := TmpSL.Text;
+    ExpandOrderObjects(x, HasObjects);
+    TmpSL.Text := x;
+    Responses.OrderContainsObjects := HasObjects;
     ExecuteTemplateOrBoilerPlate(TmpSL, cboService.ItemIEN , ltConsult, nil, 'Reason for Request: ' + cboService.DisplayText[cboService.ItemIndex], DocInfo);
+    if TmpSL.Text <> x then Responses.OrderContainsObjects := False;
     Result.Assign(TmpSL);
   finally
@@ -1284,5 +1296,5 @@
   //Except when Enter or Space is pressed. VK_LBUTTON activates OnClick in TORComboBoxes
   FcboServiceKeyDownStopClick := false;
-  if (Key <> VK_RETURN) and (Key <> VK_SPACE) and (Key <> VK_LBUTTON) then
+  if (Key <> VK_RETURN) {and (Key <> VK_SPACE)} and (Key <> VK_LBUTTON) then  //comment on this line is fix for CQ6789
     FcboServiceKeyDownStopClick := True
   else
@@ -1333,4 +1345,5 @@
      end;
   end;
+
   ProvDx.CodeInactive := False;
 end;
@@ -1387,4 +1400,10 @@
 end;
 
+procedure TfrmODCslt.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+  inherited;
+  frmFrame.pnlVisit.Enabled := true;
+end;
+
 end.
 
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fODProc.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fODProc.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fODProc.dfm	(revision 460)
@@ -1,14 +1,13 @@
 inherited frmODProc: TfrmODProc
   Tag = 112
-  Left = 262
-  Top = 191
-  Width = 531
-  Height = 322
+  Left = 208
+  Top = 188
+  Width = 543
+  Height = 393
   HorzScrollBar.Range = 523
-  HorzScrollBar.Visible = True
   VertScrollBar.Range = 295
-  VertScrollBar.Visible = True
-  AutoScroll = False
   Caption = 'Order a Procedure'
+  Constraints.MinHeight = 393
+  Constraints.MinWidth = 543
   PixelsPerInch = 96
   TextHeight = 13
@@ -31,6 +30,13 @@
     WordWrap = False
   end
-  object lblUrgency: TStaticText [2]
-    Left = 237
+  object lblReason: TLabel [2]
+    Left = 4
+    Top = 103
+    Width = 95
+    Height = 13
+    Caption = 'Reason for Request'
+  end
+  object lblUrgency: TStaticText [3]
+    Left = 249
     Top = 4
     Width = 44
@@ -40,6 +46,6 @@
     TabOrder = 15
   end
-  object lblPlace: TStaticText [3]
-    Left = 384
+  object lblPlace: TStaticText [4]
+    Left = 396
     Top = 43
     Width = 104
@@ -49,6 +55,6 @@
     TabOrder = 16
   end
-  object lblAttn: TStaticText [4]
-    Left = 384
+  object lblAttn: TStaticText [5]
+    Left = 396
     Top = 4
     Width = 46
@@ -58,6 +64,6 @@
     TabOrder = 17
   end
-  object lblProvDiag: TStaticText [5]
-    Left = 237
+  object lblProvDiag: TStaticText [6]
+    Left = 249
     Top = 81
     Width = 104
@@ -67,28 +73,18 @@
     TabOrder = 18
   end
-  object pnlReason: TPanel [6]
+  object pnlReason: TPanel [7]
     Left = 0
-    Top = 99
-    Width = 521
-    Height = 154
+    Top = 120
+    Width = 528
+    Height = 192
     Anchors = [akLeft, akTop, akRight, akBottom]
     BevelOuter = bvNone
     TabOrder = 9
-    DesignSize = (
-      521
-      154)
-    object lblReason: TLabel
-      Left = 4
-      Top = 9
-      Width = 95
-      Height = 13
-      Caption = 'Reason for Request'
-    end
     object memReason: TCaptionRichEdit
       Left = 0
-      Top = 24
-      Width = 521
-      Height = 130
-      Anchors = [akLeft, akTop, akRight, akBottom]
+      Top = 0
+      Width = 528
+      Height = 192
+      Align = alClient
       Font.Charset = DEFAULT_CHARSET
       Font.Color = clWindowText
@@ -96,4 +92,5 @@
       Font.Name = 'Courier New'
       Font.Style = []
+      Constraints.MinHeight = 40
       ParentFont = False
       PopupMenu = popReason
@@ -110,9 +107,9 @@
   end
   inherited memOrder: TCaptionMemo
-    Left = 4
-    Top = 258
-    Width = 361
-    Height = 36
-    Anchors = [akLeft, akRight, akBottom]
+    Left = 0
+    Top = 321
+    Width = 380
+    Height = 41
+    Anchors = [akLeft, akRight]
     Lines.Strings = (
       'The order text...'
@@ -123,6 +120,6 @@
     TabOrder = 1
   end
-  object cboUrgency: TORComboBox [8]
-    Left = 237
+  object cboUrgency: TORComboBox [9]
+    Left = 249
     Top = 17
     Width = 133
@@ -148,6 +145,6 @@
     CharsNeedMatch = 1
   end
-  object cboPlace: TORComboBox [9]
-    Left = 384
+  object cboPlace: TORComboBox [10]
+    Left = 396
     Top = 56
     Width = 133
@@ -173,10 +170,172 @@
     CharsNeedMatch = 1
   end
-  object txtProvDiag: TCaptionEdit [10]
-    Left = 237
+  object txtAttn: TORComboBox [11]
+    Left = 396
+    Top = 17
+    Width = 133
+    Height = 21
+    Anchors = [akTop, akRight]
+    Style = orcsDropDown
+    AutoSelect = True
+    Caption = 'Attention'
+    Color = clWindow
+    DropDownCount = 8
+    ItemHeight = 13
+    ItemTipColor = clWindow
+    ItemTipEnable = True
+    ListItemsOnly = True
+    LongList = True
+    LookupPiece = 2
+    MaxLength = 0
+    Pieces = '2,3'
+    Sorted = False
+    SynonymChars = '<>'
+    TabOrder = 3
+    OnChange = ControlChange
+    OnNeedData = txtAttnNeedData
+    CharsNeedMatch = 1
+  end
+  object cboProc: TORComboBox [12]
+    Left = 4
+    Top = 17
+    Width = 227
+    Height = 21
+    Anchors = [akLeft, akTop, akRight]
+    Style = orcsDropDown
+    AutoSelect = True
+    Caption = 'Procedure'
+    Color = clWindow
+    DropDownCount = 8
+    ItemHeight = 13
+    ItemTipColor = clWindow
+    ItemTipEnable = True
+    ListItemsOnly = True
+    LongList = True
+    LookupPiece = 0
+    MaxLength = 0
+    Pieces = '2'
+    Sorted = False
+    SynonymChars = '<>'
+    TabOrder = 0
+    OnChange = cboProcSelect
+    OnNeedData = cboProcNeedData
+    CharsNeedMatch = 1
+  end
+  object cboCategory: TORComboBox [13]
+    Left = 516
+    Top = 10
+    Width = 3
+    Height = 21
+    Style = orcsDropDown
+    AutoSelect = True
+    Color = clWindow
+    DropDownCount = 8
+    ItemHeight = 13
+    ItemTipColor = clWindow
+    ItemTipEnable = True
+    ListItemsOnly = False
+    LongList = False
+    LookupPiece = 0
+    MaxLength = 0
+    Sorted = False
+    SynonymChars = '<>'
+    TabOrder = 13
+    Visible = False
+    OnChange = ControlChange
+    CharsNeedMatch = 1
+  end
+  object cboService: TORComboBox [14]
+    Left = 4
+    Top = 58
+    Width = 227
+    Height = 21
+    Anchors = [akLeft, akTop, akRight]
+    Style = orcsDropDown
+    AutoSelect = True
+    Caption = 'Service to perform this procedure'
+    Color = clWindow
+    DropDownCount = 8
+    Enabled = False
+    ItemHeight = 13
+    ItemTipColor = clWindow
+    ItemTipEnable = True
+    ListItemsOnly = False
+    LongList = False
+    LookupPiece = 0
+    MaxLength = 0
+    Pieces = '2'
+    Sorted = False
+    SynonymChars = '<>'
+    TabOrder = 4
+    OnChange = cboServiceChange
+    CharsNeedMatch = 1
+  end
+  inherited cmdAccept: TButton
+    Left = 387
+    Top = 339
+    Anchors = [akRight, akBottom]
+    TabOrder = 10
+  end
+  inherited cmdQuit: TButton
+    Left = 469
+    Top = 339
+    Width = 64
+    Anchors = [akRight, akBottom]
+    TabOrder = 11
+  end
+  inherited pnlMessage: TPanel
+    Left = 50
+    Top = 320
+    Width = 316
+    Anchors = [akLeft, akRight, akBottom]
+    TabOrder = 12
+    inherited memMessage: TRichEdit
+      Width = 254
+    end
+  end
+  object cmdLexSearch: TButton
+    Left = 486
+    Top = 93
+    Width = 49
+    Height = 21
+    Anchors = [akTop, akRight]
+    Caption = 'Lexicon'
+    TabOrder = 8
+    OnClick = cmdLexSearchClick
+  end
+  object gbInptOpt: TGroupBox
+    Left = 249
+    Top = 36
+    Width = 140
+    Height = 45
+    Anchors = [akTop, akRight]
+    Caption = 'Patient will be seen as an:'
+    TabOrder = 5
+    object radInpatient: TRadioButton
+      Left = 3
+      Top = 20
+      Width = 61
+      Height = 17
+      Caption = '&Inpatient'
+      TabOrder = 0
+      OnClick = radInpatientClick
+    end
+    object radOutpatient: TRadioButton
+      Left = 67
+      Top = 20
+      Width = 71
+      Height = 17
+      Caption = '&Outpatient'
+      TabOrder = 1
+      OnClick = radOutpatientClick
+    end
+  end
+  object txtProvDiag: TCaptionEdit
+    Left = 249
     Top = 93
     Width = 234
     Height = 21
     Anchors = [akTop, akRight]
+    MaxLength = 180
     ParentShowHint = False
     PopupMenu = mnuPopProvDx
@@ -185,170 +344,4 @@
     OnChange = txtProvDiagChange
     Caption = 'Provisional Diagnosis'
-  end
-  object txtAttn: TORComboBox [11]
-    Left = 384
-    Top = 17
-    Width = 133
-    Height = 21
-    Anchors = [akTop, akRight]
-    Style = orcsDropDown
-    AutoSelect = True
-    Caption = 'Attention'
-    Color = clWindow
-    DropDownCount = 8
-    ItemHeight = 13
-    ItemTipColor = clWindow
-    ItemTipEnable = True
-    ListItemsOnly = True
-    LongList = True
-    LookupPiece = 2
-    MaxLength = 0
-    Pieces = '2,3'
-    Sorted = False
-    SynonymChars = '<>'
-    TabOrder = 3
-    OnChange = ControlChange
-    OnNeedData = txtAttnNeedData
-    CharsNeedMatch = 1
-  end
-  object cboProc: TORComboBox [12]
-    Left = 4
-    Top = 17
-    Width = 215
-    Height = 21
-    Anchors = [akLeft, akTop, akRight]
-    Style = orcsDropDown
-    AutoSelect = True
-    Caption = 'Procedure'
-    Color = clWindow
-    DropDownCount = 8
-    ItemHeight = 13
-    ItemTipColor = clWindow
-    ItemTipEnable = True
-    ListItemsOnly = True
-    LongList = True
-    LookupPiece = 0
-    MaxLength = 0
-    Pieces = '2'
-    Sorted = False
-    SynonymChars = '<>'
-    TabOrder = 0
-    OnChange = cboProcSelect
-    OnNeedData = cboProcNeedData
-    CharsNeedMatch = 1
-  end
-  object cboCategory: TORComboBox [13]
-    Left = 516
-    Top = 10
-    Width = 3
-    Height = 21
-    Style = orcsDropDown
-    AutoSelect = True
-    Color = clWindow
-    DropDownCount = 8
-    ItemHeight = 13
-    ItemTipColor = clWindow
-    ItemTipEnable = True
-    ListItemsOnly = False
-    LongList = False
-    LookupPiece = 0
-    MaxLength = 0
-    Sorted = False
-    SynonymChars = '<>'
-    TabOrder = 13
-    Visible = False
-    OnChange = ControlChange
-    CharsNeedMatch = 1
-  end
-  object cboService: TORComboBox [14]
-    Left = 4
-    Top = 58
-    Width = 215
-    Height = 21
-    Anchors = [akLeft, akTop, akRight]
-    Style = orcsDropDown
-    AutoSelect = True
-    Caption = 'Service to perform this procedure'
-    Color = clWindow
-    DropDownCount = 8
-    Enabled = False
-    ItemHeight = 13
-    ItemTipColor = clWindow
-    ItemTipEnable = True
-    ListItemsOnly = False
-    LongList = False
-    LookupPiece = 0
-    MaxLength = 0
-    Pieces = '2'
-    Sorted = False
-    SynonymChars = '<>'
-    TabOrder = 4
-    OnChange = cboServiceChange
-    CharsNeedMatch = 1
-  end
-  inherited cmdAccept: TButton
-    Left = 369
-    Top = 268
-    Anchors = [akRight, akBottom]
-    TabOrder = 10
-  end
-  inherited cmdQuit: TButton
-    Left = 457
-    Top = 268
-    Width = 64
-    Anchors = [akRight, akBottom]
-    TabOrder = 11
-  end
-  inherited pnlMessage: TPanel
-    Left = 50
-    Top = 249
-    Width = 304
-    Anchors = [akLeft, akRight, akBottom]
-    TabOrder = 12
-    inherited memMessage: TRichEdit
-      Width = 254
-    end
-  end
-  object cmdLexSearch: TButton
-    Left = 474
-    Top = 93
-    Width = 49
-    Height = 21
-    Anchors = [akTop, akRight]
-    Caption = 'Lexicon'
-    TabOrder = 8
-    OnClick = cmdLexSearchClick
-  end
-  object gbInptOpt: TGroupBox
-    Left = 237
-    Top = 36
-    Width = 140
-    Height = 45
-    Anchors = [akTop, akRight]
-    Caption = 'Patient will be seen as an:'
-    TabOrder = 5
-    DesignSize = (
-      140
-      45)
-    object radInpatient: TRadioButton
-      Left = 3
-      Top = 20
-      Width = 61
-      Height = 17
-      Anchors = [akTop, akRight]
-      Caption = '&Inpatient'
-      TabOrder = 0
-      OnClick = radInpatientClick
-    end
-    object radOutpatient: TRadioButton
-      Left = 67
-      Top = 20
-      Width = 71
-      Height = 17
-      Anchors = [akTop, akRight]
-      Caption = '&Outpatient'
-      TabOrder = 1
-      OnClick = radOutpatientClick
-    end
   end
   object mnuPopProvDx: TPopupMenu
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fODProc.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fODProc.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fODProc.pas	(revision 460)
@@ -12,5 +12,4 @@
     cboUrgency: TORComboBox;
     cboPlace: TORComboBox;
-    txtProvDiag: TCaptionEdit;
     txtAttn: TORComboBox;
     lblProc: TLabel;
@@ -34,8 +33,9 @@
     pnlReason: TPanel;
     memReason: TCaptionRichEdit;
-    lblReason: TLabel;
     gbInptOpt: TGroupBox;
     radInpatient: TRadioButton;
     radOutpatient: TRadioButton;
+    txtProvDiag: TCaptionEdit;
+    lblReason: TLabel;
     procedure FormCreate(Sender: TObject);
     procedure txtAttnNeedData(Sender: TObject; const StartFrom: String;
@@ -63,4 +63,6 @@
       Shift: TShiftState);
     procedure memReasonKeyPress(Sender: TObject; var Key: Char);
+    procedure FormResize(Sender: TObject);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
   private
     FLastProcID: string;
@@ -88,5 +90,5 @@
 uses
     rODBase, rConsults, uCore, uConsults, rCore, fConsults, fPCELex, rPCE, ORClasses,
-    clipbrd, fPreReq, uTemplates, uAccessibleRichEdit;
+    clipbrd, fPreReq, uTemplates, uAccessibleRichEdit, fFrame, uODBase;
 
 var
@@ -109,4 +111,5 @@
 procedure TfrmODProc.FormCreate(Sender: TObject);
 begin
+  frmFrame.pnlVisit.Enabled := false;
   AutoSizeDisabled := True;
   inherited;
@@ -709,5 +712,8 @@
   TmpSL: TStringList;
   DocInfo: string;
-begin
+  x: string;
+  HasObjects: boolean;
+begin
+  Resolve := FALSE ;  // override value passed in - resolve on client - PSI-05-093
   DocInfo := '';
   TmpSL := TStringList.Create;
@@ -715,6 +721,11 @@
     Result := GetDefaultReasonForRequest(Piece(cboProc.Items[cboProc.ItemIndex], U, 4), Resolve);
     TmpSL.Assign(Result);
+    x := TmpSL.Text;
+    ExpandOrderObjects(x, HasObjects);
+    TmpSL.Text := x;
+    Responses.OrderContainsObjects := HasObjects;
     ExecuteTemplateOrBoilerPlate(TmpSL, StrToIntDef(piece(piece(cboProc.Items[cboProc.ItemIndex],U,4),';',1),0),
                    ltProcedure, nil, 'Reason for Request: ' + cboProc.DisplayText[cboProc.ItemIndex], DocInfo);
+    if TmpSL.Text <> x then Responses.OrderContainsObjects := False;
     Result.Assign(TmpSL);
   finally
@@ -805,4 +816,17 @@
 end;
 
+procedure TfrmODProc.FormResize(Sender: TObject);
+begin
+  inherited;
+  memOrder.Top := PnlReason.Top + PnlReason.Height + 5;
+
+end;
+
+procedure TfrmODProc.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+  inherited;
+  frmFrame.pnlVisit.Enabled := true;
+end;
+
 end.
 
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/fPreReq.dfm
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/fPreReq.dfm	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/fPreReq.dfm	(revision 460)
@@ -12,5 +12,4 @@
   Font.Name = 'MS Sans Serif'
   Font.Style = []
-  FormStyle = fsStayOnTop
   OldCreateOrder = True
   Position = poScreenCenter
Index: cprs/branches/foia-cprs/CPRS-Chart/Consults/rConsults.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Consults/rConsults.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Consults/rConsults.pas	(revision 460)
@@ -4,4 +4,11 @@
 
 uses SysUtils, Classes, ORNet, ORFn, rCore, uCore, TRPCB, dialogs, uConsults, rTIU, uTIU;
+
+type
+
+  TUnresolvedConsults = record
+    UnresolvedConsultsExist: boolean;
+    ShowNagScreen: boolean;
+  end;
 
 {Consult Titles }
@@ -32,4 +39,5 @@
 function GetFormattedSF513(AConsult: Integer; ChartCopy: string): TStrings;
 function UnresolvedConsultsExist: boolean;
+procedure GetUnresolvedConsultsInfo;
 
 {list box fillers}
@@ -97,4 +105,5 @@
   uClinProcClass: integer;
   uClinProcTitles: TClinProcTitles;
+  uUnresolvedConsults: TUnresolvedConsults;
 
 implementation
@@ -602,4 +611,16 @@
 end;
 
+procedure GetUnresolvedConsultsInfo;
+var
+  x: string;
+begin
+  x := sCallV('ORQQCN UNRESOLVED', [Patient.DFN]);
+  with uUnresolvedConsults do
+  begin
+    UnresolvedConsultsExist := (Piece(x, U, 1) = '1');
+    ShowNagScreen := (Piece(x, U, 2) = '1');
+  end;
+end;
+
 function ConsultMessage(AnIEN: Integer): string;
 begin
