Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IVMRBT

IVMRBT.m

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