NURA9B2 ;HIRMFO/RM/YH,FT-AGE REPORT BY LOCATION BY POSITION ;3/27/97 10:02
;;4.0;NURSING SERVICE;**13**;Apr 25, 1997
Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
S (NURQUIT,NURQUEUE,NUROUT)=0
D EN1^NURSAUTL G QUIT:$G(NUROUT)
I NURMDSW S DIC(0)="AEQZ",NURPLSCR=1 D EN5^NURSAGSP G:$G(NUROUT) QUIT
I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
W ! D EN1^NURSAGSP G:$G(NUROUT) QUIT
W ! D EN2^NURSAGSP G:$G(NUROUT) QUIT
D EN3^NURSAGP0 W ! G QUIT:$G(NUROUT)
S ZTDESC="Nursing Age Report by Location& Position",ZTRTN="START^NURA9B2" D EN7^NURSUT0 I POP!($D(ZTSK)) G QUIT
START ;
K ^TMP("NURA",$J),^TMP($J),^TMP("NURLOC",$J) S NSEL="WS",(NURQUIT,NURSW1,NURSW1(1),NURPAGE,NTCT)=0,(NURNL1,NCATPOS)=""
D SORT G:$G(NUROUT) QUIT U IO D NPRINT,FINCAT^NURAGE
QUIT K ^TMP("NURA",$J),^TMP($J) D CLOSE^NURSUT1,^NURAKILL
Q
NPRINT F NURI=1:1:8 S (NURSMOLD(NURI),NURSPOLD(NURI),NURSOLD(NURI),NURSFOLD(NURI),NURSWOLD(NURI))=0
S NURFAC="" F S NURFAC=$O(^TMP($J,"L",NURFAC)) Q:NURFAC="" D NL Q:NURQUIT D:NURMDSW FSUBTL^NURAGE Q:NURQUIT
Q
NL S NURSPROG="" F S NURSPROG=$O(^TMP($J,"L",NURFAC,NURSPROG)) Q:NURSPROG="" D NM Q:NURQUIT D:NURPLSW PSUBTL^NURAGE Q:NURQUIT
Q
NM S NURNL1="" F S NURNL1=$O(^TMP($J,"L",NURFAC,NURSPROG,NURNL1)) Q:NURNL1="" D HDGING^NURAGE Q:NURQUIT D NN Q:NURQUIT D WRTWARD^NURAGE Q:NURQUIT
Q
NN S NPRI="" F S NPRI=$O(^TMP($J,"L",NURFAC,NURSPROG,NURNL1,NPRI)) Q:NPRI="" D NR Q:NURQUIT
Q
NR S NCATPOS="" F S NCATPOS=$O(^TMP($J,"L",NURFAC,NURSPROG,NURNL1,NPRI,NCATPOS)) Q:NCATPOS="" S NURSORT=$G(^(NCATPOS)) I NURSORT D:NURSW1 HDGBYP^NURAGE D NO Q:NURQUIT D WRTCAT^NURAGE Q:NURQUIT
Q
NO S NURDOB="" F S NURDOB=$O(^TMP($J,"L1",NURSORT,NURDOB)) Q:NURDOB="" D NP Q:NURQUIT
Q
NP S NURN1="" F S NURN1=$O(^TMP($J,"L1",NURSORT,NURDOB,NURN1)) Q:NURN1="" D NQ Q:NURQUIT
Q
NQ S DA="" F S DA=$O(^TMP($J,"L1",NURSORT,NURDOB,NURN1,DA)) Q:DA="" D ^NURAGE Q:NURQUIT
Q
SORT W ! S NRPT=7 D EN4^NURAAGS0
I $O(^TMP($J,""))="",'$D(NURSNLOC) S NUROUT=1 S NURSPROG=$S($G(NURSPROG)=0:NURSPROG(1),1:" BLANK"),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:" BLANK") D HDGING^NURAGE W !!,"THERE IS NO DATA FOR THIS REPORT"
I $O(^TMP($J,""))="",$D(NURSNLOC) S NUROUT=1,NURSPROG=$S($G(NURSPROG)=0:NURSPROG(1),1:" BLANK"),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:" BLANK") D HDGING^NURAGE S NURNL1="" F S NURNL1=$O(NURSNLOC(NURNL1)) Q:NURNL1="" S NL1=NURNL1 D NODATA^NURSUT1
I $O(^TMP($J,""))'="",$D(NURSNLOC) D I NURSW1=1 D ENDPG^NURSUT1 S NURSW1=0
. S (NURY,NURZ,NURX)="" F S NURY=$O(^TMP($J,"L",NURY)) Q:NURY="" F S NURZ=$O(^TMP($J,"L",NURY,NURZ)) Q:NURZ="" F S NURX=$O(^TMP($J,"L",NURY,NURZ,NURX)) Q:NURX="" S ^TMP("NURLOC",$J,NURX)=""
. S NURNL1="" F S NURNL1=$O(NURSNLOC(NURNL1)) Q:NURNL1="" I '$D(^TMP("NURLOC",$J,NURNL1)) D
. . S NURSPROG=$S($G(NURSPROG)=0:NURSPROG(1),1:" BLANK"),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:" BLANK") D:NURSW1=0 HDGING^NURAGE S NL1=NURNL1 D NODATA^NURSUT1
. . Q
. Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURA9B2 3017 printed Nov 22, 2024@17:28:35 Page 2
NURA9B2 ;HIRMFO/RM/YH,FT-AGE REPORT BY LOCATION BY POSITION ;3/27/97 10:02
+1 ;;4.0;NURSING SERVICE;**13**;Apr 25, 1997
+2 if '$DATA(^DIC(213.9,1,"OFF"))
QUIT
if $PIECE(^DIC(213.9,1,"OFF"),"^",1)=1
QUIT
+3 SET (NURQUIT,NURQUEUE,NUROUT)=0
+4 DO EN1^NURSAUTL
if $GET(NUROUT)
GOTO QUIT
+5 IF NURMDSW
SET DIC(0)="AEQZ"
SET NURPLSCR=1
DO EN5^NURSAGSP
if $GET(NUROUT)
GOTO QUIT
+6 IF NURMDSW=0
IF NURPLSW=1
SET NURPLSCR=1
DO PRD^NURSAGSP
KILL NURPLSCR
IF $GET(NUROUT)
GOTO QUIT
+7 WRITE !
DO EN1^NURSAGSP
if $GET(NUROUT)
GOTO QUIT
+8 WRITE !
DO EN2^NURSAGSP
if $GET(NUROUT)
GOTO QUIT
+9 DO EN3^NURSAGP0
WRITE !
if $GET(NUROUT)
GOTO QUIT
+10 SET ZTDESC="Nursing Age Report by Location& Position"
SET ZTRTN="START^NURA9B2"
DO EN7^NURSUT0
IF POP!($DATA(ZTSK))
GOTO QUIT
START ;
+1 KILL ^TMP("NURA",$JOB),^TMP($JOB),^TMP("NURLOC",$JOB)
SET NSEL="WS"
SET (NURQUIT,NURSW1,NURSW1(1),NURPAGE,NTCT)=0
SET (NURNL1,NCATPOS)=""
+2 DO SORT
if $GET(NUROUT)
GOTO QUIT
USE IO
DO NPRINT
DO FINCAT^NURAGE
QUIT KILL ^TMP("NURA",$JOB),^TMP($JOB)
DO CLOSE^NURSUT1
DO ^NURAKILL
+1 QUIT
NPRINT FOR NURI=1:1:8
SET (NURSMOLD(NURI),NURSPOLD(NURI),NURSOLD(NURI),NURSFOLD(NURI),NURSWOLD(NURI))=0
+1 SET NURFAC=""
FOR
SET NURFAC=$ORDER(^TMP($JOB,"L",NURFAC))
if NURFAC=""
QUIT
DO NL
if NURQUIT
QUIT
if NURMDSW
DO FSUBTL^NURAGE
if NURQUIT
QUIT
+2 QUIT
NL SET NURSPROG=""
FOR
SET NURSPROG=$ORDER(^TMP($JOB,"L",NURFAC,NURSPROG))
if NURSPROG=""
QUIT
DO NM
if NURQUIT
QUIT
if NURPLSW
DO PSUBTL^NURAGE
if NURQUIT
QUIT
+1 QUIT
NM SET NURNL1=""
FOR
SET NURNL1=$ORDER(^TMP($JOB,"L",NURFAC,NURSPROG,NURNL1))
if NURNL1=""
QUIT
DO HDGING^NURAGE
if NURQUIT
QUIT
DO NN
if NURQUIT
QUIT
DO WRTWARD^NURAGE
if NURQUIT
QUIT
+1 QUIT
NN SET NPRI=""
FOR
SET NPRI=$ORDER(^TMP($JOB,"L",NURFAC,NURSPROG,NURNL1,NPRI))
if NPRI=""
QUIT
DO NR
if NURQUIT
QUIT
+1 QUIT
NR SET NCATPOS=""
FOR
SET NCATPOS=$ORDER(^TMP($JOB,"L",NURFAC,NURSPROG,NURNL1,NPRI,NCATPOS))
if NCATPOS=""
QUIT
SET NURSORT=$GET(^(NCATPOS))
IF NURSORT
if NURSW1
DO HDGBYP^NURAGE
DO NO
if NURQUIT
QUIT
DO WRTCAT^NURAGE
if NURQUIT
QUIT
+1 QUIT
NO SET NURDOB=""
FOR
SET NURDOB=$ORDER(^TMP($JOB,"L1",NURSORT,NURDOB))
if NURDOB=""
QUIT
DO NP
if NURQUIT
QUIT
+1 QUIT
NP SET NURN1=""
FOR
SET NURN1=$ORDER(^TMP($JOB,"L1",NURSORT,NURDOB,NURN1))
if NURN1=""
QUIT
DO NQ
if NURQUIT
QUIT
+1 QUIT
NQ SET DA=""
FOR
SET DA=$ORDER(^TMP($JOB,"L1",NURSORT,NURDOB,NURN1,DA))
if DA=""
QUIT
DO ^NURAGE
if NURQUIT
QUIT
+1 QUIT
SORT WRITE !
SET NRPT=7
DO EN4^NURAAGS0
+1 IF $ORDER(^TMP($JOB,""))=""
IF '$DATA(NURSNLOC)
SET NUROUT=1
SET NURSPROG=$SELECT($GET(NURSPROG)=0:NURSPROG(1),1:" BLANK")
SET NURFAC=$SELECT($GET(NURFAC)=0:NURFAC(1),1:" BLANK")
DO HDGING^NURAGE
WRITE !!,"THERE IS NO DATA FOR THIS REPORT"
+2 IF $ORDER(^TMP($JOB,""))=""
IF $DATA(NURSNLOC)
SET NUROUT=1
SET NURSPROG=$SELECT($GET(NURSPROG)=0:NURSPROG(1),1:" BLANK")
SET NURFAC=$SELECT($GET(NURFAC)=0:NURFAC(1),1:" BLANK")
DO HDGING^NURAGE
SET NURNL1=""
FOR
SET NURNL1=$ORDER(NURSNLOC(NURNL1))
if NURNL1=""
QUIT
SET NL1=NURNL1
DO NODATA^NURSUT1
+3 IF $ORDER(^TMP($JOB,""))'=""
IF $DATA(NURSNLOC)
Begin DoDot:1
+4 SET (NURY,NURZ,NURX)=""
FOR
SET NURY=$ORDER(^TMP($JOB,"L",NURY))
if NURY=""
QUIT
FOR
SET NURZ=$ORDER(^TMP($JOB,"L",NURY,NURZ))
if NURZ=""
QUIT
FOR
SET NURX=$ORDER(^TMP($JOB,"L",NURY,NURZ,NURX))
if NURX=""
QUIT
SET ^TMP("NURLOC",$JOB,NURX)=""
+5 SET NURNL1=""
FOR
SET NURNL1=$ORDER(NURSNLOC(NURNL1))
if NURNL1=""
QUIT
IF '$DATA(^TMP("NURLOC",$JOB,NURNL1))
Begin DoDot:2
+6 SET NURSPROG=$SELECT($GET(NURSPROG)=0:NURSPROG(1),1:" BLANK")
SET NURFAC=$SELECT($GET(NURFAC)=0:NURFAC(1),1:" BLANK")
if NURSW1=0
DO HDGING^NURAGE
SET NL1=NURNL1
DO NODATA^NURSUT1
+7 QUIT
End DoDot:2
+8 QUIT
End DoDot:1
IF NURSW1=1
DO ENDPG^NURSUT1
SET NURSW1=0
+9 QUIT