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

IBECEA1.m

Go to the documentation of this file.
  1. IBECEA1 ;ALB/RLW - Cancel/Edit/Add... Action Entry Points ; 12-JUN-92
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. PASS ; 'Pass a Charge' Entry Action (added by Jim Moore 4/30/92)
  1. N C,IBII,IBNOS,IBND,IBMSG,IBY,IBLINE,IBSTAT,IBAFY,IBATYP
  1. N IBARTYP,IBN,IBSEQNO,IBSERV,IBTOTL,IBTRAN,IBIL,IBNOS2,Y
  1. S VALMBCK="R" D EN^VALM2($G(XQORNOD(0)))
  1. S IBII="" F S IBII=$O(VALMY(IBII)) Q:'IBII D L -^IB(IBNOS2) D MSG
  1. .S IBY=1,IBLINE=^TMP("IBACM",$J,IBII,0)
  1. .S (IBNOS,IBNOS2)=+$P(^TMP("IBACMIDX",$J,IBII),"^",4)
  1. .;
  1. .; - perform up-front edits
  1. .L +^IB(IBNOS2):5 I '$T S IBMSG="was not passed - record not available, please try again" Q
  1. .S IBND=$G(^IB(IBNOS2,0)) I IBND="" S IBMSG="was not passed - record missing the zeroth node" Q
  1. .I $P(IBND,"^",12) S IBMSG="was not passed - the charge already has an AR Transaction Number" Q
  1. .S IBSTAT=+$P(IBND,"^",5) I $P($G(^IBE(350.21,IBSTAT,0)),"^",4) S IBMSG="was not passed - the status indicates that the charge is billed" Q
  1. .I $P(IBND,"^",7)'>0 S IBMSG="was not passed - there is no charge amount" Q
  1. .S IBSEQNO=$P($G(^IBE(350.1,+$P(IBND,"^",3),0)),"^",5) I 'IBSEQNO S IBMSG="was not passed (Bulletin will be generated)",IBY="-1^IB023" Q
  1. .;
  1. .; - pass charge to AR and update list
  1. .D ^IBR S IBY=$G(Y)
  1. .S IBND=$G(^IB(IBNOS2,0))
  1. .S (IBSTAT,Y)=$P(IBND,"^",5),C=$P($G(^DD(350,.05,0)),"^",2) D Y^DIQ
  1. .S IBLINE=$$SETSTR^VALM1(Y,IBLINE,+$P(VALMDDF("STATUS"),"^",2),+$P(VALMDDF("STATUS"),"^",3))
  1. .S IBLINE=$$SETSTR^VALM1($P($P(IBND,"^",11),"-",2),IBLINE,+$P(VALMDDF("BILL#"),"^",2),+$P(VALMDDF("BILL#"),"^",3))
  1. .S ^TMP("IBACM",$J,IBII,0)=IBLINE
  1. .S IBMSG=$S(+IBY=-1:"was not passed -",IBSTAT=8:"has now been placed ON HOLD",1:"has now been passed")
  1. .;
  1. .; - if there is no active billing clock, add one
  1. .I $P(IBND,"^",14),'$D(^IBE(351,"ACT",DFN)) D
  1. ..W !,"This patient has no active billing clock. Adding a new one... "
  1. ..S IBCLDT=$P(IBND,"^",14) D CLADD^IBAUTL3 W $S(IBY>0:"done.",1:"error (see msg)")
  1. Q
  1. ;
  1. MSG ; Display results message.
  1. W !,"Charge #"_IBII_" "_IBMSG I +IBY=-1 D ^IBAERR1
  1. W ! S DIR(0)="E" D ^DIR K DIR W !
  1. Q
  1. ;
  1. ;
  1. ADD ; 'Add a Charge' Entry Action
  1. G ^IBECEA3
  1. ;
  1. UPD ; 'Edit a Charge' Entry Action
  1. S IBAUPD=1
  1. ;
  1. CAN ; 'Cancel a Charge' Entry Action
  1. D EN^VALM2(IBNOD(0)) I '$O(VALMY(0)) S VALMBCK="" G CANQ
  1. S (IBNBR,IBCOMMIT)=0,VALMBCK="R"
  1. F S IBNBR=$O(VALMY(IBNBR)) Q:'IBNBR D ^@$S($G(IBAUPD):"IBECEA2",1:"IBECEA4")
  1. I IBCOMMIT S IBBG=VALMBG W !,"Rebuilding list of charges..." D ARRAY^IBECEA0 S VALMBG=IBBG
  1. K IBBG,IBNBR,IBAUPD,IBCOMMIT
  1. CANQ Q
  1. ;
  1. PAUSE ; Keep this around for awhile.
  1. W ! S DIR(0)="E" D ^DIR K DIR W !
  1. Q