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

IB20P570.m

Go to the documentation of this file.
IB20P570 ;ALB/CXW - IB*2*570 POST INIT:COST-BASED/INTERAGENCY/CONDITION;7/7/16
 ;;2.0;INTEGRATED BILLING;**570**;21-MAR-94;Build 22
 ;;Per VA Directive 6402, this routine should not be modified.
 ; 
 ;
 ; Add CY2016 Cost Based/Interagency Charges to Charge Master 363.2
 ; Add condition code(s) in mccr utility file 399.1
 Q
POST ;
 N IBEFFDT,IBA,U S U="^"
 D MSG("    IB*2.0*570 Post-Install .....")
 S IBEFFDT=3160707 ; effective date of 07/07/2016
 D ADDCI(IBEFFDT)  ; add Charge Items (363.2) with new 66 rates
 D MCCR            ; effective date of 07/01/2016
 D MSG("    IB*2*570 Post-Install Complete")
 Q
 ;
ADDCI(IBEFFDT) ; Add Charge Items (363.2) needs Charge Sets, pass in the effective date of the new charges
 N IBC,IBCHG,IBCNT,IBCNT1,IBCI,IBCS,IBDFLTDT,IBDT,IBFN,IBI,IBLN,IBPE,IBRVCD,IBX,IBXRF,IBZ,DA,DD,DO,DLAYGO,DIC,DIE,DR,X,Y
 ; 
 D MSG("")
 S (IBCNT,IBCNT1)=0,IBDFLTDT=+$G(IBEFFDT)
 I 'IBDFLTDT D MSG("** Error: No Effective Date, No Charges Added") G CIQ
 ;
 F IBI=1:1 S IBLN=$P($T(CIF+IBI),";;",2) Q:+IBLN!(IBLN="")  I $E(IBLN)?1A D SETCI
 ;
 I +IBCNT1 D MSG("       "_IBCNT1_" Duplicate Charge Items already exist, not re-added")
 ;
CIQ D MSG("    >> "_IBCNT_" Cost Based/Interagency Charge Items added (#363.2).")
 D MSG("")
 Q
 ;
SETCI ; set Charge Item (duplicates based on item, CS, eff dt, rev cd)
 ;
 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
 S IBCI=+$$MCCRUTL($P(IBLN,U,1),5) I 'IBCI D MSG("** Error: Bed Section "_$P(IBLN,U,1)_" undefined") Q
 S IBDT=IBDFLTDT I +$P(IBLN,U,3) S IBDT=+$P(IBLN,U,3)
 S IBRVCD=$$RVCD($P(IBLN,U,4))
 S IBCHG=+$P(IBLN,U,5)
 S IBXRF="AIVDTS"_IBCS
 ;
 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
 . S IBCI=0,IBCNT1=IBCNT1+1 I +$P(IBZ,U,5)'=IBCHG D MSG("** Error: Item exists, wrong charge: "_IBLN)
 Q:'IBCI
 ;
 K DD,DO S DLAYGO=363.2,DIC="^IBA(363.2,",DIC(0)="L",X=IBCI_";DGCR(399.1," D FILE^DICN K DIC
 I Y<1 D MSG("** Error: when adding the charge item "_$P(IBLN,U,2)_" with rate "_IBCHG_" to the file, Log a ticket!") K X,Y Q
 S IBFN=+Y,IBCNT=IBCNT+1
 ;
 S DR=".02///"_IBCS_";.03///"_IBDT_";.05///"_IBCHG I +IBRVCD S DR=DR_";.06///"_IBRVCD
 S DIE="^IBA(363.2,",DA=+IBFN D ^DIE K DIE,DA,DR,X,Y
 Q
 ;
 ;
MCCRUTL(IBC,IBPE) ; returns IEN in 399.1 if Name is found and piece P is true
 N IBX,IBY S IBY=""
 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
 Q IBY
 ;
EXCODE(IBC,IBPE) ; returns IEN in 399.1 if Code is found and piece P is true
 N IBX,IBY S IBY=""
 I $G(IBC)'="" S IBX=0 F  S IBX=$O(^DGCR(399.1,"C",IBC,IBX)) Q:'IBX  I $P($G(^DGCR(399.1,IBX,0)),U,+$G(IBPE)) S IBY=IBX
 Q IBY
 ;
