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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1IBAMTBU2 ;ALB/CPM - MEANS TEST BILLING BULLETINS (CON'T.) ; 15-JUN-93
2 ;;2.0;INTEGRATED BILLING;**153,202**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5MT ; Generate the 'change in Means Test' bulletin.
6 W:'DGMTINF !!,"Patient's Means Test billing status has changed..."
7 K IBT S IBPT=$$PT^IBEFUNC(DFN)
8 S XMSUB=$E($P(IBPT,"^"),1,14)_" "_$P(IBPT,"^",3)_" - MEANS TEST CHANGE"
9 S IBT(1)="A Means Test has been "_$S(DGMTP="":"added",DGMTA="":"deleted",1:"edited")_" for the following patient:"
10 S IBT(2)=" ",IBC=2,IBDUZ=DUZ D PAT^IBAERR1 S IBC=IBC+1,IBT(IBC)=" "
11 S Y=+IBMT D DD^%DT S IBC=IBC+1,IBT(IBC)="Test Date: "_Y
12 S IBC=IBC+1,IBT(IBC)=" Status: "_$P($$MTS^DGMTU(DFN,+$P(IBMT,"^",3)),"^")
13 I "^2^6^"[("^"_+$P(IBMT,"^",3)_"^") S IBT(IBC)=IBT(IBC)_$J("",$S($P(IBMT,"^",3)=2:11,1:21))_"Agrees to Pay Deductible? "_$S($P(IBMT,"^",11):"YES",$P(IBMT,"^",11)=0:"NO",1:"UNANSWERED")
14 I $P(IBMT,"^",3)=3 D ELIG^VADPT I VAEL(3) S DIC="^DPT(",DR=.3012,DA=DFN,DIQ="IBDIQ",DIQ(0)="E" D EN^DIQ1 S IBDIQ=$G(IBDIQ(2,DFN,.3012,"E")),IBT(IBC)=IBT(IBC)_$J("",13)_"SC Award Date: "_$S(IBDIQ]"":IBDIQ,1:"Unknown")
15 S Y=+$P(IBMT,"^",7) I Y D DD^%DT S IBC=IBC+1,IBT(IBC)="Completed: "_Y
16 S IBC=IBC+1,IBT(IBC)=" "
17 S IBC=IBC+1,IBT(IBC)="This patient is no"_$S(IBCATCA:"w",1:" longer")_" billable for medical care copayments."
18 D @$S(IBCATCP:"LCHG",1:"LEP") ; build bulletin for charges or episodes
19 D MAIL^IBAERR1 ; send bulletin
20 W:'DGMTINF "bulletin has been generated."
21 Q
22 ;
23LCHG ; List charges in bulletin.
24 N C,IBD,IBIL,IBN,IBND,X,Y
25 S IBC=IBC+1,IBT(IBC)=$S($G(IBCANCEL):"Please note that the following charge(s) were automatically cancelled:",1:"The following charges have been billed since "_$$DAT1^IBOUTL($S(+$P(IBMT,"^",7):+$P(IBMT,"^",7),1:+IBMT))_":")
26 S IBC=IBC+1,IBT(IBC)=" "
27 S IBC=IBC+1,IBT(IBC)=" Bill From Bill To Charge Type Bill # Status Charge"
28 S IBC=IBC+1,IBT(IBC)=$TR($J("",79)," ","=")
29 ;
30 ; - build detail lines
31 S IBD="" F S IBD=$O(IBARR(IBD)) Q:'IBD S IBN=0 F S IBN=$O(IBARR(IBD,IBN)) Q:'IBN D
32 .S IBND=$G(^IB(IBN,0)),IBIL=$P(IBND,"^",11)
33 .S IBC=IBC+1,IBT(IBC)=" "_$$DAT1^IBOUTL(+$P(IBND,"^",14))_" "_$$DAT1^IBOUTL(+$P(IBND,"^",15))_" "
34 .S X=$P($G(^IBE(350.1,+$P(IBND,"^",3),0)),"^") S:$E(X,1,2)="DG" X=$E(X,4,99)
35 .S IBT(IBC)=IBT(IBC)_X_$J("",24-$L(X))_$S(IBIL]"":$P(IBIL,"-",2)_" ",1:$J("",8))
36 .S Y=$P(IBND,"^",5),C=$P(^DD(350,.05,0),"^",2) D Y^DIQ
37 .S IBT(IBC)=IBT(IBC)_Y_$J("",15-$L(Y))_"$"_$P(IBND,"^",7)
38 ;
39 I '$G(IBCANCEL) S IBC=IBC+1,IBT(IBC)=" ",IBC=IBC+1,IBT(IBC)="Please review these charges and cancel those that should not be billed."
40 Q
41 ;
42LEP ; List episodes of care in bulletin.
43 N IBD,IBN,IBX,X
44 S IBC=IBC+1,IBT(IBC)="The following episodes of care have occurred since "_$$DAT1^IBOUTL($S(+$P(IBMT,"^",7):+$P(IBMT,"^",7),1:+IBMT))_":"
45 S IBC=IBC+1,IBT(IBC)=" "
46 S IBC=IBC+1,IBT(IBC)="Episode Date/Time Type of Care Ward/Clinic/Disposition/Appt Type"
47 S IBC=IBC+1,IBT(IBC)=$TR($J("",79)," ","=")
48 ;
49 ; - build detail lines
50 S IBD=0 F S IBD=$O(IBARR(IBD)) Q:'IBD S IBN="" F S IBN=$O(IBARR(IBD,IBN)) Q:IBN="" D
51 .S IBX=IBARR(IBD,IBN),X=$$DAT2^IBOUTL(IBD)
52 .S IBC=IBC+1,IBT(IBC)=X_$J("",23-$L(X))
53 .D @$S(IBN["SC":"SC",1:IBN) S IBT(IBC)=IBT(IBC)_X
54 ;
55 S IBC=IBC+1,IBT(IBC)=" "
56 S IBC=IBC+1,IBT(IBC)="Please review these episodes and add charges for those that should be billed."
57 Q
58 ;
59SC ; Build string for Stop Codes.
60 S X="STOP CODE "_$E($P($G(^DIC(40.7,+IBX,0)),"^"),1,20)_" ("_$$FLD5^IBOVOP1(+$P(IBX,"^",2))_")"
61 Q
62 ;
63APP ; Build string for Scheduled Appointments.
64 S X="APPOINTMENT "_$E($P($G(^SC(+IBX,0)),"^"),1,20)_" ("_$$FLD5^IBOVOP1(+$P(IBX,"^",2))_")"
65 Q
66 ;
67R ; Build string for Registrations.
68 S X="REGISTRATION "_$P($G(^DIC(37,+IBX,0)),"^")
69 Q
70 ;
71ADM ; Build string for Admissions.
72 S X="ADMISSION "_$P($G(^DIC(42,+IBX,0)),"^")
73 Q
Note: See TracBrowser for help on using the repository browser.