1 | IBCAMS ;ALB/AAS - DETERMINE AMIS SEGMENT FOR REIMBURSABLE INS BILLS ; 10-SEP-91
|
---|
2 | ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
|
---|
3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | ;MAP TO DGCRAMS
|
---|
6 | ;
|
---|
7 | AMIS ; - calculate AMIS segment for insurance bills.
|
---|
8 | ; 249 = NSC - outpatient
|
---|
9 | ; 292 = SC - inpatient
|
---|
10 | ; 293 = SC - outpatient
|
---|
11 | ; 297 = NSC - inpatient
|
---|
12 | ; - input
|
---|
13 | ; x = internal number of entry in 399
|
---|
14 | ;
|
---|
15 | ; - output
|
---|
16 | ; y = amis segment number or -1 if can't determine
|
---|
17 | ;
|
---|
18 | % S Y=-1
|
---|
19 | I '$D(^DGCR(399,+X,0)) G AMISQ
|
---|
20 | S IBX=^DGCR(399,+X,0)
|
---|
21 | N DFN
|
---|
22 | ;
|
---|
23 | ; - make sure is RI bill
|
---|
24 | ;S R=$P(IBX,"^",7),R=$S('$D(^DGCR(399.3,+R,0)):0,1:$P(^(0),"^",6)) G:'R AMISQ S R=$S('$D(^PRCA(430.2,+R,0)):0,1:$P(^(0),"^",7)) G:R'=21 AMISQ
|
---|
25 | G:+$$CAT^PRCAFN(X)'=21 AMISQ
|
---|
26 | ;
|
---|
27 | S IBI=$P(IBX,"^",5),IBI=$S('IBI:0,IBI>2:2,IBI<3:1,1:0) G:'IBI AMISQ ; 0=err, 1=inpatient, 2=outpatient
|
---|
28 | ;
|
---|
29 | N X
|
---|
30 | S IBSC=$P(IBX,"^",18),DFN=$P(IBX,"^",2) I IBSC="" D ELIG^VADPT S IBSC=+VAEL(3)
|
---|
31 | ;
|
---|
32 | ; - compute amis segment
|
---|
33 | S:+IBSC Y=$S(IBI=1:292,IBI=2:293,1:-1) ;sc amis segments
|
---|
34 | S:'IBSC Y=$S(IBI=1:297,IBI=2:249,1:-1) ;nsc amis segments
|
---|
35 | ;
|
---|
36 | AMISQ K IBSC,IBX,IBI,VAEL,VAERR
|
---|
37 | Q
|
---|