Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BPSRPT5A

BPSRPT5A.m

Go to the documentation of this file.
BPSRPT5A ;AITC/CKB - ECME REPORTS ;3/9/2020
 ;;1.0;E CLAIMS MGMT ENGINE;**28**;JUN 2004;Build 22
 ;;Per VA Directive 6402, this routine should not be modified.
 ;
 ;
 ;Routine to Display the Detailed Lines of the Report, the code was moved from BPSRPT5 
 ;
 ;Print Report Line 1
WRLINE1(BPRTYPE,BPREC,BPDIV,BPGRPLAN,BPDFN,BPRX,BPREF,BPX,BPSRTDT,BPBIL,BPINS,BPCOLL,BPEXCEL,BPPSEQ) ;
 ;Excel Output
 I $G(BPEXCEL) D WRLINE1^BPSRPT8(BPRTYPE,.BPREC,BPDIV,BPGRPLAN,BPDFN,BPRX,BPREF,BPX,BPSRTDT,BPBIL,BPINS,BPCOLL,BPPSEQ) Q
 ;Report Output
 W !,$$PATNAME^BPSRPT6(BPDFN)
 W ?27,"("_$$SSN4^BPSRPT6(BPDFN)_")"
 I (BPRTYPE=1)!(BPRTYPE=4) D  Q
 . N ELGCD S ELGCD=$$ELIGCODE^BPSSCR05($P(BPX,U,3))
 . W ?35,$S(ELGCD="V":"VET",ELGCD="T":"TRI",ELGCD="C":"CVA",1:"UNK")
 . W ?40,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)
 . W ?52,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3))
 . W ?73,$$DATTIM^BPSRPT1(BPSRTDT)
 . W ?83,$J(BPBIL,10,2),?105,$J(BPINS,10,2),?122,$S(BPCOLL]"":$J(BPCOLL,10,2),1:"")
 I BPRTYPE=2 D  Q
 . N ELGCD S ELGCD=$$ELIGCODE^BPSSCR05($P(BPX,U,3))
 . W ?35,$S(ELGCD="V":"VET",ELGCD="T":"TRI",ELGCD="C":"CVA",1:"UNK")
 . W ?40,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)
 . W ?52,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3))
 . W ?73,$$DATTIM^BPSRPT1(BPSRTDT)
 . W ?83,$$DATTIM^BPSRPT1(+BPX)
 . W ?96,$$MWC^BPSRPT6(BPRX,BPREF)
 . W ?99,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?103,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?105,$S($P(BPX,U):"/R",1:"/N")
 . W ?114,$$RXCOB^BPSRPT8(BPPSEQ)
 . W ?121,$S($$CLOSED02^BPSSCR03($P(^BPST($P(BPX,U,3),0),U,4))=1:"Closed",1:"Open")
 I BPRTYPE=3 D  Q
 . W ?35,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)
 . W ?47,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3))
 . W ?68,$$DATTIM^BPSRPT1(BPSRTDT)
 . W ?100,$J(BPBIL,10,2),?122,$J(BPINS,10,2)
 I BPRTYPE=5 D  Q
 . W ?35,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)
 . W ?47,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3))
 . W ?65,$$DATTIM^BPSRPT1($$TRANDT^BPSRPT2($P(BPX,U,3),1))
 . W ?83,$$TTYPE^BPSRPT7($P(BPX,U,4),$P(BPX,U,5),BPPSEQ)
 . W ?100,$$RESPONSE^BPSRPT7($P(BPX,U,4),$P(BPX,U,5),BPPSEQ)
 . W ?125,$$RXCOB^BPSRPT8(BPPSEQ)
 I BPRTYPE=7 D  Q
 . N ELGCD S ELGCD=$$ELIGCODE^BPSSCR05($P(BPX,U,3))
 . W ?35,$S(ELGCD="V":"VET",ELGCD="T":"TRI",ELGCD="C":"CVA",1:"UNK")
 . W ?40,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)
 . W ?52,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3))
 . W ?70,$$MWC^BPSRPT6(BPRX,BPREF)
 . W ?73,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?77,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?79,$S($P(BPX,U):"/R",1:"/N")
 . W ?84,$S($P(BPX,U,13):"REJ",1:"")
 . W ?89,$$DRGNAM^BPSRPT6($P(BPX,U,14),27)
 . W ?118,$$GETNDC^BPSRPT6(BPRX,BPREF)
 I BPRTYPE=8 D
 . W ?35,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)
 . W ?47,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3))
 . W ?68,$$DATTIM^BPSRPT1(BPSRTDT)
 . W ?78,$J(BPBIL,10,2),?100,$J(BPINS,10,2),?122,$S(BPCOLL]"":$J(BPCOLL,10,2),1:"")
 I BPRTYPE=9 D  Q
 . N ELGCD S ELGCD=$P(BPX,U,1)
 . W ?35,$S(ELGCD="V":"VET",ELGCD="T":"TRI",ELGCD="C":"CVA",1:"UNK") ; Eligibility
 . W ?40,$$RXNUM^BPSRPT6(BPRX)_$$COPAY^BPSRPT6(BPRX)  ; RX and Copay indicator
 . W ?52,BPREF                     ; Refill
 . W ?64,$$DATTIM^BPSRPT1(BPSRTDT) ; Transaction Date
 . W ?84,$J($P(BPX,U,2),10,2)      ; Drug Cost
 I BPRTYPE=10 D  Q
 . N ELGCD,BPDUPPAY
 . S BPDUPPAY=$P(BPX,U,17)
 . S ELGCD=$$ELIGCODE^BPSSCR05($P(BPX,U,3))
 . W ?35,$S(ELGCD="V":"VET",ELGCD="T":"TRI",ELGCD="C":"CVA",1:"UNK") ; Eligibility
 . W ?45,BPREF,"/",$$ECMENUM^BPSRPT1($P(BPX,U,3)) ; Refill/ECME#
 . W ?65,$$DATTIM^BPSRPT1(BPSRTDT)                ; Transaction Date
 . W ?77,$J(BPBIL,10,2)                           ; $Billed
 . W ?90,$J(BPINS,13,2)                           ; $Ins Response
 . W ?106,$S(BPCOLL]"":$J(BPCOLL,10,2),1:"")      ; $Collected
 . W ?118,$J(BPDUPPAY,12,2)                       ; Pt. Resp (Ins)
 Q
 ;
 ;Print Report Line 2
