ABPAACHD ;OUTSTANDING CLAIM REPORTS HEADER; [ 05/17/91 4:22 PM ]
;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
START S X=0,SITENAME=$P(^DIC(4,DUZ(2),0),"^",1)
NXTX S X=$O(ABPA("HD",X)) G:+X=0 MOVE
S AU("MAX")=X G NXTX
MOVE F I=AU("MAX"):-1:1 S ABPA("HD",I+2)=ABPA("HD",I)
WRITE S ABPA("HD",1)=SITENAME
I ABPA("RTYP")=1 D
.S ABPA("HD",1)=ABPA("HD",1)_" - "_ABPATLE_" - OPEN ITEMS LIST"
I ABPA("RTYP")=3 D
.S ABPA("HD",1)=ABPA("HD",1)_" - "_ABPATLE_" - PAID ITEMS LIST"
S $P(AU("LINE"),"-",$L(ABPA("HD",1))+1)=""
S ABPA("HD",2)=AU("LINE"),AU("MAX")=AU("MAX")+2
S XX="",$P(XX,"*",+IOM)=""
D NOW^%DTC S Y=% X ^DD("DD") S RUNTM=$P(Y,"@",2)
S RUNDT=+%I(1)_"/"_+%I(2)_"/"_+$E(+%I(3),2,3)_" AT "_RUNTM
S ABPAPG=ABPAPG+1 S PG="PAGE: "_ABPAPG W @IOF
W "RUN DATE: ",RUNDT S X="(Task #"_ZTNN_")"
W ?((+IOM/2)-($L(X)/2)),X,?((+IOM-1)-($L(PG))),PG,!,XX
F I=1:1:AU("MAX") D W:I=AU("MAX") !,XX
.W !,"*",?(+IOM/2)-(($L(ABPA("HD",I))/2)),ABPA("HD",I),?(+IOM-2),"*"
I ABPA("RTYP")=1!(ABPA("RTYP")=3) D
.W !!,"PATIENT NAME",?36,"SSN",?52,"SUBSCRIBER NAME",?79,"DOS"
.W ?87,"LOCATION OF SERVICE",?119,"CLAIM AMT"
I ABPA("RTYP")=2 D
.W !!,"INSURANCE COMPANY",?42,"CURRENT",?53,"60 DAY",?63,"90 DAY"
.W ?72,"BALANCE"
I ABPA("RTYP") W ! F I=1:1:(+IOM-1) W "="
W ! K X,Y,I,AU("MAX"),SITENAME,XX,AU("LINE"),RUNDT,RUNTM,PG
F I=3:1 Q:$D(ABPA("HD",I))=0 D K ABPA("HD",I)
.S ABPA("HD",(I-2))=ABPA("HD",I)
QUIT Q
ABPAACHD ;OUTSTANDING CLAIM REPORTS HEADER; [ 05/17/91 4:22 PM ]
+1 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
START SET X=0
SET SITENAME=$PIECE(^DIC(4,DUZ(2),0),"^",1)
NXTX SET X=$ORDER(ABPA("HD",X))
IF +X=0
GOTO MOVE
+1 SET AU("MAX")=X
GOTO NXTX
MOVE FOR I=AU("MAX"):-1:1
SET ABPA("HD",I+2)=ABPA("HD",I)
WRITE SET ABPA("HD",1)=SITENAME
+1 IF ABPA("RTYP")=1
Begin DoDot:1
+2 SET ABPA("HD",1)=ABPA("HD",1)_" - "_ABPATLE_" - OPEN ITEMS LIST"
End DoDot:1
+3 IF ABPA("RTYP")=3
Begin DoDot:1
+4 SET ABPA("HD",1)=ABPA("HD",1)_" - "_ABPATLE_" - PAID ITEMS LIST"
End DoDot:1
+5 SET $PIECE(AU("LINE"),"-",$LENGTH(ABPA("HD",1))+1)=""
+6 SET ABPA("HD",2)=AU("LINE")
SET AU("MAX")=AU("MAX")+2
+7 SET XX=""
SET $PIECE(XX,"*",+IOM)=""
+8 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET RUNTM=$PIECE(Y,"@",2)
+9 SET RUNDT=+%I(1)_"/"_+%I(2)_"/"_+$EXTRACT(+%I(3),2,3)_" AT "_RUNTM
+10 SET ABPAPG=ABPAPG+1
SET PG="PAGE: "_ABPAPG
WRITE @IOF
+11 WRITE "RUN DATE: ",RUNDT
SET X="(Task #"_ZTNN_")"
+12 WRITE ?((+IOM/2)-($LENGTH(X)/2)),X,?((+IOM-1)-($LENGTH(PG))),PG,!,XX
+13 FOR I=1:1:AU("MAX")
Begin DoDot:1
+14 WRITE !,"*",?(+IOM/2)-(($LENGTH(ABPA("HD",I))/2)),ABPA("HD",I),?(+IOM-2),"*"
End DoDot:1
IF I=AU("MAX")
WRITE !,XX
+15 IF ABPA("RTYP")=1!(ABPA("RTYP")=3)
Begin DoDot:1
+16 WRITE !!,"PATIENT NAME",?36,"SSN",?52,"SUBSCRIBER NAME",?79,"DOS"
+17 WRITE ?87,"LOCATION OF SERVICE",?119,"CLAIM AMT"
End DoDot:1
+18 IF ABPA("RTYP")=2
Begin DoDot:1
+19 WRITE !!,"INSURANCE COMPANY",?42,"CURRENT",?53,"60 DAY",?63,"90 DAY"
+20 WRITE ?72,"BALANCE"
End DoDot:1
+21 IF ABPA("RTYP")
WRITE !
FOR I=1:1:(+IOM-1)
WRITE "="
+22 WRITE !
KILL X,Y,I,AU("MAX"),SITENAME,XX,AU("LINE"),RUNDT,RUNTM,PG
+23 FOR I=3:1
IF $DATA(ABPA("HD",I))=0
QUIT
Begin DoDot:1
+24 SET ABPA("HD",(I-2))=ABPA("HD",I)
End DoDot:1
KILL ABPA("HD",I)
QUIT QUIT