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

IBARXET.m

Go to the documentation of this file.
  1. IBARXET ;ALB/AAS - RX COPAY EXEMPTION THRESHOLD ENTER/LIST ; 20-JAN-93
  1. ;;2.0;INTEGRATED BILLING;**26,74**; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ADD ; -- add/edit new thresholds
  1. S IBTH=""
  1. S DIC="^IBE(354.3,",DIC(0)="AEQLMN",DLAYGO=354.3,DIC("DR")="" D ^DIC G ADDQ:Y<1
  1. S DA=+Y,DIE="^IBE(354.3,",DR="[IB ENTER THRESHOLD]" D ^DIE
  1. ;I $D(DA) S IBX=$G(^IBE(354.3,DA,0)),$P(IBX,"^",2)=2 D
  1. I $D(DA) S IBX=$G(^IBE(354.3,DA,0)),$P(IBX,"^",2)=$S($E($P(IBX,"^",1),1,5)<29612:2,1:1) D
  1. .I $P(IBX,"^",3)'="",$P(IBX,"^",4)'="",$P(IBX,"^",12)'="" Q
  1. .S DIK="^IBE(354.3," D ^DIK
  1. .W !!,"Entry Deleted, not enough information."
  1. .K DA,DIK
  1. .Q
  1. ;
  1. D:$D(DA)#2 PRIOR
  1. W ! G ADD
  1. ADDQ K DLAYGO,DIC,DIE,DA,DR,X,Y,IBDA,IBTH,IBX
  1. Q
  1. ;
  1. PRINT ; -- print threshold list
  1. I '$D(IOF) D HOME^%ZIS
  1. W @IOF,?15,"Print Medication Copayment Income Thresholds",!!!
  1. W !!,"You will need a 132 column printer for this report!",!
  1. S DIC="^IBE(354.3,",L=0,FLDS="[IB PRINT THRESHOLD]",BY="[IB PRINT THRESHOLD]",FR="?,?",TO="?,?"
  1. S DHD="Medication Copayment Income Thresholds"
  1. D EN1^DIP
  1. PRINTQ K L,FLDS,BY,FR,TO,DHD,DIC
  1. Q
  1. ;
  1. PRIOR ; -- check to see if prior year thresholds used
  1. S IBPR=$G(^IBE(354.3,+DA,0)) I IBPR="" G PRIORQ
  1. ;I $P(IBPR,"^",2)'=2 G PRIORQ
  1. S X=$S($P(IBPR,"^",2)=2:1,$P(IBPR,"^",2)=1:1,1:"") G:X="" PRIORQ
  1. ;S IBPRDT=$O(^IBE(354.3,"AIVDT",2,-($P(IBPR,"^")))) ;threshold prior to the one entered
  1. S X=$S($E($P(IBPR,"^"),1,5)'<29712:1,1:2) S IBPRDT=$O(^IBE(354.3,"AIVDT",X,-($P(IBPR,"^")))) ;threshold prior to the one entered
  1. I IBPRDT<0 S IBPRDT=-IBPRDT ; minus a negative to make positive
  1. G:IBPRDT="" PRIORQ I '$D(^IBA(354.1,"APRIOR",IBPRDT)) G PRIORQ
  1. ;
  1. ; -- is exemptions based on prior thresholds
  1. W !!,"There are Medication Copayment Exemptions based on prior thresholds",!
  1. S DIR("?")="There are exemptions that were based on the threshold values over a year old. You can ignore this, print a list of patients with old exemptions, or automatically update while printing the same list"
  1. S DIR(0)="S^1:IGNORE;2:PRINT;3:UPDATE AND PRINT",DIR("A")="Select ACTION",DIR("B")="IGNORE" D ^DIR K DIR I $D(DIRUT)!(Y<2)!(Y>3) G PRIORQ
  1. S IBACT=Y
  1. ;
  1. S %ZIS="QM" D ^%ZIS G:POP PRIORQ
  1. I $D(IO("Q")) K IO("Q") S ZTRTN="DQ^IBARXET",ZTDESC="IB PRIOR YEAR THRESHOLD PRINT"_$S(IBACT=3:" AND UPDATE",1:""),ZTSAVE("IB*")="" D ^%ZTLOAD K ZTSK D HOME^%ZIS G PRIORQ
  1. U IO
  1. ;
  1. DQ ; -- entry point from tasking
  1. S (IBQUIT,IBPAG)=0 D NOW^%DTC S Y=% D D^DIQ S IBPDAT=Y
  1. K ^TMP($J,"IBPRIOR") S IBJOB=17
  1. D HDR
  1. S IBEX=""
  1. F S IBEX=$O(^IBA(354.1,"APRIOR",IBPRDT,IBEX)) Q:IBEX="" D SET
  1. ;
  1. S IBNAM=""
  1. F S IBNAM=$O(^TMP($J,"IBPRIOR",IBNAM)) Q:IBNAM=""!IBQUIT D
  1. .S DFN="" F S DFN=$O(^TMP($J,"IBPRIOR",IBNAM,DFN)) Q:DFN=""!IBQUIT D
  1. ..S IBXXX=0 F S IBXXX=$O(^TMP($J,"IBPRIOR",IBNAM,DFN,IBXXX)) Q:'IBXXX!IBQUIT S IBP=^(IBXXX) D ONE
  1. ;
  1. I 'IBQUIT D PAUSE^IBOUTL
  1. K ^TMP($J,"IBPRIOR")
  1. I $D(ZTQUEUED) S ZTREQ="@" Q
  1. D ^%ZISC
  1. PRIORQ K X,Y,DFN,DIR,DIRUT,IBACT,IBPR,IBPRDT,IBQUIT,IBPAG,IBPDAT,IBPRIOR
  1. K IBEX,IBNAM,IBND,IBP,IBEXREA,IBJOB,IBQUIT,IBXXX,IBWHER,IBEXERR,IBADDE,IBADD,IBCODA,IBCODP
  1. Q
  1. ;
  1. HDR ; -- print prior threshold header
  1. I IBPAG!($E(IOST,1,2)="C-") W @IOF,*13
  1. S IBPAG=IBPAG+1
  1. W "Exemptions Based on Prior Year Thresholds",?(IOM-35),$P(IBPDAT,"@")," @ ",$P(IBPDAT,"@",2)," Page ",IBPAG
  1. W !,"Patient",?22,"PT. ID",?36,"Exemption Date",?52,"Status" W:IBACT=3 ?63,"Action"
  1. W !,$TR($J(" ",IOM)," ","-")
  1. Q
  1. ;
  1. SET ; -- set up sortable array by patient
  1. S IBND=$G(^IBA(354.1,IBEX,0)) Q:IBND=""
  1. S DFN=$P(IBND,"^",2),IBP=$$PT^IBEFUNC(DFN)
  1. S ^TMP($J,"IBPRIOR",$P(IBP,"^"),DFN,IBEX)=IBEX_"^"_IBP
  1. Q
  1. ;
  1. ONE ; -- print line for one patient
  1. S IBEX=+IBP,IBP=$P(IBP,"^",2,5)
  1. I $Y>(IOSL-5) D PAUSE^IBOUTL G:IBQUIT ONEQ D HDR
  1. S IBND=$G(^IBA(354.1,IBEX,0)) G ONEQ:IBND=""
  1. S Y=+IBND D D^DIQ
  1. W !,$E(IBNAM,1,20),?22,$P(IBP,"^",2),?36,Y,?52,$$TEXT^IBARXEU0($P(IBND,"^",4))
  1. ;
  1. ; -- compute exempt, add if different, else delete prior
  1. G:IBACT'=3 ONEQ
  1. S IBEXREA=$$STATUS^IBARXEU1(DFN,+IBND)
  1. I +IBEXREA'=$P(IBND,"^",5) D ADDEX^IBAUTL6(+IBEXREA,+IBND,1,1) W ?63,"Exemption updated"
  1. I +IBEXREA=$P(IBND,"^",5) S DA=IBEX,DIE="^IBA(354.1,",DR=".15///@" D ^DIE W ?63,"No Change"
  1. K DIE,DA,DR,DIC
  1. ONEQ Q