ABPAOP5 ;PRINT AO PVT INS POSTING LOG; [ 03/10/91 4:31 PM ]
;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
A0 Q ;;NOT AN ENTRY POINT
A1 ;QUEUE POSTING LOG PRINT JOB
W !!,"YOUR POSTING LOG WILL NOW BE PRINTED!"
S ZTRTN="ENTER^ABPAOP5",ZTDESC="PRINT AO PVT INS POSTING LOG"
S ZTDTH=$H,ZTIO=ABPA("IO"),ZTSAVE("ABPA(")="" D ^%ZTLOAD
K ABPA,ZTRTN,ZTDESC,ZTIO,ZTSAVE
Q
;
ENTER ;ENTRY POINT FOR TASK MANAGER
K ABPA("HD") S ABPA("HD",1)="AO PRIVATE INSURANCE SYSTEM"
S ABPA("HD",2)="DATABASE POSTING LOG",ABPAPG=0
LOOP1 K ^TMP("ABPAOP",$J) S FC=0 F I=0:0 D Q:+FC=0
.S FC=$O(^ABPAPOST(1,"F","B",FC)) Q:+FC=0
.S SITENAME=$P(^DIC(4,FC,0),"^")
.S NVCNT=$P(^ABPAPOST(1,"F",FC,0),"^",5)
.S NPCNT=$P(^ABPAPOST(1,"F",FC,0),"^",6)
.S NCCNT=$P(^ABPAPOST(1,"F",FC,0),"^",7)
.S ^TMP("ABPAOP",$J,SITENAME,"TOTALS")=NVCNT_"^"_NPCNT_"^"_NCCNT
.S DFN=0 F I=0:0 D Q:+DFN=0
..S DFN=$O(^ABPAPOST(1,"F",FC,"P",DFN)) Q:+DFN=0
..S PATNAME=$P(^ABPVAO(DFN,0),"^"),HRN=$P(^(0),"^",3)
..S ^TMP("ABPAOP",$J,SITENAME,"P",PATNAME)=HRN
.S DFN=0 F I=0:0 D Q:+DFN=0
..S DFN=$O(^ABPAPOST(1,"F",FC,"I",DFN)) Q:+DFN=0
..S INSNAME=$P(^AUTNINS(DFN,0),"^"),ZIP=$P(^(0),"^",5)
..S ^TMP("ABPAOP",$J,SITENAME,"I",INSNAME)=ZIP
LOOP2 S FC=0 F I=0:0 D Q:FC=""
.S FC=$O(^TMP("ABPAOP",$J,FC)) Q:FC=""
.S DATA=^TMP("ABPAOP",$J,FC,"TOTALS")
.S NVCNT=$P(DATA,"^"),NPCNT=$P(DATA,"^",2),NCCNT=$P(DATA,"^",3)
.D HEADP
.S DFN=0 F I=0:0 D Q:DFN=""
..S DFN=$O(^TMP("ABPAOP",$J,FC,"P",DFN)) Q:DFN=""
..W !?15,DFN,?48,$J(^TMP("ABPAOP",$J,FC,"P",DFN),6)
..D:$Y>57 HEADP
.I $Y<50 D
..W !!!?24,"INSURER NAME",?52,"ZIP",!?15
..W "------------------------------",?48,"----------"
.I $Y'<50 D HEADI
.S DFN=0 F I=0:0 D Q:DFN=""
..S DFN=$O(^TMP("ABPAOP",$J,FC,"I",DFN)) Q:DFN=""
..W !?15,DFN,?48,$J(^TMP("ABPAOP",$J,FC,"I",DFN),10)
..D:$Y>57 HEADI
.W !?5 F I=1:1:70 W "-"
.W !!?10,$J("# NEW INSURERS ADDED: ",25),$J(NVCNT,6)
.W !?10,$J("# NEW PATIENTS ADDED: ",25),$J(NPCNT,6)
.W !?10,$J("# NEW CLAIMS ADDED: ",25),$J(NCCNT,6)
TOTAL S FC="ALL FACILITIES" D ^ABPAOPHD
W !!?5 F I=1:1:70 W "-"
W !!?10,$J("TOTAL NEW INSURERS ADDED: ",30)
W $J($P(^ABPAPOST(1,0),"^",2),8)
W !!?10,$J("TOTAL NEW PATIENTS ADDED: ",30)
W $J($P(^ABPAPOST(1,0),"^",3),8)
W !!?10,$J("TOTAL NEW CLAIMS ADDED: ",30)
W $J($P(^ABPAPOST(1,0),"^",4),8)
D ^%AUCLS
;
Q
;
HEADP D ^ABPAOPHD
W !!?24,"PATIENT NAME",?50,"HRN",!?15,"------------------------------"
W ?48,"------"
Q
;
HEADI D ^ABPAOPHD
W !!?24,"INSURER NAME",?52,"ZIP",!?15
W "------------------------------",?48,"----------"
ABPAOP5 ;PRINT AO PVT INS POSTING LOG; [ 03/10/91 4:31 PM ]
+1 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
A0 ;;NOT AN ENTRY POINT
QUIT
A1 ;QUEUE POSTING LOG PRINT JOB
+1 WRITE !!,"YOUR POSTING LOG WILL NOW BE PRINTED!"
+2 SET ZTRTN="ENTER^ABPAOP5"
SET ZTDESC="PRINT AO PVT INS POSTING LOG"
+3 SET ZTDTH=$HOROLOG
SET ZTIO=ABPA("IO")
SET ZTSAVE("ABPA(")=""
DO ^%ZTLOAD
+4 KILL ABPA,ZTRTN,ZTDESC,ZTIO,ZTSAVE
+5 QUIT
+6 ;
ENTER ;ENTRY POINT FOR TASK MANAGER
+1 KILL ABPA("HD")
SET ABPA("HD",1)="AO PRIVATE INSURANCE SYSTEM"
+2 SET ABPA("HD",2)="DATABASE POSTING LOG"
SET ABPAPG=0
LOOP1 KILL ^TMP("ABPAOP",$JOB)
SET FC=0
FOR I=0:0
Begin DoDot:1
+1 SET FC=$ORDER(^ABPAPOST(1,"F","B",FC))
IF +FC=0
QUIT
+2 SET SITENAME=$PIECE(^DIC(4,FC,0),"^")
+3 SET NVCNT=$PIECE(^ABPAPOST(1,"F",FC,0),"^",5)
+4 SET NPCNT=$PIECE(^ABPAPOST(1,"F",FC,0),"^",6)
+5 SET NCCNT=$PIECE(^ABPAPOST(1,"F",FC,0),"^",7)
+6 SET ^TMP("ABPAOP",$JOB,SITENAME,"TOTALS")=NVCNT_"^"_NPCNT_"^"_NCCNT
+7 SET DFN=0
FOR I=0:0
Begin DoDot:2
+8 SET DFN=$ORDER(^ABPAPOST(1,"F",FC,"P",DFN))
IF +DFN=0
QUIT
+9 SET PATNAME=$PIECE(^ABPVAO(DFN,0),"^")
SET HRN=$PIECE(^(0),"^",3)
+10 SET ^TMP("ABPAOP",$JOB,SITENAME,"P",PATNAME)=HRN
End DoDot:2
IF +DFN=0
QUIT
+11 SET DFN=0
FOR I=0:0
Begin DoDot:2
+12 SET DFN=$ORDER(^ABPAPOST(1,"F",FC,"I",DFN))
IF +DFN=0
QUIT
+13 SET INSNAME=$PIECE(^AUTNINS(DFN,0),"^")
SET ZIP=$PIECE(^(0),"^",5)
+14 SET ^TMP("ABPAOP",$JOB,SITENAME,"I",INSNAME)=ZIP
End DoDot:2
IF +DFN=0
QUIT
End DoDot:1
IF +FC=0
QUIT
LOOP2 SET FC=0
FOR I=0:0
Begin DoDot:1
+1 SET FC=$ORDER(^TMP("ABPAOP",$JOB,FC))
IF FC=""
QUIT
+2 SET DATA=^TMP("ABPAOP",$JOB,FC,"TOTALS")
+3 SET NVCNT=$PIECE(DATA,"^")
SET NPCNT=$PIECE(DATA,"^",2)
SET NCCNT=$PIECE(DATA,"^",3)
+4 DO HEADP
+5 SET DFN=0
FOR I=0:0
Begin DoDot:2
+6 SET DFN=$ORDER(^TMP("ABPAOP",$JOB,FC,"P",DFN))
IF DFN=""
QUIT
+7 WRITE !?15,DFN,?48,$JUSTIFY(^TMP("ABPAOP",$JOB,FC,"P",DFN),6)
+8 IF $Y>57
DO HEADP
End DoDot:2
IF DFN=""
QUIT
+9 IF $Y<50
Begin DoDot:2
+10 WRITE !!!?24,"INSURER NAME",?52,"ZIP",!?15
+11 WRITE "------------------------------",?48,"----------"
End DoDot:2
+12 IF $Y'<50
DO HEADI
+13 SET DFN=0
FOR I=0:0
Begin DoDot:2
+14 SET DFN=$ORDER(^TMP("ABPAOP",$JOB,FC,"I",DFN))
IF DFN=""
QUIT
+15 WRITE !?15,DFN,?48,$JUSTIFY(^TMP("ABPAOP",$JOB,FC,"I",DFN),10)
+16 IF $Y>57
DO HEADI
End DoDot:2
IF DFN=""
QUIT
+17 WRITE !?5
FOR I=1:1:70
WRITE "-"
+18 WRITE !!?10,$JUSTIFY("# NEW INSURERS ADDED: ",25),$JUSTIFY(NVCNT,6)
+19 WRITE !?10,$JUSTIFY("# NEW PATIENTS ADDED: ",25),$JUSTIFY(NPCNT,6)
+20 WRITE !?10,$JUSTIFY("# NEW CLAIMS ADDED: ",25),$JUSTIFY(NCCNT,6)
End DoDot:1
IF FC=""
QUIT
TOTAL SET FC="ALL FACILITIES"
DO ^ABPAOPHD
+1 WRITE !!?5
FOR I=1:1:70
WRITE "-"
+2 WRITE !!?10,$JUSTIFY("TOTAL NEW INSURERS ADDED: ",30)
+3 WRITE $JUSTIFY($PIECE(^ABPAPOST(1,0),"^",2),8)
+4 WRITE !!?10,$JUSTIFY("TOTAL NEW PATIENTS ADDED: ",30)
+5 WRITE $JUSTIFY($PIECE(^ABPAPOST(1,0),"^",3),8)
+6 WRITE !!?10,$JUSTIFY("TOTAL NEW CLAIMS ADDED: ",30)
+7 WRITE $JUSTIFY($PIECE(^ABPAPOST(1,0),"^",4),8)
+8 DO ^%AUCLS
+9 ;
+10 QUIT
+11 ;
HEADP DO ^ABPAOPHD
+1 WRITE !!?24,"PATIENT NAME",?50,"HRN",!?15,"------------------------------"
+2 WRITE ?48,"------"
+3 QUIT
+4 ;
HEADI DO ^ABPAOPHD
+1 WRITE !!?24,"INSURER NAME",?52,"ZIP",!?15
+2 WRITE "------------------------------",?48,"----------"