ABPAAGS2 ;PRINT AGED CLAIM SUMMARY; [ 05/17/91 4:53 PM ]
;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
W !!?5,"<<< NOT AN ENTRY POINT - ACCESS DENIED >>>" G END
;--------------------------------------------------------------------
INIT ;PROCEDURE TO INITIALIZE TEMPORARY LOCAL VARIABLES
K ABPA("HD")
S FRDT=+$E(BDT,4,5)_"/"_+$E(BDT,6,7)_"/"_+$E(BDT,2,3)
S TODT=+$E(EDT,4,5)_"/"_+$E(EDT,6,7)_"/"_+$E(EDT,2,3)
S ABPA("HD",1)=ABPATLE,ABPA("HD",2)="AGED CLAIMS SUMMARY LISTING"
S ABPA("HD",3)="Claims submitted between "_FRDT_" and "_TODT
S (ABPAPG,P1T,P2T,P3T,P4T)=0,ZTNN=ZTSK,ZTSK=ZTN
D ^ABPAPRT S IOP=IO_";80" D ^%ZIS K IOP
I $D(A("PRINT",10)) W @A("PRINT",10) ; Set for standard print.
Q
;--------------------------------------------------------------------
GETDATA ;PROCEDURE TO GET COMPILED DATA FROM THE %ZTSK NODE
S P=0 F I=0:0 D Q:P=""
.S P=$O(^%ZTSK(ZTSK,"INSURER",P)) Q:P=""
.S INSURER=$P(P,"/.:"),ZIP=$P(P,"/.:",2)
.S (R,P1,P2,P3,P4)=0 F J=0:0 D Q:+R<1
..S R=$O(^%ZTSK(ZTSK,"INSURER",P,R)) Q:+R<1
..Q:$D(^%ZTSK(ZTSK,"AGING",R))'=1
..S DATA=^%ZTSK(ZTSK,"AGING",R) F K=1:1:4 D
...S @("P"_K)=@("P"_K)+$P(DATA,"^",K)
...S @("P"_K_"T")=@("P"_K_"T")+$P(DATA,"^",K)
.I $Y>57 D ^ABPAACHD
.W !,INSURER I ($L(INSURER)+$L(ZIP)+3)<40 W " (",ZIP,")"
.W ?40,$J($P(DATA,"^"),9,2),?50,$J($P(DATA,"^",2),9,2)
.W ?60,$J($P(DATA,"^",3),9,2),?70,$J($P(DATA,"^",4),9,2)
.I ($L(INSURER)+$L(ZIP)+3)>39 W !?5,"(",ZIP,")"
W !?40,"---------",?50,"---------",?60,"---------",?70,"---------"
W !,?56,".",?76,".",!
W "*** Report Totals ***",?37,"$" S X=P1T D COMMA^%DTC W X,?56,"."
W ?58 S X=P3T D COMMA^%DTC W X,?76,"."
W !?56,".",?76,".",!?48 S X=P2T D COMMA^%DTC W X
W ?68 S X=P4T D COMMA^%DTC W X,@IOF X ^%ZIS("C")
Q
;---------------------------------------------------------------------
END ;PROCEDURE TO KILL ALL TEMPORARY LOCAL VARIABLES
K X,Y,ABPA("HD"),I,J,ABPAPG,K,L,R,RR,RRR,RRRRDOS,AGE,AMT,ZTN,P,ABPAPG
K ITOT,GTOT,OHRN,RTMP,FRDT,TODT,P1,P2,P3,P4,P1T,P2T,P3T,P4T,ZTNN
Q
;--------------------------------------------------------------------
MAIN ;ENTRY POINT - CALLED BY TASK MANAGER
D INIT
D ^ABPAACHD
D GETDATA
D END
Q
ABPAAGS2 ;PRINT AGED CLAIM SUMMARY; [ 05/17/91 4:53 PM ]
+1 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
+2 WRITE !!?5,"<<< NOT AN ENTRY POINT - ACCESS DENIED >>>"
GOTO END
+3 ;--------------------------------------------------------------------
INIT ;PROCEDURE TO INITIALIZE TEMPORARY LOCAL VARIABLES
+1 KILL ABPA("HD")
+2 SET FRDT=+$EXTRACT(BDT,4,5)_"/"_+$EXTRACT(BDT,6,7)_"/"_+$EXTRACT(BDT,2,3)
+3 SET TODT=+$EXTRACT(EDT,4,5)_"/"_+$EXTRACT(EDT,6,7)_"/"_+$EXTRACT(EDT,2,3)
+4 SET ABPA("HD",1)=ABPATLE
SET ABPA("HD",2)="AGED CLAIMS SUMMARY LISTING"
+5 SET ABPA("HD",3)="Claims submitted between "_FRDT_" and "_TODT
+6 SET (ABPAPG,P1T,P2T,P3T,P4T)=0
SET ZTNN=ZTSK
SET ZTSK=ZTN
+7 DO ^ABPAPRT
SET IOP=IO_";80"
DO ^%ZIS
KILL IOP
+8 ; Set for standard print.
IF $DATA(A("PRINT",10))
WRITE @A("PRINT",10)
+9 QUIT
+10 ;--------------------------------------------------------------------
GETDATA ;PROCEDURE TO GET COMPILED DATA FROM THE %ZTSK NODE
+1 SET P=0
FOR I=0:0
Begin DoDot:1
+2 SET P=$ORDER(^%ZTSK(ZTSK,"INSURER",P))
IF P=""
QUIT
+3 SET INSURER=$PIECE(P,"/.:")
SET ZIP=$PIECE(P,"/.:",2)
+4 SET (R,P1,P2,P3,P4)=0
FOR J=0:0
Begin DoDot:2
+5 SET R=$ORDER(^%ZTSK(ZTSK,"INSURER",P,R))
IF +R<1
QUIT
+6 IF $DATA(^%ZTSK(ZTSK,"AGING",R))'=1
QUIT
+7 SET DATA=^%ZTSK(ZTSK,"AGING",R)
FOR K=1:1:4
Begin DoDot:3
+8 SET @("P"_K)=@("P"_K)+$PIECE(DATA,"^",K)
+9 SET @("P"_K_"T")=@("P"_K_"T")+$PIECE(DATA,"^",K)
End DoDot:3
End DoDot:2
IF +R<1
QUIT
+10 IF $Y>57
DO ^ABPAACHD
+11 WRITE !,INSURER
IF ($LENGTH(INSURER)+$LENGTH(ZIP)+3)<40
WRITE " (",ZIP,")"
+12 WRITE ?40,$JUSTIFY($PIECE(DATA,"^"),9,2),?50,$JUSTIFY($PIECE(DATA,"^",2),9,2)
+13 WRITE ?60,$JUSTIFY($PIECE(DATA,"^",3),9,2),?70,$JUSTIFY($PIECE(DATA,"^",4),9,2)
+14 IF ($LENGTH(INSURER)+$LENGTH(ZIP)+3)>39
WRITE !?5,"(",ZIP,")"
End DoDot:1
IF P=""
QUIT
+15 WRITE !?40,"---------",?50,"---------",?60,"---------",?70,"---------"
+16 WRITE !,?56,".",?76,".",!
+17 WRITE "*** Report Totals ***",?37,"$"
SET X=P1T
DO COMMA^%DTC
WRITE X,?56,"."
+18 WRITE ?58
SET X=P3T
DO COMMA^%DTC
WRITE X,?76,"."
+19 WRITE !?56,".",?76,".",!?48
SET X=P2T
DO COMMA^%DTC
WRITE X
+20 WRITE ?68
SET X=P4T
DO COMMA^%DTC
WRITE X,@IOF
XECUTE ^%ZIS("C")
+21 QUIT
+22 ;---------------------------------------------------------------------
END ;PROCEDURE TO KILL ALL TEMPORARY LOCAL VARIABLES
+1 KILL X,Y,ABPA("HD"),I,J,ABPAPG,K,L,R,RR,RRR,RRRRDOS,AGE,AMT,ZTN,P,ABPAPG
+2 KILL ITOT,GTOT,OHRN,RTMP,FRDT,TODT,P1,P2,P3,P4,P1T,P2T,P3T,P4T,ZTNN
+3 QUIT
+4 ;--------------------------------------------------------------------
MAIN ;ENTRY POINT - CALLED BY TASK MANAGER
+1 DO INIT
+2 DO ^ABPAACHD
+3 DO GETDATA
+4 DO END
+5 QUIT