Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/Consults/fConsults.pas

    r459 r460  
    162162    popNoteMemoInsTemplate: TMenuItem;
    163163    popNoteMemoEncounter: TMenuItem;
     164    mnuViewInformation: TMenuItem;
     165    mnuViewDemo: TMenuItem;
     166    mnuViewVisits: TMenuItem;
     167    mnuViewPrimaryCare: TMenuItem;
     168    mnuViewMyHealtheVet: TMenuItem;
     169    mnuInsurance: TMenuItem;
     170    mnuViewFlags: TMenuItem;
     171    mnuViewReminders: TMenuItem;
     172    mnuViewRemoteData: TMenuItem;
     173    mnuViewPostings: TMenuItem;
    164174    procedure mnuChartTabClick(Sender: TObject);
    165175    procedure lstConsultsClick(Sender: TObject);
     
    267277    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
    268278      Y: Integer);
     279    procedure ViewInfo(Sender: TObject);
     280    procedure mnuViewInformationClick(Sender: TObject);
    269281  private
    270282    FEditingIndex: Integer;      // TIU index of document being currently edited
     
    296308    procedure frmDrawerPnlEncounterButtonExit(Sender: TObject);
    297309    procedure frmDrawerEdtSearchExit(Sender: TObject);
    298     procedure DoAutoSave;
     310    procedure DoAutoSave(Suppress: integer = 1);
    299311    function GetTitleText(AnIndex: Integer): string;
    300312    //function MakeTitleText(IsAddendum: Boolean = False): string;
     
    870882            lstNotesClick(Self);  // will make pnlWrite visible
    871883            if timAutoSave.Interval <> 0 then EnableAutosave := TRUE;
    872 
    873             if txtSubject.Visible then
    874               txtSubject.SetFocus
    875             else
    876               memResults.SetFocus;
     884            if txtSubject.Visible then txtSubject.SetFocus else memResults.SetFocus;
    877885          end
    878886        else  //  CreatedNote.ErrorText <> ''
     
    947955    else HaveRequired := True;
    948956  // lock the consult request if there is a consult
    949   if FEditNote.PkgIEN > 0 then HaveRequired := LockConsultRequest(FEditNote.PkgIEN);
     957  if HaveRequired and (FEditNote.PkgIEN > 0) then
     958    HaveRequired := LockConsultRequest(FEditNote.PkgIEN);
    950959  if HaveRequired then
    951960  begin
     
    15291538      CompleteConsult(IS_ID_CHILD, 0, UseClinProcTitles);
    15301539    end
    1531   else if NoteIEN = -1 then Exit;
     1540  else if NoteIEN = -1 then Exit
    15321541end;
    15331542
     
    20032012procedure TfrmConsults.SaveSignItem(const ItemID, ESCode: string);
    20042013{ saves and optionally signs a progress note or addendum }
     2014const
     2015  SIG_COSIGN = 'COSIGNATURE';
     2016  SIG_SIGN   = 'SIGNATURE';
    20052017var
    20062018  AnIndex, IEN, i: Integer;
    20072019  Saved, ContinueSign: Boolean;  {*RAB* 8/26/99}
    2008   SignSts: TActionRec;
     2020  ActionSts, SignSts: TActionRec;
    20092021  APCEObject: TPCEData;
    20102022  OK: boolean;
     
    20122024  tmpNode: TORTreeNode;
    20132025  ErrMsg: string;
     2026  ActionType, SignTitle: string;
    20142027begin
    20152028  AnIndex := -1;
     
    20392052  if Length(ESCode) > 0 then
    20402053  begin
    2041 (*    if LacksClinProcFieldsForSignature(IEN, ErrMsg) then
    2042        begin
    2043          InfoBox(ErrMsg, TC_CLIN_PROC, MB_OK);
    2044          ContinueSign := False;
    2045        end
    2046     else ContinueSign := True;
    2047     if not LastSaveClean(IEN) and
    2048       (InfoBox(TX_ABSAVE, TC_ABSAVE, MB_YESNO or MB_DEFBUTTON2) <> IDYES)
    2049        then ContinueSign := False;
    2050        //else ContinueSign := True;*)
    2051     if LacksClinProcFieldsForSignature(IEN, ErrMsg) then
     2054    if CosignDocument(IEN) then
     2055    begin
     2056      SignTitle := TX_COSIGN;
     2057      ActionType := SIG_COSIGN;
     2058    end else
     2059    begin
     2060      SignTitle := TX_SIGN;
     2061      ActionType := SIG_SIGN;
     2062    end;
     2063    ActOnDocument(ActionSts, IEN, ActionType);
     2064    if not ActionSts.Success then
     2065      begin
     2066        InfoBox(ActionSts.Reason, TX_IN_AUTH, MB_OK);
     2067        ContinueSign := False;
     2068      end
     2069    else if LacksClinProcFieldsForSignature(IEN, ErrMsg) then
    20522070      begin
    20532071       InfoBox(ErrMsg, TC_CLIN_PROC, MB_OK);
     
    20632081       then ContinueSign := False
    20642082    else ContinueSign := True;
    2065 
    20662083    if ContinueSign then
    20672084    begin
     
    27532770begin
    27542771  inherited;
    2755   DoAutoSave;
     2772  DoAutoSave(0);
    27562773  timAutoSave.Enabled := False;
    27572774  try
    27582775    SpellCheckForControl(memResults);
    27592776  finally
     2777    FChanged := True;
     2778    DoAutoSave(0);
    27602779    timAutoSave.Enabled := True;
    27612780  end;
     
    27652784begin
    27662785  inherited;
    2767   DoAutoSave;
     2786  DoAutoSave(0);
    27682787  timAutoSave.Enabled := False;
    27692788  try
    27702789    GrammarCheckForControl(memResults);
    27712790  finally
     2791    FChanged := True;
     2792    DoAutoSave(0);
    27722793    timAutoSave.Enabled := True;
    27732794  end;
     
    29853006  SigAction: integer;
    29863007  SavedDocID, SavedCsltID: string;
     3008  ARefDate: TFMDateTime;
    29873009begin
    29883010  inherited;
     
    30173039    end;
    30183040
    3019   if not LockConsultRequestAndNote(lstNotes.ItemIEN) then Exit;
    3020   Exclusions := GetCurrentSigners(lstNotes.ItemIEN);
    3021   SelectAdditionalSigners(Font.Size, lstNotes.ItemIEN, SigAction, Exclusions, SignerList, CT_CONSULTS);
     3041  with lstNotes do
     3042    begin
     3043      if not LockConsultRequestAndNote(ItemIEN) then Exit;
     3044      Exclusions := GetCurrentSigners(ItemIEN);
     3045      ARefDate := StrToFloat(Piece(Items[ItemIndex], U, 3));
     3046      SelectAdditionalSigners(Font.Size, ItemIEN, SigAction, Exclusions, SignerList, CT_CONSULTS, ARefDate);
     3047    end;
    30223048  with SignerList do
    30233049    begin
     
    35563582    begin
    35573583      if Title > 0 then CurTitle := Title else CurTitle := DocType;
    3558       if AskCosignerForTitle(CurTitle, Author) and (Cosigner <= 0) then Result := True;
     3584      if AskCosignerForTitle(CurTitle, Author, DateTime) and (Cosigner <= 0) then Result := True;
    35593585    end;
    35603586  end;
     
    35723598          ErrMsg := TX_NO_AUTHOR;
    35733599        end;
    3574       if AskCosignerForTitle(Title, Author) and (Cosigner = 0) then
     3600      if AskCosignerForTitle(Title, Author, DateTime) and (Cosigner = 0) then
    35753601        begin
    35763602          Result := True;
     
    36653691end;
    36663692
    3667 procedure TfrmConsults.DoAutoSave;
     3693procedure TfrmConsults.DoAutoSave(Suppress: integer = 1);
    36683694var
    36693695  ErrMsg: string;
     
    36723698  begin
    36733699    StatusText('Autosaving note...');
    3674     //PutTextOnly(ErrMsg, memNewNote.Lines, lstNotes.GetIEN(EditingIndex));
     3700    //PutTextOnly(ErrMsg, memResults.Lines, lstNotes.GetIEN(EditingIndex));
    36753701    timAutoSave.Enabled := False;
    36763702    try
    3677       SetText(ErrMsg, memResults.Lines, lstNotes.GetIEN(EditingIndex),1);
     3703      SetText(ErrMsg, memResults.Lines, lstNotes.GetIEN(EditingIndex), Suppress);
    36783704    finally
    36793705      timAutoSave.Enabled := True;
     
    46824708        (Screen.ActiveControl = txtSubject) or
    46834709        (Screen.ActiveControl = memResults) then
    4684       //frmFrame.pnlPatient.SetFocus  //COMMENTED OUT FOR CQ6498
    4685       memResults.SetFocus //ADDED THIS LINE FOR CQ6498
     4710      begin
     4711        //frmFrame.pnlPatient.SetFocus  //COMMENTED OUT FOR CQ6498
     4712        if memResults.CanFocus then
     4713          memResults.SetFocus //ADDED THIS LINE FOR CQ6498
     4714        else
     4715          memConsult.SetFocus;
     4716      end
    46864717    else
    46874718    if (Screen.ActiveControl = tvConsults) then
     
    47294760  {Below is a fix for ClearQuest Defect HDS0000948, Kind of Kloogy I looked
    47304761  and looked for side effects and a better solution and this was the best!}
    4731   frmDrawers.Hide;
     4762  if (EditingIndex = -1) or (lstNotes.ItemIndex <> EditingIndex) then
     4763    frmDrawers.Hide;
    47324764  {This TStaticText I am looking for doesn't have a Name! So
    47334765   I have to loop through the panel's controls and disable the TStaticText.}
     
    47684800end;
    47694801
     4802procedure TfrmConsults.ViewInfo(Sender: TObject);
     4803begin
     4804  inherited;
     4805  frmFrame.ViewInfo(Sender);
     4806end;
     4807
     4808procedure TfrmConsults.mnuViewInformationClick(Sender: TObject);
     4809begin
     4810  inherited;
     4811  mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled;
     4812  mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled;
     4813  mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled;
     4814  mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No');
     4815  mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No');
     4816  mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled;
     4817  mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled;
     4818  mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled;
     4819  mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled;
     4820end;
     4821
    47704822initialization
    47714823  uPCEEdit := TPCEData.Create;
Note: See TracChangeset for help on using the changeset viewer.