1 | IBCRLM ;ALB/ARH - RATES: DISPLAY REVENUE CODE LINKS ; 10-OCT-1998
|
---|
2 | ;;2.0;INTEGRATED BILLING;**106**;21-MAR-94
|
---|
3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | EN ; -- main entry point for IBCR REVENUE CODE LINK
|
---|
6 | D EN^VALM("IBCR REVENUE CODE LINK")
|
---|
7 | Q
|
---|
8 | ;
|
---|
9 | HDR ; -- header code
|
---|
10 | I +$G(IBCPT) S VALMHDR(1)="Revenue Codes linked to "_$P($$CPT^ICPTCOD(+IBCPT),U,2)
|
---|
11 | I +$G(IBCPT) S VALMSG="* revenue code used on a bill for "_$P($$CPT^ICPTCOD(+IBCPT),U,2)
|
---|
12 | Q
|
---|
13 | ;
|
---|
14 | INIT ; -- init variables and list array
|
---|
15 | K ^TMP("IBCRLM",$J)
|
---|
16 | I '$G(IBCPT) S IBCPT=$$GETCPT^IBCRU1("",1) I IBCPT'>0 S VALMQUIT="" Q
|
---|
17 | D BLD
|
---|
18 | Q
|
---|
19 | ;
|
---|
20 | HELP ; -- help code
|
---|
21 | S X="?" D DISP^XQORM1 W !!
|
---|
22 | Q
|
---|
23 | ;
|
---|
24 | EXIT ; -- exit code
|
---|
25 | K ^TMP("IBCRLM",$J) D CLEAR^VALM1,CLEAN^VALM10
|
---|
26 | Q
|
---|
27 | ;
|
---|
28 | BLD ; build charge set display array
|
---|
29 | N IBRLFN,IBCPT1,IBRL0,IBLABEL,IBBRFN,IBCSFN,IBX,IBY,RVCPTARR,BRCSARR S VALMCNT=0
|
---|
30 | ;
|
---|
31 | D FNDSRT(+$G(IBCPT),.RVCPTARR,.BRCSARR)
|
---|
32 | ;
|
---|
33 | ; create LM display array
|
---|
34 | S IBCPT1="" F S IBCPT1=$O(RVCPTARR(IBCPT1)) Q:IBCPT1="" D
|
---|
35 | . S IBRLFN="" F S IBRLFN=$O(RVCPTARR(IBCPT1,IBRLFN)) Q:IBRLFN="" D
|
---|
36 | .. ;
|
---|
37 | .. S IBY="",IBRL0=$G(^IBE(363.33,+IBRLFN,0)) Q:IBRL0=""
|
---|
38 | .. ;
|
---|
39 | .. I $D(BRCSARR(IBRLFN)) S IBX="*",IBY=$$SETFLD^VALM1(IBX,IBY,"USED")
|
---|
40 | .. S IBX=$P($$CPT^ICPTCOD(+$P(IBRL0,U,3)),U,2),IBY=$$SETFLD^VALM1(IBX,IBY,"PRC1")
|
---|
41 | .. I +$P(IBRL0,U,4) S IBX=$P($$CPT^ICPTCOD(+$P(IBRL0,U,4)),U,2),IBY=$$SETFLD^VALM1(IBX,IBY,"PRC2")
|
---|
42 | .. S IBX=$P($G(^DGCR(399.2,+$P(IBRL0,U,1),0)),U,1),IBY=$$SETFLD^VALM1(IBX,IBY,"RVCD")
|
---|
43 | .. S IBX=$P($G(^DGCR(399.2,+$P(IBRL0,U,1),0)),U,2),IBY=$$SETFLD^VALM1(IBX,IBY,"RVDS")
|
---|
44 | .. S IBX=$P($G(^IBE(363.32,+$P(IBRL0,U,2),0)),U,1),IBY=$$SETFLD^VALM1(IBX,IBY,"SGRP")
|
---|
45 | .. D SET(IBY) S IBY=""
|
---|
46 | .. ;
|
---|
47 | .. S IBLABEL="applied to bills for:"
|
---|
48 | .. S IBBRFN=0 F S IBBRFN=$O(BRCSARR(IBRLFN,IBBRFN)) Q:'IBBRFN D
|
---|
49 | ... S IBCSFN="" F S IBCSFN=$O(BRCSARR(IBRLFN,IBBRFN,IBCSFN)) Q:IBCSFN="" D Q:'IBCSFN
|
---|
50 | .... S IBX=IBLABEL,IBY=$$SETFLD^VALM1(IBX,IBY,"RVDS"),IBLABEL=""
|
---|
51 | .... I +IBCSFN S IBX=$P($G(^IBE(363.1,+IBCSFN,0)),U,1),IBY=$$SETFLD^VALM1(IBX,IBY,"SGRP")
|
---|
52 | .... I 'IBCSFN S IBX=$P($G(^IBE(363.3,+IBBRFN,0)),U,1),IBY=$$SETFLD^VALM1(IBX,IBY,"SGRP")
|
---|
53 | .... D SET(IBY) S IBY=""
|
---|
54 | .. ;
|
---|
55 | .. S IBY="" D SET(IBY) S IBY=""
|
---|
56 | ;
|
---|
57 | I VALMCNT=0 D SET(" "),SET("No Revenue Code links for this CPT.")
|
---|
58 | Q
|
---|
59 | ;
|
---|
60 | SET(X) ; set up list manager screen array
|
---|
61 | S VALMCNT=VALMCNT+1
|
---|
62 | S ^TMP("IBCRLM",$J,VALMCNT,0)=X
|
---|
63 | Q
|
---|
64 | ;
|
---|
65 | FNDSRT(CPT,CPTARR,BRARR) ; find and sort all revenue code links for a CPT
|
---|
66 | ; array of all links for a CPT: CPTARR(procedure 1, ifn of rev link) = special group
|
---|
67 | ; array of links used on bills: BRARR(ifn of rv link, billing rate, charge set) = special group
|
---|
68 | N IBSGFN,IBSG0,IBRLFN,IBCPT1,IBSGFN1,IBSG10,IBX,RLARR K CPTARR,BRARR Q:'$G(CPT)
|
---|
69 | ;
|
---|
70 | S IBSGFN=0 F S IBSGFN=$O(^IBE(363.32,IBSGFN)) Q:'IBSGFN D
|
---|
71 | . S IBSG0=$G(^IBE(363.32,IBSGFN,0)) I $P(IBSG0,U,2)'=1 Q
|
---|
72 | . ;
|
---|
73 | . ; find all revenue code links for the CPT
|
---|
74 | . K RLARR S RLARR=1,IBX=$$GRVLNK^IBCRU6(CPT,IBSGFN,.RLARR) Q:'IBX
|
---|
75 | . S IBRLFN=0 F S IBRLFN=$O(RLARR(IBRLFN)) Q:'IBRLFN D
|
---|
76 | .. S IBCPT1=$P($G(^IBE(363.33,IBRLFN,0)),U,3)
|
---|
77 | .. S CPTARR(IBCPT1,IBRLFN)=IBSGFN
|
---|
78 | . ;
|
---|
79 | . ; find the primary link to be used on a bill for the billing rates and charge sets
|
---|
80 | . S IBSGFN1=0 F S IBSGFN1=$O(^IBE(363.32,IBSGFN,11,IBSGFN1)) Q:'IBSGFN1 D
|
---|
81 | .. S IBSG10=$G(^IBE(363.32,IBSGFN,11,IBSGFN1,0))
|
---|
82 | .. S IBRLFN=$$RVLNK^IBCRU6(CPT,+$P(IBSG10,U,1),+$P(IBSG10,U,2))
|
---|
83 | .. I +IBRLFN S BRARR(+IBRLFN,+$P(IBSG10,U,1),+$P(IBSG10,U,2))=IBSGFN
|
---|
84 | ;
|
---|
85 | Q
|
---|