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

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1IBTUBV ;ALB/AAS - UNBILLED AMOUNTS - VIEW UNBILLED DATA ;29-SEP-94
2 ;;2.0;INTEGRATED BILLING;**19,123,155**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5% ; - View unbilled amounts for the month.
6 I '$D(IOF) D HOME^%ZIS
7 W !!,"View unbilled amounts",!
8 S %ZIS="QM" D ^%ZIS G:POP END
9 I $D(IO("Q")) D G END
10 .S ZTRTN="DQ^IBTUBV",ZTSAVE("IB*")=""
11 .S ZTDESC="IB - Unbilled View Unbilled Amounts"
12 .D ^%ZTLOAD K IO("Q"),ZTSK D HOME^%ZIS
13 ;
14 U IO D DQ
15 ;
16END W ! I $D(ZTQUEUED) S ZTREQ="@" Q
17 D ^%ZISC
18 Q
19 ;
20DQ ; - Entry point when queued.
21 N IBAVGI,IBAVGP,IBFL,IBHDT,IBPAG,IBQUIT,IBTMON,DA,ND,ND3,TAB,X,Y
22 S IBHDT=$$HTE^XLFDT($H,1),(IBPAG,IBQUIT)=0
23 D HDR S IBTMON="",TAB=40
24 F S IBTMON=$O(^IBE(356.19,"AIVDT",IBTMON)) Q:'IBTMON D Q:IBQUIT
25 .S DA=-IBTMON,IBFL=1
26 .I '$D(^IBE(356.19,DA,1)) D OLDV(DA) Q ; No '1' node-print old report.
27 .S ND=$P($G(^IBE(356.19,DA,1)),U,1,6)
28 .;
29 .; - Get average instutional amount.
30 .S X1=$S('$P(ND,U,3):0,1:+ND/$P(ND,U,3))
31 .S X2=$S('$P(ND,U):0,1:+$P(ND,U,2)/+ND),IBAVGI=$J(X1*X2,0,2)
32 .;
33 .; - Get average professional amount.
34 .S X1=$S('$P(ND,U,6):0,1:+$P(ND,U,4)/$P(ND,U,6))
35 .S X2=$S('$P(ND,U,4):0,1:+$P(ND,U,5)/$P(ND,U,4)),IBAVGP=$J(X1*X2,0,2)
36 .;
37 .S ND=$G(^IBE(356.19,DA,2))
38 .S ND3=$G(^IBE(356.19,DA,3))
39 .I $Y>(IOSL-7) D HDR Q:IBQUIT
40 .W !?22,"Inpatient Care: ",$$MYR(DA)
41 .W !?9,"Number of Unbilled Inpatient Cases: ",$J($P(ND,U,2)+ND,11)
42 .W !?10,"Number of Unbilled MRA Admissions: ",$J($P(ND3,U,2)+ND3,11)
43 .W !?4,"Average Inpt. Institutional Bill Amount: ",$J(IBAVGI,11,2)
44 .W !?5,"Average Inpt. Professional Bill Amount: ",$J(IBAVGP,11,2)
45 .W !?14,"Total Unbilled Inpatient Care: ",$J($P(ND,U,7),11,2)
46 .W !?10,"Total MRA Unbilled Inpatient Care: ",$J($P(ND3,U,7),11,2),!
47 .;
48 .I $Y>(IOSL-7) D HDR Q:IBQUIT
49 .W !?21,"Outpatient Care: ",$$MYR(DA)
50 .W !?8,"Number of Unbilled Outpatient Cases: ",$J($P(ND,U,3),11)
51 .W !?15,"Number of Unbilled CPT Codes: ",$J($P(ND,U,4)+$P(ND,U,5),11)
52 .W !?11,"Number of MRA Unbilled CPT Codes: ",$J($P(ND3,U,4)+$P(ND3,U,5),11)
53 .W !?13,"Total Unbilled Outpatient Care: ",$J($P(ND,U,8),11,2)
54 .W !?9,"Total MRA Unbilled Outpatient Care: ",$J($P(ND3,U,8),11,2),!
55 .;
56 .I $Y>(IOSL-7) D HDR Q:IBQUIT
57 .W !?23,"Prescriptions: ",$$MYR(DA)
58 .W !?11,"Number of Unbilled Prescriptions: ",$J($P(ND,U,6),11)
59 .W !?7,"Number of MRA Unbilled Prescriptions: ",$J($P(ND3,U,6),11)
60 .W !?15,"Total Unbilled Prescriptions: ",$J($P(ND,U,9),11,2)
61 .W !?11,"Total MRA Unbilled Prescriptions: ",$J($P(ND3,U,9),11,2),!
62 ;
63 I '$G(IBFL) W !!,"No Unbilled Amount information found."
64 Q
65 ;
66OLDV(X) ; - Print old version of report if no '1' node of file #356.19 entry.
67 S ND=$G(^IBE(356.19,X,0)) G:'$P(ND,U,16) OLDVQ
68 I $Y>(IOSL-7) D HDR
69 W !!?11,"Inpatient Care: ",$$MYR(X)
70 W !?3,"Number of Unbilled Inpt. Cases: ",$J($P(ND,U,12),11)
71 W !?8,"Average Inpt. Bill Amount: ",$J($P(ND,U,13),11,2)
72 W !?9,"Total Inpatient Unbilled: ",$J($P(ND,U,12)*$P(ND,U,13),11,2)
73 ;
74 I $Y>(IOSL-7) D HDR
75 W !!?11,"Outpatient Care: ",$$MYR(X)
76 W !?3,"Number of Unbilled Opt. Cases: ",$J($P(ND,U,14),11)
77 W !?9,"Average Opt. Bill Amount: ",$J($P(ND,U,15),11,2)
78 W !?8,"Total Outpatient Unbilled: ",$J($P(ND,U,14)*$P(ND,U,15),11,2)
79 ;
80OLDVQ Q
81 ;
82HDR ; - Output header.
83 I $E(IOST,1,2)="C-",IBPAG D PAUSE^VALM1 I $D(DIRUT) S IBQUIT=1 G HDRQ
84 I $E(IOST,1,2)="C-"!(IBPAG) W @IOF
85 S IBPAG=IBPAG+1
86 W !,"Unbilled Amounts Report",?(IOM-33),"Page ",IBPAG," ",IBHDT
87 W !,$TR($J(" ",IOM)," ","-")
88 I $D(ZTQUEUED),$$S^%ZTLOAD D
89 .S (IBQUIT,ZTSTOP)=1 W !!,"...task stopped at user request"
90 ;
91HDRQ Q
92 ;
93MYR(X) ; - Format month/year (MM/YY).
94 Q $S('$G(X):"",1:$E(X,4,5)_"/"_$E(X,2,3))
Note: See TracBrowser for help on using the repository browser.