IBECEAU1 ;ALB/CPM - Cancel/Edit/Add... Clock Utilities ; 12-MAR-93
;;2.0;INTEGRATED BILLING;**57,704**;21-MAR-94;Build 49
;Per VA Directive 6402, this routine should not be modified.
;
CLSTR(DFN,DATE) ; Find the billing clock in effect on DATE.
; Input: DFN -- Pointer to the patient in file #2
; DATE -- The date which is covered by the clock
; Output: IBCLDA -- Pointer to the clock in file #351
; (or null if there is none)
; IBCLST -- Zeroth node of clock pointed to by
; IBCLDA [OPTIONAL]
N X,Y
K IBCLST S IBCLDA=""
I '$G(DATE)!'$G(DFN) G CLSTRQ
S X="" F S X=$O(^IBE(351,"AIVDT",DFN,X)) Q:'X S IBCLDA=0 F S IBCLDA=$O(^IBE(351,"AIVDT",DFN,X,IBCLDA)) Q:'IBCLDA S Y=$G(^IBE(351,IBCLDA,0)) I Y,$P(Y,"^",4)'=3,$P(Y,"^",3)'>DATE S IBCLST=Y G CLSTRQ
CLSTRQ Q
;
CLDSP(X,NAM) ; Display Billing Clock data for NAM.
; Input: X -- Zeroth node of clock in file #351
; NAM -- Patient name^short id^long id
I '$G(X)!($G(NAM)="") G CLDSPQ
W !!,"Means Test Billing Clock information for ",$P(NAM,"^")," (",$P(NAM,"^",3),")"
W !,$TR($J("",80)," ","-")
W !?2,"Clock Start Date: ",$$DAT1^IBOUTL($P(X,"^",3)),?42,"Clock End Date: ",$S($P(X,"^",10):$$DAT1^IBOUTL($P(X,"^",10)),1:"N/A")
W !?6,"Clock Status: ",$S($P(X,"^",4)=1:"CURRENT",$P(X,"^",4)=2:"CLOSED",1:"UNKNOWN"),?42,"Inpatient Days: ",+$P(X,"^",9)
W !!?2,"Medicare Deductible Co-payments:"
W !?15,"1st 90 days: $",+$P(X,"^",5),?45,"3rd 90 days: $",+$P(X,"^",7)
W !?15,"2nd 90 days: $",+$P(X,"^",6),?45,"4th 90 days: $",+$P(X,"^",8)
W !,$TR($J("",80)," ","-")
CLDSPQ Q
;
CLINP(BEG,DIF,IBCLDA) ; Update Billing Clock Inpatient Days
; Input: BEG -- Existing number of inpatient days
; DIF -- Days to add to clock (could be negative)
; IBCLDA -- Pointer to clock in file #351
N DAYS,DIR,DIRUT,DUOUT,DTOUT,DIE,DA,DR,I,IBF
I $G(BEG)=""!'$G(DIF)!'$G(IBCLDA) G CLINPQ1
S DAYS=BEG+DIF
I DAYS<0!(DAYS>365) W !!,"Can't update the clock to reflect ",DAYS," inpatient days.",!,"Please review this patient's clock and use the Clock Maintenance option",!,"to make any changes, if necessary." G CLINPQ1
W ! S DIR(0)="Y",DIR("?")="Enter 'Y' or 'YES' to update the clock, or 'N', 'NO', or '^' to stop.",DIR("A")="Update the number of inpatient days from "_BEG_" to "_DAYS D ^DIR
I 'Y!($D(DIRUT))!($D(DUOUT)) W !,"The billing clock has not been updated." G CLINPQ
S DIE="^IBE(351,",DA=IBCLDA,DR=".09////"_DAYS_";13////"_DUZ_";14///NOW" D ^DIE
W !,"The clock has been updated."
I $$GET1^DIQ(351,IBCLDA_",",16,"I")=1 D EN^IBECECU1(DFN,IBCLDA) ;IB*2.0*704 - Update billing clocks as other sites
CLINPQ S IBF=0 F I=90,180,270 I BEG'>I,DAYS>I S IBF=1 Q
I IBF W !!,*7," ** Please review to see if this patient requires a new copay charge. **"
CLINPQ1 Q
;
CLAMT(STR,AMT,IBCLDA) ; Update Billing Clock Medicare Deductible co-payments
; Input: STR -- Zeroth node of clock in file #351
; AMT -- Dollar Amt to add to clock (could be negative)
; IBCLDA -- Pointer to clock in file #351
N DAYS,DIR,DIRUT,DUOUT,DTOUT,DIE,DA,DR,IBMED,IBCLDT,NEWAMT,PTR
I $G(STR)=""!'$G(AMT)!'$G(IBCLDA) G CLAMTQ
S DAYS=+$P(STR,"^",9),PTR=$S(DAYS<91:5,DAYS<181:6,DAYS<271:7,1:8)
S IBCLDT=+$P(STR,"^",3) D DED^IBAUTL3
S NEWAMT=+$P(STR,"^",PTR)+AMT
I NEWAMT<0 W !!,"Can't update the clock to reflect a copayment of -$",-NEWAMT,".",!,"Please review this patient's clock and use the Clock Maintenance option",!,"to make any changes, if necessary." G CLAMTQ
I NEWAMT>IBMED W !!,"Note that the effective Medicare Deductible for this billing clock is $",IBMED,".",!,"Please note that $",NEWAMT," is beyond this limit."
W ! S DIR(0)="Y",DIR("?")="Enter 'Y' or 'YES' to update the clock, or 'N', 'NO', or '^' to stop.",DIR("A")="Update the "_$$INPT^IBECEAU(DAYS)_" 90 days copayment from $"_+$P(STR,"^",PTR)_" to $"_NEWAMT D ^DIR
I 'Y!($D(DIRUT))!($D(DUOUT)) W !,"The billing clock has not been updated." G CLAMTQ
S DIE="^IBE(351,",DA=IBCLDA,DR=".0"_PTR_"////"_NEWAMT_";13////"_DUZ_";14///NOW" D ^DIE
W !,"The clock has been updated."
I $$GET1^DIQ(351,IBCLDA_",",16,"I")=1 D EN^IBECECU1(DFN,IBCLDA) ;IB*2.0*704 - Update billing clocks as other sites
CLAMTQ Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBECEAU1 4361 printed Dec 13, 2024@02:21:31 Page 2
IBECEAU1 ;ALB/CPM - Cancel/Edit/Add... Clock Utilities ; 12-MAR-93
+1 ;;2.0;INTEGRATED BILLING;**57,704**;21-MAR-94;Build 49
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
CLSTR(DFN,DATE) ; Find the billing clock in effect on DATE.
+1 ; Input: DFN -- Pointer to the patient in file #2
+2 ; DATE -- The date which is covered by the clock
+3 ; Output: IBCLDA -- Pointer to the clock in file #351
+4 ; (or null if there is none)
+5 ; IBCLST -- Zeroth node of clock pointed to by
+6 ; IBCLDA [OPTIONAL]
+7 NEW X,Y
+8 KILL IBCLST
SET IBCLDA=""
+9 IF '$GET(DATE)!'$GET(DFN)
GOTO CLSTRQ
+10 SET X=""
FOR
SET X=$ORDER(^IBE(351,"AIVDT",DFN,X))
if 'X
QUIT
SET IBCLDA=0
FOR
SET IBCLDA=$ORDER(^IBE(351,"AIVDT",DFN,X,IBCLDA))
if 'IBCLDA
QUIT
SET Y=$GET(^IBE(351,IBCLDA,0))
IF Y
IF $PIECE(Y,"^",4)'=3
IF $PIECE(Y,"^",3)'>DATE
SET IBCLST=Y
GOTO CLSTRQ
CLSTRQ QUIT
+1 ;
CLDSP(X,NAM) ; Display Billing Clock data for NAM.
+1 ; Input: X -- Zeroth node of clock in file #351
+2 ; NAM -- Patient name^short id^long id
+3 IF '$GET(X)!($GET(NAM)="")
GOTO CLDSPQ
+4 WRITE !!,"Means Test Billing Clock information for ",$PIECE(NAM,"^")," (",$PIECE(NAM,"^",3),")"
+5 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+6 WRITE !?2,"Clock Start Date: ",$$DAT1^IBOUTL($PIECE(X,"^",3)),?42,"Clock End Date: ",$SELECT($PIECE(X,"^",10):$$DAT1^IBOUTL($PIECE(X,"^",10)),1:"N/A")
+7 WRITE !?6,"Clock Status: ",$SELECT($PIECE(X,"^",4)=1:"CURRENT",$PIECE(X,"^",4)=2:"CLOSED",1:"UNKNOWN"),?42,"Inpatient Days: ",+$PIECE(X,"^",9)
+8 WRITE !!?2,"Medicare Deductible Co-payments:"
+9 WRITE !?15,"1st 90 days: $",+$PIECE(X,"^",5),?45,"3rd 90 days: $",+$PIECE(X,"^",7)
+10 WRITE !?15,"2nd 90 days: $",+$PIECE(X,"^",6),?45,"4th 90 days: $",+$PIECE(X,"^",8)
+11 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
CLDSPQ QUIT
+1 ;
CLINP(BEG,DIF,IBCLDA) ; Update Billing Clock Inpatient Days
+1 ; Input: BEG -- Existing number of inpatient days
+2 ; DIF -- Days to add to clock (could be negative)
+3 ; IBCLDA -- Pointer to clock in file #351
+4 NEW DAYS,DIR,DIRUT,DUOUT,DTOUT,DIE,DA,DR,I,IBF
+5 IF $GET(BEG)=""!'$GET(DIF)!'$GET(IBCLDA)
GOTO CLINPQ1
+6 SET DAYS=BEG+DIF
+7 IF DAYS<0!(DAYS>365)
WRITE !!,"Can't update the clock to reflect ",DAYS," inpatient days.",!,"Please review this patient's clock and use the Clock Maintenance option",!,"to make any changes, if necessary."
GOTO CLINPQ1
+8 WRITE !
SET DIR(0)="Y"
SET DIR("?")="Enter 'Y' or 'YES' to update the clock, or 'N', 'NO', or '^' to stop."
SET DIR("A")="Update the number of inpatient days from "_BEG_" to "_DAYS
DO ^DIR
+9 IF 'Y!($DATA(DIRUT))!($DATA(DUOUT))
WRITE !,"The billing clock has not been updated."
GOTO CLINPQ
+10 SET DIE="^IBE(351,"
SET DA=IBCLDA
SET DR=".09////"_DAYS_";13////"_DUZ_";14///NOW"
DO ^DIE
+11 WRITE !,"The clock has been updated."
+12 ;IB*2.0*704 - Update billing clocks as other sites
IF $$GET1^DIQ(351,IBCLDA_",",16,"I")=1
DO EN^IBECECU1(DFN,IBCLDA)
CLINPQ SET IBF=0
FOR I=90,180,270
IF BEG'>I
IF DAYS>I
SET IBF=1
QUIT
+1 IF IBF
WRITE !!,*7," ** Please review to see if this patient requires a new copay charge. **"
CLINPQ1 QUIT
+1 ;
CLAMT(STR,AMT,IBCLDA) ; Update Billing Clock Medicare Deductible co-payments
+1 ; Input: STR -- Zeroth node of clock in file #351
+2 ; AMT -- Dollar Amt to add to clock (could be negative)
+3 ; IBCLDA -- Pointer to clock in file #351
+4 NEW DAYS,DIR,DIRUT,DUOUT,DTOUT,DIE,DA,DR,IBMED,IBCLDT,NEWAMT,PTR
+5 IF $GET(STR)=""!'$GET(AMT)!'$GET(IBCLDA)
GOTO CLAMTQ
+6 SET DAYS=+$PIECE(STR,"^",9)
SET PTR=$SELECT(DAYS<91:5,DAYS<181:6,DAYS<271:7,1:8)
+7 SET IBCLDT=+$PIECE(STR,"^",3)
DO DED^IBAUTL3
+8 SET NEWAMT=+$PIECE(STR,"^",PTR)+AMT
+9 IF NEWAMT<0
WRITE !!,"Can't update the clock to reflect a copayment of -$",-NEWAMT,".",!,"Please review this patient's clock and use the Clock Maintenance option",!,"to make any changes, if necessary."
GOTO CLAMTQ
+10 IF NEWAMT>IBMED
WRITE !!,"Note that the effective Medicare Deductible for this billing clock is $",IBMED,".",!,"Please note that $",NEWAMT," is beyond this limit."
+11 WRITE !
SET DIR(0)="Y"
SET DIR("?")="Enter 'Y' or 'YES' to update the clock, or 'N', 'NO', or '^' to stop."
SET DIR("A")="Update the "_$$INPT^IBECEAU(DAYS)_" 90 days copayment from $"_+$PIECE(STR,"^",PTR)_" to $"_NEWAMT
DO ^DIR
+12 IF 'Y!($DATA(DIRUT))!($DATA(DUOUT))
WRITE !,"The billing clock has not been updated."
GOTO CLAMTQ
+13 SET DIE="^IBE(351,"
SET DA=IBCLDA
SET DR=".0"_PTR_"////"_NEWAMT_";13////"_DUZ_";14///NOW"
DO ^DIE
+14 WRITE !,"The clock has been updated."
+15 ;IB*2.0*704 - Update billing clocks as other sites
IF $$GET1^DIQ(351,IBCLDA_",",16,"I")=1
DO EN^IBECECU1(DFN,IBCLDA)
CLAMTQ QUIT