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

IBCREC.m

Go to the documentation of this file.
  1. IBCREC ;ALB/ARH - RATES: CM INACTIVATE CPT CHARGE OPTION ; 22-MAY-1996
  1. ;;2.0;INTEGRATED BILLING;**52,131**;21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ENTER ; OPTION ENTRY POINT: inactivate all CPT procedures Charge Items that are currently inactive in the CPT file
  1. ;
  1. W @IOF W !,?8,"**** INACTIVATE CHARGES FOR ALL CURRENTLY INACTIVE CPTS ****"
  1. W !!,?5,"For all Charge Sets based on CPT procedures, this option will add an",!,?5,"Inactive Date to each Charge Item that is a currently Inactive CPT code.",!!
  1. ;
  1. N DIR,DTOUT,DUOUT,DIRUT,X,Y,IBQUIT K ^TMP($J,"IBCREC")
  1. ;
  1. S DIR(0)="SO^1:Print List of Active Charges for Inactive CPT's;2:Inactivate Charges for Inactive CPT's"
  1. D ^DIR K DIR I +Y<1!$D(DIRUT) Q
  1. I +Y=1 D DEV Q:$G(IBQUIT) G RPT
  1. ;
  1. W !!!,"All charges for currently Inactive CPT codes will become inactive",!,"on the CPT Inactive Date.",!
  1. ;
  1. S DIR(0)="YO",DIR("A")="Is this correct, do you want to continue" D ^DIR K DIR I Y'=1 W !,"None inactivated",! Q
  1. ;
  1. I Y=1 W !,"Beginning Inactivations" W !,$$INACTCPT(0)," charges inactivated"
  1. Q
  1. ;
  1. INACTCPT(SAVE) ; inactivate charges for all Inactive CPT codes, all sets checked
  1. ; if an active charge for an Inactive CPT, the CPT's inactive date is added as the charges Inactive Date
  1. ; if a CPT is inactive before the charges Effective date, that Effective date is added as the Inactive Date
  1. ; Input: SAVE - if true, charge items that would be deleted are entered into TMP array for print instead
  1. ; Output: returns the count of the charge items inactivated
  1. ;
  1. N IBCS,IBBI,IBXRF,IBSUB2,IBITM,IBEFDT,IBCIFN,IBCNT,IBINDTCI,IBINDATE,IBX,INDT S IBCNT=0
  1. ;
  1. S IBCS=0 F S IBCS=$O(^IBE(363.1,IBCS)) Q:'IBCS D
  1. . ;
  1. . S IBBI=$$CSBI^IBCRU3(IBCS) I +IBBI'=2 Q
  1. . S IBXRF="AIVDTS"_+IBCS I '$D(ZTQUEUED),'$D(XPDNM) W "."
  1. . I +$G(SAVE) S IBSUB2=$$TMPHDR(IBCS) Q:IBSUB2=""
  1. . ;
  1. . S IBITM=0 F S IBITM=$O(^IBA(363.2,IBXRF,IBITM)) Q:'IBITM D
  1. .. ;
  1. .. S IBX=$$CPT^ICPTCOD(IBITM,DT) I +$P(IBX,U,7) Q
  1. .. S INDT=$P(IBX,U,6) I 'INDT Q
  1. .. ;
  1. .. S IBEFDT=-9999999 F S IBEFDT=$O(^IBA(363.2,IBXRF,IBITM,IBEFDT)) Q:'IBEFDT D
  1. ... S IBCIFN=0 F S IBCIFN=$O(^IBA(363.2,IBXRF,IBITM,IBEFDT,IBCIFN)) Q:'IBCIFN D
  1. .... ;
  1. .... S IBINDTCI=$$INACTCI^IBCRU4(IBCIFN) I +IBINDTCI,IBINDTCI<INDT Q
  1. .... ;
  1. .... S IBINDATE=INDT I -IBEFDT>IBINDATE S IBINDATE=-IBEFDT
  1. .... I IBINDATE=$P($G(^IBA(363.2,IBCIFN,0)),U,4) Q
  1. .... ;
  1. .... S IBCNT=IBCNT+1
  1. .... I +$G(SAVE) D TMPLN^IBCROI1(IBCIFN,"IBCREC",IBSUB2,1) Q
  1. .... D EDITCI^IBCREF(IBCIFN,"","","",IBINDATE)
  1. Q IBCNT
  1. ;
  1. DATE(X) ;
  1. Q $E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)
  1. ;
  1. TMPHDR(CS) ; set up array header for printed report
  1. N IBHDR,IBSUB2 S IBSUB2="BILLING RATE",IBHDR="Charges for Inactive CPT's"
  1. D TMPHDR^IBCROI1("IBCREC",IBSUB2,0,IBHDR,"1^1")
  1. Q IBSUB2
  1. ;
  1. DEV ; get device for printed report
  1. S IBQUIT=0 S %ZIS="QM",%ZIS("A")="OUTPUT DEVICE: " D ^%ZIS I POP S IBQUIT=1 Q
  1. I $D(IO("Q")) S ZTRTN="RPT^IBCREC",ZTDESC="Charges for Inactive CPT's" D ^%ZTLOAD K IO("Q") S IBQUIT=1
  1. Q
  1. ;
  1. RPT ; print report - entry point for tasked jobs
  1. N IBSCRPT,IBCNT S IBSCRPT="IBCREC" K ^TMP($J,"IBCREC")
  1. S IBCNT=$$INACTCPT(1)
  1. I $D(^TMP($J,"IBCREC")) S $P(^TMP($J,"IBCREC"),U,4)=IBCNT_" Charges for Inactive CPT's"
  1. G RPT^IBCROI
  1. Q