source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBOMTC1.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1IBOMTC1 ;ALB/CPM-BILLING ACTIVITY LIST (CON'T) ; 09-JAN-92
2 ;;2.0;INTEGRATED BILLING;**145,176**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;***
6 ;S XRTL=$ZU(0),XRTN="IBOMTC-2" D T0^%ZOSV ;start rt clock
7 ; Select charges from file #350.
8 K ^TMP($J,"IBPHT")
9 S DFN="" F S DFN=$O(^IB("AFDT",DFN)) Q:'DFN S IBHEART=$$PH(DFN) D:'$G(IBPURPHT)!($G(IBPURPHT)&(IBHEART))
10 . S EVDT=-(IBEDT+.99) F S EVDT=$O(^IB("AFDT",DFN,EVDT)) Q:'EVDT D
11 .. S EVDA=0 F S EVDA=$O(^IB("AFDT",DFN,EVDT,EVDA)) Q:'EVDA D
12 ... S IBDA=0 F IBCNT=1:1 S IBDA=$O(^IB("AF",EVDA,IBDA)) Q:'IBDA D
13 .... Q:'$D(^IB(IBDA,0)) S IBD0=^(0)
14 .... Q:$P(IBD0,"^",8)["ADMISSION"
15 .... I $P(IBD0,"^",15)<IBBDT!($P(IBD0,"^",14)>IBEDT) Q
16 .... S NAM=$P($G(^DPT(DFN,0)),"^") S:NAM="" NAM="UNKNOWN"
17 .... S ^TMP($J,"IBOMTC",NAM_"@@"_DFN,+$P(IBD0,"^",14),IBDA)=""
18 .... I IBHEART S ^TMP($J,"IBPHT",NAM_"@@"_DFN)=""
19 ;
20 ; Print report.
21 D NOW^%DTC S IBHDT=$$DAT2^IBOUTL($E(%,1,12))
22 S IBLINE="",$P(IBLINE,"-",IOM+1)="",(IBPAG,IBQUIT)=0 D HDR G:IBQUIT END
23 I '$D(^TMP($J,"IBOMTC")) S IBX=$S($G(IBPURPHT):"Purple Heart Recipients",1:"Bills") W !!,"There are no "_IBX_" for this date range." G END
24 ;
25 S NAM="" F S NAM=$O(^TMP($J,"IBOMTC",NAM)) Q:NAM="" D Q:IBQUIT
26 . S IBPT=$$PT^IBEFUNC($P(NAM,"@@",2))
27 . I $Y>(IOSL-5) D PHT,PAUSE^IBOUTL Q:IBQUIT D HDR Q:IBQUIT
28 . W !,$S($D(^TMP($J,"IBPHT",NAM)):"*",1:" ")_$E($P(IBPT,"^"),1,9),?11,$P(IBPT,"^",3)
29 . S IBDT="" F S IBDT=$O(^TMP($J,"IBOMTC",NAM,IBDT)) Q:'IBDT D Q:IBQUIT
30 .. S IBDA="" F S IBDA=$O(^TMP($J,"IBOMTC",NAM,IBDT,IBDA)) Q:'IBDA D Q:IBQUIT
31 ... I $Y>(IOSL-4) D PHT,PAUSE^IBOUTL Q:IBQUIT D HDR Q:IBQUIT W !,$S($D(^TMP($J,"IBPHT",NAM)):"*",1:" ")_$E($P(IBPT,"^"),1,9),?11,$P(IBPT,"^",3)
32 ... S IBD0=$G(^IB(+IBDA,0)) Q:'IBD0
33 ... S X=$P($P($G(^IBE(350.1,+$P(IBD0,"^",3),0)),"^")," ",2,99)
34 ... W ?17,$E($P(X," ",1,$L(X," ")-1),1,16)
35 ... W ?35,$E($P($G(^IBE(350.21,+$P(IBD0,"^",5),0)),"^",2),1,11)
36 ... W ?47,$$DAT1^IBOUTL($P(IBD0,"^",14)),?57,$$DAT1^IBOUTL($P(IBD0,"^",15))
37 ... W ?66,$J($P(IBD0,"^",6),3)
38 ... S X=$P(IBD0,"^",7),X2="2$",X3=10 D COMMA^%DTC W ?70,X,!
39 ;
40 ; - close device and quit
41END D:'IBQUIT PHT,PAUSE^IBOUTL K ^TMP($J,"IBOMTC"),^TMP($J,"IBPHT")
42 ;***
43 ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOMTC1" D T1^%ZOSV ;stop rt clock
44 I $D(ZTQUEUED) S ZTREQ="@" Q
45 K NAM,DFN,EVDA,EVDT,IBD0,IBDA,IBDT,IBJ,IBQUIT,IBLINE,IBHDT,IBHEART,IBN,IBPAG,IBPT,IBCNT,X,X2,X3
46 D ^%ZISC Q
47 ;
48 ;
49HDR ; Print header.
50 I $E(IOST,1,2)["C-"!(IBPAG) W @IOF
51 S IBPAG=IBPAG+1 W !,IBDESC,?IOM-35,IBHDT,?IOM-9,"Page: ",IBPAG
52 I $G(IBPURPHT) W !," * This report is being generated for Purple Heart Patients only *"
53 W !,"Charges from ",$$DAT1^IBOUTL(IBBDT)," through ",$$DAT1^IBOUTL(IBEDT)
54 W !,"PATIENT/ID",?17,"DESCRIPTION",?35,"STATUS",?49,"FROM",?60,"TO",?66,"UNITS",?72,"CHARGE"
55 W !,IBLINE
56 S IBQUIT=$$STOP^IBOUTL("Billing Activity List")
57 Q
58PHT ;ADDS the footnote of * Purple Heart Recipient to the report.
59 W !,?10,"* Purple Heart Recipient"
60 Q
61 ;
62 ;
63PH(DFN) ;Call to find out if a patient is a Purple Heart recipient.
64 ; DFN - patient's DFN
65 ;
66 ; Output - 1 means PH Indicator is "Yes"
67 ; 0 means PH Indicator is not "yes" (either "no" or null)
68 I '$D(^DPT(+$G(DFN),0)) Q 0
69 N IBPHT,VASV,VAERR
70 D SVC^VADPT
71 S IBPHT=$P($G(VASV(9,1)),"^",1)
72 I IBPHT'=3 S IBPHT=0
73 Q IBPHT
Note: See TracBrowser for help on using the repository browser.