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

NURAFSD.m

Go to the documentation of this file.
NURAFSD ;HIRMFO/MD-EMPLOYEE ACT/SEP MANUAL AND TASKED REPORTS ; 4/25/03 2:37pm
 ;;4.0;NURSING SERVICE;**2,14,38**;Apr 25, 1997
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),U,1)=1
 W ! S (NURMDSW,NQSW,NUROUT)=0,X="T-30" D ^%DT S %DT(0)=Y,%DT("A")="Select Date of Staff Activation/Separation Report: ",%DT("B")="T-1",%DT="AE" D ^%DT K %DT I +Y'>0 S NUROUT=1 G QUIT
 S NURSDATE=+Y
 D EN9^NURSAGSP I NURMDSW W ! S DIC(0)="AEMQZ" D EN8^NURSAGSP G QUIT:$G(NUROUT)
 W ! S ZTRTN="START^NURAFSD" D EN7^NURSUT0 I POP!($D(ZTSK)) S NUROUT=1 G QUIT
START ;
 K ^TMP($J)
 S (NURSW1,NTCNT)=0,X=NURSDATE,DIC="^NURSA(213.5,",DIC(0)="",DIC("S")="I $P(^(0),U,2)=0" D ^DIC K DIC I '(+Y>0) S Y=NURSDATE D:+Y D^DIQ S NURSDATE=Y D HDGING W !,"NO DATA FOR "_NURSDATE G QUIT
 S NURSDA=$S(Y'>0:"",1:+Y)
 I $G(NURSDA) S DA(1)=NURSDA F DA=0:0 S DA=$O(^NURSA(213.5,+DA(1),2,+DA)) Q:DA'>0  I $D(^NURSA(213.5,+DA(1),2,+DA,0)) D
 .  S NURSWARD=+$P($G(^NURSA(213.5,+DA(1),2,+DA,0)),U,5)
 .  I NURMDSW S NURFAC(2)=$S($$EN12^NURSUT3(NURSWARD)'="":$$EN12^NURSUT3(NURSWARD),1:"  BLANK")
 .  E  S NURFAC(2)="  BLANK"
 .  I $G(NURFAC)=0,NURFAC(2)'="  BLANK",NURFAC(2)'=NURFAC(1) Q
 .  S ^TMP($J,NURFAC(2),DA(1),DA)=""
 .  Q
 S DA=0 F  S DA=$O(^NURSA(213.2,DA)) Q:DA'>0  S Y=+^NURSA(213.2,+DA,0) I Y S X=$P(^DIC(4,+Y,0),U) D
 .  I $G(NURFAC)=0,NURFAC(1)'="  BLANK",NURFAC(1)'=X Q
 .  S:$G(X)'="" NURSFAC(X)=""
 .  Q
 I $G(NURMDSW)=1 S NURS="" F  S NURS=$O(NURSFAC(NURS)) Q:NURS=""  I '$D(^TMP($J,NURS)) D
 . S NURFAC(2)=$S($G(NURS)="":"",1:NURS) D HDGING W !,"NO EMPLOYEES SEPARATED/ACTIVATED ON ",Y,! D ENDPG^NURSUT1
 . Q
 I $G(NURMDSW)=0 S NURS=$O(^TMP($J,"")) S NURFAC(2)=$S($G(NURS)="":"",1:NURS) I NURFAC(2)="" D
 .  D HDGING W !,"NO EMPLOYEES SEPARARTED/ACTIVATED ON ",Y,! D ENDPG^NURSUT1
 .  Q
 S NURFAC(2)="" F  S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)=""  D TOTAL,HDGING S DA(1)=0 F  S DA(1)=$O(^TMP($J,NURFAC(2),DA(1))) Q:DA(1)'>0  S DA=0 F  S DA=$O(^TMP($J,NURFAC(2),DA(1),DA)) Q:DA'>0  D PRINT
 D TOTAL
QUIT D CLOSE^NURSUT1,^NURAKILL
 K ^TMP($J)
 Q
TOTAL ;
 S:'+NTCNT NUROUT=1 I +NTCNT W !!,"TOTAL EMPLOYEES SEPARATED/ACTIVATED: ",NTCNT
 Q
PRINT ;
 I ($Y>(IOSL-10))!'(NURSW1) D HDGING
 S NURSEMP=^NURSA(213.5,DA(1),2,DA,0) I $D(^VA(200,$P(NURSEMP,U),0)) W !,$E($P(^(0),U),1,20)
 W ?20,$S($P(NURSEMP,U,2)="S":"SEP",$P(NURSEMP,U,2)="A":"ACT",1:"") S NPWARD=$P(NURSEMP,U,5) D EN6^NURSAUTL W ?29,$E(NPWARD,1,10)
 S Y=$P(NURSEMP,U,3) W ?39," " D DT^DIQ W:$D(^NURSF(211.3,+$P(NURSEMP,U,6),0)) ?53,$P(^(0),U) W:$D(^NURSF(211.9,+$P(NURSEMP,U,4),0)) ?64,$E($P(^(0),U,2),1,15) S NTCNT=NTCNT+1
 Q
HDGING ;
 I $G(NUROUT) I '$G(NURQUEUE),$E(IOST)="C",$G(NURSW1) D ENDPG^NURSUT1 S:NUROUT=1 NURQUIT=+NUROUT Q:$G(NURQUIT)
 W:$Y>0 @IOF
 W !,"ON THE REPORT DATE, ASSIGNMENTS FOR THE FOLLOWING EMPLOYEES WERE",!,"ACTIVATED/SEPARATED.  THE STATUS INDICATORS WERE MODIFIED APPROPRIATELY:",!
 I NURMDSW,$G(NURFAC(2))'="" W !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
 S Y=NURSDATE D:+Y D^DIQ W !,?15,"EMPLOYEE ACTIVATION/SEPARATION REPORT "_Y S NURSW1=1
 W !,"NAME",?20,"ACT/SEP",?29,"LOCATION",?40,"ST/VAC DT",?53,"POSITION",?63,"REASON",!,$$REPEAT^XLFSTR("-",80)
 S NURSW1=1
 Q