Procedure

SetDefaultCoPayToNewOrder

Module

rODBase

Last Modified

7/15/2014 3:26:42 PM

Scope

Interfaced

Declaration

procedure SetDefaultCoPayToNewOrder(AnOrderID, CoPayInfo:string);

Called-By Hierarchy


                                   SetDefaultCoPayToNewOrder
                                      TfrmODBase.ValidSave┘ 
                               TfrmODBase.cmdAcceptClick┤   
                                   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┘     │   
                               TfrmODBase.FormCloseQuery┤   
                                     TfrmODBase.TabClose┤   
                            TfrmODAllergy.cmdAcceptClick┘   

Called-By

Name Declaration Comments
TfrmODBase.ValidSave function ValidSave: Boolean; -


Source

615   procedure SetDefaultCoPayToNewOrder(AnOrderID, CoPayInfo:string);
616   var
617     temp,CPExems: string;
618     CoPayValue: array [1..7] of Char;
619     i: integer;
620   begin
621     // SC AO IR EC MST HNC CV
622     CoPayValue[1] := 'N';
623     CoPayValue[2] := 'N';
624     CoPayValue[3] := 'N';
625     CoPayValue[4] := 'N';
626     CoPayValue[5] := 'N';
627     CoPayValue[6] := 'N';
628     CoPayValue[7] := 'N';
629     temp := Pieces(CoPayInfo,'^',2,6);
630     i := 1;
631     while Length(Piece(temp,'^',i))>0 do
632     begin
633       if Piece(Piece(temp,'^',i),';',1) = 'SC' then
634       begin
635         if Piece( Piece(temp,'^',i),';',2) = '1' then
636           CoPayValue[1] := 'C'
637         else
638           CopayValue[1] := 'U';
639       end;
640       if Piece(Piece(temp,'^',i),';',1) = 'AO' then
641       begin
642         if Piece( Piece(temp,'^',i),';',2) = '1' then
643           CoPayValue[2] := 'C'
644         else
645           CopayValue[2] := 'U';
646       end;
647       if Piece(Piece(temp,'^',i),';',1) = 'IR' then
648       begin
649         if Piece( Piece(temp,'^',i),';',2) = '1' then
650           CoPayValue[3] := 'C'
651         else
652           CopayValue[3] := 'U';
653       end;
654       if Piece(Piece(temp,'^',i),';',1) = 'EC' then
655       begin
656         if Piece( Piece(temp,'^',i),';',2) = '1' then
657           CoPayValue[4] := 'C'
658         else
659           CopayValue[4] := 'U';
660       end;
661       if Piece(Piece(temp,'^',i),';',1) = 'MST' then
662       begin
663         if Piece( Piece(temp,'^',i),';',2) = '1' then
664           CoPayValue[5] := 'C'
665         else
666           CopayValue[5] := 'U';
667       end;
668       if Piece(Piece(temp,'^',i),';',1) = 'HNC' then
669       begin
670         if Piece( Piece(temp,'^',i),';',2) = '1' then
671           CoPayValue[6] := 'C'
672         else
673           CopayValue[6] := 'U';
674       end;
675       if Piece(Piece(temp,'^',i),';',1) = 'CV' then
676       begin
677         if Piece( Piece(temp,'^',i),';',2) = '1' then
678           CoPayValue[7] := 'C'
679         else
680           CopayValue[7] := 'U';
681       end;
682       i := i + 1;
683     end;
684     CPExems := CoPayValue[1] + CoPayValue[2] + CoPayValue[3] + CoPayValue[4]
685              + CoPayValue[5] + CoPayValue[6] + CoPayValue[7];
686     CPExems := AnOrderId + '^' + CPExems;
687     with RPCBrokerV do
688     begin
689       ClearParameters := True;
690       RemoteProcedure := 'ORWDPS4 CPINFO';
691       Param[0].PType := list;
692       Param[0].Mult['1'] := CPExems;
693       CallBroker;
694     end;
695   end;