IBCB1 ;ALB/AAS - Process bill after enter/edited ; 2-NOV-89
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
;MAP TO DGCRB1
;
;IBQUIT = Flag to stop processing
;IBVIEW = Flag showing Bill has been viewed
;IBDISP = Flag showing Bill entering display been viewed.
;
K ^UTILITY($J) I $D(IBAC),IBAC>1 G @IBAC
1 ;complete bill
D END,EDITS^IBCB2 G:IBQUIT END
;
2 ;review bill
;I '$D(^XUSEC("IB AUTHORIZE",DUZ))!('$D(IBIFN)) W !!,"You do not hold the Review Key.",! G END
;I '$P($G(^IBE(350.9,1,1)),"^",11),DUZ=$P(^DGCR(399,IBIFN,"S"),"^",2) W !!,"Entering user can not review bill.",! G END
;D EDITS^IBCB2 G:IBQUIT END
REV ;W !!,"WANT TO ",$S($P(^DGCR(399,IBIFN,"S"),"^",6)]"":"RE-",1:""),"REVIEW BILL AT THIS TIME" S %=2 D YN^DICN G:%=-1!(%=2) END
;I '% W !?4,"YES - To set the status to Reviewed",!?4,"No - To take no action" G REV
;
;S (DIC,DIE)=399,DA=IBIFN,DR="[IB STATUS]" D ^DIE K DIC,DIE D:$D(IBX3) DISAP^IBCBULL
;
3 ;authorize bill
I '$D(^XUSEC("IB AUTHORIZE",DUZ))!('$D(IBIFN)) W !!,"You do not hold the Authorize Key.",! G END
;I '$P(^DGCR(399,IBIFN,"S"),"^",6) W:IBAC>2 !!,"Not Yet Reviewed.",! G END
;I '$P($G(^IBE(350.9,1,1)),"^",3),DUZ=$P(^DGCR(399,IBIFN,"S"),"^",8) W !!,"Reviewing user can not authorize.",! G END
I '$P($G(^IBE(350.9,1,1)),"^",23),DUZ=$P(^DGCR(399,IBIFN,"S"),"^",2) W !!,"Entering user can not authorize.",! G END
I $P(^DGCR(399,IBIFN,"S"),"^",9) W !,"Already Approved, Can't change" G END
D EDITS^IBCB2 G:IBQUIT END
AUTH W !!,"WANT TO AUTHORIZE BILL AT THIS TIME" S %=2 D YN^DICN G:%=-1!(%=2) END
I '% W !?4,"YES - To set the status to Complete",!?4,"No - To take no action" G AUTH
S (DIC,DIE)=399,IBYY="@90",DA=IBIFN,DR="[IB STATUS]" D ^DIE K DIC,DIE,IBYY D:$D(IBX3) DISAP^IBCBULL
I '$P(^DGCR(399,IBIFN,"S"),"^",9) G END
W !,"Passing completed Bill to Accounts Receivable. Bill is no longer editable."
I $P(^DGCR(399,IBIFN,"S"),"^",9) D GVAR^IBCBB,ARRAY^IBCBB1,^PRCASVC6 D REL^PRCASVC:PRCASV("OKAY") I 'PRCASV("OKAY") D FXERR1^IBCB2 G END
W !,"Completed Bill Successfully sent to Accounts Receivable."
;
4 ;generate/print bill
G:('$D(IBIFN)) END
I '$P(^DGCR(399,IBIFN,"S"),"^",9) W !!,*7,"Not Authorized, Can Not Print!" G END
D DISP^IBCB2
S:'$D(IBQUIT) IBQUIT=0
D:'$D(IBVIEW) VIEW^IBCB2 G:IBQUIT END
S IBPNT=$P(^DGCR(399,IBIFN,"S"),"^",12)
GEN W !!,"WANT TO ",$S(IBPNT]"":"RE-",1:""),"PRINT BILL AT THIS TIME" S %=2 D YN^DICN G:%=-1!(%=2) END
I '% W !?4,"YES - to print the bill now",!?4,"NO - To take no action" G GEN
I 'IBPNT D EN1^IBCF G END
RPNT R !!,"(2)nd Notice, (3)rd Notice, (C)opy or (O)riginal: C// ",IBPNT:DTIME S:IBPNT="" IBPNT="C" G:IBPNT["^" END
S IBPNT=$E(IBPNT,1) I "23oOcC"'[IBPNT W !?5,"Enter 'O' to reprint the original bill or",!?5,"Enter 'C' to reprint the bill as a duplicate copy or",!?5,"Enter '2' or '3' to print 2nd or 3rd follow-up notices." S IBPNT=1 G RPNT
W " (",$S("cC"[IBPNT:"COPY","oO"[IBPNT:"ORIGINAL",IBPNT=2:"2nd NOTICE",IBPNT=3:"3rd NOTICE",1:""),")"
S IBPNT=$S("oO"[IBPNT:1,"cC"[IBPNT:0,1:IBPNT)
D EN1^IBCF
;
END K IBER D END^IBCBB1 K IBQUIT,IBVIEW,IBDISP,IBST,IB,PRCAERCD,PRCAERR,PRCASVC,PRCAT,DGRA2,IBBT,IBCH,IBNDS,IBOA,IBREV,IBX,DGXRF1,PRCAORA,IBX3,DGBILLBS,DGII,DGVISCNT,DGFIL,DGTE
K %DT,DIC,DIE,I,J,X,Y,Y1,Y2,IBER,IBDFN,IBDSDT,IBJ,IBNDI1,IBZZ,VA,IBMA,IBXDT,DI,PRCAPAYR,DGBS,DGCNT,DGDA,DGPAG,DGREVC,DGRV,DGTEXT,DGTOTPAG,IBOPV,DGLCNT,DGTEXT1,DGRSPAC,DGSM,IBPNT,DGINPT,DGLL,IBCPTN
K IBOPV1,IBOPV2,IBCHG,DGBIL1,DGU,DDH,IBA1,IBINS,IBPROC,PRCARI K:'$D(PRCASV("NOTICE")) PRCASV
Q
IBCB1 ;ALB/AAS - Process bill after enter/edited ; 2-NOV-89
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
+4 ;MAP TO DGCRB1
+5 ;
+6 ;IBQUIT = Flag to stop processing
+7 ;IBVIEW = Flag showing Bill has been viewed
+8 ;IBDISP = Flag showing Bill entering display been viewed.
+9 ;
+10 KILL ^UTILITY($JOB)
IF $DATA(IBAC)
IF IBAC>1
GOTO @IBAC
1 ;complete bill
+1 DO END
DO EDITS^IBCB2
IF IBQUIT
GOTO END
+2 ;
2 ;review bill
+1 ;I '$D(^XUSEC("IB AUTHORIZE",DUZ))!('$D(IBIFN)) W !!,"You do not hold the Review Key.",! G END
+2 ;I '$P($G(^IBE(350.9,1,1)),"^",11),DUZ=$P(^DGCR(399,IBIFN,"S"),"^",2) W !!,"Entering user can not review bill.",! G END
+3 ;D EDITS^IBCB2 G:IBQUIT END
REV ;W !!,"WANT TO ",$S($P(^DGCR(399,IBIFN,"S"),"^",6)]"":"RE-",1:""),"REVIEW BILL AT THIS TIME" S %=2 D YN^DICN G:%=-1!(%=2) END
+1 ;I '% W !?4,"YES - To set the status to Reviewed",!?4,"No - To take no action" G REV
+2 ;
+3 ;S (DIC,DIE)=399,DA=IBIFN,DR="[IB STATUS]" D ^DIE K DIC,DIE D:$D(IBX3) DISAP^IBCBULL
+4 ;
3 ;authorize bill
+1 IF '$DATA(^XUSEC("IB AUTHORIZE",DUZ))!('$DATA(IBIFN))
WRITE !!,"You do not hold the Authorize Key.",!
GOTO END
+2 ;I '$P(^DGCR(399,IBIFN,"S"),"^",6) W:IBAC>2 !!,"Not Yet Reviewed.",! G END
+3 ;I '$P($G(^IBE(350.9,1,1)),"^",3),DUZ=$P(^DGCR(399,IBIFN,"S"),"^",8) W !!,"Reviewing user can not authorize.",! G END
+4 IF '$PIECE($GET(^IBE(350.9,1,1)),"^",23)
IF DUZ=$PIECE(^DGCR(399,IBIFN,"S"),"^",2)
WRITE !!,"Entering user can not authorize.",!
GOTO END
+5 IF $PIECE(^DGCR(399,IBIFN,"S"),"^",9)
WRITE !,"Already Approved, Can't change"
GOTO END
+6 DO EDITS^IBCB2
IF IBQUIT
GOTO END
AUTH WRITE !!,"WANT TO AUTHORIZE BILL AT THIS TIME"
SET %=2
DO YN^DICN
IF %=-1!(%=2)
GOTO END
+1 IF '%
WRITE !?4,"YES - To set the status to Complete",!?4,"No - To take no action"
GOTO AUTH
+2 SET (DIC,DIE)=399
SET IBYY="@90"
SET DA=IBIFN
SET DR="[IB STATUS]"
DO ^DIE
KILL DIC,DIE,IBYY
IF $DATA(IBX3)
DO DISAP^IBCBULL
+3 IF '$PIECE(^DGCR(399,IBIFN,"S"),"^",9)
GOTO END
+4 WRITE !,"Passing completed Bill to Accounts Receivable. Bill is no longer editable."
+5 IF $PIECE(^DGCR(399,IBIFN,"S"),"^",9)
DO GVAR^IBCBB
DO ARRAY^IBCBB1
DO ^PRCASVC6
IF PRCASV("OKAY")
DO REL^PRCASVC
IF 'PRCASV("OKAY")
DO FXERR1^IBCB2
GOTO END
+6 WRITE !,"Completed Bill Successfully sent to Accounts Receivable."
+7 ;
4 ;generate/print bill
+1 IF ('$DATA(IBIFN))
GOTO END
+2 IF '$PIECE(^DGCR(399,IBIFN,"S"),"^",9)
WRITE !!,*7,"Not Authorized, Can Not Print!"
GOTO END
+3 DO DISP^IBCB2
+4 IF '$DATA(IBQUIT)
SET IBQUIT=0
+5 IF '$DATA(IBVIEW)
DO VIEW^IBCB2
IF IBQUIT
GOTO END
+6 SET IBPNT=$PIECE(^DGCR(399,IBIFN,"S"),"^",12)
GEN WRITE !!,"WANT TO ",$SELECT(IBPNT]"":"RE-",1:""),"PRINT BILL AT THIS TIME"
SET %=2
DO YN^DICN
IF %=-1!(%=2)
GOTO END
+1 IF '%
WRITE !?4,"YES - to print the bill now",!?4,"NO - To take no action"
GOTO GEN
+2 IF 'IBPNT
DO EN1^IBCF
GOTO END
RPNT READ !!,"(2)nd Notice, (3)rd Notice, (C)opy or (O)riginal: C// ",IBPNT:DTIME
IF IBPNT=""
SET IBPNT="C"
IF IBPNT["^"
GOTO END
+1 SET IBPNT=$EXTRACT(IBPNT,1)
IF "23oOcC"'[IBPNT
WRITE !?5,"Enter 'O' to reprint the original bill or",!?5,"Enter 'C' to reprint the bill as a duplicate copy or",!?5,"Enter '2' or '3' to print 2nd or 3rd follow-up notices."
SET IBPNT=1
GOTO RPNT
+2 WRITE " (",$SELECT("cC"[IBPNT:"COPY","oO"[IBPNT:"ORIGINAL",IBPNT=2:"2nd NOTICE",IBPNT=3:"3rd NOTICE",1:""),")"
+3 SET IBPNT=$SELECT("oO"[IBPNT:1,"cC"[IBPNT:0,1:IBPNT)
+4 DO EN1^IBCF
+5 ;
END KILL IBER
DO END^IBCBB1
KILL IBQUIT,IBVIEW,IBDISP,IBST,IB,PRCAERCD,PRCAERR,PRCASVC,PRCAT,DGRA2,IBBT,IBCH,IBNDS,IBOA,IBREV,IBX,DGXRF1,PRCAORA,IBX3,DGBILLBS,DGII,DGVISCNT,DGFIL,DGTE
+1 KILL %DT,DIC,DIE,I,J,X,Y,Y1,Y2,IBER,IBDFN,IBDSDT,IBJ,IBNDI1,IBZZ,VA,IBMA,IBXDT,DI,PRCAPAYR,DGBS,DGCNT,DGDA,DGPAG,DGREVC,DGRV,DGTEXT,DGTOTPAG,IBOPV,DGLCNT,DGTEXT1,DGRSPAC,DGSM,IBPNT,DGINPT,DGLL,IBCPTN
+2 KILL IBOPV1,IBOPV2,IBCHG,DGBIL1,DGU,DDH,IBA1,IBINS,IBPROC,PRCARI
IF '$DATA(PRCASV("NOTICE"))
KILL PRCASV
+3 QUIT