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

IB20P580.m

Go to the documentation of this file.
  1. IB20P580 ;ALB/CXW - IB*2*580 POST INIT:COST-BASED/INTERAGENCY FIX ;11-07-2016
  1. ;;2.0;INTEGRATED BILLING;**580**;21-MAR-94;Build 38
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ;
  1. ; Cost Based/Interagency Rate fix for Polytrauma in Charge Item (363.2)
  1. Q
  1. POST ;
  1. N IBEFFDT,IBA,U S U="^"
  1. D MSG(" IB*2.0*580 Post-Install .....")
  1. S IBEFFDT=3160707 ; effective date of 07/07/2016
  1. D UPDTCI(IBEFFDT) ; update Charge Items (363.2) with 4 rates
  1. D MSG(" IB*2.0*580 Post-Install Complete")
  1. Q
  1. ;
  1. UPDTCI(IBEFFDT) ; Update Charge Items (363.2) needs Charge Sets, pass in the effective date of the new charges
  1. N IBC,IBCHG,IBCNT,IBCNT1,IBC,IBCI,IBCS,IBDFLTDT,IBDT,IBI,IBLN,IBPE,IBRVCD,IBX,IBXRF,IBZ,DA,DIE,DR,X,Y
  1. ;
  1. D MSG("")
  1. S IBCNT=0,IBDFLTDT=+$G(IBEFFDT)
  1. I 'IBDFLTDT D MSG("** Error: No Effective Date, No Charges Updated") G CIQ
  1. ;
  1. F IBI=1:1 S IBLN=$P($T(CIF+IBI),";;",2) Q:+IBLN!(IBLN="") I $E(IBLN)?1A D SETCI
  1. ;
  1. CIQ D MSG(">> "_IBCNT_" Cost Based/Interagency for Polytrauma/PM&RS charge items updated (#363.2).")
  1. D MSG("")
  1. Q
  1. ;
  1. SETCI ; set Charge Item (duplicates based on item, CS, eff dt, rev cd)
  1. ;
  1. S IBCS=$P(IBLN,U,2),IBCS=+$O(^IBE(363.1,"B",IBCS,0)) I 'IBCS D MSG("** Error: Charge Set "_$P(IBLN,U,2)_" undefined") Q
  1. S IBCI=+$$MCCRUTL($P(IBLN,U,1),5) I 'IBCI D MSG("** Error: Bed Section "_$P(IBLN,U,2)_" undefined") Q
  1. S IBDT=IBDFLTDT I +$P(IBLN,U,3) S IBDT=+$P(IBLN,U,3)
  1. S IBRVCD=$$RVCD($P(IBLN,U,4))
  1. S IBCHG=+$P(IBLN,U,5)
  1. S IBXRF="AIVDTS"_IBCS
  1. ; check for duplicate charge items
  1. S IBCNT1=0
  1. ;
  1. S IBX=0 F S IBX=$O(^IBA(363.2,IBXRF,IBCI,-IBDT,IBX)) Q:'IBX S IBZ=$G(^IBA(363.2,IBX,0)) I $P(IBZ,U,6)=IBRVCD D
  1. . S IBCNT1=IBCNT1+1
  1. . I +$P(IBZ,U,5)=IBCHG D MSG(" "_$P(IBLN,U,2)_" with $"_IBCHG_" charge item already exists") Q
  1. . S DIE="^IBA(363.2,",DA=+IBX,DR=".05///"_IBCHG D ^DIE K DIE,DA,DR,X,Y
  1. . S IBCNT=IBCNT+1
  1. I IBCNT1>1 D MSG("** Error: "_$P(IBLN,U,2)_" duplicate charge items on 07/07/2016")
  1. Q
  1. ;
  1. MCCRUTL(IBC,IBPE) ; returns IEN in 399.1 if Name is found and piece P is true
  1. N IBX,IBY S IBY=""
  1. I $G(IBC)'="" S IBX=0 F S IBX=$O(^DGCR(399.1,"B",IBC,IBX)) Q:'IBX I $P($G(^DGCR(399.1,IBX,0)),U,+$G(IBPE)) S IBY=IBX
  1. Q IBY
  1. ;
  1. RVCD(IBRVCD) ; returns IFN if revenue code is valid and active
  1. N IBX,IBY S IBY=""
  1. I +$G(IBRVCD) S IBX=$G(^DGCR(399.2,+IBRVCD,0)) I +$P(IBX,U,3) S IBY=+IBRVCD
  1. Q IBY
  1. ;
  1. MSG(IBA) ;
  1. D MES^XPDUTL(IBA)
  1. Q
  1. ;
  1. CIF ; 4 Charge Items (363.2): Bedsection ^ Charge Set ^Effective Date ^ Revenue Code ^ Charge
  1. ;;
  1. TORT ;; Cost Based (Tortiously Liable) for outpatient care
  1. ;;PM&RS OUTPATIENT VISIT^TL-OPT VST PM&RS^^^212
  1. ;;POLYTRAUMA OUTPATIENT VISIT^TL-OPT VST POLYTRAUMA^^^537
  1. ;;
  1. IA ;; Interagency for outpatient care
  1. ;;PM&RS OUTPATIENT VISIT^IA-OPT VST PM&RS^^^199
  1. ;;POLYTRAUMA OUTPATIENT VISIT^IA-OPT VST POLYTRAUMA^^^510
  1. ;;
  1. Q