Ignore:
Timestamp:
Jul 7, 2010, 4:31:10 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Upgrade to version 27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/Orders/fODBase.pas

    r456 r829  
    88  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, fAutoSz, StdCtrls,
    99  ORCtrls, ORFn, uConst, rOrders, rODBase, uCore, ComCtrls, ExtCtrls, Menus, Mask,
    10   Buttons, UBAGlobals, UBACore;
     10  Buttons, UBAGlobals, UBACore, VA508AccessibilityManager;
    1111
    1212type
     
    182182    procedure SetDialogIEN(Value: Integer); virtual;
    183183    procedure Validate(var AnErrMsg: string); virtual;
     184    procedure updateSig; virtual;
    184185    function ValidSave: Boolean;
    185186    procedure ShowOrderMessage(Show: boolean);
     
    221222
    222223var
    223   frmODBase: TfrmODBase;
     224  frmODBase: TfrmODBase = nil;
    224225  XfInToOutNow :boolean = False;       // it's used only for transfering Inpatient Meds to OutPatient Med for
    225226                                       // immediately release (NO EVENT DELAY)
     
    246247uses fOCAccept, uODBase, rCore, rMisc, fODMessage,
    247248  fTemplateDialog, uEventHooks, uTemplates, rConsults,fOrders,uOrders,
    248   fFrame, uTemplateFields, fClinicWardMeds;
     249  fFrame, uTemplateFields, fClinicWardMeds, fODDietLT, rODDiet, VAUtils;
    249250
    250251const
     
    425426  else if AControl is TButton then with TButton(AControl) do Caption := CtrlInit.Text
    426427  else if AControl is TEdit then with TEdit(AControl) do Text := CtrlInit.Text
    427   else if AControl is TMemo then with TMemo(AControl) do Lines.Assign(CtrlInit.List)
    428   else if AControl is TRichEdit then with TRichEdit(AControl) do Lines.Assign(CtrlInit.List)
    429   else if AControl is TORListBox then with TORListBox(AControl) do Items.Assign(CtrlInit.List)
    430   else if AControl is TListBox then with TListBox(AControl) do Items.Assign(CtrlInit.List)
     428  else if AControl is TMemo then FastAssign(CtrlInit.List, TMemo(AControl).Lines)
     429  else if AControl is TRichEdit then QuickCopy(CtrlInit.List, TRichEdit(AControl))
     430  else if AControl is TORListBox then FastAssign(CtrlInit.List, TORListBox(AControl).Items)
     431  else if AControl is TListBox then FastAssign(CtrlInit.List, TListBox(AControl).Items)
    431432  else if AControl is TComboBox then with TComboBox(AControl) do
    432433  begin
    433     Items.Assign(CtrlInit.List);
     434    FastAssign(CtrlInit.List, TComboBox(AControl).Items);
    434435    Text := CtrlInit.Text;
    435436  end
    436437  else if AControl is TORComboBox then with TORComboBox(AControl) do
    437438  begin
    438     Items.Assign(CtrlInit.List);
     439    FastAssign(CtrlInit.List, TORComboBox(AControl).Items);
    439440    if LongList then InitLongList(Text) else Text := CtrlInit.Text;
    440441    SelectByID(CtrlInit.ListID);
     
    450451  CtrlInit := FindInitByName(ASection);
    451452  if CtrlInit = nil then Exit;
    452   if      AControl is TMemo       then with TMemo(AControl)       do Lines.Assign(CtrlInit.List)
    453   else if AControl is TORListBox  then with TORListBox(AControl)  do Items.Assign(CtrlInit.List)
    454   else if AControl is TListBox    then with TListBox(AControl)    do Items.Assign(CtrlInit.List)
    455   else if AControl is TComboBox   then with TComboBox(AControl)   do Items.Assign(CtrlInit.List)
    456   else if AControl is TORComboBox then with TORComboBox(AControl) do Items.Assign(CtrlInit.List);
     453  if      AControl is TMemo       then FastAssign(CtrlInit.List, TMemo(AControl).Lines)
     454  else if AControl is TORListBox  then FastAssign(CtrlInit.List, TORListBox(AControl).Items)
     455  else if AControl is TListBox    then FastAssign(CtrlInit.List, TListBox(AControl).Items)
     456  else if AControl is TComboBox   then FastAssign(CtrlInit.List, TComboBox(AControl).Items)
     457  else if AControl is TORComboBox then FastAssign(CtrlInit.List, TORComboBox(AControl).Items);
    457458end;
    458459
     
    10281029    //AGP Text orders are only treated as IMO if the order display group is a nursing display group
    10291030    if (Patient.Inpatient = False) and (IsValidIMOLoc(encounter.Location,Patient.DFN)=true) and
    1030        (((pos('OR GXTEXT WORD PROCESSING ORDE',ConstructOrder.DialogName)>0) and (ConstructOrder.DGroup = NurDisp)) or
     1031       (((pos('OR GXTEXT WORD PROCESSING ORDER',ConstructOrder.DialogName)>0) and (ConstructOrder.DGroup = NurDisp)) or
    10311032       ((ConstructOrder.DialogName = 'OR GXMISC GENERAL') and (ConstructOrder.DGroup = NurDisp)) or
    10321033       ((ConstructOrder.DialogName = 'OR GXTEXT TEXT ONLY ORDER') and (ConstructOrder.DGroup = NurDisp))) and //AGP Change CQ #10757
     
    11441145        //  CheckBoilerplate4Fields(tmp, cptn)
    11451146        //else
    1146           ExecuteTemplateOrBoilerPlate(tmp, IEN, LType, nil, cptn, DocInfo);
     1147
     1148        // CQ #11669 - changing an existing order shouldn't restart template - JM
     1149          if assigned(frmODBase) and (frmODBase.FOrderAction = ORDER_EDIT) then
     1150            CheckBoilerplate4Fields(tmp, cptn)
     1151          else
     1152            ExecuteTemplateOrBoilerPlate(tmp, IEN, LType, nil, cptn, DocInfo);
    11471153      end
    11481154    else
     
    13911397begin
    13921398  inherited;
    1393   memOrder.Color := ReadOnlyColor;
     1399  frmODBase   := Self;
    13941400  FAcceptOK   := False;
    13951401  FAutoAccept := False;
     
    14201426  FEvtType   := OrderEventTypeOnCreate;
    14211427  FEvtName   := OrderEventNameOnCreate;
     1428  DefaultButton := cmdAccept;
    14221429end;
    14231430
    14241431procedure TfrmODBase.FormDestroy(Sender: TObject);
    14251432begin
     1433  frmODBase := nil;
    14261434  FCtrlInits.Free;
    14271435  FResponses.Free;
     
    14781486  NewOrder: TOrder;
    14791487  CanSign, OrderAction: Integer;
     1488  IsDelayOrder: boolean;
    14801489  //thisSourceOrder: TOrder;
    14811490begin
    14821491  Result := True;
    14831492  Validate(ErrMsg);
     1493  IsDelayOrder := False;
    14841494  if Length(ErrMsg) > 0 then
    14851495  begin
     
    15311541        else CanSign := CH_SIGN_NA;
    15321542      if NewOrder.Signature = OSS_NOT_REQUIRE then CanSign := CH_SIGN_NA;
    1533       Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, Responses.FViewName, CanSign);
     1543      if NewOrder.EventPtr <> '' then IsDelayOrder := True;
     1544      Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, Responses.FViewName, CanSign,'',0, NewOrder.DGroupName, False,IsDelayOrder);
    15341545
    15351546    UBAGlobals.TargetOrderID := NewOrder.ID;
     
    15581569  theGrpName: string;
    15591570  alreadyClosed: boolean;
     1571  LateTrayFields: TLateTrayFields;
     1572  x, CxMsg: string;
    15601573begin
    15611574  FAcceptOK := False;
     
    15711584    end;
    15721585  end;
     1586
     1587  // check for diet orders that will be auto-DCd because of start/stop overlaps
     1588  if Responses.Dialog = 'FHW1' then
     1589  begin
     1590    if (Self.EvtID <> 0) then
     1591    begin
     1592      CheckForAutoDCDietOrders(Self.EvtID, Self.DisplayGroup, '', CxMsg, cmdAccept);
     1593      if CxMsg <> '' then
     1594      begin
     1595        if InfoBox(CxMsg + CRLF + CRLF +
     1596           'Have you done either of the above?', 'Possible delayed order conflict',
     1597           MB_ICONWARNING or MB_YESNO) = ID_NO
     1598           then exit;
     1599      end;
     1600    end
     1601    else if FAutoAccept then
     1602    begin
     1603      x := CurrentDietText;
     1604      CheckForAutoDCDietOrders(0, Self.DisplayGroup, x, CxMsg, nil);
     1605      if CxMsg <> '' then
     1606      begin
     1607        if InfoBox(CxMsg + CRLF +
     1608                  'Are you sure?', 'Confirm', MB_ICONWARNING or MB_YESNO) = ID_NO then
     1609        begin
     1610          //AbortOrder := True;
     1611          FAcceptOK := FALSE;
     1612          //cmdQuitClick(Self);
     1613          exit;
     1614        end;
     1615      end;
     1616    end;
     1617  end;
     1618
    15731619  if ValidSave then
    15741620  begin
     
    15811627        else
    15821628        begin
     1629          LateTrayFields.LateMeal := #0;
     1630          with Responses do
     1631            if FAutoAccept and ((Dialog = 'FHW1') or (Dialog = 'FHW OP MEAL') or (Dialog ='FHW SPECIAL MEAL')) then
     1632            begin
     1633              LateTrayCheck(Responses, Self.EvtID, not OrderForInpatient, LateTrayFields);
     1634            end;
    15831635          ClearDialogControls;    // to allow form to close without prompting to save order
     1636          with LateTrayFields do if LateMeal <> #0 then LateTrayOrder(LateTrayFields, OrderForInpatient);
    15841637          Close;
    15851638          alreadyClosed := True;
     
    16271680begin
    16281681  inherited;
     1682  FFromQuit := True;
    16291683  Close;
    16301684end;
     
    16651719      exit;
    16661720    end;
     1721  if FFromQuit = False then updateSig;
    16671722  if Length(memOrder.Text) > 0 then
    16681723  begin
     
    16811736      if not ValidSave then CanClose := False;
    16821737  if CanClose then InitDialog;
     1738end;
     1739
     1740procedure TfrmODBase.updateSig;
     1741begin
     1742
    16831743end;
    16841744
     
    17851845        if Length(TempMSG)>0 then
    17861846        begin
    1787           ShowMessage(TempMSG);
     1847          ShowMsg(TempMSG);
    17881848          Result := False;
    17891849        end;
Note: See TracChangeset for help on using the changeset viewer.