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

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

initial load of FOIAVistA 6/30/08 version

File size: 6.7 KB
Line 
1IBCU7A ;ALB/ARH - BILL PROCEDURE MANIPULATIONS ; 10-OCT-03
2 ;;2.0;INTEGRATED BILLING;**245,287**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; Based on Reasonable Charges v2.0+, certain CPT codes should be reported in a certain way
6 ; this set of routines manipulates the bill's procedure to conform to the charges and proper billing
7 ;
8 ; criteria: bill must be a Reasonable Charges bill
9 ; charges must be v2.0 or greater
10 ;
11 ; called after bill created and populated to reset procedures
12 ;
13PROC(IBIFN,EDIT) ; manipulate bill procedures base on charges and the clinical data
14 ; EDIT is a flag for which manipulations should be completed, if true then only the charge significant manipulations are preformed
15 N IB0,IBBCT,IBPBTYP S EDIT=$G(EDIT)
16 I '$O(^DGCR(399,+$G(IBIFN),"CP",0)) Q
17 S IB0=$G(^DGCR(399,+IBIFN,0)) Q:IB0="" S IBBCT=$P(IB0,U,27) Q:'IBBCT
18 I +$P($G(^DGCR(399,+IBIFN,"U")),U,2)<$$VERSDT^IBCRU8(2) Q
19 I '$$BILLRATE^IBCRU3($P(IB0,U,7),$P(IB0,U,5),$P(IB0,U,3),"RC") Q
20 ;
21 S IBPBTYP=$P($$RCDV^IBCRU8(+$P(IB0,U,22)),U,3) Q:'IBPBTYP
22 ;
23 I 'EDIT,IBPBTYP<3 D DELCLN(IBIFN) ; delete TC/26 component clinical procedures from bills
24 I 'EDIT,IBPBTYP<3 D ADDCLN(IBIFN) ; add 26 modified clinical procedures to bill
25 I 'EDIT,IBPBTYP<3 D DELTC(IBIFN) ; delete all TC modifiers from institutional bills
26 ;
27 D MOD26(IBIFN) ; if only professional charge is a 26 charge then add or delete modifier 26 on procedure
28 ;
29 D BNDL^IBCU7A1(IBIFN) ; split or combine bundled procedures
30 ;
31 K ^UTILITY($J)
32 Q
33 ;
34 ;
35 ;
36DELTC(IBIFN) ; delete TC modifier from all procedures on RC v2.0+ Institutional bills
37 N IB0,IBBCT,IBTC,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE S IBCHANGE=0
38 S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I IBBCT'=1 Q
39 S IBTC=+$$MOD^ICPTMOD("TC","E") Q:IBTC<1 S IBV2=$$VERSDT^IBCRU8(2)
40 ;
41 S IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP",IBBCPT)) Q:'IBBCPT D
42 . S IBLN=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0)),IBEVDT=$P(IBLN,U,2) Q:IBLN'[";ICPT("
43 . I IBEVDT<IBV2 Q
44 . S IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
45 . I IBMODS[IBTC D DELMOD^IBCU73(IBIFN,IBBCPT,IBTC) S IBCHANGE=IBCHANGE+1
46 I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier TC Deleted from all Procedures ("_IBCHANGE_")."
47 Q
48 ;
49DELCLN(IBIFN) ; remove clinical procedures from RC v2.0+ bills
50 ; - remove from institutional bill any procedures with a 26 in the clincal data
51 ; - remove from professional bill any procedures with a TC in the clinical data
52 ; to delete a procedure the outpatient encounter pointer must match the clinical encounter
53 ; (checks for non-modified procedure on bill in case modifier was manually removed)
54 ;
55 N IB0,IBBCT,IBMODE,IBMOD,IBX,IBLN,IBOE,IBCM,IBCPT,IBBCPT,IBLN1,IBFND,IBEND,IBV2,IBCHANGE S IBCHANGE=0
56 S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I 'IBBCT Q
57 S IBMODE=$S(IBBCT=1:26,IBBCT=2:"TC",1:"") Q:IBMODE="" S IBV2=$$VERSDT^IBCRU8(2)
58 S IBMOD=+$$MOD^ICPTMOD(IBMODE,"E") Q:IBMOD<1
59 ;
60 D GETSD^IBCU7U(IBIFN)
61 S IBX=0 F S IBX=$O(^UTILITY($J,"CPT-CNT",IBX)) Q:'IBX D
62 . S IBLN=$G(^UTILITY($J,"CPT-CNT",IBX)),(IBEND,IBFND)=0
63 . I +$P(IBLN,U,2)<IBV2 Q
64 . S IBOE=+$P(IBLN,U,11),IBCM=","_$P(IBLN,U,10)_","
65 . ;
66 . I IBCM[(","_IBMOD_",") D
67 .. S IBCPT=+IBLN_";ICPT(",IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP","B",IBCPT,IBBCPT)) Q:'IBBCPT D Q:IBEND
68 ... S IBLN1=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0))
69 ... I IBOE=$P(IBLN1,U,20) S IBFND=IBBCPT I $O(^DGCR(399,IBIFN,"CP",IBBCPT,"MOD","C",IBMOD,0)) S IBEND=1
70 .. I +IBFND,+$$DELCPT^IBCU7U(IBIFN,IBBCPT) S IBCHANGE=IBCHANGE+1
71 I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier "_IBMODE_" Procedures Deleted ("_IBCHANGE_")."
72 Q
73 ;
74ADDCLN(IBIFN) ; add 26 modified clinical procedures to RC v2.0+ bills
75 ; - add to professional bill any procedures with a 26 in the clinical data
76 ; to add the clinical procedure the bill must not already have that procedure for the date
77 ; (checks for non-modified procedure on bill in case modifier was manually removed)
78 ;
79 N IB0,IBBCT,IBMOD,IBX,IBLN,IBEVDT,IBCM,IBCPT,IBBCPT,IBLN1,IBFND,IBEND,IBV2,IBCHANGE S IBCHANGE=0
80 S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I IBBCT'=2 Q
81 S IBMOD=+$$MOD^ICPTMOD("26","E") Q:IBMOD<1 S IBV2=$$VERSDT^IBCRU8(2)
82 ;
83 D GETSD^IBCU7U(IBIFN)
84 S IBX=0 F S IBX=$O(^UTILITY($J,"CPT-CNT",IBX)) Q:'IBX D
85 . S IBLN=$G(^UTILITY($J,"CPT-CNT",IBX)),(IBEND,IBFND)=0
86 . S IBEVDT=+$P(IBLN,U,2),IBCM=","_$P(IBLN,U,10)_","
87 . I IBEVDT<IBV2 Q
88 . ;
89 . I IBCM[(","_IBMOD_",") D
90 .. S IBCPT=+IBLN_";ICPT(",IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP","B",IBCPT,IBBCPT)) Q:'IBBCPT D Q:IBEND
91 ... S IBLN1=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0))
92 ... I IBEVDT=$P(IBLN1,U,2) S IBFND=IBBCPT I $O(^DGCR(399,IBIFN,"CP",IBBCPT,"MOD","C",IBMOD,0)) S IBEND=1
93 .. I 'IBFND,+$$ADDCPT^IBCU7U(IBIFN,IBLN) S IBCHANGE=IBCHANGE+1
94 I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier 26 Procedures Added ("_IBCHANGE_")."
95 Q
96 ;
97MOD26(IBIFN) ; add/delete modifier 26 to procedure if that is the only professional charge available
98 ; added on professional bill, deleted from institutional bill
99 N IB0,IBBCT,IB26,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE,IBCHGS S IBCHANGE=0
100 S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I 'IBBCT Q
101 S IB26=+$$MOD^ICPTMOD("26","E") Q:IB26<1 S IBV2=$$VERSDT^IBCRU8(2)
102 ;
103 S IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP",IBBCPT)) Q:'IBBCPT D
104 . S IBLN=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0)),IBEVDT=$P(IBLN,U,2) Q:IBLN'[";ICPT("
105 . I IBEVDT<IBV2 Q
106 . S IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
107 . ;
108 . S IBCHGS=$$CHGMOD^IBCRCU1(IBIFN,+IBLN,IBEVDT,2) I (+IBCHGS'=1)!(+$P(IBCHGS,":",3)'=IB26) Q
109 . ;
110 . I IBBCT=1,IBMODS[IB26 D DELMOD^IBCU73(IBIFN,IBBCPT,IB26) S IBCHANGE=IBCHANGE+1
111 . I IBBCT=2,IBMODS'[IB26 D ADDMOD^IBCU73(IBIFN,IBBCPT,IB26) S IBCHANGE=IBCHANGE+1
112 ;
113 I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier 26 "_$S(IBBCT=1:"Deleted from",1:"Added to")_" Procedures ("_IBCHANGE_")."
114 Q
115 ;
116 ;
117ASK(IBIFN) ; ask if the bill procedure modifications should be executed
118 N DIR,DIRUT,DUOUT,DTOUT,X,Y
119 I '$O(^DGCR(399,+$G(IBIFN),"CP",0)) Q
120 S DIR("?")="Enter Yes to apply the bill procedure modifications for charges."
121 S DIR("?",1)="For Reasonable Charges some procedures must be billed in a certain way to"
122 S DIR("?",2)="receive a charge. The bill procedure modifications apply rules to the bill"
123 S DIR("?",3)="procedures to ensure the correct Reasonable Charge.",DIR("?",4)=""
124 S DIR("?",5)="- Modifier 26 will be added/removed from procedures if it affects the charges."
125 S DIR("?",6)="- Certain global procedures with no charge will be split into their component"
126 S DIR("?",7)=" procedures which do have charges.",DIR("?",8)=""
127 ;
128 S DIR("A")="Apply Procedure Updates for Charges" W !!
129 S DIR(0)="Y",DIR("B")="YES" D ^DIR K DIR,X I Y=1 D PROC(+IBIFN,1) W !
130 Q
Note: See TracBrowser for help on using the repository browser.