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/fDCSumm.pas

    r459 r460  
    134134    popSummMemoInsTemplate: TMenuItem;
    135135    popSummMemoEncounter: TMenuItem;
     136    mnuViewInformation: TMenuItem;
     137    mnuViewDemo: TMenuItem;
     138    mnuViewVisits: TMenuItem;
     139    mnuViewPrimaryCare: TMenuItem;
     140    mnuViewMyHealtheVet: TMenuItem;
     141    mnuInsurance: TMenuItem;
     142    mnuViewFlags: TMenuItem;
     143    mnuViewReminders: TMenuItem;
     144    mnuViewRemoteData: TMenuItem;
     145    mnuViewPostings: TMenuItem;
    136146    procedure mnuChartTabClick(Sender: TObject);
    137147    procedure lstSummsClick(Sender: TObject);
     
    211221    procedure tvSummsAddition(Sender: TObject; Node: TTreeNode);
    212222    procedure tvSummsDeletion(Sender: TObject; Node: TTreeNode);
     223    procedure ViewInfo(Sender: TObject);
     224    procedure mnuViewInformationClick(Sender: TObject);
    213225  private
    214226    FEditingIndex: Integer;                      // index of Summary being currently edited
     
    230242    procedure ClearEditControls;
    231243    function StartNewEdit(NewNoteType: integer): Boolean;
    232     procedure DoAutoSave;
     244    procedure DoAutoSave(Suppress: integer = 1);
    233245    function LacksRequiredForCreate: Boolean;
    234246    function GetTitleText(AnIndex: Integer): string;
     
    17261738procedure TfrmDCSumm.SaveSignItem(const ItemID, ESCode: string);
    17271739{ saves and optionally signs a Discharge Summary or addendum }
     1740const
     1741  SIG_COSIGN = 'COSIGNATURE';
     1742  SIG_SIGN   = 'SIGNATURE';
    17281743var
    17291744  AnIndex, IEN, i: Integer;
    17301745  Saved, ContinueSign: Boolean;   {*RAB* 8/26/99}
    1731   SignSts: TActionRec;
     1746  ActionSts, SignSts: TActionRec;
    17321747  APCEObject: TPCEData;
    17331748  OK: boolean;
    1734 
     1749  ActionType, SignTitle: string;
    17351750begin
    17361751  AnIndex := -1;
     
    17571772  if Length(ESCode) > 0 then
    17581773  begin
    1759     if not NoteHasText(IEN) then
     1774    if CosignDocument(IEN) then
     1775    begin
     1776      SignTitle := TX_COSIGN;
     1777      ActionType := SIG_COSIGN;
     1778    end else
     1779    begin
     1780      SignTitle := TX_SIGN;
     1781      ActionType := SIG_SIGN;
     1782    end;
     1783    ActOnDocument(ActionSts, IEN, ActionType);
     1784    if not ActionSts.Success then
     1785      begin
     1786        InfoBox(ActionSts.Reason, TX_IN_AUTH, MB_OK);
     1787        ContinueSign := False;
     1788      end
     1789    else if not NoteHasText(IEN) then
    17601790      begin
    17611791        InfoBox(TX_EMPTY_SUMM1, TC_EMPTY_SUMM, MB_OK or MB_ICONERROR);
     
    19101940begin
    19111941  inherited;
    1912   DoAutoSave;
     1942  DoAutoSave(0);
    19131943  timAutoSave.Enabled := False;
    19141944  try
    19151945    SpellCheckForControl(memNewSumm);
    19161946  finally
     1947    FChanged := True;
     1948    DoAutoSave(0);
    19171949    timAutoSave.Enabled := True;
    19181950  end;
     
    19221954begin
    19231955  inherited;
    1924   DoAutoSave;
     1956  DoAutoSave(0);
    19251957  timAutoSave.Enabled := False;
    19261958  try
    19271959    GrammarCheckForControl(memNewSumm);
    19281960  finally
     1961    FChanged := True;
     1962    DoAutoSave(0);
    19291963    timAutoSave.Enabled := True;
    19301964  end;
     
    20132047  SigAction: integer;
    20142048  SavedDocID: string;
     2049  ARefDate: TFMDateTime;
    20152050begin
    20162051  inherited;
     
    20522087
    20532088  Exclusions := GetCurrentSigners(lstSumms.ItemIEN);
    2054   SelectAdditionalSigners(Font.Size, lstSumms.ItemIEN, SigAction, Exclusions, SignerList, CT_DCSUMM);
     2089  ARefDate := ExtractFloat(Piece(Piece(lstSumms.Items[lstSumms.ItemIndex], U, 9), ';', 2));
     2090  if ARefDate = 0 then        //no discharge date, so use note date
     2091    ARefDate := StrToFloat(Piece(lstSumms.Items[lstSumms.ItemIndex], U, 3));
     2092  SelectAdditionalSigners(Font.Size, lstSumms.ItemIEN, SigAction, Exclusions, SignerList, CT_DCSUMM, ARefDate);
    20552093  with SignerList do
    20562094    begin
     
    23082346var
    23092347  CurTitle: Integer;
     2348  ADateTime:  TFMDateTime;
    23102349begin
    23112350  Result := False;
     
    23212360    begin
    23222361      if Title > 0 then CurTitle := Title else CurTitle := DocType;
    2323       if AskCosignerForTitle(CurTitle, Dictator) and (Cosigner <= 0) then Result := True;
     2362      if DischargeDateTime > 0 then
     2363        ADateTime := DischargeDateTime
     2364      else
     2365        ADateTime := DictDateTime;
     2366      if AskCosignerForTitle(CurTitle, Dictator, ADateTime) and (Cosigner <= 0) then Result := True;
    23242367    end;
    23252368  end;
     
    23572400end;
    23582401
    2359 procedure TfrmDCSumm.DoAutoSave;
     2402procedure TfrmDCSumm.DoAutoSave(Suppress: integer = 1);
    23602403var
    23612404  ErrMsg: string;
     
    23672410    timAutoSave.Enabled := False;
    23682411    try
    2369       SetText(ErrMsg, memNewSumm.Lines, lstSumms.GetIEN(EditingIndex),1);
     2412      SetText(ErrMsg, memNewSumm.Lines, lstSumms.GetIEN(EditingIndex), Suppress);
    23702413    finally
    23712414      timAutoSave.Enabled := True;
     
    32163259end;
    32173260
     3261procedure TfrmDCSumm.ViewInfo(Sender: TObject);
     3262begin
     3263  inherited;
     3264  frmFrame.ViewInfo(Sender);
     3265end;
     3266
     3267procedure TfrmDCSumm.mnuViewInformationClick(Sender: TObject);
     3268begin
     3269  inherited;
     3270  mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled;
     3271  mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled;
     3272  mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled;
     3273  mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No');
     3274  mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No');
     3275  mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled;
     3276  mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled;
     3277  mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled;
     3278  mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled;
     3279end;
     3280
    32183281initialization
    32193282  uPCEEdit := TPCEData.Create;
Note: See TracChangeset for help on using the changeset viewer.