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

IB20P787.m

Go to the documentation of this file.
IB20P787 ;ALB/JAB - UPDATE MCCR UTILITY & POS ; 02/15/2024
 ;;2.0;INTEGRATED BILLING;**787**;21-MAR-94;Build 3
 ;;Per VA Directive 6402, this routine should not be modified.
 ;
 ; This routine is used as a post-init in a KIDS build to
 ; update conditional codes in mccr utility file 399.1
 ; and place of service codes in service file 353.1.
 ;
 ; See previous patches for all the other types of files
 ; that can possibly be updated.
 ;
 ; Reference to FILE^DICN in ICR #10009
 ; Reference to ^DIE in ICR #10018
 ; Reference to $$FMADD^XLFDT in ICR #10103
 ; Reference to MES^XPDUTL in ICR #10141
 ;
 Q
POST ; 
 D MSG("IB*2.0*787 Post-Install starts .....")
 D MSG("")
 N IBZ,U S U="^"
 D MCR ; 3 conditional codes in mccr utility file 399.1
 D POS ; 2 pos codes in service file 353.1
 D MSG("IB*2.0*787 Post-Install is complete.")
 D MSG("")
 Q
 ;
MCR ;
 ; Condition code  
 N IBCNT,IBCOD,IBPE,IBFD,IBI,IBX
 ; condition code flag in field #.22/piece 15
 S IBCNT=0,IBPE=15,IBFD=.22
 D MSG(">>> Condition Code")
 F IBI=1:1 S IBX=$P($T(CONU+IBI),";;",2) Q:IBX="Q"  D MFILE
 ; 
 D MSG("    Total "_IBCNT_" code"_$S(IBCNT'=1:"s",1:"")_" added to MCCR UTILITY (#399.1) file")
 D MSG("")
 Q
 ;
MFILE ; Store in fields
 N IBA,IBB,IBC,IBFN,IBMS,IBX3,IBY,DLAYGO,DIC,DIE,DA,DD,DO,DR,X,Y
 S IBA=$P(IBX,U),IBB=$P(IBX,U,2)
 S IBY="    #"_IBA_" "_IBB
 S IBFN=+$$EXCODE(IBA,IBPE)
 I IBFN D  Q:'IBFN
 . S IBX3=$G(^DGCR(399.1,IBFN,0)),IBC=IBB_U_IBA
 . I $P(IBX3,U,1,2)=IBC S IBFN=0 D MSG(IBY_" not re-added") Q
 . ; if new code already exists
 . S DA=IBFN,IBMS="updated"
 I 'IBFN D  Q:Y<1
 . S DLAYGO=399.1,DIC="^DGCR(399.1,",DIC(0)="L",X=IBB D FILE^DICN
 . I Y<1 D MSG(">>> ERROR when adding "_$S(IBPE=11:"Value",1:"Condition")_" Code #"_IBA_" to the #399.1 file, Log a ticket!") Q
 . S DA=+Y,IBMS=""
 S DIE="^DGCR(399.1,",DR=".01///"_IBB_";.02///"_IBA_";"_IBFD_"///1" D ^DIE
 S IBCNT=IBCNT+1 D MSG(IBY_$S(IBMS'="":" "_IBMS,1:""))
 Q
 ;
EXCODE(IBCOD,IBPE) ; Returns IEN if code found in the IBPE piece
 N IBX,IBY S IBY=""
 I $G(IBCOD)'="" S IBX=0 F  S IBX=$O(^DGCR(399.1,"C",IBCOD,IBX)) Q:'IBX  I $P($G(^DGCR(399.1,IBX,0)),U,+$G(IBPE)) S IBY=IBX
 Q IBY
 ;
POS ;
 ; Place Of Service in fields #.01/piece 1, #.02/piece 2, #.03/piece 3
 N IBA,IBB,IBC,IBCNT,IBD,IBF,IBI,IBMS,IBX,IBX3,IBY,DA,DIC,DIE,DLAYGO,DD,DO,DR,X,Y
 S IBCNT=0
 D MSG(">>> Place of Service Code")
 F IBI=1:1 S IBX=$P($T(POSU+IBI),";;",2) Q:IBX="Q"  D
 . S IBA=$P(IBX,U,1),IBB=$P(IBX,U,2),IBC=$P(IBX,U,3)
 . S IBY="    #"_IBA_" "_IBB,IBD=IBA_U_IBB_U_IBC
 . S IBF=+$O(^IBE(353.1,"B",IBA,0))
 . I IBF D  Q:'IBF
 .. S IBX3=$G(^IBE(353.1,IBF,0)),DA=IBF,IBMS="updated"
 .. I $P(IBX3,U,1,3)=IBD D MSG(IBY_" already exists") S IBF=0
 . I 'IBF D  Q:Y<1
 .. S DLAYGO=353.1,DIC="^IBE(353.1,",DIC(0)="L",X=IBA D FILE^DICN
 .. I Y<1 D MSG(">>> ERROR when adding #"_IBA_" "_IBB_" to the #353.1 file, Log a ticket!") Q 
 .. S DA=+Y,IBMS="added"
 . S DIE="^IBE(353.1,",DR=".02///"_IBB_";.03///"_IBC D ^DIE
 . S IBCNT=IBCNT+1 D MSG(IBY_" "_IBMS)
 D MSG("    Total "_IBCNT_" code"_$S(IBCNT'=1:"s",1:"")_" updated in the Place of Service (#353.1) file")
 D MSG("")
 Q
 ;
MSG(IBZ) ;
 D MES^XPDUTL(IBZ) Q
 ;
CONU ; Condition code^name^update (3)
 ;;35^PACE Eligible Patient Disenrolls During an IP Admission
 ;;92^Intensive Outpatient Program (IOP)
 ;;45^Gender Incongruence^1
 ;;Q
 ;
POSU ; Place of Service code^name^abbreviation (1)
 ;;27^Outreach Site/Street
 ;;58^Non-residential Opioid Treatment Facility
 ;;Q
 ;