1 | IBCBB11 ;ALB/AAS - CONTINUATION OF EDIT CHECK ROUTINE ;12 Jun 2006 3:45 PM
|
---|
2 | ;;2.0;INTEGRATED BILLING;**51,343,363,371,395,392,401**;21-MAR-94;Build 5
|
---|
3 | ;;Per VHA Directive 2004-038, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | WARN(IBDISP) ; Set warning in global
|
---|
6 | ; DISP = warning text to display
|
---|
7 | ;
|
---|
8 | N Z
|
---|
9 | S Z=+$O(^TMP($J,"BILL-WARN",""),-1)
|
---|
10 | I Z=0 S ^TMP($J,"BILL-WARN",1)=$J("",5)_"**Warnings**:",Z=1
|
---|
11 | S Z=Z+1,^TMP($J,"BILL-WARN",Z)=$J("",5)_IBDISP
|
---|
12 | Q
|
---|
13 | ;
|
---|
14 | MULTDIV(IBIFN,IBND0) ; Check for multiple divisions on a bill ien IBIFN
|
---|
15 | ; IBND0 = 0-node of bill
|
---|
16 | ;
|
---|
17 | ; Function returns 1 if more than 1 division found on bill
|
---|
18 | N Z,Z0,Z1,MULT
|
---|
19 | S MULT=0,Z1=$P(IBND0,U,22)
|
---|
20 | I Z1 D
|
---|
21 | . S Z=0 F S Z=$O(^DGCR(399,IBIFN,"RC",Z)) Q:'Z S Z0=$P(^(Z,0),U,7) I Z0,Z0'=Z1 S MULT=1 Q
|
---|
22 | . S Z=0 F S Z=$O(^DGCR(399,IBIFN,"CP",Z)) Q:'Z S Z0=$P(^(Z,0),U,6) I Z0,Z0'=Z1 S MULT=2 Q
|
---|
23 | I 'Z1 S MULT=3
|
---|
24 | Q MULT
|
---|
25 | ;
|
---|
26 | ;; PREGNANCY DX CODES: V22**-V24**, V27**-V28**, 630**-677**
|
---|
27 | ;; FLU SHOTS PROCEDURE CODES: 90724, G0008, 90732, G0009
|
---|
28 | ;
|
---|
29 | ; Check for required NPIs
|
---|
30 | NPICHK ;
|
---|
31 | N IBNPIS,IBNONPI,IBNPIREQ,Z
|
---|
32 | S IBNPIREQ=$$NPIREQ^IBCEP81(DT) ; Check if NPI is required
|
---|
33 | ; Check providers
|
---|
34 | S IBNPIS=$$PROVNPI^IBCEF73A(IBIFN,.IBNONPI)
|
---|
35 | I $L(IBNONPI) F Z=1:1:$L(IBNONPI,U) D
|
---|
36 | . I IBNPIREQ S IBER=IBER_"IB"_(140+$P(IBNONPI,U,Z))_";" Q ; If required, set error
|
---|
37 | . D WARN("NPI for the "_$P("referring^operating^rendering^attending^supervising^^^^other",U,$P(IBNONPI,U,Z))_" provider has no value") ; Else, set warning
|
---|
38 | ; Check organizations
|
---|
39 | S IBNONPI=""
|
---|
40 | S IBNPIS=$$ORGNPI^IBCEF73A(IBIFN,.IBNONPI)
|
---|
41 | I $L(IBNONPI) F Z=1:1:$L(IBNONPI,U) D
|
---|
42 | . ; Turn IB161, IB162 to a warning
|
---|
43 | . I IBNPIREQ,$P(IBNONPI,U,Z)=3 S IBER=IBER_"IB163;" Q
|
---|
44 | . ; PRXM/KJH - Changed descriptions.
|
---|
45 | . D WARN("NPI for the "_$P("Division^Non-VA Service Facility^Billing Provider",U,$P(IBNONPI,U,Z))_" has no value") ; Else, set warning
|
---|
46 | Q
|
---|
47 | ;
|
---|
48 | ; Check for required taxonomies
|
---|
49 | TAXCHK ;
|
---|
50 | N IBTAXS,IBNOTAX,IBTAXREQ,Z
|
---|
51 | S IBTAXREQ=$$TAXREQ^IBCEP81(DT) ; Check if taxonomy is required
|
---|
52 | ; Check providers
|
---|
53 | S IBTAXS=$$PROVTAX^IBCEF73A(IBIFN,.IBNOTAX)
|
---|
54 | I $L(IBNOTAX) F Z=1:1:$L(IBNOTAX,U) D
|
---|
55 | . ; Only Referring, Rendering and Attending are currently sent to the payer
|
---|
56 | . I IBTAXREQ,"134"[$P(IBNOTAX,U,Z) S IBER=IBER_"IB"_(250+$P(IBNOTAX,U,Z))_";" Q ; If required, set error
|
---|
57 | . D WARN("Taxonomy for the "_$P("referring^operating^rendering^attending^supervising^^^^other",U,$P(IBNOTAX,U,Z))_" provider has no value") ; Else, set warning
|
---|
58 | ; Check organizations
|
---|
59 | S IBNOTAX=""
|
---|
60 | S IBTAXS=$$ORGTAX^IBCEF73A(IBIFN,.IBNOTAX)
|
---|
61 | I $L(IBNOTAX) F Z=1:1:$L(IBNOTAX,U) D
|
---|
62 | . ; Turn IB165, IB166 to a warning
|
---|
63 | . I IBTAXREQ,$P(IBNOTAX,U,Z)=3 S IBER=IBER_"IB167;" Q
|
---|
64 | . ; PRXM/KJH - Changed descriptions.
|
---|
65 | . D WARN("Taxonomy for the "_$P("Division^Non-VA Service Facility^Billing Provider",U,$P(IBNOTAX,U,Z))_" has no value") ; Else, set warning
|
---|
66 | Q
|
---|
67 | ;
|
---|
68 | VALNDC(IBIFN,IBDFN) ; IB*2*363 - validate NDC# between PRESCRIPTION file (#52)
|
---|
69 | ; and IB BILL/CLAIMS PRESCRIPTION REFILL file (#362.4)
|
---|
70 | ; input - IBIFN = internal entry number of the billing record in the BILL/CLAIMS file (#399)
|
---|
71 | ; IBDFN = internal entry number of patient record in the PATIENT file (#2)
|
---|
72 | N IBX,IBRXCOL
|
---|
73 | ; call program that determines if NDC differences exist
|
---|
74 | D VALNDC^IBEFUNC3(IBIFN,IBDFN,.IBRXCOL)
|
---|
75 | Q:'$D(IBRXCOL)
|
---|
76 | ; at least one RX on the IB record has an NDC discrepancy
|
---|
77 | S IBX=0 F S IBX=$O(IBRXCOL(IBX)) Q:'IBX D WARN("NDC# on Bill does not equal the NDC# on Rx "_IBRXCOL(IBX))
|
---|
78 | Q
|
---|
79 | ;
|
---|
80 | PRIIDCHK ; Check for required Pimarary ID (SSN/EIN)
|
---|
81 | ; If the provider is on the claim, he must have one
|
---|
82 | ;
|
---|
83 | N IBI,IBZ
|
---|
84 | I $$TXMT^IBCEF4(IBIFN) D
|
---|
85 | . D F^IBCEF("N-ALL ATT/REND PROV SSN/EI","IBZ",,IBIFN)
|
---|
86 | . S IBI="" F S IBI=$O(^DGCR(399,IBIFN,"PRV","B",IBI)) Q:IBI="" D
|
---|
87 | .. I $P(IBZ,U,IBI)="" S IBER=IBER_$S(IBI=1:"IB151;",IBI=2:"IB152;",IBI=3!(IBI=4):"IB321;",IBI=5:"IB153;",IBI=9:"IB154;",1:"")
|
---|
88 | Q
|
---|
89 | ;
|
---|
90 | RXNPI(IBIFN) ; check for multiple pharmacy npi's on the same bill
|
---|
91 | N IBORG,IBRXNPI,IBX,IBY
|
---|
92 | S IBORG=$$RXSITE^IBCEF73A(IBIFN,.IBORG)
|
---|
93 | S IBX=0 F S IBX=$O(IBORG(IBX)) Q:'IBX S IBY=0 F S IBY=$O(IBORG(IBX,IBY)) Q:'IBY S IBRXNPI(+IBORG(IBX,IBY))=""
|
---|
94 | S (IBX,IBY)=0 F S IBX=$O(IBRXNPI(IBX)) Q:'IBX S IBY=IBY+1
|
---|
95 | I IBY>1 D WARN("Bill has prescriptions resulting from "_IBY_" different NPI locations")
|
---|
96 | Q
|
---|