| 1 | IVMRBT ;ALB/CPM - IVM BILLING TRANSMISSION REPORT ; 13-JUN-94 | 
|---|
| 2 | ;;Version 2.0 ; INCOME VERIFICATION MATCH ;; 21-OCT-94 | 
|---|
| 3 | ; | 
|---|
| 4 | EN ; Entry point to generate the IVM Billing Transmission Report. | 
|---|
| 5 | ; | 
|---|
| 6 | W !!,"This report will list all billing activity which has been, or will be," | 
|---|
| 7 | W !,"transmitted to the IVM Center.  This includes Means Test charges for" | 
|---|
| 8 | W !,"patients who have changed categories due to IVM-verified Means Tests," | 
|---|
| 9 | W !,"as well as claims to insurance companies for patients who have" | 
|---|
| 10 | W !,"insurance policies identified by the IVM Center." | 
|---|
| 11 | W !!,"Please note that this output requires 132 columns.  This report may not" | 
|---|
| 12 | W !,"run very quickly so you might choose to queue the report to a printer.",! | 
|---|
| 13 | ; | 
|---|
| 14 | S %ZIS="QM" D ^%ZIS G:POP ENQ | 
|---|
| 15 | I $D(IO("Q")) D  G ENQ | 
|---|
| 16 | .S ZTRTN="DQ^IVMRBT",ZTDESC="IVM - BILLING TRANSMISSION REPORT" | 
|---|
| 17 | .D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued as task #"_ZTSK_".",1:"Unable to queue this job.") | 
|---|
| 18 | .K ZTSK,IO("Q") | 
|---|
| 19 | ; | 
|---|
| 20 | U IO | 
|---|
| 21 | ; | 
|---|
| 22 | DQ ; Tasked entry point. | 
|---|
| 23 | K ^TMP("IVMRBT",$J) | 
|---|
| 24 | 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 | 
|---|
| 25 | ; | 
|---|
| 26 | ; - print out the report | 
|---|
| 27 | D NOW^%DTC S IVMHDRDT=$$DAT1^IVMUFNC4(%,1),IVMPAG=0,IVMQ=0 D HDR | 
|---|
| 28 | I '$D(^TMP("IVMRBT",$J)) W !!?25,"There have been no recorded transmissions of billing data to the IVM Center." G ENQ1 | 
|---|
| 29 | ; | 
|---|
| 30 | S IVMNA="" F  S IVMNA=$O(^TMP("IVMRBT",$J,IVMNA)) Q:IVMNA=""!IVMQ  S DFN=^(IVMNA) D | 
|---|
| 31 | .W ! I $Y>(IOSL-5) D PAUSE Q:IVMQ  D HDR W ! | 
|---|
| 32 | .W !,$E($P(IVMNA,"^"),1,25),?27,$E($P(IVMNA,"^",2),1,12) | 
|---|
| 33 | .; | 
|---|
| 34 | .S (IVMF,IVMTDA)=0 F  S IVMTDA=$O(^IVM(301.61,"C",DFN,IVMTDA)) Q:'IVMTDA!IVMQ  D | 
|---|
| 35 | ..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 | 
|---|
| 36 | ..S IVMN=$G(^IVM(301.61,IVMTDA,0)) | 
|---|
| 37 | ..W:IVMF ! | 
|---|
| 38 | ..W ?40,$P(IVMN,"^") | 
|---|
| 39 | ..W ?52,$S($P(IVMN,"^",10)!$P(IVMN,"^",11):"*",1:"") | 
|---|
| 40 | ..W ?54,$$CLSF($P(IVMN,"^",3)) | 
|---|
| 41 | ..W ?59,$$EXPAND^IVMUFNC(301.61,.04,$P(IVMN,"^",4)) | 
|---|
| 42 | ..W ?70,$$DAT1^IVMUFNC4($P(IVMN,"^",5)),?80,$$DAT1^IVMUFNC4($P(IVMN,"^",6)) | 
|---|
| 43 | ..W ?90,$$DAT1^IVMUFNC4($P(IVMN,"^",7)) | 
|---|
| 44 | ..W ?100,$J($P(IVMN,"^",8),8,2) | 
|---|
| 45 | ..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)) | 
|---|
| 46 | ..W ?120,$S($P(IVMN,"^",13):$$DAT1^IVMUFNC4($P(IVMN,"^",13)),1:"Not Sent") | 
|---|
| 47 | ..W ?129,$$EXPAND^IVMUFNC(301.61,.14,+$P(IVMN,"^",14)) | 
|---|
| 48 | ..S IVMF=1 | 
|---|
| 49 | ; | 
|---|
| 50 | D:'IVMQ PAUSE | 
|---|
| 51 | ; | 
|---|
| 52 | ENQ K ^TMP("IVMRBT",$J) | 
|---|
| 53 | I $D(ZTQUEUED) S ZTREQ="@" Q | 
|---|
| 54 | D ^%ZISC | 
|---|
| 55 | K IVMQ,IVMPAG,DIRUT,DUOUT,DTOUT,DIROUT,I,ZTDESC,ZTREQ,ZTRTN,ZTSAVE | 
|---|
| 56 | ENQ1 Q | 
|---|
| 57 | ; | 
|---|
| 58 | ; | 
|---|
| 59 | PAUSE ; Pause for screen output. | 
|---|
| 60 | Q:$E(IOST,1,2)'="C-" | 
|---|
| 61 | N IVMI,DIR,DIRUT,DIROUT,DUOUT,DTOUT | 
|---|
| 62 | F IVMI=$Y:1:(IOSL-3) W ! | 
|---|
| 63 | S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S IVMQ=1 | 
|---|
| 64 | Q | 
|---|
| 65 | ; | 
|---|
| 66 | HDR ; Display report header. | 
|---|
| 67 | N X,Y | 
|---|
| 68 | I $E(IOST,1,2)="C-"!(IVMPAG) W @IOF | 
|---|
| 69 | S IVMPAG=IVMPAG+1 | 
|---|
| 70 | W !,"Run Date: ",IVMHDRDT,?50,"IVM BILLING TRANSMISSION REPORT",?121,"Page: ",IVMPAG | 
|---|
| 71 | W !!,$$DASH,!,?53,"Bill",?92,"Date",?103,"Amt",?113,"Amt",?122,"Date",?128,"Last" | 
|---|
| 72 | 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 | 
|---|
| 73 | Q | 
|---|
| 74 | ; | 
|---|
| 75 | DASH() ; Write dashed line. | 
|---|
| 76 | Q $TR($J("",132)," ","=") | 
|---|
| 77 | ; | 
|---|
| 78 | CLSF(X) ; Return the bill classification. | 
|---|
| 79 | ;  Input:  X  --  Internal value of classification in #301.61 | 
|---|
| 80 | ; Output:  I=Inpatient, O=Outpatient, R=Refill, P=Prosthetics | 
|---|
| 81 | Q $S('$G(X):"O",X=1:"I",X=2:"O",X=3:"R",X=4:"P",1:"O") | 
|---|