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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.1 KB
Line 
1IBCAMS ;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 ;
7AMIS ; - 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 ;
36AMISQ K IBSC,IBX,IBI,VAEL,VAERR
37 Q
Note: See TracBrowser for help on using the repository browser.