Procedure

TfrmConsults.mnuActSignatureListClick

Module

fConsults

Last Modified

7/15/2014 3:26:34 PM

Comments

Add the note to the Encounter object, see mnuActSignatureSignClick - copied

Visibility

Public/Published

Owner

TfrmConsults

Declaration

procedure mnuActSignatureListClick(Sender: TObject);

Calls Hierarchy


TfrmConsults.mnuActSignatureListClick
 ├TfrmConsults.LacksClinProcFieldsForSignature
 │ ├GetConsultIENforNote
 │ ├GetActionMenuLevel
 │ │ └ConsultCanBeResubmitted
 │ ├IsClinProcTitle
 │ ├TitleForNote
 │ ├GetSavedCPFields
 │ │ └StrToFMDateTime
 │ └TfrmConsults.LacksClinProcFields
 │   └AskCosignerForTitle
 │     └TIUPatch175Installed
 │       └ServerHasPatch
 ├NoteHasText
 ├LastSaveClean
 ├CosignDocument
 ├ActOnDocument
 ├TfrmConsults.LockConsultRequestAndNote
 │ ├TfrmNotes.ActiveEditOf
 │ ├TChanges.Exist
 │ ├IsConsultTitle
 │ ├TitleForNote
 │ ├GetPackageRefForNote
 │ ├TfrmConsults.LockConsultRequest
 │ │ ├GetConsultOrderIEN
 │ │ ├TfrmNotes.ActiveEditOf
 │ │ └OrderCanBeLocked
 │ │   └LockOrder
 │ ├LockDocument
 │ └UnlockOrderIfAble
 │   └UnlockOrder
 ├TChanges.Add
 │ └TChangeItem.Create
 └TfrmConsults.GetTitleText
   └MakeConsultNoteDisplayText

Calls

Name Declaration Comments
ActOnDocument procedure ActOnDocument(var AuthSts: TActionRec; IEN: Integer; const ActionName: string); -
TChanges.Add procedure Add(ItemType: Integer; const AnID, ItemText, GroupName: string; SignState: Integer; AParentID: string = ''; User: int64 = 0; OrderDG: String = ''; DCOrder: Boolean = False; Delay: Boolean = False; ProblemAdded: Boolean = False); -
CosignDocument function CosignDocument(IEN: Integer): Boolean; -
TfrmConsults.GetTitleText function GetTitleText(AnIndex: Integer): string; -
TfrmConsults.LacksClinProcFieldsForSignature function LacksClinProcFieldsForSignature(NoteIEN: int64; var ErrMsg: string): boolean; -
LastSaveClean function LastSaveClean(IEN: Int64): Boolean; -
TfrmConsults.LockConsultRequestAndNote function LockConsultRequestAndNote(AnIEN: Int64): Boolean; -
NoteHasText function NoteHasText(NoteIEN: integer): boolean; -


Source

1706  procedure TfrmConsults.mnuActSignatureListClick(Sender: TObject);
1707  { add the note to the Encounter object, see mnuActSignatureSignClick - copied}
1708  const
1709    SIG_COSIGN = 'COSIGNATURE';
1710    SIG_SIGN   = 'SIGNATURE';
1711  var
1712    ActionType, SignTitle: string;
1713    ActionSts: TActionRec;
1714    ErrMsg: string;
1715  begin
1716    inherited;
1717    if lstNotes.ItemIEN = 0 then Exit;
1718    if lstNotes.ItemIndex = EditingIndex then Exit;  // already in signature list
1719    if LacksClinProcFieldsForSignature(lstNotes.ItemIEN, ErrMsg) then
1720       begin
1721         InfoBox(ErrMsg, TC_CLIN_PROC, MB_OK);
1722         Exit;
1723       end;
1724    if not NoteHasText(lstNotes.ItemIEN) then
1725      begin
1726        InfoBox(TX_EMPTY_NOTE1, TC_EMPTY_NOTE, MB_OK or MB_ICONERROR);
1727        Exit;
1728      end;
1729    if not LastSaveClean(lstNotes.ItemIEN) and
1730      (InfoBox(TX_ABSAVE, TC_ABSAVE, MB_YESNO or MB_DEFBUTTON2 or MB_ICONWARNING) <> IDYES) then Exit;
1731    if CosignDocument(lstNotes.ItemIEN) then
1732    begin
1733      SignTitle := TX_COSIGN;
1734      ActionType := SIG_COSIGN;
1735    end else
1736    begin
1737      SignTitle := TX_SIGN;
1738      ActionType := SIG_SIGN;
1739    end;
1740    ActOnDocument(ActionSts, lstNotes.ItemIEN, ActionType);
1741    if not ActionSts.Success then
1742    begin
1743      InfoBox(ActionSts.Reason, TX_IN_AUTH, MB_OK);
1744      Exit;
1745    end;
1746    LockConsultRequestAndNote(lstNotes.ItemIEN);
1747    with lstNotes do Changes.Add(CH_CON, ItemID, GetTitleText(ItemIndex), '', CH_SIGN_YES);
1748  end;