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

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

revised back to 6/30/08 version

File size: 2.3 KB
Line 
1IBCBB5 ;ALB/BGA - CONT OF MEDICARE EDIT CHECKS ;08/12/98
2 ;;2.0;INTEGRATED BILLING;**51,137**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, 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,4),IBOCCS=$P(IBXSAVE("OCCS",IBI),U)
18 . S IBOCSP(IBOCCS,$O(IBOCSP(IBOCCS,""),-1)+1)=IBXSAVE("OCCS",IBI)
19 ;
20 S IBI=0 F S IBI=$O(IBXSAVE("OCC",IBI)) Q:'IBI D
21 . N Z
22 . S IBOCCD=$P(IBXSAVE("OCC",IBI),U)
23 . S IBOCCD(IBOCCD,$O(IBOCCD(IBOCCD,""),-1)+1)=IBXSAVE("OCC",IBI)
24 . I IBOCCD=10 S ^TMP($J,"LMD")=1
25 Q:IBQUIT
26 ;
27 ; For type of admit = 1 or 2, at least one occ code 1-6, 10, or 11 req
28 I $P(IBNDU,U,8)=1!($P(IBNDU,U,8)=2) D
29 . N OK
30 . S OK=0
31 . F Z="01","02","03","04","05","06",10,11 I $D(IBOCCD(Z))!($D(IBOCCD(+Z))) S OK=1 Q
32 . I 'OK S IBQUIT=$$IBER^IBCBB3(.IBER,133)
33 K IBXDATA D F^IBCEF("N-VALUE CODES",,,IBIFN)
34 S IBX=0
35 F S IBX=$O(IBXDATA(IBX)) Q:'IBX D Q:IBQUIT
36 . ; value code 01 must have a value>0
37 . I $P(IBXDATA(IBX),U)="01",IBER'["134;",$P(IBXDATA(IBX),U,2)'>0 S IBQUIT=$$IBER^IBCBB3(.IBER,134)
38 . Q:IBQUIT
39 . ; value code 02 must have a value=0
40 . I $P(IBXDATA(IBX),U)="02",IBER'["135;",+$P(IBXDATA(IBX),U,2)'=0 S IBQUIT=$$IBER^IBCBB3(.IBER,135)
41 . ; code^amount^dollar amt flag (1=amt,0=quantity)
42 . Q:IBQUIT
43 . I '$D(IBVALCD($P(IBXDATA(IBX),U))) S IBVALCD($P(IBXDATA(IBX),U))=$P(IBXDATA(IBX),U,2) Q
44 ; Must have value code 01 or 02 for TOB 11X, 18X, 21X - default it
45 ;I '$D(IBVALCD("01")),'$D(IBVALCD("02")),$S(IBTOB12="11":1,IBTOB12="18":1,1:IBTOB12="21") S IBQUIT=$$IBER^IBCBB3(.IBER,132)
46 ;
47 Q:IBQUIT
48 ; Must have acc hr if accident is indicated on inpatient bill
49 I $$INPAT^IBCEF(IBIFN,1) D
50 . I $D(IBOCCD("01"))!$D(IBOCCD("02"))!$D(IBOCCD("03"))!$D(IBOCCD("04"))!$D(IBOCCD("05")) D
51 .. I '$D(IBVALCD(45)),'$P($G(^DGCR(399,IBIFN,"U")),U,10) S IBQUIT=$$IBER^IBCBB3(.IBER,156)
52 Q:IBQUIT
53 ;
54 D ^IBCBB6
55 Q
Note: See TracBrowser for help on using the repository browser.