RVCD(RVCD) ; returns IFN if revenue code is valid and active
 N IBX,IBY S IBY=""
 I +$G(RVCD) S IBX=$G(^DGCR(399.2,+RVCD,0)) I +$P(IBX,U,3) S IBY=+RVCD
 Q IBY
 ;
MCCR ; Condition code flag in field #.22/piece 15
 N IBC,IBCD,IBCNT,IBFD,IBPE,IBI,IBLN,DA,DD,DO,DLAYGO,DIC,DIE,DR,X,Y
 S IBCNT=0,IBPE=15,IBFD=.22
 F IBI=1:1 S IBLN=$P($T(CONU+IBI),";;",2) Q:IBLN="QUIT"  D
 . S IBCD=$P(IBLN,U)_" "_$P(IBLN,U,2)
 . I (+$$MCCRUTL($P(IBLN,U,2),IBPE))!(+$$EXCODE($P(IBLN,U),IBPE)) D MSG("       #"_IBCD_" already exists, not re-added") Q
 . K DD,DO S DLAYGO=399.1,DIC="^DGCR(399.1,",DIC(0)="L",X=$P(IBLN,U,2)
 . D FILE^DICN I Y<1 D MSG("** Error: when adding Condition #"_IBCD_" to the file, Log a ticket!") K X,Y Q
 . S DA=+Y,DIE=DIC,DR=".02///"_$P(IBLN,U,1)_";"_IBFD_"///"_1
 . D ^DIE K DIE,DR,DA,X,Y
 . S IBCNT=IBCNT+1
 D MSG("    >> "_IBCNT_" Condition Code added (#399.1).")
 D MSG("")
 Q
 ;
MSG(IBA) ;
 D MES^XPDUTL(IBA)
 Q
CONU ; Condition code^name
 ;;54^NO SKILL HH VISITS IN BILL PERIOD. POLICY EXCEPT DOC AT HHA.
 ;;QUIT
 ;
CIF ; 68 Charge Items (363.2): Bedsection ^ Charge Set ^Effective Date ^ Revenue Code ^ Charge
 ;;     