WRLINE2(BPRTYPE,BPREC,BPX,BPRX,BPREF,BPBIL,BPGRPLAN,BPEXCEL,BPICNT,BPPSEQ) ;
 ;Excel Output
 N BPSX
 I $G(BPEXCEL) D WRLINE2^BPSRPT8(BPRTYPE,.BPREC,BPX,BPRX,BPREF,BPBIL,BPGRPLAN,BPPSEQ) Q
 ;Report Output
 I (BPRTYPE=1)!(BPRTYPE=4) D  Q
 . W !,?4,$$DRGNAM^BPSRPT6($P(BPX,U,14),27),?32,$$GETNDC^BPSRPT6(BPRX,BPREF)
 . I BPRTYPE=1 W ?47,$$DATTIM^BPSRPT1(+BPX)
 . W ?68,$$MWC^BPSRPT6(BPRX,BPREF)
 . W ?71,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?75,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?77,$S($P(BPX,U):"/R",1:"/N")
 . W ?82,$S($P(BPX,U,13):"REJ",1:"")
 . I BPRTYPE=4 W ?92,$$RXCOB^BPSRPT8(BPPSEQ)
 . I BPRTYPE=1 W ?115,$$BILLCOB^BPSRPT5(BPRX,BPREF,BPPSEQ)
 I BPRTYPE=2 D  Q
 . W !,?3,$E($$CRDHLDID^BPSRPT2(+$P(BPX,U,3)),3,23)
 . W ?26,$E($$GRPID^BPSRPT2(+$P(BPX,U,3)),3,17)
 . W ?41,$J(BPBIL,10,2)
 . W ?54,$$QTY^BPSRPT6($P(BPX,U,3))
 . W ?61,$$GETNDC^BPSRPT6(BPRX,BPREF)
 . S BPSX=$$PRESCIN^BPSRPT6($P(BPX,U,3))
 . W ?82,$P(BPSX,U),?98,$P(BPSX,U,2)
 I BPRTYPE=3 D  Q
 . W !,?4,$$DRGNAM^BPSRPT6($P(BPX,U,14),32)
 . W ?41,$$GETNDC^BPSRPT6(BPRX,BPREF)
 . W ?68,$$MWC^BPSRPT6(BPRX,BPREF)
 . W ?71,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?74,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?76,$S($P(BPX,U):"/R",1:"/N")
 . W ?81,$S($P(BPX,U,13):"REJ",1:"")
 . W ?88,$$RXCOB^BPSRPT8(BPPSEQ)
 . N ELGCD S ELGCD=$$ELIGCODE^BPSSCR05($P(BPX,U,3))
 . W ?96,$S(ELGCD="V":"VET",ELGCD="T":"TRI",ELGCD="C":"CVA",1:"UNK")
 I BPRTYPE=5 D  Q
 . W !,?4,$$DRGNAM^BPSRPT6($P(BPX,U,14),23)
 . W ?28,$$GETNDC^BPSRPT6(BPRX,BPREF)
 . W ?47,$$MWC^BPSRPT6(BPRX,BPREF)
 . W ?50,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?53,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?55,$S($P(BPX,U):"/R",1:"/N")
 . W ?60,$S($P(BPX,U,13):"REJ",1:"")
 . I $P(BPGRPLAN,U,2)]"" W ?69,$E($P(BPGRPLAN,U,2),1,30)
 . W ?122,$J($$ELAPSE^BPSRPT6($P(BPX,U,3)),10)
 I BPRTYPE=7 D  Q
 . W !,?3,$E($$CRDHLDID^BPSRPT2(+$P(BPX,U,3)),3,23)
 . W ?28,$E($$GRPID^BPSRPT2(+$P(BPX,U,3)),3,17)
 . W ?46,$$DATTIM^BPSRPT1(+$$CLOSEDT^BPSRPT2(+$P(BPX,U,3)))
 . N BPCLBY S BPCLBY=$E($$CLSBY^BPSRPT6(+$P(BPX,U,3)),1,25) S:BPCLBY="" BPCLBY="BLANK"
 . W ?65,BPCLBY S BPCNT(BPCLBY)=$G(BPCNT(BPCLBY))+1,BPGCNT(BPCLBY)=$G(BPGCNT(BPCLBY))+1,BPICNT(BPCLBY)=$G(BPICNT(BPCLBY))+1
 . W ?93,$E($P($$CLRSN^BPSRPT7(+$P(BPX,U,3)),U,2),1,30)
 . W ?128,$$RXCOB^BPSRPT8(BPPSEQ)
 I BPRTYPE=8 D  Q
 . W !,?2,$$DRGNAM^BPSRPT6($P(BPX,U,14),34)
 . W ?38,$$MWC^BPSRPT6(BPRX,BPREF)
 . W ?42,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?46,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?48,$S($P(BPX,U):"/R",1:"/N")
 . W ?54,$E($$GRPID^BPSRPT2(+$P(BPX,U,3)),3,10)
 . W ?72,$E(BPGRPLAN,1,50)
 . W ?125,$$BILL^BPSRPT6(BPRX,BPREF,BPPSEQ)
 I BPRTYPE=9 D  Q
 . W !,?4,$$DRGNAM^BPSRPT6($P(BPX,U,4),27) ;Drug
 . W ?32,$$GETNDC^BPSRPT6(BPRX,BPREF)  ;NDC
 . W ?47,$$DATTIM^BPSRPT1($P(BPX,U,5)) ;Release Date
 . W ?62,$$MWC^BPSRPT6(BPRX,BPREF)     ;Fill Location
 . W ?65,$$RXSTANAM^BPSSCRU2($P(BPX,U,6))  ;Status
 . W ?67,$S($P(BPX,U,5):"/R",1:"/N")   ;Released
 . W ?75,$E($$GET1^DIQ(366.17,$P(BPX,U,7),.01,"E"),1,57) ;Non-Billalble Reason - ICR 6136
 I BPRTYPE=10 D  Q
 . N BPDUPST
 . S BPDUPST=$P(BPX,U,16)
 . W !,?4,$$DRGNAM^BPSRPT6($P(BPX,U,14),27) ; Drug
 . W ?32,$$GETNDC^BPSRPT6(BPRX,BPREF)       ; NDC
 . W ?47,$$DATTIM^BPSRPT1(+BPX)             ; Released On Date
 . W ?68,$$MWC^BPSRPT6(BPRX,BPREF)          ; Fill Location
 . W ?71,$$RTBCKNAM^BPSRPT1($$RTBCK^BPSRPT1($P(BPX,U,3)))
 . W ?75,$$RXSTATUS^BPSRPT6($P(BPX,U,3))
 . W ?77,$S($P(BPX,U):"/R",1:"/N")
 . W ?82,$S($P(BPX,U,13):"REJ",1:"")
 . W ?94,$$BILL^BPSRPT6(BPRX,BPREF,BPPSEQ)   ; Bill #
 . W ?113,$$RXCOB^BPSRPT8(BPPSEQ)            ; COB
 . W ?122,BPDUPST                            ; Status (Duplicate Trans Status)
 Q
 ;
 ;Print Report Line 3
