ABSPER2A ; IHS/FCS/DRS - Payable claims report ; [ 09/12/2002 10:02 AM ]
;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
;----------------------------------------------------------------------
;----------------------------------------------------------------------
;Pharmacy Claim Payable Report (by Tran Date, Sorted by Insurer)
;----------------------------------------------------------------------
W @IOF ;D ^AUCLS
W $$LJBF^ABSPOSU9(SCRNTXT,IOM-10)_$$LJBF^ABSPOSU9("PAGE "_PAGE,10),!
W $TR($J("",IOM)," ","-"),!
Q
;----------------------------------------------------------------------
W !
W "Insurer:",?11,$$LJBF^ABSPOSU9(INSNAME,46)
W ?61,"Help #:",?70,$$LJBF^ABSPOSU9($G(^TMP($J,RPTNAME,INSNAME)),20)
W ?92,"Transmission Dates:"
W ?113,$$LJBF^ABSPOSU9($$FM2MDY^ABSPOSU1(SDATE),8)_" - "
W $$LJBF^ABSPOSU9($$FM2MDY^ABSPOSU1(EDATE),8),!
W !
D WCOLUMNS^ABSPOSU9(0,2,"Trans On:8,Claim ID:17,"_$P($G(^ABSP(9002313.99,PSIEN,2)),U,1)_" #:12,Patient Name:20,NDC #:13,Ingr Pd:7,Disp Pd:7,Total Pd:9,Pat Pay Amt:11,Rem Dedct:11",1)
Q
;----------------------------------------------------------------------
PRINT ;EP - from ABSPER20
N FLAG,INSNAME,TDATE,ANS,RESPIEN,MEDIEN,DATA,TRANSON,CLAIMID,PCN
N PATNAME,NDC,INGRPD,DISPPD,TOTPD,PATPAY,REMDED
N TINGRPD,TDISPPD,TTOTPD,TPATPAY,TREMDED
;
;I IOM<132 D Q
;.D HEADER1
;.W !,"Device selected does not support 132 column reports.",!
;.D:(IO=$P) PRESSANY^ABSPOSU5(1,DTIME)
;
;
;
S FLAG=0,INSNAME=""
F D Q:INSNAME=""!(FLAG)
.S INSNAME=$O(^TMP($J,RPTNAME,INSNAME))
.Q:INSNAME=""
.S (TINGRPD,TDISPPD,TTOTPD,TPATPAY,TREMDED)=0
.D HEADER1,HEADER2
.S TDATE=""
.F D Q:'+TDATE!(FLAG)
..S TDATE=$O(^TMP($J,RPTNAME,INSNAME,TDATE))
..Q:'+TDATE
..S RESPIEN=""
..F D Q:'+RESPIEN!(FLAG)
...S RESPIEN=$O(^TMP($J,RPTNAME,INSNAME,TDATE,RESPIEN))
...Q:'+RESPIEN
...S MEDIEN=""
...F D Q:'+MEDIEN!(FLAG)
....S MEDIEN=$O(^TMP($J,RPTNAME,INSNAME,TDATE,RESPIEN,MEDIEN))
....Q:'+MEDIEN
....S DATA=$G(^TMP($J,RPTNAME,INSNAME,TDATE,RESPIEN,MEDIEN))
....S TRANSON=$$FM2MDY^ABSPOSU1(TDATE)
....S CLAIMID=$P(DATA,U,1)
....S PCN=$P(DATA,U,2)
....S PATNAME=$P(DATA,U,3)
....S NDC=$P(DATA,U,4)
....S INGRPD=$P(DATA,U,5),TINGRPD=TINGRPD+$$CLIP^ABSPOSU9(INGRPD)
....S DISPPD=$P(DATA,U,6),TDISPPD=TDISPPD+$$CLIP^ABSPOSU9(DISPPD)
....S TOTPD=$P(DATA,U,7),TTOTPD=TTOTPD+$$CLIP^ABSPOSU9(TOTPD)
....S PATPAY=$P(DATA,U,8),TPATPAY=TPATPAY+$$CLIP^ABSPOSU9(PATPAY)
....S REMDED=$P(DATA,U,9),TREMDED=TREMDED+$$CLIP^ABSPOSU9(REMDED)
....I ($Y+2)>IOSL,'(IO=$P) D HEADER1,HEADER2
....I ($Y+2)>IOSL,(IO=$P) D
.....S ANS=$$ENDPAGE^ABSPOSU5(0,DTIME)
.....S:ANS=-1!(ANS="^") FLAG=1
.....I 'FLAG D HEADER1,HEADER2
....D:'FLAG WDATA^ABSPOSU9(0,2,"TRANSON:8,CLAIMID:17,PCN:12,PATNAME:20,NDC:13,INGRPD:7,DISPPD:7,TOTPD:9,PATPAY:9,REMDED:11")
.;PRINT Totals
.I ($Y+3)>IOSL,'(IO=$P) D HEADER1,HEADER2
.I ($Y+3)>IOSL,(IO=$P) D
..S ANS=$$ENDPAGE^ABSPOSU5(0,DTIME)
..S:ANS=-1!(ANS="^") FLAG=1
..I 'FLAG D HEADER1,HEADER2
.Q:FLAG
.W ?79,"------- ------- --------- ----------- -----------",!
.W ?78,$J(TINGRPD,8,2)," ",$J(TDISPPD,8,2)," ",$J(TTOTPD,9,2)," ",$J(TPATPAY,11,2)," ",$J(TREMDED,11,2),!
;
Q:FLAG
D:(IO=$P) PRESSANY^ABSPOSU5(1,DTIME)
Q
ABSPER2A ; IHS/FCS/DRS - Payable claims report ; [ 09/12/2002 10:02 AM ]
+1 ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
+2 ;----------------------------------------------------------------------
+3 ;----------------------------------------------------------------------
+4 ;Pharmacy Claim Payable Report (by Tran Date, Sorted by Insurer)
+5 ;----------------------------------------------------------------------
+1 ;D ^AUCLS
WRITE @IOF
+2 WRITE $$LJBF^ABSPOSU9(SCRNTXT,IOM-10)_$$LJBF^ABSPOSU9("PAGE "_PAGE,10),!
+3 WRITE $TRANSLATE($JUSTIFY("",IOM)," ","-"),!
+4 QUIT
+5 ;----------------------------------------------------------------------
SET PSIEN=1
+1 WRITE !
+2 WRITE "Insurer:",?11,$$LJBF^ABSPOSU9(INSNAME,46)
+3 WRITE ?61,"Help #:",?70,$$LJBF^ABSPOSU9($GET(^TMP($JOB,RPTNAME,INSNAME)),20)
+4 WRITE ?92,"Transmission Dates:"
+5 WRITE ?113,$$LJBF^ABSPOSU9($$FM2MDY^ABSPOSU1(SDATE),8)_" - "
+6 WRITE $$LJBF^ABSPOSU9($$FM2MDY^ABSPOSU1(EDATE),8),!
+7 WRITE !
+8 DO WCOLUMNS^ABSPOSU9(0,2,"Trans On:8,Claim ID:17,"_$PIECE($GET(^ABSP(9002313.99,PSIEN,2)),U,1)_" #:12,Patient Name:20,NDC #:13,Ingr Pd:7,Disp Pd:7,Total Pd:9,Pat Pay Amt:11,Rem Dedct:11",1)
+9 QUIT
+10 ;----------------------------------------------------------------------
PRINT ;EP - from ABSPER20
+1 NEW FLAG,INSNAME,TDATE,ANS,RESPIEN,MEDIEN,DATA,TRANSON,CLAIMID,PCN
+2 NEW PATNAME,NDC,INGRPD,DISPPD,TOTPD,PATPAY,REMDED
+3 NEW TINGRPD,TDISPPD,TTOTPD,TPATPAY,TREMDED
+4 ;
+5 ;I IOM<132 D Q
+6 ;.D HEADER1
+7 ;.W !,"Device selected does not support 132 column reports.",!
+8 ;.D:(IO=$P) PRESSANY^ABSPOSU5(1,DTIME)
+9 ;
+10 ;
+11 ;
+12 SET FLAG=0
SET INSNAME=""
+13 FOR
Begin DoDot:1
+14 SET INSNAME=$ORDER(^TMP($JOB,RPTNAME,INSNAME))
+15 IF INSNAME=""
QUIT
+16 SET (TINGRPD,TDISPPD,TTOTPD,TPATPAY,TREMDED)=0
+17 DO HEADER1
DO HEADER2
+18 SET TDATE=""
+19 FOR
Begin DoDot:2
+20 SET TDATE=$ORDER(^TMP($JOB,RPTNAME,INSNAME,TDATE))
+21 IF '+TDATE
QUIT
+22 SET RESPIEN=""
+23 FOR
Begin DoDot:3
+24 SET RESPIEN=$ORDER(^TMP($JOB,RPTNAME,INSNAME,TDATE,RESPIEN))
+25 IF '+RESPIEN
QUIT
+26 SET MEDIEN=""
+27 FOR
Begin DoDot:4
+28 SET MEDIEN=$ORDER(^TMP($JOB,RPTNAME,INSNAME,TDATE,RESPIEN,MEDIEN))
+29 IF '+MEDIEN
QUIT
+30 SET DATA=$GET(^TMP($JOB,RPTNAME,INSNAME,TDATE,RESPIEN,MEDIEN))
+31 SET TRANSON=$$FM2MDY^ABSPOSU1(TDATE)
+32 SET CLAIMID=$PIECE(DATA,U,1)
+33 SET PCN=$PIECE(DATA,U,2)
+34 SET PATNAME=$PIECE(DATA,U,3)
+35 SET NDC=$PIECE(DATA,U,4)
+36 SET INGRPD=$PIECE(DATA,U,5)
SET TINGRPD=TINGRPD+$$CLIP^ABSPOSU9(INGRPD)
+37 SET DISPPD=$PIECE(DATA,U,6)
SET TDISPPD=TDISPPD+$$CLIP^ABSPOSU9(DISPPD)
+38 SET TOTPD=$PIECE(DATA,U,7)
SET TTOTPD=TTOTPD+$$CLIP^ABSPOSU9(TOTPD)
+39 SET PATPAY=$PIECE(DATA,U,8)
SET TPATPAY=TPATPAY+$$CLIP^ABSPOSU9(PATPAY)
+40 SET REMDED=$PIECE(DATA,U,9)
SET TREMDED=TREMDED+$$CLIP^ABSPOSU9(REMDED)
+41 IF ($Y+2)>IOSL
IF '(IO=$PRINCIPAL)
DO HEADER1
DO HEADER2
+42 IF ($Y+2)>IOSL
IF (IO=$PRINCIPAL)
Begin DoDot:5
+43 SET ANS=$$ENDPAGE^ABSPOSU5(0,DTIME)
+44 IF ANS=-1!(ANS="^")
SET FLAG=1
+45 IF 'FLAG
DO HEADER1
DO HEADER2
End DoDot:5
+46 IF 'FLAG
DO WDATA^ABSPOSU9(0,2,"TRANSON:8,CLAIMID:17,PCN:12,PATNAME:20,NDC:13,INGRPD:7,DISPPD:7,TOTPD:9,PATPAY:9,REMDED:11")
End DoDot:4
IF '+MEDIEN!(FLAG)
QUIT
End DoDot:3
IF '+RESPIEN!(FLAG)
QUIT
End DoDot:2
IF '+TDATE!(FLAG)
QUIT
+47 ;PRINT Totals
+48 IF ($Y+3)>IOSL
IF '(IO=$PRINCIPAL)
DO HEADER1
DO HEADER2
+49 IF ($Y+3)>IOSL
IF (IO=$PRINCIPAL)
Begin DoDot:2
+50 SET ANS=$$ENDPAGE^ABSPOSU5(0,DTIME)
+51 IF ANS=-1!(ANS="^")
SET FLAG=1
+52 IF 'FLAG
DO HEADER1
DO HEADER2
End DoDot:2
+53 IF FLAG
QUIT
+54 WRITE ?79,"------- ------- --------- ----------- -----------",!
+55 WRITE ?78,$JUSTIFY(TINGRPD,8,2)," ",$JUSTIFY(TDISPPD,8,2)," ",$JUSTIFY(TTOTPD,9,2)," ",$JUSTIFY(TPATPAY,11,2)," ",$JUSTIFY(TREMDED,11,2),!
End DoDot:1
IF INSNAME=""!(FLAG)
QUIT
+56 ;
+57 IF FLAG
QUIT
+58 IF (IO=$PRINCIPAL)
DO PRESSANY^ABSPOSU5(1,DTIME)
+59 QUIT