Procedure

TfrmSurgery.mnuActSignListClick

Module

fSurgery

Last Modified

7/15/2014 3:26:38 PM

Comments

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

Visibility

Public/Published

Owner

TfrmSurgery

Declaration

procedure mnuActSignListClick(Sender: TObject);

Calls Hierarchy


TfrmSurgery.mnuActSignListClick
 ├NoteHasText
 ├LastSaveClean
 ├CosignDocument
 ├ActOnDocument
 ├TChanges.Add
 │ └TChangeItem.Create
 └TfrmSurgery.GetTitleText

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; -
TfrmSurgery.GetTitleText function GetTitleText(AnIndex: Integer): string; -
LastSaveClean function LastSaveClean(IEN: Int64): Boolean; -
NoteHasText function NoteHasText(NoteIEN: integer): boolean; -


Source

1497  procedure TfrmSurgery.mnuActSignListClick(Sender: TObject);
1498  { add the note to the Encounter object, see mnuActSignClick - copied}
1499  const
1500    SIG_COSIGN = 'COSIGNATURE';
1501    SIG_SIGN   = 'SIGNATURE';
1502  var
1503    ActionType, SignTitle: string;
1504    ActionSts: TActionRec;
1505  begin
1506    inherited;
1507    if lstNotes.ItemIEN = 0 then Exit;
1508    if lstNotes.ItemIndex = EditingIndex then Exit;  // already in signature list
1509    if not NoteHasText(lstNotes.ItemIEN) then
1510      begin
1511        InfoBox(TX_EMPTY_NOTE1, TC_EMPTY_NOTE, MB_OK or MB_ICONERROR);
1512        Exit;
1513      end;
1514    if not LastSaveClean(lstNotes.ItemIEN) and
1515      (InfoBox(TX_ABSAVE, TC_ABSAVE, MB_YESNO or MB_DEFBUTTON2 or MB_ICONWARNING) <> IDYES) then Exit;
1516    if CosignDocument(lstNotes.ItemIEN) then
1517    begin
1518      SignTitle := TX_COSIGN;
1519      ActionType := SIG_COSIGN;
1520    end else
1521    begin
1522      SignTitle := TX_SIGN;
1523      ActionType := SIG_SIGN;
1524    end;
1525    ActOnDocument(ActionSts, lstNotes.ItemIEN, ActionType);
1526    if not ActionSts.Success then
1527    begin
1528      InfoBox(ActionSts.Reason, TX_IN_AUTH, MB_OK);
1529      Exit;
1530    end;
1531    with lstNotes do Changes.Add(CH_SUR, ItemID, GetTitleText(ItemIndex), '', CH_SIGN_YES);
1532  end;