WRLINE3(BPRTYPE,BPREC,BPX,BPEXCEL) N BP59,BPRICINF
 S BP59=+$P(BPX,U,3)
 ;Excel Output
 I $G(BPEXCEL) D WRLINE3^BPSRPT8(BPRTYPE,.BPREC,BPX) Q
 ;Report Output
 I BPRTYPE=4 D  Q
 . S NP=$$CHKP^BPSRPT5(1) Q:BPQ
 . ;Released On
 . W !,?6,$$DATTIM^BPSRPT1(+BPX)
 . ;Method
 . I $$AUTOREV^BPSRPT1(BP59) W ?22,"AUTO/"
 . E  W ?22,"REGULAR/"
 . ;Return Status
 . I $P(BPX,U,15)["ACCEPTED" W "ACCEPTED/"
 . E  W "REJECTED/"
 . ;Reason
 . W $$RVSRSN^BPSRPT7(+$P(BPX,U,3))
 ;
 I BPRTYPE=8 D  Q
 . S BPRICINF=$$PRICEVAL^BPSRPT5(BP59)
 . W !,?4,$S($P(BPRICINF,U,3)]"":$P(BPRICINF,U,3),1:"N/A")
 . W ?23,$S($P(BPRICINF,U,4)]"":$P(BPRICINF,U,4),1:"N/A")
 . W ?38,$S($P(BPRICINF,U,5)]"":$P(BPRICINF,U,5),1:"N/A")
 . W ?56,$S($P(BPRICINF,U,6)]"":$P(BPRICINF,U,6),1:"N/A")
 . W ?81,$S($P(BPRICINF,U,7)]"":$P(BPRICINF,U,7),1:"N/A")
 . W ?96,$S($P(BPRICINF,U,2)]"":$P(BPRICINF,U,2),1:"N/A")
 . W ?111,$S($P(BPRICINF,U,1)]"":$P(BPRICINF,U,1),1:"N/A")
 ;
 Q
 ;