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

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1IBCBB5 ;ALB/BGA - CONT OF MEDICARE EDIT CHECKS ;08/12/98
2 ;;2.0;INTEGRATED BILLING;**51,137,371**;21-MAR-94;Build 57
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 D F^IBCEF("N-ADMISSION DATE","IBZADMIT",,IBIFN)
6 D F^IBCEF("N-DISCHARGE DATE","IBZDISCH",,IBIFN)
7 ;
8 ; Occurrence Code and Dates
9 ; occ codes can not be duplicates for same dates and must have a date
10 K IBXSAVE,IBXDATA D F^IBCEF("N-OCCURRENCE CODES",,,IBIFN)
11 ; Returns arrays IBXSAVE("OCC",n) AND IBXSAVE("OCCS",n) =
12 ; code^start date^state^end date
13 ; IBOCS=occ codes ;; IBOCSP=occ span codes
14 ;
15 S IBI=0 F S IBI=$O(IBXSAVE("OCCS",IBI)) Q:'IBI D
16 . N IBOCSDT,IBOCSDT1,Z
17 . S IBOCSDT=$P(IBXSAVE("OCCS",IBI),U,2),IBOCSDT1=$P(IBXSAVE("OCCS",IBI),U,3),IBOCCS=$P(IBXSAVE("OCCS",IBI),U)
18 . S IBOCSP(IBOCCS,$O(IBOCSP(IBOCCS,""),-1)+1)=IBXSAVE("OCCS",IBI)
19 . ; Occurrence Code End dates must be > start date and are required for OCCURANCE SPANS
20 . I 'IBOCSDT1 S IBER=IBER_"IB155;" Q
21 . I IBOCSDT1<IBOCSDT S IBER=IBER_"IB150;" Q
22 ;
23 S IBI=0 F S IBI=$O(IBXSAVE("OCC",IBI)) Q:'IBI D
24 . N Z
25 . S IBOCCD=$P(IBXSAVE("OCC",IBI),U)
26 . S IBOCCD(IBOCCD,$O(IBOCCD(IBOCCD,""),-1)+1)=IBXSAVE("OCC",IBI)
27 . I IBOCCD=10 S ^TMP($J,"LMD")=1
28 Q:IBQUIT
29 ;
30 ; For type of admit = 1 or 2, at least one occ code 1-6, 10, or 11 req
31 I $P(IBNDU,U,8)=1!($P(IBNDU,U,8)=2) D
32 . N OK
33 . S OK=0
34 . F Z="01","02","03","04","05","06",10,11 I $D(IBOCCD(Z))!($D(IBOCCD(+Z))) S OK=1 Q
35 . I 'OK S IBQUIT=$$IBER^IBCBB3(.IBER,133)
36 K IBXDATA D F^IBCEF("N-VALUE CODES",,,IBIFN)
37 S IBX=0
38 F S IBX=$O(IBXDATA(IBX)) Q:'IBX D Q:IBQUIT
39 . I '$D(IBVALCD($P(IBXDATA(IBX),U))) S IBVALCD($P(IBXDATA(IBX),U))=$P(IBXDATA(IBX),U,2)
40 . ; value code 01 must have a value>0
41 . I $P(IBXDATA(IBX),U)="01",IBER'["134;",$P(IBXDATA(IBX),U,2)'>0 S IBQUIT=$$IBER^IBCBB3(.IBER,134) Q
42 . ; value code 02 must have a value=0
43 . I $P(IBXDATA(IBX),U)="02",IBER'["135;",+$P(IBXDATA(IBX),U,2)'=0 S IBQUIT=$$IBER^IBCBB3(.IBER,135) Q
44 . ; code^amount^dollar amt flag (1=amt,0=quantity)
45 . I $P(IBXDATA(IBX),U,2)="",IBER'["157;" S IBQUIT=$$IBER^IBCBB3(.IBER,157) Q
46 . I '$$CHK^IBCVC($P(IBXDATA(IBX),U,4),$P(IBXDATA(IBX),U,2)),IBER'["158;" S IBQUIT=$$IBER^IBCBB3(.IBER,158) Q
47 ;
48 Q:IBQUIT
49 ; Must have acc hr if accident is indicated on inpatient bill
50 I $$INPAT^IBCEF(IBIFN,1) D
51 . I $D(IBOCCD("01"))!$D(IBOCCD("02"))!$D(IBOCCD("03"))!$D(IBOCCD("04"))!$D(IBOCCD("05")) D
52 .. I '$D(IBVALCD(45)),'$P($G(^DGCR(399,IBIFN,"U")),U,10) S IBQUIT=$$IBER^IBCBB3(.IBER,156)
53 Q:IBQUIT
54 ;
55 D ^IBCBB6
56 Q
Note: See TracBrowser for help on using the repository browser.