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

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

initial load of FOIAVistA 6/30/08 version

File size: 9.2 KB
Line 
1IBCEU5 ;ALB/TMP - EDI UTILITIES (continued) FOR CMS-1500 ;13-DEC-99
2 ;;2.0;INTEGRATED BILLING;**51,137,232,348,349**;21-MAR-94;Build 46
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5EXTCR(IBPRV) ; Called by trigger on field .02 of file 399.0222
6 ; Function returns the first 3 digits of the provider's degree if
7 ; a VA provider or the credentials in file 355.9 if non-VA provider
8 ; IBPRV = vp to file 200 or 355.93
9 Q $E($$CRED^IBCEU(IBPRV),1,3)
10 ;
11FTPRV(IBIFN,NOASK) ; If form type changes from UB-04 to CMS-1500 or vice
12 ; versa, ask to change provider function to appropriate function for
13 ; form type (ATTENDING = UB-04, RENDERING = CMS-1500)
14 ; IBIFN = ien of bill in file 399
15 ; NOASK (flag) = 1 if change should happen without asking first
16 N ATT,REN,FT
17 S FT=$$FT^IBCEF(IBIFN)
18 S REN=$$CKPROV^IBCEU(IBIFN,3,1)
19 S ATT=$$CKPROV^IBCEU(IBIFN,4,1)
20 I $S(FT=2:'REN&ATT,FT=3:'ATT&REN,1:0) D
21 . I '$G(NOASK) D TXFERPRV(IBIFN,FT) Q
22 . D PRVCHG(IBIFN,FT)
23 Q
24 ;
25TXFERPRV(IBIFN,FT) ; Ask to change the function of the main provider on
26 ; bill IBIFN to the function appropriate to the form type FT
27 ;
28 N DIR,X,Y,Z,DIE,DA,DR,HAVE,NEED,IBZ
29 W ! S DIR("A")=" WANT TO CHANGE THE "_$S(FT=3:"RENDERING",1:"ATTENDING")_" PROVIDER'S FUNCTION TO "_$S(FT=3:"ATTENDING",1:"RENDERING")_"?: "
30 S DIR(0)="YA",DIR("B")="YES",DIR("?",1)="IF YOU ANSWER YES HERE, YOU WILL MAKE THE PROVIDER FUNCTIONS CONSISTENT",DIR("?")=" WITH THE FORM TYPE OF THE BILL"
31 D ^DIR K DIR
32 Q:Y'=1
33 D PRVCHG(IBIFN,FT)
34 Q
35 ;
36PRVCHG(IBIFN,IBFT) ; Change provider type to type consistent with current
37 ; data on bill
38 N Z,IBZ,HAVE,NEED,DIE,DA,X,Y
39 S HAVE=$S(IBFT=3:3,1:4)
40 S NEED=$S(IBFT=3:4,1:3)
41 S Z=$O(^DGCR(399,IBIFN,"PRV","B",HAVE,0))
42 I Z D
43 . S DA(1)=IBIFN,DA=+Z
44 . D FDA^DILF(399.0222,.DA,.01,,NEED,"IBZ")
45 . D FILE^DIE(,"IBZ")
46 ;I Z S DA(1)=IBIFN,DIE="^DGCR(399,"_DA(1)_",""PRV"",",DA=+Z,DR=".01////"_NEED D FILE^DIE(,DIE
47 Q
48 ;
49PRVHELP ; Text for the provider function help
50 Q:$G(X)'="??"
51 N IBZ,IBQUIT,IB,IB1,DIR
52 S IBQUIT=0
53 I '$D(IOSL)!'$D(IOST) D HOME^%ZIS
54 Q:IOST'["C-"
55 W @IOF
56 I $G(D0) D
57 . N Z
58 . D SPECIFIC(D0)
59 . S Z=$$FT^IBCEF(D0)
60 . I $S(Z=2:$D(^DGCR(399,D0,"PRV","B",4)),Z=3:$D(^DGCR(399,D0,"PRV","B",3)),1:0) D
61 .. W !,"**** ",$S(Z=2:"ATTENDING",1:"RENDERING")," FUNCTION DOES NOT BELONG ON THIS BILL TYPE & MUST BE DELETED"
62 S IB=IOSL,IB1=1
63 F IBZ=1:1 S:$P($T(HLPTXT+IBZ),";;",2)="" IBQUIT=1 Q:IBQUIT S IB1=1 D
64 . I $Y>(IB-3) N DIR,X,Y S IB1=0,DIR(0)="E" D ^DIR K DIR S IB=IB+IOSL I Y'=1 S IBQUIT=1 Q
65 . W !,$P($T(HLPTXT+IBZ),";;",2)
66 I IB1 D
67 . N DIR,X,Y S DIR(0)="E" D ^DIR K DIR
68 W @IOF
69 Q
70 ;
71SPECIFIC(IBIFN) ; Display specific provider requirements for the bill IBIFN
72 N IBFT,IBPRV,IBR,ONBILL,Z,IBZ
73 S IBFT=$$FT^IBCEF(IBIFN)
74 D GETPRV^IBCEU(IBIFN,"ALL",.IBPRV) ;Returns needed providers
75 W !,"This bill is ",$S(IBFT=3:"UB-04",1:"CMS-1500"),"/",$S($$INPAT^IBCEF(IBIFN):"Inpatient",1:"Outpatient")
76 W !!,"The valid provider functions for this bill are:"
77 F IBZ=1:1:5,9 I $$PRVOK^IBCEU(IBZ,IBIFN) D
78 . S ONBILL=$$CKPROV^IBCEU(IBIFN,IBZ)
79 . S IBR=$S($G(IBPRV(IBZ,"NOTOPT")):1,1:0)
80 . W !,IBZ," ",$$EXPAND^IBTRE(399.0222,.01,IBZ),?13,$S(IBR&'ONBILL:"**",1:""),?15,$S(IBR:"REQUIRED",1:"OPTIONAL"),$S(ONBILL:" - ALREADY ON BILL",1:" - NOT ON BILL")
81 W !
82 Q
83 ;
84HLPTXT ; Helptext for provider function
85 ;;
86 ;;PROVIDER FUNCTION requirements:
87 ;;
88 ;;RENDERING: CMS-1500 (both inpatient and outpatient): REQUIRED
89 ;; This is the provider who performed the services.
90 ;; Data will appear in Form Locator 24 of the CMS-1500.
91 ;;
92 ;; NOTE: There can be only one rendering provider per CMS-1500
93 ;; claim form, so there may be multiple CMS-1500's for a
94 ;; single episode of care if services were performed by more
95 ;; than one provider. For example, there will be 2 CMS-1500's
96 ;; created for an episode of care that involved a surgical
97 ;; procedure and a radiology exam. The operating physician
98 ;; would be the rendering provider on the CMS-1500 that
99 ;; included the surgical procedure(s) and the radiologist
100 ;; would be the rendering provider on the CMS-1500 that
101 ;; included the radiology procedure(s).
102 ;;
103 ;;
104 ;;ATTENDING: UB-04 (inpatient and outpatient): REQUIRED
105 ;; The physician who normally would be expected to
106 ;; certify and recertify the medical necessity of the
107 ;; services rendered and/or who has primary responsibility
108 ;; for the patient's medical care and treatment. Data is
109 ;; printed in Form Locator 76 on the UB-04.
110 ;;
111 ;; NOTE: If there are multiple attending providers for the bill,
112 ;; report the attending provider for the procedure having the
113 ;; highest charge. For outpatient, if the patient is
114 ;; self-referred (e.g.: an ER or clinic visit), you may use
115 ;; SLF000 as the attending provider id, with no provider
116 ;; name. SLF000 may NOT be used for services which require a
117 ;; physician referral/order.
118 ;;
119 ;;
120 ;;OPERATING: UB-04 (inpatient and outpatient): SOMETIMES REQUIRED
121 ;; The provider who performed the principal procedure(s)
122 ;; being billed. Data will be printed in Form Locator 77
123 ;; on the UB-04.
124 ;;
125 ;; NOTE: Not applicable for CMS-1500 form type as this would be
126 ;; reported as the rendering provider on
127 ;; the CMS-1500.
128 ;; UB-04 (inpatient): REQUIRED IF type of bill has first 2
129 ;; digits of 11, and there is a principal
130 ;; procedure that will print in Form
131 ;; Locator 74 of the claim.
132 ;; UB-04 (outpatient): REQUIRED IF type of bill has first 2
133 ;; digits of 83, and there is a principal
134 ;; procedure that will print in Form
135 ;; Locator 74 of the claim.
136 ;;
137 ;;
138 ;;REFERRING: CMS-1500 (both inpatient and outpatient): OPTIONAL
139 ;; The provider who requested that the services being billed
140 ;; be performed. Data will be printed in boxes 17 and 17a of
141 ;; the CMS-1500.
142 ;;
143 ;;
144 ;;SUPERVISING: CMS-1500 (both inpatient and outpatient): OPTIONAL
145 ;; Required only when the rendering provider is supervised
146 ;; by a physician. Data will not be printed.
147 ;;
148 ;;
149 ;;OTHER: UB-04 (both inpatient and outpatient): OPTIONAL
150 ;; Used to report providers with functions not specifically
151 ;; designated here.
152 ;;
153 ;
154LINKRX(IBIFN,IBREV) ; Ask for revenue code's RX if not already there
155 N DIR,X,Y,IBZ,IBRX,Z,Z0,DA
156 Q:$P($G(^DGCR(399,IBIFN,"RC",IBREV,0)),U,11)!($P($G(^(0)),U,10)'=3)
157 S Z=0 F S Z=$O(^DGCR(399,IBIFN,"RC",Z)) Q:'Z I Z'=IBREV S Z0=$G(^(Z,0)) I $P(Z0,U,10)=3,$P(Z0,U,11) S IBRX(+$P(Z0,U,11))=""
158 S DIR(0)="PAO^IBA(362.4,:AEMQ",DIR("S")="I $P(^(0),U,2)=IBIFN,'$D(IBRX(+Y))"
159 S DIR("A")="Select Rx for this charge: "
160 S DIR("?",1)="Enter an Rx# for this revenue code"
161 S DIR("?")=" The Rx must not already have an associated revenue code"
162 D ^DIR K DIR
163 I Y>0 D
164 . S DA(1)=IBIFN,DA=IBREV,IBZ=""
165 . D FDA^DILF(399.042,.DA,.11,"R",+Y,"IBZ")
166 . D FILE^DIE(,"IBZ")
167 Q
168 ;
169LINKCPT(IBIFN,IBREV) ; Ask for revenue code's CPT
170 N DIR,X,Y,IBZ,IBCP,Z,Z0,Z1,DA,IBRC,IBP
171 S IBRC=$G(^DGCR(399,IBIFN,"RC",IBREV,0))
172 Q:$P(IBRC,U,8)!($P(IBRC,U,10)'=4)
173 S IBP=+$P(IBRC,U,6)
174 I $P(IBRC,U,11) W !,"PROCEDURE #"_$P(IBRC,U,11)_" HAS BEEN ASSOCIATED WITH THIS MANUAL CHARGE"
175 I '$P(IBRC,U,11) D Q:IBRC=""
176 . S DIR("?",1)="Respond YES if this revenue code charge specifically references the data for"
177 . S DIR("?",2)=" a particular procedure that was manually entered on the previous screen."
178 . S DIR("?",3)=" For outpatient UB-04 bills, associating a manual revenue code charge with",DIR("?")=" a procedure is the only way to print a modifier in box 44"
179 . S DIR(0)="YA",DIR("A")="SHOULD A PROCEDURE ENTRY BE ASSOCIATED WITH THIS CHARGE?: ",DIR("B")=$S(IBP:"YES",1:"NO") W ! D ^DIR K DIR W !
180 . I Y'=1 S IBRC="" Q
181 I $P(IBRC,U,11) D
182 . S DIR("?",1)="Respond YES if you no longer want this revenue code charge to reference a",DIR("?")=" specific manually entered procedure"
183 . S DIR(0)="YA",DIR("A")="DELETE THE EXISTING PROCEDURE ASSOCIATION?: ",DIR("B")="NO" W ! D ^DIR K DIR
184 . I Y=1 D UPDPTR(IBIFN,IBREV,"") S $P(IBRC,U,11)=""
185 S Z=0 F S Z=$O(^DGCR(399,IBIFN,"RC",Z)) Q:'Z S Z0=$G(^(Z,0)) I IBREV'=Z,$P(Z0,U,11) D
186 . ; Don't allow to link to 'used' proc
187 . I $P(Z0,U,10)=4 S IBCP($P(Z0,U,11))="" Q
188 . I $P(Z0,U,10)=3,$P(Z0,U,15) S IBCP($P(Z0,U,15))=""
189 S DIR(0)="PAO^DGCR(399,"_IBIFN_",""CP"",:AEMQ",DIR("S")="I '$D(IBCP(+Y)),$P(^(0),U)[""CPT"",+^(0)="_+$P($G(^DGCR(399,IBIFN,"RC",IBREV,0)),U,6)
190 S DIR("A")="SELECT A PROCEDURE ENTRY: "_$S($P(IBRC,U,11):"#"_$P(IBRC,U,11)_" - "_$$EXPAND^IBTRE(399.0304,.01,$P($G(^DGCR(399,IBIFN,"CP",$P(IBRC,U,11),0)),U))_"// ",1:"")
191 S DIR("?")="Enter a manually-added CPT procedure to associate with this charge"
192 S DA(1)=IBIFN
193 D ^DIR K DIR W !
194 I Y>0 D UPDPTR(IBIFN,IBREV,+Y)
195 Q
196 ;
197UPDPTR(IBIFN,IBREV,Y) ;
198 N IBZ,DA
199 S DA(1)=IBIFN,DA=IBREV,IBZ=""
200 D FDA^DILF(399.042,.DA,.11,"R",$S(Y:+Y,1:""),"IBZ")
201 D FILE^DIE(,"IBZ")
202 Q
203 ;
204INSFT(IBIFN) ; Returns 1 if form type is UB-04, 0 if CMS-1500
205 Q ($$FT^IBCEF(IBIFN)=3)
206 ;
Note: See TracBrowser for help on using the repository browser.