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

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1IBCBB11 ;ALB/AAS - CONTINUATION OF EDIT CHECK ROUTINE ;12 Jun 2006 3:45 PM
2 ;;2.0;INTEGRATED BILLING;**51,343,363,371,395,392**;21-MAR-94;Build 2
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5WARN(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 ;
14MULTDIV(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
30NPICHK ;
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 . I IBNPIREQ S IBER=IBER_"IB"_(160+$P(IBNONPI,U,Z))_";" Q ; If required, set error
43 . ; PRXM/KJH - Changed descriptions.
44 . D WARN("NPI for the "_$P("Division^Non-VA Service Facility^Billing Provider",U,$P(IBNONPI,U,Z))_" has no value") ; Else, set warning
45 Q
46 ;
47 ; Check for required taxonomies
48TAXCHK ;
49 N IBTAXS,IBNOTAX,IBTAXREQ,Z
50 S IBTAXREQ=$$TAXREQ^IBCEP81(DT) ; Check if taxonomy is required
51 ; Check providers
52 S IBTAXS=$$PROVTAX^IBCEF73A(IBIFN,.IBNOTAX)
53 I $L(IBNOTAX) F Z=1:1:$L(IBNOTAX,U) D
54 . ; Only Referring, Rendering and Attending are currently sent to the payer
55 . I IBTAXREQ,"134"[$P(IBNOTAX,U,Z) S IBER=IBER_"IB"_(250+$P(IBNOTAX,U,Z))_";" Q ; If required, set error
56 . D WARN("Taxonomy for the "_$P("referring^operating^rendering^attending^supervising^^^^other",U,$P(IBNOTAX,U,Z))_" provider has no value") ; Else, set warning
57 ; Check organizations
58 S IBNOTAX=""
59 S IBTAXS=$$ORGTAX^IBCEF73A(IBIFN,.IBNOTAX)
60 I $L(IBNOTAX) F Z=1:1:$L(IBNOTAX,U) D
61 . ; These are not currently sent to the payer so no errors yet
62 . ; I IBTAXREQ S IBER=IBER_"IB"_(164+$P(IBNOTAX,U,Z))_";" Q ; If required, set error
63 . ; PRXM/KJH - Changed descriptions.
64 . D WARN("Taxonomy for the "_$P("Division^Non-VA Service Facility^Billing Provider",U,$P(IBNOTAX,U,Z))_" has no value") ; Else, set warning
65 Q
66 ;
67VALNDC(IBIFN,IBDFN) ; IB*2*363 - validate NDC# between PRESCRIPTION file (#52)
68 ; and IB BILL/CLAIMS PRESCRIPTION REFILL file (#362.4)
69 ; input - IBIFN = internal entry number of the billing record in the BILL/CLAIMS file (#399)
70 ; IBDFN = internal entry number of patient record in the PATIENT file (#2)
71 N IBX,IBRXCOL
72 ; call program that determines if NDC differences exist
73 D VALNDC^IBEFUNC3(IBIFN,IBDFN,.IBRXCOL)
74 Q:'$D(IBRXCOL)
75 ; at least one RX on the IB record has an NDC discrepancy
76 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))
77 Q
78 ;
79PRIIDCHK ; Check for required Pimarary ID (SSN/EIN)
80 ; If the provider is on the claim, he must have one
81 ;
82 N IBI,IBZ
83 I $$TXMT^IBCEF4(IBIFN) D
84 . D F^IBCEF("N-ALL ATT/REND PROV SSN/EI","IBZ",,IBIFN)
85 . S IBI="" F S IBI=$O(^DGCR(399,IBIFN,"PRV","B",IBI)) Q:IBI="" D
86 .. 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:"")
87 Q
88 ;
89RXNPI(IBIFN) ; check for multiple pharmacy npi's on the same bill
90 N IBORG,IBRXNPI,IBX,IBY
91 S IBORG=$$RXSITE^IBCEF73A(IBIFN,.IBORG)
92 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))=""
93 S (IBX,IBY)=0 F S IBX=$O(IBRXNPI(IBX)) Q:'IBX S IBY=IBY+1
94 I IBY>1 D WARN("Bill has prescriptions resulting from "_IBY_" different NPI locations")
95 Q
Note: See TracBrowser for help on using the repository browser.