TORT ;; Cost Based (Tortiously Liable) - All Inclusive 
 ;;        
 ;;ALCOHOL AND DRUG TREATMENT^TL-INPT (INCLUSIVE)^^^1861
 ;;BLIND REHABILITATION^TL-INPT (INCLUSIVE)^^^1741
 ;;GENERAL MEDICAL CARE^TL-INPT (INCLUSIVE)^^^3720
 ;;INTERMEDIATE CARE^TL-INPT (INCLUSIVE)^^^2233
 ;;NEUROLOGY^TL-INPT (INCLUSIVE)^^^3564
 ;;NURSING HOME CARE^TL-INPT (INCLUSIVE)^^^1197
 ;;POLYTRAUMA INPATIENT^TL-INPT (INCLUSIVE)^^^3227
 ;;PRRTP^TL-INPT (INCLUSIVE)^^^695
 ;;PSYCHIATRIC CARE^TL-INPT (INCLUSIVE)^^^1771
 ;;REHABILITATION MEDICINE^TL-INPT (INCLUSIVE)^^^2477
 ;;SPINAL CORD INJURY CARE^TL-INPT (INCLUSIVE)^^^2631
 ;;SURGICAL CARE^TL-INPT (INCLUSIVE)^^^5910
 ;;             
 ;; Non-Professional: Nursing/Room/Board 101 & Ancillary 240    
 ;;ALCOHOL AND DRUG TREATMENT^TL-INPT (NPF)^^101^1252
 ;;ALCOHOL AND DRUG TREATMENT^TL-INPT (NPF)^^240^431
 ;;BLIND REHABILITATION^TL-INPT (NPF)^^101^736
 ;;BLIND REHABILITATION^TL-INPT (NPF)^^240^865
 ;;GENERAL MEDICAL CARE^TL-INPT (NPF)^^101^2306
 ;;GENERAL MEDICAL CARE^TL-INPT (NPF)^^240^969
 ;;INTERMEDIATE CARE^TL-INPT (NPF)^^101^1795
 ;;INTERMEDIATE CARE^TL-INPT (NPF)^^240^328
 ;;NEUROLOGY^TL-INPT (NPF)^^101^2101
 ;;NEUROLOGY^TL-INPT (NPF)^^240^941
 ;;NURSING HOME CARE^TL-INPT (NPF)^^101^998
 ;;NURSING HOME CARE^TL-INPT (NPF)^^240^162
 ;;POLYTRAUMA INPATIENT^TL-INPT (NPF)^^101^1874
 ;;POLYTRAUMA INPATIENT^TL-INPT (NPF)^^240^986
 ;;PRRTP^TL-INPT (NPF)^^101^578
 ;;PRRTP^TL-INPT (NPF)^^240^73
 ;;PSYCHIATRIC CARE^TL-INPT (NPF)^^101^1325
 ;;PSYCHIATRIC CARE^TL-INPT (NPF)^^240^279
 ;;REHABILITATION MEDICINE^TL-INPT (NPF)^^101^1439
 ;;REHABILITATION MEDICINE^TL-INPT (NPF)^^240^757
 ;;SPINAL CORD INJURY CARE^TL-INPT (NPF)^^101^1643
 ;;SPINAL CORD INJURY CARE^TL-INPT (NPF)^^240^662
 ;;SURGICAL CARE^TL-INPT (NPF)^^101^3466
 ;;SURGICAL CARE^TL-INPT (NPF)^^240^1793
 ;;              
 ;; Professional Physician
 ;;ALCOHOL AND DRUG TREATMENT^TL-INPT (PF)^^^178
 ;;BLIND REHABILITATION^TL-INPT (PF)^^^140
 ;;GENERAL MEDICAL CARE^TL-INPT (PF)^^^445
 ;;INTERMEDIATE CARE^TL-INPT (PF)^^^110
 ;;NEUROLOGY^TL-INPT (PF)^^^522
 ;;NURSING HOME CARE^TL-INPT (PF)^^^37
 ;;POLYTRAUMA INPATIENT^TL-INPT (PF)^^^367
 ;;PRRTP^TL-INPT (PF)^^^44
 ;;PSYCHIATRIC CARE^TL-INPT (PF)^^^167
 ;;REHABILITATION MEDICINE^TL-INPT (PF)^^^281
 ;;SPINAL CORD INJURY CARE^TL-INPT (PF)^^^326
 ;;SURGICAL CARE^TL-INPT (PF)^^^651
 ;;                    
 ;; Outpatient Care Other
 ;;OUTPATIENT DENTAL^TL-OPT DENTAL^^^335
 ;;OUTPATIENT VISIT^TL-OPT VST^^^335
 ;;PM&RS OUTPATIENT VISIT^TL-OPT VST PM&RS^^^537
 ;;POLYTRAUMA OUTPATIENT VISIT^TL-OPT VST POLYTRAUMA^^^212
 ;;          
IA ;; Interagency
 ;;            
 ;;ALCOHOL AND DRUG TREATMENT^IA-INPT^^^1765
 ;;BLIND REHABILITATION^IA-INPT^^^1653
 ;;GENERAL MEDICAL CARE^IA-INPT^^^3553
 ;;INTERMEDIATE CARE^IA-INPT^^^2126
 ;;NEUROLOGY^IA-INPT^^^3401
 ;;NURSING HOME CARE^IA-INPT^^^1138
 ;;POLYTRAUMA INPATIENT^IA-INPT^^^3057
 ;;PRRTP^IA-INPT^^^662
 ;;PSYCHIATRIC CARE^IA-INPT^^^1679
 ;;REHABILITATION MEDICINE^IA-INPT^^^2354
 ;;SPINAL CORD INJURY CARE^IA-INPT^^^2502
 ;;SURGICAL CARE^IA-INPT^^^5642
 ;;OUTPATIENT DENTAL^IA-OPT DENTAL^^^319
 ;;OUTPATIENT VISIT^IA-OPT VST^^^319
 ;;PM&RS OUTPATIENT VISIT^IA-OPT VST PM&RS^^^510
 ;;POLYTRAUMA OUTPATIENT VISIT^IA-OPT VST POLYTRAUMA^^^199
 ;;
 Q