ABPVCK0 ;3P BILL TRANSMISSION EDIT REPORT;[ 08/07/91 3:51 PM ]
;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
G A0
;--------------------------------------------------------------------
INSCHK ;PROCEDURE TO INSPECT FOR COMPLETE INSURANCE RECORD
S ZINSERR=0,ZNODE=""
NXTNODE S ZNODE=$O(^AUTNINS(ZINSCO,ZNODE)) G:(ZNODE="")!(+ZNODE>1) INSCHKC
S ZY=^AUTNINS(ZINSCO,ZNODE)
I ZNODE=1 I $P(ZY,"^")']"" I $P(ZY,"^",5)']"" G NXTNODE
I $L($P(ZY,"^",2))<2 S ZINSERR=ZINSERR_1 G NXTNODE
I $L($P(ZY,"^",3))<2 S ZINSERR=ZINSERR_1 G NXTNODE
I +$P(ZY,"^",4)<1!('$D(^DIC(5,+$P(ZY,"^",4),0))) D G NXTNODE
.S ZINSERR=ZINSERR_1
I $L($P(ZY,"^",5))<5!($P(ZY,"^",5)'?5N.E) D G NXTNODE
.S ZINSERR=ZINSERR_1
S ZINSERR=ZINSERR_0 G NXTNODE
INSCHKC I ZINSERR="01"!(ZINSERR="010") D
.S ^UTILITY("ABPVTXE","INS-ERR",ZINSCO)=""
I ZINSERR="001"!(ZINSERR="011") D
.S ^UTILITY("ABPVTXE","INS-ERR",ZINSCO)="*"
Q
;--------------------------------------------------------------------
A0 ;PROCEDURE TO DRAW SCREEN HEADING
W @IOF,! S PGNO=0 F I=1:1:79 W "*"
W !,"*",?13,"PRIVATE INSURANCE BILLING CLAIM TRANSMISSION EDIT REPORT"
W ?78,"*",! S X="FOR "_$P(^DIC(4,DUZ(2),0),"^",1) W "*",?80-$L(X)/2
W X,?78,"*",! S Y=DT X ^DD("DD") W "*",?80-$L(Y)/2,Y,?78,"*",!
F I=1:1:79 W "*"
;--------------------------------------------------------------------
A0A ;PROCEDURE TO GET THE LAST DATE DATA WAS EXPORTED
S LEXDATE=9999999-($O(^ABPVTXST("AC",DUZ(2),"")))
L (^ABPVFAC,^AUTNINS):1
I '$T D H 4 G JOBEND^ABPVTX1
.W *7,!!,?18,"PRIVATE INSURANCE AUDIT or INSURER File in Use.",!,?22
.W "Cannot Do Export at this time.",!!,?25
.W "THIS JOB HAS BEEN CANCELLED"
D A1 G:+IO=0 S3ENDA G A2
;--------------------------------------------------------------------
A1 ;PROCEDURE TO GET PRINTER OUTPUT DEVICE
W !! S %IS="P",%ZIS("A")="Print Edit List on Device: " D ^%ZIS
Q
;--------------------------------------------------------------------
A2 ;PROCEDURE TO DETERMINE THE BEGINNING RECORD NUMBER FOR THIS RUN
S ABPV("SITE")=DUZ(2),BRECNO=0,R=0,ZCLCT=0,ZCLAMT=0
I '$D(^ABPVTXST(ABPV("SITE"))) G A2A
S X=+$P(^ABPVTXST(ABPV("SITE"),1,0),"^",4) I X<1 G A2A
S BRECNO=+$P(^ABPVTXST(ABPV("SITE"),1,X,0),"^",4)
I BRECNO'<+$P(^ABPVFAC(0),"^",3) D D PRESET G S3ENDA
.U IO(0) W !!,*7,?10,"NO RECORDS AVAILABLE FOR EXPORT -- "
.U IO(0) W "JOB CANCELLED"
;--------------------------------------------------------------------
A2A ;PROCEDURE TO CONTROL REMAINING TASKS OF THIS ROUTINE
W ! D WAIT^DICD,A3^ABPVCK1,A4^ABPVCK1 G S3START
;--------------------------------------------------------------------
PRESET ;PROCEDURE TO RESET THE PRINTER TO 10 CPI
I $D(IO),$D(A("PRINT",10)) U IO W @A("PRINT",10)
Q
;--------------------------------------------------------------------
S3START ;PRINT INS CO ADD ERRORS REPORT OF INSURANCE CO ADDRESS ERRORS
S (R,RR)=0
I '$D(^UTILITY("ABPVTXE","INS-ERR")) G S3END
S X="You have INCOMPLETE ADDRESS INFORMATION in your INSURER FILE."
S Y="An ERROR REPORT will now be PRINTED."
U IO(0) W *7,*7,!!,?10,X,!!,?20,Y H 5
U IO W !!,?30,X,!,?40,Y
D HEADER2
S3A S R=$O(^UTILITY("ABPVTXE","INS-ERR",R)) G S3END:R=""
S ZY=^AUTNINS(R,0)
W ?2,$E($P(ZY,"^",1),1,30)
W ?34,$E($P(ZY,"^",2),1,30)
W ?66,$E($P(ZY,"^",3),1,15) S X=+$P(ZY,"^",4) G S3C:+X<1
G S3C:'$D(^DIC(5,X,0))
W ?83,$P(^DIC(5,X,0),"^",2)
S3C W ?87,$E($P(ZY,"^",5),1,10)
I ^UTILITY("ABPVTXE","INS-ERR",R)="*" W ?105,"YES"
W ! I $Y>50 D HEADER2
S RR=RR+1 G S3A
S3END W !!,?30,"NUMBER OF RECORDS WITH INCOMPLETE DATA = ",RR,!! H 3
I $D(A("PRINT",10)) U IO W @A("PRINT",10)
S3ENDA K %DT,A,BDATE,BDATED,EDATE,EDATED,I,PDFN,PGNO,R,RDATES,RR,X,XXX,Y,ZCLAMT,ZCLCT,ZINSCO,ZINSERR,ZX,ZY,^UTILITY("ABPVTXE"),ZNODE
X ^%ZIS("C") D PAUSE^ABPVZMM
Q
F I=1:1:122 W "*"
S X1="Device # "_+IO,X2="FOR "_$P(^DIC(4,DUZ(2),0),"^",1)
W !,"* ",X1,?32,"PRIVATE INSURANCE BILLING CLAIM TRANSMISSION EDIT REPORT",?111,"Page ",PGNO,?121,"*",!
S X="FOR "_$P(^DIC(4,DUZ(2),0),"^",1) W "*",?121-$L(X)/2,X,?121,"*",!
S Y=DT X ^DD("DD") W "*",?121-$L(Y)/2,Y,?121,"*",!,"*"
F I=1:1:120 W "-"
W "*",!,"* ENTRY",?12,"CONTROL",?62,"DATE OF",?105,"CLAIM",?113,"T",?118,"D",?121,"*",!
W "*",?3,"DATE",?12,"NUMBER",?20,"*** PATIENT'S NAME ***",?53,"H R N",?62,"SERVICE",?71,"INSURANCE COMPANY NAME",?105,"AMOUNT",?113,"P",?118,"V",?121,"*",!
F I=1:1:122 W "*"
W !!
Q
F I=1:1:117 W "*"
W !,"*",?47,"INSURANCE COMPANY ADDRESS ERRORS",?116,"*",!,"*"
W ?32,"THESE ERRORS MUST BE CORRECTED IN ORDER TO EXPORT CLAIM DATA",?116,"*",!,"*"
F I=1:1:115 W "-"
W "*",!,"*",?2,"INSURANCE COMPANY NAME",?34,"*** STREET ADDRESS ***",?66,"CITY",?83,"ST",?87,"ZIP CODE",?100,"B-ADDRESS ERROR",?116,"*",!,"*"
F I=1:1:115 W "-"
W "*",!! Q
ERR U IO W @A("PRINT",10) X ^%ZIS("C") G ERR^ZU
ABPVCK0 ;3P BILL TRANSMISSION EDIT REPORT;[ 08/07/91 3:51 PM ]
+1 ;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
+2 GOTO A0
+3 ;--------------------------------------------------------------------
INSCHK ;PROCEDURE TO INSPECT FOR COMPLETE INSURANCE RECORD
+1 SET ZINSERR=0
SET ZNODE=""
NXTNODE SET ZNODE=$ORDER(^AUTNINS(ZINSCO,ZNODE))
IF (ZNODE="")!(+ZNODE>1)
GOTO INSCHKC
+1 SET ZY=^AUTNINS(ZINSCO,ZNODE)
+2 IF ZNODE=1
IF $PIECE(ZY,"^")']""
IF $PIECE(ZY,"^",5)']""
GOTO NXTNODE
+3 IF $LENGTH($PIECE(ZY,"^",2))<2
SET ZINSERR=ZINSERR_1
GOTO NXTNODE
+4 IF $LENGTH($PIECE(ZY,"^",3))<2
SET ZINSERR=ZINSERR_1
GOTO NXTNODE
+5 IF +$PIECE(ZY,"^",4)<1!('$DATA(^DIC(5,+$PIECE(ZY,"^",4),0)))
Begin DoDot:1
+6 SET ZINSERR=ZINSERR_1
End DoDot:1
GOTO NXTNODE
+7 IF $LENGTH($PIECE(ZY,"^",5))<5!($PIECE(ZY,"^",5)'?5N.E)
Begin DoDot:1
+8 SET ZINSERR=ZINSERR_1
End DoDot:1
GOTO NXTNODE
+9 SET ZINSERR=ZINSERR_0
GOTO NXTNODE
INSCHKC IF ZINSERR="01"!(ZINSERR="010")
Begin DoDot:1
+1 SET ^UTILITY("ABPVTXE","INS-ERR",ZINSCO)=""
End DoDot:1
+2 IF ZINSERR="001"!(ZINSERR="011")
Begin DoDot:1
+3 SET ^UTILITY("ABPVTXE","INS-ERR",ZINSCO)="*"
End DoDot:1
+4 QUIT
+5 ;--------------------------------------------------------------------
A0 ;PROCEDURE TO DRAW SCREEN HEADING
+1 WRITE @IOF,!
SET PGNO=0
FOR I=1:1:79
WRITE "*"
+2 WRITE !,"*",?13,"PRIVATE INSURANCE BILLING CLAIM TRANSMISSION EDIT REPORT"
+3 WRITE ?78,"*",!
SET X="FOR "_$PIECE(^DIC(4,DUZ(2),0),"^",1)
WRITE "*",?80-$LENGTH(X)/2
+4 WRITE X,?78,"*",!
SET Y=DT
XECUTE ^DD("DD")
WRITE "*",?80-$LENGTH(Y)/2,Y,?78,"*",!
+5 FOR I=1:1:79
WRITE "*"
+6 ;--------------------------------------------------------------------
A0A ;PROCEDURE TO GET THE LAST DATE DATA WAS EXPORTED
+1 SET LEXDATE=9999999-($ORDER(^ABPVTXST("AC",DUZ(2),"")))
+2 LOCK (^ABPVFAC,^AUTNINS):1
+3 IF '$TEST
Begin DoDot:1
+4 WRITE *7,!!,?18,"PRIVATE INSURANCE AUDIT or INSURER File in Use.",!,?22
+5 WRITE "Cannot Do Export at this time.",!!,?25
+6 WRITE "THIS JOB HAS BEEN CANCELLED"
End DoDot:1
HANG 4
GOTO JOBEND^ABPVTX1
+7 DO A1
IF +IO=0
GOTO S3ENDA
GOTO A2
+8 ;--------------------------------------------------------------------
A1 ;PROCEDURE TO GET PRINTER OUTPUT DEVICE
+1 WRITE !!
SET %IS="P"
SET %ZIS("A")="Print Edit List on Device: "
DO ^%ZIS
+2 QUIT
+3 ;--------------------------------------------------------------------
A2 ;PROCEDURE TO DETERMINE THE BEGINNING RECORD NUMBER FOR THIS RUN
+1 SET ABPV("SITE")=DUZ(2)
SET BRECNO=0
SET R=0
SET ZCLCT=0
SET ZCLAMT=0
+2 IF '$DATA(^ABPVTXST(ABPV("SITE")))
GOTO A2A
+3 SET X=+$PIECE(^ABPVTXST(ABPV("SITE"),1,0),"^",4)
IF X<1
GOTO A2A
+4 SET BRECNO=+$PIECE(^ABPVTXST(ABPV("SITE"),1,X,0),"^",4)
+5 IF BRECNO'<+$PIECE(^ABPVFAC(0),"^",3)
Begin DoDot:1
+6 USE IO(0)
WRITE !!,*7,?10,"NO RECORDS AVAILABLE FOR EXPORT -- "
+7 USE IO(0)
WRITE "JOB CANCELLED"
End DoDot:1
DO PRESET
GOTO S3ENDA
+8 ;--------------------------------------------------------------------
A2A ;PROCEDURE TO CONTROL REMAINING TASKS OF THIS ROUTINE
+1 WRITE !
DO WAIT^DICD
DO A3^ABPVCK1
DO A4^ABPVCK1
GOTO S3START
+2 ;--------------------------------------------------------------------
PRESET ;PROCEDURE TO RESET THE PRINTER TO 10 CPI
+1 IF $DATA(IO)
IF $DATA(A("PRINT",10))
USE IO
WRITE @A("PRINT",10)
+2 QUIT
+3 ;--------------------------------------------------------------------
S3START ;PRINT INS CO ADD ERRORS REPORT OF INSURANCE CO ADDRESS ERRORS
+1 SET (R,RR)=0
+2 IF '$DATA(^UTILITY("ABPVTXE","INS-ERR"))
GOTO S3END
+3 SET X="You have INCOMPLETE ADDRESS INFORMATION in your INSURER FILE."
+4 SET Y="An ERROR REPORT will now be PRINTED."
+5 USE IO(0)
WRITE *7,*7,!!,?10,X,!!,?20,Y
HANG 5
+6 USE IO
WRITE !!,?30,X,!,?40,Y
+7 DO HEADER2
S3A SET R=$ORDER(^UTILITY("ABPVTXE","INS-ERR",R))
IF R=""
GOTO S3END
+1 SET ZY=^AUTNINS(R,0)
+2 WRITE ?2,$EXTRACT($PIECE(ZY,"^",1),1,30)
+3 WRITE ?34,$EXTRACT($PIECE(ZY,"^",2),1,30)
+4 WRITE ?66,$EXTRACT($PIECE(ZY,"^",3),1,15)
SET X=+$PIECE(ZY,"^",4)
IF +X<1
GOTO S3C
+5 IF '$DATA(^DIC(5,X,0))
GOTO S3C
+6 WRITE ?83,$PIECE(^DIC(5,X,0),"^",2)
S3C WRITE ?87,$EXTRACT($PIECE(ZY,"^",5),1,10)
+1 IF ^UTILITY("ABPVTXE","INS-ERR",R)="*"
WRITE ?105,"YES"
+2 WRITE !
IF $Y>50
DO HEADER2
+3 SET RR=RR+1
GOTO S3A
S3END WRITE !!,?30,"NUMBER OF RECORDS WITH INCOMPLETE DATA = ",RR,!!
HANG 3
+1 IF $DATA(A("PRINT",10))
USE IO
WRITE @A("PRINT",10)
S3ENDA KILL %DT,A,BDATE,BDATED,EDATE,EDATED,I,PDFN,PGNO,R,RDATES,RR,X,XXX,Y,ZCLAMT,ZCLCT,ZINSCO,ZINSERR,ZX,ZY,^UTILITY("ABPVTXE"),ZNODE
+1 XECUTE ^%ZIS("C")
DO PAUSE^ABPVZMM
+2 QUIT
USE IO
WRITE @IOF
+1 FOR I=1:1:122
WRITE "*"
+2 SET X1="Device # "_+IO
SET X2="FOR "_$PIECE(^DIC(4,DUZ(2),0),"^",1)
+3 WRITE !,"* ",X1,?32,"PRIVATE INSURANCE BILLING CLAIM TRANSMISSION EDIT REPORT",?111,"Page ",PGNO,?121,"*",!
+4 SET X="FOR "_$PIECE(^DIC(4,DUZ(2),0),"^",1)
WRITE "*",?121-$LENGTH(X)/2,X,?121,"*",!
+5 SET Y=DT
XECUTE ^DD("DD")
WRITE "*",?121-$LENGTH(Y)/2,Y,?121,"*",!,"*"
+6 FOR I=1:1:120
WRITE "-"
+7 WRITE "*",!,"* ENTRY",?12,"CONTROL",?62,"DATE OF",?105,"CLAIM",?113,"T",?118,"D",?121,"*",!
+8 WRITE "*",?3,"DATE",?12,"NUMBER",?20,"*** PATIENT'S NAME ***",?53,"H R N",?62,"SERVICE",?71,"INSURANCE COMPANY NAME",?105,"AMOUNT",?113,"P",?118,"V",?121,"*",!
+9 FOR I=1:1:122
WRITE "*"
+10 WRITE !!
+11 QUIT
WRITE @IOF
+1 FOR I=1:1:117
WRITE "*"
+2 WRITE !,"*",?47,"INSURANCE COMPANY ADDRESS ERRORS",?116,"*",!,"*"
+3 WRITE ?32,"THESE ERRORS MUST BE CORRECTED IN ORDER TO EXPORT CLAIM DATA",?116,"*",!,"*"
+4 FOR I=1:1:115
WRITE "-"
+5 WRITE "*",!,"*",?2,"INSURANCE COMPANY NAME",?34,"*** STREET ADDRESS ***",?66,"CITY",?83,"ST",?87,"ZIP CODE",?100,"B-ADDRESS ERROR",?116,"*",!,"*"
+6 FOR I=1:1:115
WRITE "-"
+7 WRITE "*",!!
QUIT
ERR USE IO
WRITE @A("PRINT",10)
XECUTE ^%ZIS("C")
GOTO ERR^ZU