IBAMTC3 ;ALB/CJM - BULLETINS FOR UNCLOSED EVENTS,UNPASSED CHARGES ; 21-APRIL-92
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
BULLET1 N IBT,IBC,XMSUB,XMY,XMDUZ,XMTEXT
S IBC=1,IBDUZ=$G(DUZ)
D HDR1,PAT1,CHRG1,MAIL^IBAERR1
Q
BULLET2 N IBT,IBC,XMSUB,XMY,XMDUZ,XMTEXT
S IBC=1,IBDUZ=$G(DUZ)
D HDR2,PAT2,CHRG2,MAIL^IBAERR1
Q
MAIL ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CALL MAIL^IBAERR1
; F I=1:1:(IBC-1) W IBT(I),!
; Q
HDR1 ;
S XMSUB="REQUIRED VERIFICATION OF CATEGORY C CHARGES"
S IBT(IBC)="Please verify the Category C charges for the following inpatient admission:",IBC=IBC+1
Q
HDR2 ;
S XMSUB="CATEGORY C CHARGES NOT YET PASSED TO ACCOUNTS RECEIVABLE"
S IBT(IBC)="The following charge is "_IBOLD_" days old and has not been passed to Accounts ",IBT(IBC+1)="Receivable. Action is required to edit, cancel, or pass the charge.",IBC=IBC+2
Q
CHRG2 ;
N I,IBTYPE,IBFROM,IBTO,IBAMOUNT
D CHGDATA
S IBT(IBC)="Type : "_IBTYPE,IBC=IBC+1
S IBT(IBC)="From : "_IBFROM,IBC=IBC+1
S IBT(IBC)="To : "_IBTO,IBC=IBC+1
S IBT(IBC)="Amount : "_IBAMOUNT,IBC=IBC+1
Q
CHRG1 ;
N I,IBTYPE,IBFROM,IBTO,IBAMOUNT
I 'IBPASS&(IBCHG) D
.S IBT(IBC)=" ",IBT(IBC+1)="These charges have not been passed to Accounts Receivable.",IBT(IBC+2)="Action is required to edit, cancel, or pass the charges.",IBT(IBC+3)=" ",IBC=IBC+4
.S IBT(IBC)=$$PR("Type",30)_$$PR("From",16)_$$PR("To",16)_$$PR("Amount",15),IBC=IBC+1
.F I=1:1:IBCHG S IBND=$G(^IB(IBCHG(I),0)) D CHGDATA D
..S IBT(IBC)=$$PR(IBTYPE,30)_$$PR(IBFROM,16)_$$PR(IBTO,16)_$$PR(IBAMOUNT,15),IBC=IBC+1
Q
CHGDATA ;
S Y=$P(IBND,"^",14) D:Y DD^%DT S IBFROM=Y
S Y=$P(IBND,"^",15) D:Y DD^%DT S IBTO=Y
S IBTYPE=$P(IBND,"^",3) S:IBTYPE IBTYPE=$P($G(^IBE(350.1,IBTYPE,0)),"^",1)
S IBAMOUNT="$"_+$P(IBND,"^",7)
Q
PAT1 ; patient demographic data, admission and discharge date
N VAERR,VADM,DFN,IBNAME,IBID,IBADMIT,VA
S IBT(IBC)=" ",IBC=IBC+1
S DFN=+$P(IBND,"^",2) D DEM^VADPT I VAERR K VADM
S IBNAME=$G(VADM(1)),IBID=$G(VA("PID"))
S Y=$P(IBND,"^",17) D DD^%DT S IBADMIT=Y
S Y=IBDISC D DD^%DT S IBDISC=Y
S IBT(IBC)="Patient Name: "_IBNAME,IBC=IBC+1
S IBT(IBC)="Patient Id : "_IBID,IBC=IBC+1
S IBT(IBC)="Admitted : "_IBADMIT,IBC=IBC+1
S IBT(IBC)="Discharged : "_IBDISC,IBC=IBC+1
Q
PAT2 ; patient demographic data, admission and discharge date
N VAERR,VADM,DFN,IBNAME,IBID,IBADMIT,IBPARENT,IBDISC,VA
S IBT(IBC)=" ",IBC=IBC+1,(IBADMIT,IBDISC)=""
S DFN=+$P(IBND,"^",2) D DEM^VADPT I VAERR K VADM
S IBNAME=$G(VADM(1)),IBID=$G(VA("PID"))
S IBPARENT=$P(IBND,"^",16) I $G(IBPARENT) D
.N IBND S IBND=$G(^IB(IBPARENT,0))
.S Y=$P(IBND,"^",17) D DD^%DT S IBADMIT=Y
.D DISC^IBAMTC2 I IBDISC S Y=IBDISC D DD^%DT S IBDISC=Y
S IBT(IBC)="Patient Name: "_IBNAME,IBC=IBC+1
S IBT(IBC)="Patient Id : "_IBID,IBC=IBC+1
S IBT(IBC)="Admitted : "_IBADMIT,IBC=IBC+1
S IBT(IBC)="Discharged : "_IBDISC,IBC=IBC+1
Q
PR(STR,LEN) ; pad right
N B S STR=$E(STR,1,LEN),$P(B," ",LEN-$L(STR))=" "
Q STR_$G(B)
IBAMTC3 ;ALB/CJM - BULLETINS FOR UNCLOSED EVENTS,UNPASSED CHARGES ; 21-APRIL-92
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
BULLET1 NEW IBT,IBC,XMSUB,XMY,XMDUZ,XMTEXT
+1 SET IBC=1
SET IBDUZ=$GET(DUZ)
+2 DO HDR1
DO PAT1
DO CHRG1
DO MAIL^IBAERR1
+3 QUIT
BULLET2 NEW IBT,IBC,XMSUB,XMY,XMDUZ,XMTEXT
+1 SET IBC=1
SET IBDUZ=$GET(DUZ)
+2 DO HDR2
DO PAT2
DO CHRG2
DO MAIL^IBAERR1
+3 QUIT
MAIL ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CALL MAIL^IBAERR1
+1 ; F I=1:1:(IBC-1) W IBT(I),!
+2 ; Q
HDR1 ;
+1 SET XMSUB="REQUIRED VERIFICATION OF CATEGORY C CHARGES"
+2 SET IBT(IBC)="Please verify the Category C charges for the following inpatient admission:"
SET IBC=IBC+1
+3 QUIT
HDR2 ;
+1 SET XMSUB="CATEGORY C CHARGES NOT YET PASSED TO ACCOUNTS RECEIVABLE"
+2 SET IBT(IBC)="The following charge is "_IBOLD_" days old and has not been passed to Accounts "
SET IBT(IBC+1)="Receivable. Action is required to edit, cancel, or pass the charge."
SET IBC=IBC+2
+3 QUIT
CHRG2 ;
+1 NEW I,IBTYPE,IBFROM,IBTO,IBAMOUNT
+2 DO CHGDATA
+3 SET IBT(IBC)="Type : "_IBTYPE
SET IBC=IBC+1
+4 SET IBT(IBC)="From : "_IBFROM
SET IBC=IBC+1
+5 SET IBT(IBC)="To : "_IBTO
SET IBC=IBC+1
+6 SET IBT(IBC)="Amount : "_IBAMOUNT
SET IBC=IBC+1
+7 QUIT
CHRG1 ;
+1 NEW I,IBTYPE,IBFROM,IBTO,IBAMOUNT
+2 IF 'IBPASS&(IBCHG)
Begin DoDot:1
+3 SET IBT(IBC)=" "
SET IBT(IBC+1)="These charges have not been passed to Accounts Receivable."
SET IBT(IBC+2)="Action is required to edit, cancel, or pass the charges."
SET IBT(IBC+3)=" "
SET IBC=IBC+4
+4 SET IBT(IBC)=$$PR("Type",30)_$$PR("From",16)_$$PR("To",16)_$$PR("Amount",15)
SET IBC=IBC+1
+5 FOR I=1:1:IBCHG
SET IBND=$GET(^IB(IBCHG(I),0))
DO CHGDATA
Begin DoDot:2
+6 SET IBT(IBC)=$$PR(IBTYPE,30)_$$PR(IBFROM,16)_$$PR(IBTO,16)_$$PR(IBAMOUNT,15)
SET IBC=IBC+1
End DoDot:2
End DoDot:1
+7 QUIT
CHGDATA ;
+1 SET Y=$PIECE(IBND,"^",14)
IF Y
DO DD^%DT
SET IBFROM=Y
+2 SET Y=$PIECE(IBND,"^",15)
IF Y
DO DD^%DT
SET IBTO=Y
+3 SET IBTYPE=$PIECE(IBND,"^",3)
IF IBTYPE
SET IBTYPE=$PIECE($GET(^IBE(350.1,IBTYPE,0)),"^",1)
+4 SET IBAMOUNT="$"_+$PIECE(IBND,"^",7)
+5 QUIT
PAT1 ; patient demographic data, admission and discharge date
+1 NEW VAERR,VADM,DFN,IBNAME,IBID,IBADMIT,VA
+2 SET IBT(IBC)=" "
SET IBC=IBC+1
+3 SET DFN=+$PIECE(IBND,"^",2)
DO DEM^VADPT
IF VAERR
KILL VADM
+4 SET IBNAME=$GET(VADM(1))
SET IBID=$GET(VA("PID"))
+5 SET Y=$PIECE(IBND,"^",17)
DO DD^%DT
SET IBADMIT=Y
+6 SET Y=IBDISC
DO DD^%DT
SET IBDISC=Y
+7 SET IBT(IBC)="Patient Name: "_IBNAME
SET IBC=IBC+1
+8 SET IBT(IBC)="Patient Id : "_IBID
SET IBC=IBC+1
+9 SET IBT(IBC)="Admitted : "_IBADMIT
SET IBC=IBC+1
+10 SET IBT(IBC)="Discharged : "_IBDISC
SET IBC=IBC+1
+11 QUIT
PAT2 ; patient demographic data, admission and discharge date
+1 NEW VAERR,VADM,DFN,IBNAME,IBID,IBADMIT,IBPARENT,IBDISC,VA
+2 SET IBT(IBC)=" "
SET IBC=IBC+1
SET (IBADMIT,IBDISC)=""
+3 SET DFN=+$PIECE(IBND,"^",2)
DO DEM^VADPT
IF VAERR
KILL VADM
+4 SET IBNAME=$GET(VADM(1))
SET IBID=$GET(VA("PID"))
+5 SET IBPARENT=$PIECE(IBND,"^",16)
IF $GET(IBPARENT)
Begin DoDot:1
+6 NEW IBND
SET IBND=$GET(^IB(IBPARENT,0))
+7 SET Y=$PIECE(IBND,"^",17)
DO DD^%DT
SET IBADMIT=Y
+8 DO DISC^IBAMTC2
IF IBDISC
SET Y=IBDISC
DO DD^%DT
SET IBDISC=Y
End DoDot:1
+9 SET IBT(IBC)="Patient Name: "_IBNAME
SET IBC=IBC+1
+10 SET IBT(IBC)="Patient Id : "_IBID
SET IBC=IBC+1
+11 SET IBT(IBC)="Admitted : "_IBADMIT
SET IBC=IBC+1
+12 SET IBT(IBC)="Discharged : "_IBDISC
SET IBC=IBC+1
+13 QUIT
PR(STR,LEN) ; pad right
+1 NEW B
SET STR=$EXTRACT(STR,1,LEN)
SET $PIECE(B," ",LEN-$LENGTH(STR))=" "
+2 QUIT STR_$GET(B)