source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBOSTUS1.m@ 1166

Last change on this file since 1166 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 5.1 KB
Line 
1IBOSTUS1 ;ALB/SGD-MCCR BILL STATUS REPORT ;25 MAY 88 14:19
2 ;;2.0;INTEGRATED BILLING;**31,118,128,153,137,161,183,155**;21-MAR-94
3 ;
4 ;MAP TO DGCROST1
5 ;
6EN ; - Entry point from IBOSTUS.
7 N IBSUB,IBHDR,IBST1,IBST2,IBCAT,IBAMT,IBBEF,IBCRT,IBQUIT,IBMTCT,DFN,REJFLG
8 S IBBEF="",IBQUIT=0,IBCRT=$S($E($G(IOST),1,2)="C-":1,1:0)
9 I IBDTP="Entered" S IBSUB="APD",IBHDR=1
10 I IBDTP="Bill" S IBSUB="AP",IBHDR=1
11 I IBDTP="Event" S IBSUB="D",IBHDR=0
12 I IBDTP="MRA Request" S IBSUB="APM",IBHDR=0
13 I 'IBSUM D HEAD
14 ;
15PROC ; - Get data for report(s).
16 S X1=IBBEG\1,X2=-1 D C^%DTC S IBNEX=X_.2359,X=132 X ^%ZOSF("RM")
17 F S IBNEX=$O(^DGCR(399,IBSUB,IBNEX)) Q:'IBNEX!(IBNEX>(IBEND\1_.2359))!(IBQUIT) D Q:IBQUIT
18 .I $Y>$S($D(IOSL):(IOSL-$S(IBCRT:4,1:9)),1:20) D HEAD Q:IBQUIT
19 .I IBHDR,'IBSUM D SUBHDR
20 .S IBIFN="" F J=0:0 S IBIFN=$O(^DGCR(399,IBSUB,IBNEX,IBIFN)) Q:'IBIFN!IBQUIT D SET S IBBEF=IBNEX
21 I 'IBQUIT D
22 .I '$D(IBF) W !!,?10,"*** No matches found ***"
23 .E D SUM^IBOSTUS
24 ;
25Q I $D(ZTQUEUED) S ZTREQ="@"
26 Q
27 ;
28SET ; This section is called for a single bill - IBIFN
29 S IBS=$G(^DGCR(399,IBIFN,"S")),IBAPP=1
30 I $P(IBS,U,17)'="" S IBBS=" CANCELLED",IBBSDT=$P(IBS,U,17),IBBSBY=$P(IBS,U,18) D:IBBST="C" PRINT G ALL
31 I $P(IBS,U,14)'="" S IBBS=" PRNT/TXMT",IBBSDT=$P(IBS,U,12),IBBSBY=$P(IBS,U,13) D:IBBST="P" PRINT G ALL
32 I $P(IBS,U,10)'="" S IBBS="* AUTHORIZED",IBAPP=$P(IBS,U,9),IBBSDT=$P(IBS,U,10),IBBSBY=$P(IBS,U,11) D:IBBST="A" PRINT G ALL
33 I $P(IBS,U,7)'="" S IBBS="* REQUEST MRA",IBBSDT=$P(IBS,U,7),IBBSBY=$P(IBS,U,8) D:IBBST="R" G ALL
34 . ; if user answered No to 'print Bills with No MRA Received and No Rejection messages', print report as usual
35 . I 'IBNOEOB D PRINT Q
36 . ; if user answered Yes (IBNOEOB=1), check two things before printing:
37 . ; 1) if MRA on file, don't print
38 . I $$CHK^IBCEMU1(IBIFN) Q
39 . ; 2) if the most recent transmission for this claim was rejected, don't print
40 . D TXSTS^IBCEMU2(IBIFN,,.REJFLG)
41 . I REJFLG Q
42 . ;
43 . ; otherwise, print bill
44 . D PRINT
45 ;
46 S IBBS="* ENTERED",IBBSDT=$P(IBS,U),IBBSBY=$P(IBS,U,2) D:IBBST="E" PRINT
47ALL Q:IBQUIT I IBBST="ALL" D PRINT
48 Q
49 ;
50PRINT ; - Print detail report, if necessary.
51 NEW LINE
52 I $Y>$S($D(IOSL):(IOSL-$S(IBCRT:4,1:6)),1:6) D HEAD Q:IBQUIT D SUBHDR:(IBBEF=IBNEX)&IBHDR
53 S IBF=1,IB0=$G(^DGCR(399,IBIFN,0))
54 S IBCAT=$S($D(^DGCR(399.3,+$P(IB0,U,7),0)):$P(^(0),U,4),1:"UNSPECIFIED")_$S($P(IB0,U,5)>2:"-OPT",1:"-INPT")
55 S IBU1=$G(^DGCR(399,IBIFN,"U1")),IBAMT=$S(IBU1="":0,$P(IBU1,U,2)]"":$P(IBU1,U)-$P(IBU1,U,2),1:$P(IBU1,U))
56 I IBSUM D ADD Q ; Printing summary ONLY.
57 ;
58 S DFN=$P(IB0,U,2) D PID^VADPT6 W !,$P(IB0,U),?10,$E($P(^DPT($P(IB0,U,2),0),U),1,20),?31,VA("BID"),?39,$E($P(IB0,U,3),4,5),"/",$E($P(IB0,U,3),6,7),"/",$E($P(IB0,U,3),2,3)
59 S IBBY=$P(IBS,U,2) W:IBBY ?50,$E($S($D(^VA(200,IBBY,0)):$P(^(0),U,2),1:"UNKN"),1,4) W ?57,IBCAT
60 ;
61 ; - MT status as of event date.
62 S IBMTCT=$P($$LST^DGMTU(DFN,$P(IB0,U,3)),U,4)
63 S IBMTCT=$S(IBMTCT="C":"YES",IBMTCT="P":"PEN",IBMTCT="R":"REQ",IBMTCT="G":"GMT",1:"NO")
64 W ?72,IBMTCT
65 ;
66 S X=IBAMT,X2="2$" D COMMA^%DTC W ?77,$J(X,10)
67 W ?90,IBBS,$S('IBAPP:"/DISAPP",1:"")," ",$E(IBBSDT,4,5),"/",$E(IBBSDT,6,7),"/",$E(IBBSDT,2,3)," (",$S($D(^VA(200,+IBBSBY,0)):$P(^(0),U,2),1:"UNKN USER"),"/",IBBSBY,")" K VA("BID"),VA("PID")
68 ;
69 ; If the user chose to print the ClaimsManager comments, then show
70 ; them all here. Also do the appropriate $Y checks for the next page.
71 ;
72 I 'IBCICOMM G SKPCMM ; user doesn't want comments
73 I '$D(^IBA(351.9,IBIFN,2)) G SKPCMM ; no comments exist
74 ;
75 W !!?8,$$CMTINFO^IBCIUT5(IBIFN)
76 S LINE=0
77 F S LINE=$O(^IBA(351.9,IBIFN,2,LINE)) Q:'LINE D Q:IBQUIT
78 . I $Y>(IOSL-$S(IBCRT:4,1:6)) D HEAD Q:IBQUIT
79 . W !?10,$G(^IBA(351.9,IBIFN,2,LINE,0))
80 . Q
81 Q:IBQUIT
82 W !
83 ;
84SKPCMM ; skip to here if we're not printing ClaimsManager comments
85 ;
86 D ADD
87 Q
88 ;
89HEAD ; - Print report header.
90 I $G(IBPAGE)>0,IBCRT S DIR(0)="E" D ^DIR K DIR I $D(DTOUT)!($D(DUOUT)) S IBQUIT=1 Q
91 S IBPAGE=$G(IBPAGE)+1,$P(IBL,"=",IOM)="",Y=IBBEG X ^DD("DD")
92 W @IOF,!,"MCCR Bill Status ",$S(IBSUM:"Statistics",1:"Report")," for ",$S(IBBEG'=IBEND:"period covering ",1:"")_Y
93 I IBBEG<IBEND S Y=IBEND X ^DD("DD") W " thru "_Y
94 I '$D(IBRUN) D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") S IBRUN=Y
95 I 'IBSUM W ?100,IBRUN,?123,"Page ",$J(IBPAGE,3)
96 W ! I $D(IBHD) W "Bill Status: ",IBHD," "
97 I 'IBSUM W:IBBST'="C"&(IBBST'="P") "* Denotes that the bill status is not Printed or Cancelled" W:IBCICOMM ?106,"ClaimsManager Comments ON"
98 E W "Run Date: ",IBRUN
99 ; if user answered Yes to 'No MRA Received and No Rejection messages' question, print this line in header
100 I IBNOEOB W !,"**** Bills with No MRA Received and No current CSA Rejection messages ****"
101 I 'IBSUM D
102 .W !!?39,"EVENT",?49,"ENTRD",?73,"MT",!,"BILL NO.",?10,"PATIENT NAME"
103 .W ?31,"PT.ID",?39,"DATE",?50,"BY",?57,"RATE TYPE",?70,"STATUS"
104 .W ?81,"CHARGES",?94,"BILL STATUS"
105 ;
106 W !,IBL W:IBSUM ! K IBL
107 Q
108 ;
109SUBHDR W !!?3,IBDTP_" Date: "_$$DAT1^IBOUTL(IBNEX)
110 Q
111 ;
112ADD ; - For summary statistics.
113 S IBST1(IBCAT,"C")=1+$G(IBST1(IBCAT,"C"))
114 S IBST1(IBCAT,"$")=IBAMT+$G(IBST1(IBCAT,"$"))
115 S:IBBS["* " IBBS=$P(IBBS,"* ",2)
116 S:IBBS[" " IBBS=$P(IBBS," ",2)
117 S:IBBS="" IBBS="UNKNOWN"
118 S IBST2(IBBS,"C")=1+$G(IBST2(IBBS,"C"))
119 S IBST2(IBBS,"$")=IBAMT+$G(IBST2(IBBS,"$"))
120 Q
Note: See TracBrowser for help on using the repository browser.