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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1IBEPTC2 ;ALB/CPM/ARH - TP LIST NON-BILLABLE STOP CODES AND CLINICS ; 05-AUG-93
2 ;;Version 2.0 ; INTEGRATED BILLING ;**55**; 21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5EN ; Option entry point - describe output.
6 W !!?5,"This report may be used to generate a list of all clinic stop codes,"
7 W !?5,"and clinics that are non-billable in Third Party Billing or "
8 W !,?5,"that will not have bills created by the Third Party Auto Biller.",!
9 ;
10 ; - grab effective date
11 S %DT="AEX",%DT("A")="Please select the effective date for this list: ",%DT("B")=$$DAT2^IBOUTL(DT)
12 D ^%DT K %DT G:Y<0 ENQ S IBDAT=Y
13 ;
14 ; - select a device
15 S %ZIS="QM" D ^%ZIS G:POP ENQ
16 I $D(IO("Q")) D G ENQ
17 .S ZTRTN="DQ^IBEPTC2",ZTDESC="LIST NON-BILLABLE STOPS/CLINICS",ZTSAVE("IBDAT")=""
18 .D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"Unable to queue this job.")
19 .K ZTSK,IO("Q") D HOME^%ZIS
20 ;
21 U IO
22 ;
23DQ ; Tasked entry point.
24 ;
25 ; - compile data
26 D ENQ1 F IBI=352.3,352.4 S IBJ=0 F S IBJ=$O(^IBE(IBI,"AIVDTT2",IBJ)) Q:'IBJ D
27 . S IBX=$$NBILL(IBI,IBJ,IBDAT)
28 . I +IBX S ^TMP("IBEPTC2",$J,IBI,1,$$VAL(IBI,IBJ)_IBJ)=IBJ Q
29 . I +$P(IBX,U,2) S ^TMP("IBEPTC2",$J,IBI,2,$E($$VAL(IBI,IBJ),1,20)_IBJ)=IBJ
30 ;
31 ; - print results
32 S (IBPAG,IBQ)=0 F IBI=352.3,352.4 D HDR,LST,PAUSE:'IBQ Q:IBQ
33 ;
34ENQ I '$D(ZTQUEUED) D ^%ZISC
35 K IBDAT,IBI,IBJ,IBQ,IBT,IBPAG
36ENQ1 K ^TMP("IBEPTC2",$J)
37 Q
38 ;
39HDR ; Generate a report header.
40 I $E(IOST,1,2)="C-"!(IBPAG) W @IOF,*13
41 S IBPAG=IBPAG+1,IBT="LIST OF "_$S(IBI=352.3:"CLINIC STOP CODES",1:"CLINICS")_" FLAGGED FOR THIRD PARTY BILLING"
42 W $$DASH(),!?(80-$L(IBT)\2),IBT,!?33,"As Of: ",$$DAT1^IBOUTL(IBDAT)
43 W !?64,"Page: ",IBPAG,!?60,"Run Date: ",$$DAT1^IBOUTL(DT)
44 W !,$$DASH(),!
45 Q
46 ;
47LST ; List all selected entries.
48 I '$D(^TMP("IBEPTC2",$J,IBI)) W "All ",$S(IBI=352.3:"clinic stop codes",1:"clinics")," are billable and may be auto billed on this date." G LSTQ
49 F IBK=1,2 S IBK1=$S(IBK=1:"NON-BILLABLE",1:"NOT AUTO BILLED") D
50 .W !!,?(80-$L(IBK1)\2),IBK1,!!
51 .I '$D(^TMP("IBEPTC2",$J,IBI,IBK)) W !,"No ",$S(IBI=352.3:"clinic stop codes",1:"clinics")," are flagged as ",IBK1,!
52 .S IBJ="" F S IBJ=$O(^TMP("IBEPTC2",$J,IBI,IBK,IBJ)) Q:IBJ="" D Q:IBQ
53 ..S IBH=+^TMP("IBEPTC2",$J,IBI,IBK,IBJ)
54 ..W:$X>40 ! I $Y>(IOSL-3) D PAUSE Q:IBQ D HDR
55 ..W:$X>2 ?40 W $$VAL(IBI,IBH)
56LSTQ Q
57 ;
58NBILL(IBF,IBEN,IBD) ; Is the entry not billable as of the effective date?
59 ; Input: IBF -- Base file (#352.3, #352.4)
60 ; IBEN -- Internal entry number for entry
61 ; IBD -- Effective date for non-billing
62 N Y S Y=0
63 I '$G(IBF)!'$G(IBEN)!'$G(IBD) G NBILLQ
64 I $G(IBF)=352.3 S Y=+$$NBST^IBEFUNC(IBEN,IBDAT)_U_+$$NABST^IBEFUNC(IBEN,IBDAT) G NBILLQ
65 I $G(IBF)=352.4 S Y=+$$NBCT^IBEFUNC(IBEN,IBDAT)_U_+$$NABCT^IBEFUNC(IBEN,IBDAT)
66NBILLQ Q Y
67 ;
68VAL(IBF,IBEN) ; Return the entry name.
69 ; Input: IBF -- Base file (#352.3, #352.4)
70 ; IBEN -- Internal entry number for entry
71 ; Output: Entry name (#.01 from respective file)
72 N Y S Y="'ENTRY NAME UNKNOWN'"
73 I '$G(IBF)!'$G(IBEN) G VALQ
74 I $G(IBF)=352.3 S Y=$P($G(^DIC(40.7,IBEN,0)),"^") G VALQ
75 I $G(IBF)=352.4 S Y=$P($G(^SC(IBEN,0)),"^")
76VALQ Q Y
77 ;
78DASH() ; Return a dashed line.
79 Q $TR($J("",80)," ","=")
80 ;
81PAUSE ; Page break
82 Q:$E(IOST,1,2)'="C-"
83 N IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
84 F IBX=$Y:1:(IOSL-3) W !
85 S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S IBQ=1
86 Q
Note: See TracBrowser for help on using the repository browser.