IVMRBT ;ALB/CPM - IVM BILLING TRANSMISSION REPORT ; 13-JUN-94
;;Version 2.0 ; INCOME VERIFICATION MATCH ;; 21-OCT-94
;
EN ; Entry point to generate the IVM Billing Transmission Report.
;
W !!,"This report will list all billing activity which has been, or will be,"
W !,"transmitted to the IVM Center. This includes Means Test charges for"
W !,"patients who have changed categories due to IVM-verified Means Tests,"
W !,"as well as claims to insurance companies for patients who have"
W !,"insurance policies identified by the IVM Center."
W !!,"Please note that this output requires 132 columns. This report may not"
W !,"run very quickly so you might choose to queue the report to a printer.",!
;
S %ZIS="QM" D ^%ZIS G:POP ENQ
I $D(IO("Q")) D G ENQ
.S ZTRTN="DQ^IVMRBT",ZTDESC="IVM - BILLING TRANSMISSION REPORT"
.D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued as task #"_ZTSK_".",1:"Unable to queue this job.")
.K ZTSK,IO("Q")
;
U IO
;
DQ ; Tasked entry point.
K ^TMP("IVMRBT",$J)
S DFN=0 F S DFN=$O(^IVM(301.61,"C",DFN)) Q:'DFN S ^TMP("IVMRBT",$J,$P($$PT^IVMUFNC4(DFN),"^",1,2))=DFN
;
; - print out the report
D NOW^%DTC S IVMHDRDT=$$DAT1^IVMUFNC4(%,1),IVMPAG=0,IVMQ=0 D HDR
I '$D(^TMP("IVMRBT",$J)) W !!?25,"There have been no recorded transmissions of billing data to the IVM Center." G ENQ1
;
S IVMNA="" F S IVMNA=$O(^TMP("IVMRBT",$J,IVMNA)) Q:IVMNA=""!IVMQ S DFN=^(IVMNA) D
.W ! I $Y>(IOSL-5) D PAUSE Q:IVMQ D HDR W !
.W !,$E($P(IVMNA,"^"),1,25),?27,$E($P(IVMNA,"^",2),1,12)
.;
.S (IVMF,IVMTDA)=0 F S IVMTDA=$O(^IVM(301.61,"C",DFN,IVMTDA)) Q:'IVMTDA!IVMQ D
..I $Y>(IOSL-5),IVMF D PAUSE Q:IVMQ D HDR W !!,$E($P(IVMNA,"^"),1,25),?27,$E($P(IVMNA,"^",2),1,14) S IVMF=0
..S IVMN=$G(^IVM(301.61,IVMTDA,0))
..W:IVMF !
..W ?40,$P(IVMN,"^")
..W ?52,$S($P(IVMN,"^",10)!$P(IVMN,"^",11):"*",1:"")
..W ?54,$$CLSF($P(IVMN,"^",3))
..W ?59,$$EXPAND^IVMUFNC(301.61,.04,$P(IVMN,"^",4))
..W ?70,$$DAT1^IVMUFNC4($P(IVMN,"^",5)),?80,$$DAT1^IVMUFNC4($P(IVMN,"^",6))
..W ?90,$$DAT1^IVMUFNC4($P(IVMN,"^",7))
..W ?100,$J($P(IVMN,"^",8),8,2)
..W ?110,$S($P(IVMN,"^",9):$J($P(IVMN,"^",9),8,2),$P(IVMN,"^",4)>1:" --N/A--",1:$J($P(IVMN,"^",9),8,2))
..W ?120,$S($P(IVMN,"^",13):$$DAT1^IVMUFNC4($P(IVMN,"^",13)),1:"Not Sent")
..W ?129,$$EXPAND^IVMUFNC(301.61,.14,+$P(IVMN,"^",14))
..S IVMF=1
;
D:'IVMQ PAUSE
;
ENQ K ^TMP("IVMRBT",$J)
I $D(ZTQUEUED) S ZTREQ="@" Q
D ^%ZISC
K IVMQ,IVMPAG,DIRUT,DUOUT,DTOUT,DIROUT,I,ZTDESC,ZTREQ,ZTRTN,ZTSAVE
ENQ1 Q
;
;
PAUSE ; Pause for screen output.
Q:$E(IOST,1,2)'="C-"
N IVMI,DIR,DIRUT,DIROUT,DUOUT,DTOUT
F IVMI=$Y:1:(IOSL-3) W !
S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S IVMQ=1
Q
;
HDR ; Display report header.
N X,Y
I $E(IOST,1,2)="C-"!(IVMPAG) W @IOF
S IVMPAG=IVMPAG+1
W !,"Run Date: ",IVMHDRDT,?50,"IVM BILLING TRANSMISSION REPORT",?121,"Page: ",IVMPAG
W !!,$$DASH,!,?53,"Bill",?92,"Date",?103,"Amt",?113,"Amt",?122,"Date",?128,"Last"
W !,"Patient Name",?27,"SSN",?40,"Ref #",?53,"Clsf",?59,"Bill Type",?70,"Bill From - To",?90,"Generated",?102,"Billed",?113,"Coll",?122,"Trans",?128,"Tran",!,$$DASH
Q
;
DASH() ; Write dashed line.
Q $TR($J("",132)," ","=")
;
CLSF(X) ; Return the bill classification.
; Input: X -- Internal value of classification in #301.61
; Output: I=Inpatient, O=Outpatient, R=Refill, P=Prosthetics
Q $S('$G(X):"O",X=1:"I",X=2:"O",X=3:"R",X=4:"P",1:"O")
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIVMRBT 3475 printed Dec 13, 2024@02:02:35 Page 2
IVMRBT ;ALB/CPM - IVM BILLING TRANSMISSION REPORT ; 13-JUN-94
+1 ;;Version 2.0 ; INCOME VERIFICATION MATCH ;; 21-OCT-94
+2 ;
EN ; Entry point to generate the IVM Billing Transmission Report.
+1 ;
+2 WRITE !!,"This report will list all billing activity which has been, or will be,"
+3 WRITE !,"transmitted to the IVM Center. This includes Means Test charges for"
+4 WRITE !,"patients who have changed categories due to IVM-verified Means Tests,"
+5 WRITE !,"as well as claims to insurance companies for patients who have"
+6 WRITE !,"insurance policies identified by the IVM Center."
+7 WRITE !!,"Please note that this output requires 132 columns. This report may not"
+8 WRITE !,"run very quickly so you might choose to queue the report to a printer.",!
+9 ;
+10 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO ENQ
+11 IF $DATA(IO("Q"))
Begin DoDot:1
+12 SET ZTRTN="DQ^IVMRBT"
SET ZTDESC="IVM - BILLING TRANSMISSION REPORT"
+13 DO ^%ZTLOAD
WRITE !!,$SELECT($DATA(ZTSK):"This job has been queued as task #"_ZTSK_".",1:"Unable to queue this job.")
+14 KILL ZTSK,IO("Q")
End DoDot:1
GOTO ENQ
+15 ;
+16 USE IO
+17 ;
DQ ; Tasked entry point.
+1 KILL ^TMP("IVMRBT",$JOB)
+2 SET DFN=0
FOR
SET DFN=$ORDER(^IVM(301.61,"C",DFN))
if 'DFN
QUIT
SET ^TMP("IVMRBT",$JOB,$PIECE($$PT^IVMUFNC4(DFN),"^",1,2))=DFN
+3 ;
+4 ; - print out the report
+5 DO NOW^%DTC
SET IVMHDRDT=$$DAT1^IVMUFNC4(%,1)
SET IVMPAG=0
SET IVMQ=0
DO HDR
+6 IF '$DATA(^TMP("IVMRBT",$JOB))
WRITE !!?25,"There have been no recorded transmissions of billing data to the IVM Center."
GOTO ENQ1
+7 ;
+8 SET IVMNA=""
FOR
SET IVMNA=$ORDER(^TMP("IVMRBT",$JOB,IVMNA))
if IVMNA=""!IVMQ
QUIT
SET DFN=^(IVMNA)
Begin DoDot:1
+9 WRITE !
IF $Y>(IOSL-5)
DO PAUSE
if IVMQ
QUIT
DO HDR
WRITE !
+10 WRITE !,$EXTRACT($PIECE(IVMNA,"^"),1,25),?27,$EXTRACT($PIECE(IVMNA,"^",2),1,12)
+11 ;
+12 SET (IVMF,IVMTDA)=0
FOR
SET IVMTDA=$ORDER(^IVM(301.61,"C",DFN,IVMTDA))
if 'IVMTDA!IVMQ
QUIT
Begin DoDot:2
+13 IF $Y>(IOSL-5)
IF IVMF
DO PAUSE
if IVMQ
QUIT
DO HDR
WRITE !!,$EXTRACT($PIECE(IVMNA,"^"),1,25),?27,$EXTRACT($PIECE(IVMNA,"^",2),1,14)
SET IVMF=0
+14 SET IVMN=$GET(^IVM(301.61,IVMTDA,0))
+15 if IVMF
WRITE !
+16 WRITE ?40,$PIECE(IVMN,"^")
+17 WRITE ?52,$SELECT($PIECE(IVMN,"^",10)!$PIECE(IVMN,"^",11):"*",1:"")
+18 WRITE ?54,$$CLSF($PIECE(IVMN,"^",3))
+19 WRITE ?59,$$EXPAND^IVMUFNC(301.61,.04,$PIECE(IVMN,"^",4))
+20 WRITE ?70,$$DAT1^IVMUFNC4($PIECE(IVMN,"^",5)),?80,$$DAT1^IVMUFNC4($PIECE(IVMN,"^",6))
+21 WRITE ?90,$$DAT1^IVMUFNC4($PIECE(IVMN,"^",7))
+22 WRITE ?100,$JUSTIFY($PIECE(IVMN,"^",8),8,2)
+23 WRITE ?110,$SELECT($PIECE(IVMN,"^",9):$JUSTIFY($PIECE(IVMN,"^",9),8,2),$PIECE(IVMN,"^",4)>1:" --N/A--",1:$JUSTIFY($PIECE(IVMN,"^",9),8,2))
+24 WRITE ?120,$SELECT($PIECE(IVMN,"^",13):$$DAT1^IVMUFNC4($PIECE(IVMN,"^",13)),1:"Not Sent")
+25 WRITE ?129,$$EXPAND^IVMUFNC(301.61,.14,+$PIECE(IVMN,"^",14))
+26 SET IVMF=1
End DoDot:2
End DoDot:1
+27 ;
+28 if 'IVMQ
DO PAUSE
+29 ;
ENQ KILL ^TMP("IVMRBT",$JOB)
+1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+2 DO ^%ZISC
+3 KILL IVMQ,IVMPAG,DIRUT,DUOUT,DTOUT,DIROUT,I,ZTDESC,ZTREQ,ZTRTN,ZTSAVE
ENQ1 QUIT
+1 ;
+2 ;
PAUSE ; Pause for screen output.
+1 if $EXTRACT(IOST,1,2)'="C-"
QUIT
+2 NEW IVMI,DIR,DIRUT,DIROUT,DUOUT,DTOUT
+3 FOR IVMI=$Y:1:(IOSL-3)
WRITE !
+4 SET DIR(0)="E"
DO ^DIR
IF $DATA(DIRUT)!($DATA(DUOUT))
SET IVMQ=1
+5 QUIT
+6 ;
HDR ; Display report header.
+1 NEW X,Y
+2 IF $EXTRACT(IOST,1,2)="C-"!(IVMPAG)
WRITE @IOF
+3 SET IVMPAG=IVMPAG+1
+4 WRITE !,"Run Date: ",IVMHDRDT,?50,"IVM BILLING TRANSMISSION REPORT",?121,"Page: ",IVMPAG
+5 WRITE !!,$$DASH,!,?53,"Bill",?92,"Date",?103,"Amt",?113,"Amt",?122,"Date",?128,"Last"
+6 WRITE !,"Patient Name",?27,"SSN",?40,"Ref #",?53,"Clsf",?59,"Bill Type",?70,"Bill From - To",?90,"Generated",?102,"Billed",?113,"Coll",?122,"Trans",?128,"Tran",!,$$DASH
+7 QUIT
+8 ;
DASH() ; Write dashed line.
+1 QUIT $TRANSLATE($JUSTIFY("",132)," ","=")
+2 ;
CLSF(X) ; Return the bill classification.
+1 ; Input: X -- Internal value of classification in #301.61
+2 ; Output: I=Inpatient, O=Outpatient, R=Refill, P=Prosthetics
+3 QUIT $SELECT('$GET(X):"O",X=1:"I",X=2:"O",X=3:"R",X=4:"P",1:"O")