PRSPEAX ;WOIFO/SAB - CANCEL EXTENDED ABSENCE ;1/4/2005 ;;4.0;PAID;**93**;Sep 21, 1995;Build 7 ;;Per VHA Directive 2004-038, this routine should not be modified. ; ; Cancel Existing Extended Absence ; N DIR,DIROUT,DIRUT,DTOUT,DUOUT,EAIEN,EALIST,EAY0,ESRU N PERSTR,PEREND,PRSFDA,PRSIEN,PRSLCK,PRSLCKE,X,X1,Y ; ; determine Employee IEN S PRSIEN=$$PRSIEN^PRSPUT2(1) I 'PRSIEN G EXIT ; ; verify that user has electronic signature code I '$$ESIGC^PRSPUT2(1) G EXIT ; SEL ; select extended absence W @IOF W !?26,"VA TIME & ATTENDANCE SYSTEM" W !?28,"CANCEL EXTENDED ABSENCE",! ; ; build list in EALIST( array D BLDLST^PRSPEAU(PRSIEN,DT,"^A^") ; ; display list (exit if ^ or time-out during list display) G:$$DISLST^PRSPEAU() EXIT ; I EALIST(0)=0 G EXIT ; nothing to select ; ; select item from list W ! S DIR(0)="NO^1:"_EALIST(0) S DIR("A")="Cancel which extended absence #?" D ^DIR K DIR G:Y'>0!$D(DIRUT) EXIT S EAIEN=EALIST(+Y) S EAY0=$G(^PRST(458.4,EAIEN,0)) ; ; Lock EA L +^PRST(458.4,EAIEN):2 I '$T D G AGAIN . W $C(7),!,"Another user is editing this extended absence!" ; ; Display EA W @IOF D DISEA^PRSPEAU(EAIEN) W ! ; ; set ESRU to indicate any restruction for ESR updates upon EA cancel. ; if absence includes prior days then they will not be updated on ESR ; if absence includes Today and RG posted then Today can't be updated ; restruction: 0 = none, 1 = prior to Today, 2 = Today and prior S ESRU=0 ; init with no restriction ; check if EA includes Today and if RG already posted to Today I $P(EAY0,U)'>DT,$$CHKRG^PRSPEAU(PRSIEN) S ESRU=2 ; if Today OK then check if EA includes any prior days I 'ESRU,$P(EAY0,U)