Function

PassDrugTest

Module

rODMeds

Last Modified

7/15/2014 3:26:42 PM

Scope

Interfaced

Declaration

function PassDrugTest(OI: integer; OrderType: string; InptOrder: boolean; CheckForClozapineOnly: boolean = false): boolean;

Called-By Hierarchy


                                            PassDrugTest
                                   ActivateOrderDialog┤ 
                           TfrmRemDlg.btnFinishClick┤ │ 
           TfrmConsults.mnuActNewConsultRequestClick┤ │ 
                   TfrmConsults.cmdNewConsultClick┘ │ │ 
                TfrmConsults.mnuActNewProcedureClick┤ │ 
                      TfrmConsults.cmdNewProcClick┘ │ │ 
                                        ChangeOrders┤ │ 
                      TfrmOrders.mnuActChangeClick┤ │ │ 
                        TfrmMeds.mnuActChangeClick┘ │ │ 
                                     ChangeOrdersEvt┤ │ 
                                          CopyOrders┤ │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ 
                           TfrmODActive.btnOKClick┘ │ │ 
                                      TransferOrders┤ │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ 
                           TfrmODActive.btnOKClick┘ │ │ 
                            TfrmOrders.lstWriteClick┤ │ 
               TfrmOrders.PlaceOrderForDefaultDialog┤ │ 
                  TfrmOrders.DisplayDefaultDlgList┤ │ │ 
                       TfrmOrders.ResetOrderPage┘ │ │ │ 
               TfrmOrders.btnDelayedOrderClick┘   │ │ │ 
                                 DisplayEvntDialog┤ │ │ 
                             SetDelayEventForMed┘ │ │ │ 
                      TfrmMeds.mnuActCopyClick┘   │ │ │ 
                                 DisplayEvntDialog┤ │ │ 
                                  SetViewForCopy┘ │ │ │ 
                    TfrmOrders.mnuActCopyClick┘   │ │ │ 
                                 DisplayEvntDialog┘ │ │ 
                                ExecuteChangeEvt┘   │ │ 
                 TfrmOrders.mnuActChgEvntClick┘     │ │ 
                             TfrmMeds.mnuActNewClick┤ │ 
                           TfrmOMNavA.ActivateDialog┤ │ 
                         TfrmOMNavA.grdMenuKeyDown┤ │ │ 
                         TfrmOMNavA.grdMenuMouseUp┘ │ │ 
                                TfrmOMSet.DoNextItem┘ │ 
                              TfrmOMSet.InsertList┤   │ 
                               ActivateOrderList┘ │   │ 
                     TfrmRemDlg.btnFinishClick┤   │   │ 
                             ActivateOrderHTML┤   │   │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │   │ 
                              ActivateOrderSet┤   │   │ 
                   TfrmRemDlg.btnFinishClick┤ │   │   │ 
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │   │ 
     TfrmConsults.mnuActNewProcedureClick...┤ │   │   │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │   │ 
                     TfrmMeds.mnuActNewClick┤ │   │   │ 
                TfrmOMNavA.ActivateDialog...┤ │   │   │ 
                     TfrmOMSet.DoNextItem...┘ │   │   │ 
                       TfrmOMNavA.DoSelectList┘   │   │ 
                     TfrmOMNavA.grdMenuKeyUp┤     │   │ 
                   TfrmOMNavA.grdMenuMouseUp┘     │   │ 
                                        SkipToNext┤   │ 
                         TfrmOMSet.DoNextItem...┘ │   │ 
                            TfrmOMSet.UMDelayEvent┘   │ 
                           TfrmOrders.ValidateSelected┤ 
                            TfrmOrders.mnuActDCClick┤ │ 
                           TfrmOrders.mnuActRelClick┤ │ 
                       TfrmOrders.mnuActChgEvntClick┤ │ 
                          TfrmOrders.mnuActHoldClick┤ │ 
                        TfrmOrders.mnuActUnholdClick┤ │ 
                         TfrmOrders.mnuActRenewClick┤ │ 
                         TfrmOrders.mnuActAlertClick┤ │ 
                      TfrmOrders.mnuActCompleteClick┤ │ 
                        TfrmOrders.mnuActVerifyClick┤ │ 
                      TfrmOrders.mnuActChartRevClick┤ │ 
                        TfrmOrders.mnuActChangeClick┤ │ 
                          TfrmOrders.mnuActCopyClick┤ │ 
                       TfrmOrders.mnuActReleaseClick┤ │ 
                       TfrmOrders.mnuActOnChartClick┤ │ 
                          TfrmOrders.mnuActSignClick┘ │ 
                                TfrmODMeds.SetupDialog┤ 
                             TfrmODMeds.btnSelectClick┘ 
                             TfrmODMeds.UMDelayClick┘   

Called-By

Name Declaration Comments
ActivateOrderDialog function ActivateOrderDialog(const AnID: string; AnEvent: TOrderDelayEvent; AnOwner: TComponent; ARefNum: Integer; ANeedVerify: boolean = True): Boolean; -
TfrmODMeds.btnSelectClick procedure btnSelectClick(Sender: TObject); -
TfrmODMeds.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -
TfrmOrders.ValidateSelected procedure ValidateSelected(const AnAction, WarningMsg, WarningTitle: string); -


Source

313   function PassDrugTest(OI: integer; OrderType: string; InptOrder: boolean; CheckForClozapineOnly: boolean = false): boolean;
314   var
315   MessCap, MessText: string;
316   i: integer;
317   begin
318     result := false;
319     MessText := '';
320     uDrugHasMaxData.CaptureMaxData := false;
321     uDrugHasMaxData.MaxSupply := 0;
322     uDrugHasMaxData.MaxQuantity := 0;
323     uDrugHasMaxData.MaxRefills := 0;
324     CallV('ORALWORD ALLWORD', [Patient.DFN, OI, OrderType, Encounter.Provider]);
325     for i := 0 to RPCBrokerV.Results.Count -1 do
326       begin
327         if i = 0 then
328           begin
329             MessCap := Piece(RPCBrokerV.Results.strings[i],U,1);
330             if Piece(RPCBrokerV.Results.strings[i],U,2) = '1' then uDrugHasMaxData.CaptureMaxData := True;
331           end;
332         if i >0 then MessText := MessText + RPCBrokerV.Results.Strings[i] + CRLF;
333       end;
334     if CheckForClozapineOnly = True then
335       begin
336         Result := uDrugHasMaxData.CaptureMaxData = True;
337         Exit;
338       end;
339     if (MessText = '') and (MessCap = '') then
340       begin
341         Result := True;
342         if (InptOrder = true) and (uDrugHasMaxData.CaptureMaxData = true) then
343           begin
344             uDrugHasMaxData.CaptureMaxData := false;
345             if uInpatientClozapineText.dispText = '' then
346               begin
347                 CallV('ORDDPAPI CLOZMSG', []);
348                 for i := 0 to RPCBrokerV.Results.Count -1 do
349                    if i = 0 then uInpatientClozapineText.dispText := RPCBrokerV.Results.Strings[i]
350                    else uInpatientClozapineText.dispText := uInpatientClozapineText.dispText + CRLF + RPCBrokerV.Results.Strings[i];
351               end;
352             if uInpatientClozapineText.dispText <> '' then infoBox(uInpatientClozapineText.dispText, 'Inpatient Drug Warning', MB_OK);
353           end;
354         exit;
355       end;
356     infoBox(MessText, MessCap,MB_OK);
357   end;