Procedure

TChanges.AddUnsignedToChanges

Module

uCore

Last Modified

7/15/2014 3:26:44 PM

Comments

Retrieves unsigned orders outside this session based on OR UNSIGNED ORDERS ON EXIT

Visibility

Private

Owner

TChanges

Declaration

procedure AddUnsignedToChanges;

Calls Hierarchy


TChanges.AddUnsignedToChanges
 ├LoadUnsignedOrders
 ├TChanges.Add
 │ └TChangeItem.Create
 └TextForOrder

Called-By Hierarchy


                  TChanges.AddUnsignedToChanges
                       TChanges.RequireReview┘ 
            TfrmFrame.AllowContextChangeAll┤   
                 TfrmFrame.FormCloseQuery┤ │   
               TfrmFrame.mnuFileNextClick┤ │   
             TfrmFrame.mnuFileOpenClick┤ │ │   
                 TfrmFrame.UMInitiate┤ │ │ │   
        TfrmFrame.mnuFileNextClick...┤ │ │ │   
        TfrmFrame.mnuFileRefreshClick┤ │ │ │   
        TfrmOrders.CheckOrderStatus┤ │ │ │ │   
    TfrmOrders.mnuActChgEvntClick┤ │ │ │ │ │   
       TfrmOrders.mnuActHoldClick┤ │ │ │ │ │   
     TfrmOrders.mnuActUnholdClick┤ │ │ │ │ │   
      TfrmOrders.mnuActRenewClick┤ │ │ │ │ │   
     TfrmOrders.mnuActChangeClick┤ │ │ │ │ │   
       TfrmOrders.mnuActCopyClick┘ │ │ │ │ │   
             TfrmMeds.mnuActDCClick┤ │ │ │ │   
            TfrmMeds.CheckMedStatus┘ │ │ │ │   
         TfrmMeds.mnuActHoldClick┤   │ │ │ │   
        TfrmMeds.mnuActRenewClick┤   │ │ │ │   
       TfrmMeds.mnuActUnholdClick┤   │ │ │ │   
       TfrmMeds.mnuActChangeClick┤   │ │ │ │   
         TfrmMeds.mnuActCopyClick┤   │ │ │ │   
       TfrmMeds.mnuActRefillClick┘   │ │ │ │   
                   TfrmFrame.ViewInfo┘ │ │ │   
                TfrmDCSumm.ViewInfo┤   │ │ │   
              TfrmConsults.ViewInfo┤   │ │ │   
      TfrmFrame.pnlRemindersMouseUp┤   │ │ │   
       TfrmFrame.RemindersChanged┘ │   │ │ │   
           TfrmFrame.FormCreate┘   │   │ │ │   
             TfrmFrame.pnlCIRNClick┤   │ │ │   
       TfrmFrame.pnlVistaWebClick┤ │   │ │ │   
            TfrmFrame.FormKeyDown┘ │   │ │ │   
          TfrmFrame.pnlPatientClick┤   │ │ │   
            TfrmFrame.pnlVisitClick┤   │ │ │   
      TfrmFrame.pnlPrimaryCareClick┤   │ │ │   
        TfrmFrame.pnlRemindersClick┤   │ │ │   
         TfrmFrame.pnlPostingsClick┤   │ │ │   
             TfrmFrame.pnlFlagClick┤   │ │ │   
               TfrmFrame.laMHVClick┤   │ │ │   
              TfrmFrame.laVAA2Click┤   │ │ │   
                TfrmOrders.ViewInfo┤   │ │ │   
                  TfrmMeds.ViewInfo┤   │ │ │   
               TfrmSurgery.ViewInfo┤   │ │ │   
                 TfrmNotes.ViewInfo┤   │ │ │   
              TfrmProblems.ViewInfo┘   │ │ │   
      TfrmFrame.mnuFileNotifRemoveClick┤ │ │   
              TfrmFrame.NextButtonClick┘ │ │   
            TfrmFrame.SetUpNextButton┘   │ │   
      TfrmFrame.mnuFileOpenClick...┤     │ │   
               TfrmFrame.FormResize┘     │ │   
             TfrmFrame.ChangeFont┘       │ │   
     TfrmFrame.LoadSizesForUser┤         │ │   
TfrmFrame.LoadUserPreferences┘ │         │ │   
       TfrmFrame.UMInitiate┘   │         │ │   
     TfrmFrame.mnuFontSizeClick┘         │ │   
            TfrmFrame.mnuFileOpenClick...┤ │   
            TfrmFrame.ctxContextorPending┤ │   
           TfrmFrame.StartCCOWContextor┘ │ │   
                 TfrmFrame.FormCreate┘   │ │   
          TfrmFrame.ctxContextorCommitted┤ │   
        TfrmFrame.StartCCOWContextor...┘ │ │   
   TfrmFrame.mnuFileResumeContextGetClick┤ │   
   TfrmFrame.mnuFileResumeContextSetClick┘ │   
                   TfrmFrame.FormCloseQuery┘   

Calls

Name Declaration Comments
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); -
LoadUnsignedOrders procedure LoadUnsignedOrders(IDList, HaveList: TStrings); -
TextForOrder function TextForOrder(const ID: string): string; -

Called-By

Name Declaration Comments
TChanges.RequireReview function RequireReview: Boolean; -


Source

1401  procedure TChanges.AddUnsignedToChanges;
1402  { retrieves unsigned orders outside this session based on OR UNSIGNED ORDERS ON EXIT }
1403  var
1404    i, CanSign(*, OrderUser*): Integer;
1405    OrderUser: int64;
1406    AnID, Display: string;
1407    HaveOrders, OtherOrders: TStringList;
1408    AChangeItem: TChangeItem;
1409    IsDiscontinue, IsDelay: boolean;
1410  begin
1411    if Patient.DFN = '' then Exit;
1412    // exit if there is already an 'Other Unsigned' group?
1413    HaveOrders  := TStringList.Create;
1414    OtherOrders := TStringList.Create;
1415    try
1416      StatusText('Looking for unsigned orders...');
1417      for i := 0 to Pred(fOrders.Count) do
1418      begin
1419        AChangeItem := fOrders[i];
1420        HaveOrders.Add(AChangeItem.ID);
1421      end;
1422      LoadUnsignedOrders(OtherOrders, HaveOrders);
1423      if (Encounter.Provider = User.DUZ) and User.CanSignOrders
1424        then CanSign := CH_SIGN_YES
1425        else CanSign := CH_SIGN_NA;
1426      for i := 0 to Pred(OtherOrders.Count) do
1427      begin
1428        AnID := Piece(OtherOrders[i],U,1);
1429        if Piece(OtherOrders[i],U,2) = '' then OrderUser := 0
1430        else OrderUser := StrtoInt64(Piece(OtherOrders[i],U,2));
1431        //agp change the M code to pass back the value for the new order properties
1432        Display := Piece(OtherOrders[i],U,3);
1433        if Piece(OtherOrders[i],U,4) = '1' then  IsDiscontinue := True
1434        else IsDiscontinue := False;
1435        if Piece(OtherOrders[i],U,5) = '1' then  IsDelay := True
1436        else IsDelay := False;
1437        Add(CH_ORD, AnID, TextForOrder(AnID), 'Other Unsigned', CanSign,'', OrderUser, Display, IsDiscontinue, IsDelay);
1438      end;
1439    finally
1440      StatusText('');
1441      HaveOrders.Free;
1442      OtherOrders.Free;
1443    end;
1444  end;