ABSPECZA ; IHS/FCS/DRS - JWS 04:27 PM 28 Sep 1995 ; [ 09/12/2002 10:01 AM ]
;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
;----------------------------------------------------------------------
;----------------------------------------------------------------------
DISPLAY(SCRNTXT,IEN) ;EP - from ABSPECZ2 and ABSPECZ3
;Manage local variables
N DIC,DR,DA,DIQ,DR,F1,F2,F3,F4,CFLDS,RFLDS,RDA,CDA
N RJTCODE,RJTNEXT,RJTDA,RJTCOUNT,ANS
;
;Make sure input variables are defined
Q:$G(SCRNTXT)=""
Q:$G(IEN)=""
;
;G data from Claim Submission Record
S CDA=$P(IEN,U,1)
S F1=9002313.02,F2=9002313.0201
S DIC="^ABSPC(" ; 03/12/2001
S DR=".01;.02;.05;1.01;1.02;1.03;301;302;3004;400"
S DA=$P(IEN,U,1)
S DIQ="CFLDS"
S DIQ(0)="E"
S DR(F2)=".04;401:405;407;409:412"
S DA(F2)=$P(IEN,U,2)
D EN^DIQ1
;
;G data from Claim Response Record
S RDA=$P(IEN,U,3)
I RDA'="" D
.S F3=9002313.03,F4=9002313.0301
.S DIC="^ABSPR(" ; 03/12/2001
.S DR=".02;1000"
.S (RDA,DA)=$P(IEN,U,3)
.S DIQ="RFLDS"
.S DIQ(0)="E"
.S DR(F4)="501;503;504;505;506;507;508;509;510;513"
.S DA(F4)=$P(IEN,U,2)
.D EN^DIQ1
;
D WHEADER^ABSPOSU9(SCRNTXT,IOF,IOM)
W !
W "Claim ID:",?14,$G(CFLDS(F1,CDA,.01,"E"))
W ?46,"Sent On:",?61,$P($G(CFLDS(F1,CDA,.05,"E")),"@",1),!
W "PCN#:",?14,$G(CFLDS(F1,CDA,1.02,"E"))
W ?46,"VCN#:",?61,$G(CFLDS(F1,CDA,1.03,"E")),!
W $TR($J("",80)," ","-"),!
;
W "Insurer:",?14,$G(CFLDS(F1,CDA,.02,"E"))
W ?46,"Group #:",?61,$G(CFLDS(F1,CDA,301,"E")),!
W "Patient:",?14,$G(CFLDS(F1,CDA,1.01,"E"))
W ?46,"Card #:",?61,$G(CFLDS(F1,CDA,302,"E")),!
;
W $TR($J("",80)," ","-"),!
W "Medication:",?14,$G(CFLDS(F2,DA(F2),.04,"E")),!
W "NDC #:",?14,$G(CFLDS(F2,DA(F2),407,"E"))
W ?46,"Prescriber:",?61,$G(CFLDS(F2,DA(F2),411,"E")),!
W "RX #:",?14,$G(CFLDS(F2,DA(F2),402,"E"))
W ?46,"Date Filled:",?61,$G(CFLDS(F2,DA(F2),401,"E")),!
W "N/Refill:",?14,$G(CFLDS(F2,DA(F2),403,"E"))
W ?46,"Ingr Cost:",?61,$G(CFLDS(F2,DA(F2),409,"E")),!
W "Quantity:",?14,$G(CFLDS(F2,DA(F2),404,"E"))
W ?46,"Sales Tax:",?61,$G(CFLDS(F2,DA(F2),410,"E")),!
W "Day Supply:",?14,$G(CFLDS(F2,DA(F2),405,"E"))
W ?46,"Disp Fee:",?61,$G(CFLDS(F2,DA(F2),412,"E")),!
;
I RDA="" D PRESSANY^ABSPOSU5(1,DTIME) Q
;
W $TR($J("",80)," ","-"),!
;
I $G(RFLDS(F4,DA(F4),501,"E"))="CLAIM PAYABLE" D
.W "Resp Status:",?14,$G(RFLDS(F4,DA(F4),501,"E"))
.W ?46,"Ingr Cost Pd:",?61,$G(RFLDS(F4,DA(F4),506,"E")),!
.W "Patient Pay:",?14,$G(RFLDS(F4,DA(F4),505,"E"))
.W ?46,"Sales Tax Pd:",?61,$G(RFLDS(F4,DA(F4),508,"E")),!
.W "Rem Ded Amt:",?14,$G(RFLDS(F4,DA(F4),513,"E"))
.W ?46,"Disp Fee Pd:",?61,$G(RFLDS(F4,DA(F4),507,"E")),!
.W "Authoriz #:",?14,$G(RFLDS(F4,DA(F4),503,"E"))
.W ?46,"Total Paid:",?61,$G(RFLDS(F4,DA(F4),509,"E")),!
.W "Message:",?14,$E($G(RFLDS(F4,DA(F4),504,"E")),1,75),!
.D PRESSANY^ABSPOSU5(1,DTIME)
;
I $G(RFLDS(F4,DA(F4),501,"E"))="CLAIM CAPTURED" D
.W "Resp Status:",?14,$G(RFLDS(F4,DA(F4),501,"E")),!
.W "Authoriz #:",?14,$G(RFLDS(F4,DA(F4),503,"E")),!
.W "Message:",?14,$E($G(RFLDS(F4,DA(F4),504,"E")),1,75),!
.D PRESSANY^ABSPOSU5(1,DTIME)
;
I $G(RFLDS(F4,DA(F4),501,"E"))="REJECTED CLAIM" D
.W "Resp Status:",?14,$G(RFLDS(F4,DA(F4),501,"E"))
.W ?46,"Reject COUNT:",?61,$G(RFLDS(F4,DA(F4),510,"E")),!
.W "Message:",?14,$E($G(RFLDS(F4,DA(F4),504,"E")),1,75),!
.S ANS=$$YESNO^ABSPOSU3("DISPLAY Reject CODEs","NO",0,DTIME)
.Q:ANS'=1
.D WHEADER^ABSPOSU9(SCRNTXT,IOF,IOM)
.W !
.W "Claim ID:",?14,$G(CFLDS(F1,CDA,.01,"E"))
.W ?46,"Sent On:",?61,$P($G(CFLDS(F1,CDA,.05,"E")),"@",1),!
.W $TR($J("",80)," ","-"),!
.S (RJTCOUNT,RJTNEXT)=0
.F D Q:'+RJTNEXT
..S RJTNEXT=$O(^ABSPR(RDA,1000,DA(F4),511,RJTNEXT))
..Q:'RJTNEXT
..S RJTCODE=$P($G(^ABSPR(RDA,1000,DA(F4),511,RJTNEXT,0)),U,1)
..Q:RJTCODE=""
..Q:'$D(^ABSPF(9002313.93,"B",RJTCODE))
..S RJTDA=$O(^ABSPF(9002313.93,"B",RJTCODE,0))
..Q:RJTDA=""
..S RJTCOUNT=RJTCOUNT+1
..W "Reject "_$J(RJTCOUNT,2)_":",?14,$E($P($G(^ABSPF(9002313.93,RJTDA,0)),U,2),1,75),!
.D PRESSANY^ABSPOSU5(1,DTIME)
Q
ABSPECZA ; IHS/FCS/DRS - JWS 04:27 PM 28 Sep 1995 ; [ 09/12/2002 10:01 AM ]
+1 ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
+2 ;----------------------------------------------------------------------
+3 ;----------------------------------------------------------------------
DISPLAY(SCRNTXT,IEN) ;EP - from ABSPECZ2 and ABSPECZ3
+1 ;Manage local variables
+2 NEW DIC,DR,DA,DIQ,DR,F1,F2,F3,F4,CFLDS,RFLDS,RDA,CDA
+3 NEW RJTCODE,RJTNEXT,RJTDA,RJTCOUNT,ANS
+4 ;
+5 ;Make sure input variables are defined
+6 IF $GET(SCRNTXT)=""
QUIT
+7 IF $GET(IEN)=""
QUIT
+8 ;
+9 ;G data from Claim Submission Record
+10 SET CDA=$PIECE(IEN,U,1)
+11 SET F1=9002313.02
SET F2=9002313.0201
+12 ; 03/12/2001
SET DIC="^ABSPC("
+13 SET DR=".01;.02;.05;1.01;1.02;1.03;301;302;3004;400"
+14 SET DA=$PIECE(IEN,U,1)
+15 SET DIQ="CFLDS"
+16 SET DIQ(0)="E"
+17 SET DR(F2)=".04;401:405;407;409:412"
+18 SET DA(F2)=$PIECE(IEN,U,2)
+19 DO EN^DIQ1
+20 ;
+21 ;G data from Claim Response Record
+22 SET RDA=$PIECE(IEN,U,3)
+23 IF RDA'=""
Begin DoDot:1
+24 SET F3=9002313.03
SET F4=9002313.0301
+25 ; 03/12/2001
SET DIC="^ABSPR("
+26 SET DR=".02;1000"
+27 SET (RDA,DA)=$PIECE(IEN,U,3)
+28 SET DIQ="RFLDS"
+29 SET DIQ(0)="E"
+30 SET DR(F4)="501;503;504;505;506;507;508;509;510;513"
+31 SET DA(F4)=$PIECE(IEN,U,2)
+32 DO EN^DIQ1
End DoDot:1
+33 ;
+34 DO WHEADER^ABSPOSU9(SCRNTXT,IOF,IOM)
+35 WRITE !
+36 WRITE "Claim ID:",?14,$GET(CFLDS(F1,CDA,.01,"E"))
+37 WRITE ?46,"Sent On:",?61,$PIECE($GET(CFLDS(F1,CDA,.05,"E")),"@",1),!
+38 WRITE "PCN#:",?14,$GET(CFLDS(F1,CDA,1.02,"E"))
+39 WRITE ?46,"VCN#:",?61,$GET(CFLDS(F1,CDA,1.03,"E")),!
+40 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
+41 ;
+42 WRITE "Insurer:",?14,$GET(CFLDS(F1,CDA,.02,"E"))
+43 WRITE ?46,"Group #:",?61,$GET(CFLDS(F1,CDA,301,"E")),!
+44 WRITE "Patient:",?14,$GET(CFLDS(F1,CDA,1.01,"E"))
+45 WRITE ?46,"Card #:",?61,$GET(CFLDS(F1,CDA,302,"E")),!
+46 ;
+47 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
+48 WRITE "Medication:",?14,$GET(CFLDS(F2,DA(F2),.04,"E")),!
+49 WRITE "NDC #:",?14,$GET(CFLDS(F2,DA(F2),407,"E"))
+50 WRITE ?46,"Prescriber:",?61,$GET(CFLDS(F2,DA(F2),411,"E")),!
+51 WRITE "RX #:",?14,$GET(CFLDS(F2,DA(F2),402,"E"))
+52 WRITE ?46,"Date Filled:",?61,$GET(CFLDS(F2,DA(F2),401,"E")),!
+53 WRITE "N/Refill:",?14,$GET(CFLDS(F2,DA(F2),403,"E"))
+54 WRITE ?46,"Ingr Cost:",?61,$GET(CFLDS(F2,DA(F2),409,"E")),!
+55 WRITE "Quantity:",?14,$GET(CFLDS(F2,DA(F2),404,"E"))
+56 WRITE ?46,"Sales Tax:",?61,$GET(CFLDS(F2,DA(F2),410,"E")),!
+57 WRITE "Day Supply:",?14,$GET(CFLDS(F2,DA(F2),405,"E"))
+58 WRITE ?46,"Disp Fee:",?61,$GET(CFLDS(F2,DA(F2),412,"E")),!
+59 ;
+60 IF RDA=""
DO PRESSANY^ABSPOSU5(1,DTIME)
QUIT
+61 ;
+62 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
+63 ;
+64 IF $GET(RFLDS(F4,DA(F4),501,"E"))="CLAIM PAYABLE"
Begin DoDot:1
+65 WRITE "Resp Status:",?14,$GET(RFLDS(F4,DA(F4),501,"E"))
+66 WRITE ?46,"Ingr Cost Pd:",?61,$GET(RFLDS(F4,DA(F4),506,"E")),!
+67 WRITE "Patient Pay:",?14,$GET(RFLDS(F4,DA(F4),505,"E"))
+68 WRITE ?46,"Sales Tax Pd:",?61,$GET(RFLDS(F4,DA(F4),508,"E")),!
+69 WRITE "Rem Ded Amt:",?14,$GET(RFLDS(F4,DA(F4),513,"E"))
+70 WRITE ?46,"Disp Fee Pd:",?61,$GET(RFLDS(F4,DA(F4),507,"E")),!
+71 WRITE "Authoriz #:",?14,$GET(RFLDS(F4,DA(F4),503,"E"))
+72 WRITE ?46,"Total Paid:",?61,$GET(RFLDS(F4,DA(F4),509,"E")),!
+73 WRITE "Message:",?14,$EXTRACT($GET(RFLDS(F4,DA(F4),504,"E")),1,75),!
+74 DO PRESSANY^ABSPOSU5(1,DTIME)
End DoDot:1
+75 ;
+76 IF $GET(RFLDS(F4,DA(F4),501,"E"))="CLAIM CAPTURED"
Begin DoDot:1
+77 WRITE "Resp Status:",?14,$GET(RFLDS(F4,DA(F4),501,"E")),!
+78 WRITE "Authoriz #:",?14,$GET(RFLDS(F4,DA(F4),503,"E")),!
+79 WRITE "Message:",?14,$EXTRACT($GET(RFLDS(F4,DA(F4),504,"E")),1,75),!
+80 DO PRESSANY^ABSPOSU5(1,DTIME)
End DoDot:1
+81 ;
+82 IF $GET(RFLDS(F4,DA(F4),501,"E"))="REJECTED CLAIM"
Begin DoDot:1
+83 WRITE "Resp Status:",?14,$GET(RFLDS(F4,DA(F4),501,"E"))
+84 WRITE ?46,"Reject COUNT:",?61,$GET(RFLDS(F4,DA(F4),510,"E")),!
+85 WRITE "Message:",?14,$EXTRACT($GET(RFLDS(F4,DA(F4),504,"E")),1,75),!
+86 SET ANS=$$YESNO^ABSPOSU3("DISPLAY Reject CODEs","NO",0,DTIME)
+87 IF ANS'=1
QUIT
+88 DO WHEADER^ABSPOSU9(SCRNTXT,IOF,IOM)
+89 WRITE !
+90 WRITE "Claim ID:",?14,$GET(CFLDS(F1,CDA,.01,"E"))
+91 WRITE ?46,"Sent On:",?61,$PIECE($GET(CFLDS(F1,CDA,.05,"E")),"@",1),!
+92 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
+93 SET (RJTCOUNT,RJTNEXT)=0
+94 FOR
Begin DoDot:2
+95 SET RJTNEXT=$ORDER(^ABSPR(RDA,1000,DA(F4),511,RJTNEXT))
+96 IF 'RJTNEXT
QUIT
+97 SET RJTCODE=$PIECE($GET(^ABSPR(RDA,1000,DA(F4),511,RJTNEXT,0)),U,1)
+98 IF RJTCODE=""
QUIT
+99 IF '$DATA(^ABSPF(9002313.93,"B",RJTCODE))
QUIT
+100 SET RJTDA=$ORDER(^ABSPF(9002313.93,"B",RJTCODE,0))
+101 IF RJTDA=""
QUIT
+102 SET RJTCOUNT=RJTCOUNT+1
+103 WRITE "Reject "_$JUSTIFY(RJTCOUNT,2)_":",?14,$EXTRACT($PIECE($GET(^ABSPF(9002313.93,RJTDA,0)),U,2),1,75),!
End DoDot:2
IF '+RJTNEXT
QUIT
+104 DO PRESSANY^ABSPOSU5(1,DTIME)
End DoDot:1
+105 QUIT