Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBCAMS

IBCAMS.m

Go to the documentation of this file.
  1. IBCAMS ;ALB/AAS - DETERMINE AMIS SEGMENT FOR REIMBURSABLE INS BILLS ; 10-SEP-91
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;MAP TO DGCRAMS
  1. ;
  1. AMIS ; - calculate AMIS segment for insurance bills.
  1. ; 249 = NSC - outpatient
  1. ; 292 = SC - inpatient
  1. ; 293 = SC - outpatient
  1. ; 297 = NSC - inpatient
  1. ; - input
  1. ; x = internal number of entry in 399
  1. ;
  1. ; - output
  1. ; y = amis segment number or -1 if can't determine
  1. ;
  1. % S Y=-1
  1. I '$D(^DGCR(399,+X,0)) G AMISQ
  1. S IBX=^DGCR(399,+X,0)
  1. N DFN
  1. ;
  1. ; - make sure is RI bill
  1. ;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
  1. G:+$$CAT^PRCAFN(X)'=21 AMISQ
  1. ;
  1. 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
  1. ;
  1. N X
  1. S IBSC=$P(IBX,"^",18),DFN=$P(IBX,"^",2) I IBSC="" D ELIG^VADPT S IBSC=+VAEL(3)
  1. ;
  1. ; - compute amis segment
  1. S:+IBSC Y=$S(IBI=1:292,IBI=2:293,1:-1) ;sc amis segments
  1. S:'IBSC Y=$S(IBI=1:297,IBI=2:249,1:-1) ;nsc amis segments
  1. ;
  1. AMISQ K IBSC,IBX,IBI,VAEL,VAERR
  1. Q