- 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
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURAFSD 3206 printed Feb 18, 2025@23:45:46 Page 2
- NURAFSD ;HIRMFO/MD-EMPLOYEE ACT/SEP MANUAL AND TASKED REPORTS ; 4/25/03 2:37pm
- +1 ;;4.0;NURSING SERVICE;**2,14,38**;Apr 25, 1997
- +2 if '$DATA(^DIC(213.9,1,"OFF"))
- QUIT
- if $PIECE(^DIC(213.9,1,"OFF"),U,1)=1
- QUIT
- +3 WRITE !
- SET (NURMDSW,NQSW,NUROUT)=0
- SET X="T-30"
- DO ^%DT
- SET %DT(0)=Y
- SET %DT("A")="Select Date of Staff Activation/Separation Report: "
- SET %DT("B")="T-1"
- SET %DT="AE"
- DO ^%DT
- KILL %DT
- IF +Y'>0
- SET NUROUT=1
- GOTO QUIT
- +4 SET NURSDATE=+Y
- +5 DO EN9^NURSAGSP
- IF NURMDSW
- WRITE !
- SET DIC(0)="AEMQZ"
- DO EN8^NURSAGSP
- if $GET(NUROUT)
- GOTO QUIT
- +6 WRITE !
- SET ZTRTN="START^NURAFSD"
- DO EN7^NURSUT0
- IF POP!($DATA(ZTSK))
- SET NUROUT=1
- GOTO QUIT
- START ;
- +1 KILL ^TMP($JOB)
- +2 SET (NURSW1,NTCNT)=0
- SET X=NURSDATE
- SET DIC="^NURSA(213.5,"
- SET DIC(0)=""
- SET DIC("S")="I $P(^(0),U,2)=0"
- DO ^DIC
- KILL DIC
- IF '(+Y>0)
- SET Y=NURSDATE
- if +Y
- DO D^DIQ
- SET NURSDATE=Y
- DO HDGING
- WRITE !,"NO DATA FOR "_NURSDATE
- GOTO QUIT
- +3 SET NURSDA=$SELECT(Y'>0:"",1:+Y)
- +4 IF $GET(NURSDA)
- SET DA(1)=NURSDA
- FOR DA=0:0
- SET DA=$ORDER(^NURSA(213.5,+DA(1),2,+DA))
- if DA'>0
- QUIT
- IF $DATA(^NURSA(213.5,+DA(1),2,+DA,0))
- Begin DoDot:1
- +5 SET NURSWARD=+$PIECE($GET(^NURSA(213.5,+DA(1),2,+DA,0)),U,5)
- +6 IF NURMDSW
- SET NURFAC(2)=$SELECT($$EN12^NURSUT3(NURSWARD)'="":$$EN12^NURSUT3(NURSWARD),1:" BLANK")
- +7 IF '$TEST
- SET NURFAC(2)=" BLANK"
- +8 IF $GET(NURFAC)=0
- IF NURFAC(2)'=" BLANK"
- IF NURFAC(2)'=NURFAC(1)
- QUIT
- +9 SET ^TMP($JOB,NURFAC(2),DA(1),DA)=""
- +10 QUIT
- End DoDot:1
- +11 SET DA=0
- FOR
- SET DA=$ORDER(^NURSA(213.2,DA))
- if DA'>0
- QUIT
- SET Y=+^NURSA(213.2,+DA,0)
- IF Y
- SET X=$PIECE(^DIC(4,+Y,0),U)
- Begin DoDot:1
- +12 IF $GET(NURFAC)=0
- IF NURFAC(1)'=" BLANK"
- IF NURFAC(1)'=X
- QUIT
- +13 if $GET(X)'=""
- SET NURSFAC(X)=""
- +14 QUIT
- End DoDot:1
- +15 IF $GET(NURMDSW)=1
- SET NURS=""
- FOR
- SET NURS=$ORDER(NURSFAC(NURS))
- if NURS=""
- QUIT
- IF '$DATA(^TMP($JOB,NURS))
- Begin DoDot:1
- +16 SET NURFAC(2)=$SELECT($GET(NURS)="":"",1:NURS)
- DO HDGING
- WRITE !,"NO EMPLOYEES SEPARATED/ACTIVATED ON ",Y,!
- DO ENDPG^NURSUT1
- +17 QUIT
- End DoDot:1
- +18 IF $GET(NURMDSW)=0
- SET NURS=$ORDER(^TMP($JOB,""))
- SET NURFAC(2)=$SELECT($GET(NURS)="":"",1:NURS)
- IF NURFAC(2)=""
- Begin DoDot:1
- +19 DO HDGING
- WRITE !,"NO EMPLOYEES SEPARARTED/ACTIVATED ON ",Y,!
- DO ENDPG^NURSUT1
- +20 QUIT
- End DoDot:1
- +21 SET NURFAC(2)=""
- FOR
- SET NURFAC(2)=$ORDER(^TMP($JOB,NURFAC(2)))
- if NURFAC(2)=""
- QUIT
- DO TOTAL
- DO HDGING
- SET DA(1)=0
- FOR
- SET DA(1)=$ORDER(^TMP($JOB,NURFAC(2),DA(1)))
- if DA(1)'>0
- QUIT
- SET DA=0
- FOR
- SET DA=$ORDER(^TMP($JOB,NURFAC(2),DA(1),DA))
- if DA'>0
- QUIT
- DO PRINT
- +22 DO TOTAL
- QUIT DO CLOSE^NURSUT1
- DO ^NURAKILL
- +1 KILL ^TMP($JOB)
- +2 QUIT
- TOTAL ;
- +1 if '+NTCNT
- SET NUROUT=1
- IF +NTCNT
- WRITE !!,"TOTAL EMPLOYEES SEPARATED/ACTIVATED: ",NTCNT
- +2 QUIT
- PRINT ;
- +1 IF ($Y>(IOSL-10))!'(NURSW1)
- DO HDGING
- +2 SET NURSEMP=^NURSA(213.5,DA(1),2,DA,0)
- IF $DATA(^VA(200,$PIECE(NURSEMP,U),0))
- WRITE !,$EXTRACT($PIECE(^(0),U),1,20)
- +3 WRITE ?20,$SELECT($PIECE(NURSEMP,U,2)="S":"SEP",$PIECE(NURSEMP,U,2)="A":"ACT",1:"")
- SET NPWARD=$PIECE(NURSEMP,U,5)
- DO EN6^NURSAUTL
- WRITE ?29,$EXTRACT(NPWARD,1,10)
- +4 SET Y=$PIECE(NURSEMP,U,3)
- WRITE ?39," "
- DO DT^DIQ
- if $DATA(^NURSF(211.3,+$PIECE(NURSEMP,U,6),0))
- WRITE ?53,$PIECE(^(0),U)
- if $DATA(^NURSF(211.9,+$PIECE(NURSEMP,U,4),0))
- WRITE ?64,$EXTRACT($PIECE(^(0),U,2),1,15)
- SET NTCNT=NTCNT+1
- +5 QUIT
- HDGING ;
- +1 IF $GET(NUROUT)
- IF '$GET(NURQUEUE)
- IF $EXTRACT(IOST)="C"
- IF $GET(NURSW1)
- DO ENDPG^NURSUT1
- if NUROUT=1
- SET NURQUIT=+NUROUT
- if $GET(NURQUIT)
- QUIT
- +2 if $Y>0
- WRITE @IOF
- +3 WRITE !,"ON THE REPORT DATE, ASSIGNMENTS FOR THE FOLLOWING EMPLOYEES WERE",!,"ACTIVATED/SEPARATED. THE STATUS INDICATORS WERE MODIFIED APPROPRIATELY:",!
- +4 IF NURMDSW
- IF $GET(NURFAC(2))'=""
- WRITE !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
- +5 SET Y=NURSDATE
- if +Y
- DO D^DIQ
- WRITE !,?15,"EMPLOYEE ACTIVATION/SEPARATION REPORT "_Y
- SET NURSW1=1
- +6 WRITE !,"NAME",?20,"ACT/SEP",?29,"LOCATION",?40,"ST/VAC DT",?53,"POSITION",?63,"REASON",!,$$REPEAT^XLFSTR("-",80)
- +7 SET NURSW1=1
- +8 QUIT