NURARMH0 ;HIRMFO/RM/MD-DRIVER TO PRINT AMIS 1106 PATIENT CARE MANHOURS REPORTS ;2/17/96
;;4.0;NURSING SERVICE;**14**;Apr 25, 1997
Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
S (NUROUT,NURQUEUE)=0 D LOSER^NURARST G QUIT:NUROUT,EN1:SEL=2,EN2:SEL=1
EN1 ;ENTRY FROM OPTION NURAPR-RES-MANSER
S NHOSPSW=1
G HSKEEP
EN2 ;ENTRY FROM OPTION NURAPR-RES-MANLOC
S NHOSPSW=0
HSKEEP ; SET LOCAL VARIABLES
S (NUROUT,NURPAGE,NURQUEUE,NURMDSW,NURMDSW(3),NPTCEN,NBCEN,NBRK)=0,(NURSWARD,NBDSECT,NURSWHEN,%DT)="",X="T",(NURMDSW(1),NURMDSW(4))=1
D ^%DT S NRPTDAT=Y
W !!,?17,"Nursing AMIS 1106 Patient Care Manhours Reports"
D EN9^NURSAGSP I NURMDSW,NHOSPSW D EN12^NURSAGSP G:$G(NUROUT) QUIT W ! S DIC(0)="AEMQZ" D EN8^NURSAGSP G:$G(NUROUT) QUIT
D WARDSEL:'NHOSPSW G QUIT:NUROUT
D BEDSEL^NURARPC0 I NUROUT G QUIT
D TIMESEL^NURARPC0 I NUROUT G QUIT
D @$S(NURSWHEN="D":"ASKDAY",NURSWHEN="M":"SETMON^NURARPC1",NURSWHEN="Q":"SETQUART^NURARPC1",NURSWHEN="A":"SETQUART^NURARPC1",1:"ERROR^NURARPC0") W !
G:NUROUT QUIT
S ZTRTN="START^NURARMH0" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
START ;
F X="RN","LPN","NA" S (DTL(X),TL(X),NT(X),FT(X),FNT(X))=0
K ^TMP($J),^TMP("NURBDSM",$J)
D ^NURARMH1
QUIT ; KILL LOCAL VARIABLES
D:$E(IOST)="C"&'NUROUT RERUNRPT^NURARPC3 I $E(IOST)="C",'NURQUEUE,'NUROUT G HSKEEP
K ^TMP($J) D CLOSE^NURSUT1 D ^NURAKILL
Q
ASKDAY ;
D EN8^NURSAGP1 Q:NUROUT
S HDATE=NDATED,NURSHDR="Daily Report for "_$E(+NDATED,4,5)_"/"_$E(+NDATED,6,7)_"/"_$E(+NDATED,2,3)_$S(+NDATED'=$P(NDATED,U,2):" - "_$E($P(NDATED,U,2),4,5)_"/"_$E($P(NDATED,U,2),6,7)_"/"_$E($P(NDATED,U,2),2,3),1:"")
Q
WARDSEL R !!,"Select Nursing Unit: ",X:DTIME I "^"[X!('$T) S NUROUT=1 Q
S DIC="^NURSF(211.4,",DIC(0)="EMZQ"
D ^DIC K DIC
I +Y'>0 G WARDSEL
S NURSWARD(0)=Y(0,0),NURSWARD=+Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURARMH0 1819 printed Nov 22, 2024@17:29:50 Page 2
NURARMH0 ;HIRMFO/RM/MD-DRIVER TO PRINT AMIS 1106 PATIENT CARE MANHOURS REPORTS ;2/17/96
+1 ;;4.0;NURSING SERVICE;**14**;Apr 25, 1997
+2 if '$DATA(^DIC(213.9,1,"OFF"))
QUIT
if $PIECE(^DIC(213.9,1,"OFF"),"^",1)=1
QUIT
+3 SET (NUROUT,NURQUEUE)=0
DO LOSER^NURARST
if NUROUT
GOTO QUIT
if SEL=2
GOTO EN1
if SEL=1
GOTO EN2
EN1 ;ENTRY FROM OPTION NURAPR-RES-MANSER
+1 SET NHOSPSW=1
+2 GOTO HSKEEP
EN2 ;ENTRY FROM OPTION NURAPR-RES-MANLOC
+1 SET NHOSPSW=0
HSKEEP ; SET LOCAL VARIABLES
+1 SET (NUROUT,NURPAGE,NURQUEUE,NURMDSW,NURMDSW(3),NPTCEN,NBCEN,NBRK)=0
SET (NURSWARD,NBDSECT,NURSWHEN,%DT)=""
SET X="T"
SET (NURMDSW(1),NURMDSW(4))=1
+2 DO ^%DT
SET NRPTDAT=Y
+3 WRITE !!,?17,"Nursing AMIS 1106 Patient Care Manhours Reports"
+4 DO EN9^NURSAGSP
IF NURMDSW
IF NHOSPSW
DO EN12^NURSAGSP
if $GET(NUROUT)
GOTO QUIT
WRITE !
SET DIC(0)="AEMQZ"
DO EN8^NURSAGSP
if $GET(NUROUT)
GOTO QUIT
+5 if 'NHOSPSW
DO WARDSEL
if NUROUT
GOTO QUIT
+6 DO BEDSEL^NURARPC0
IF NUROUT
GOTO QUIT
+7 DO TIMESEL^NURARPC0
IF NUROUT
GOTO QUIT
+8 DO @$SELECT(NURSWHEN="D":"ASKDAY",NURSWHEN="M":"SETMON^NURARPC1",NURSWHEN="Q":"SETQUART^NURARPC1",NURSWHEN="A":"SETQUART^NURARPC1",1:"ERROR^NURARPC0")
WRITE !
+9 if NUROUT
GOTO QUIT
+10 SET ZTRTN="START^NURARMH0"
DO EN7^NURSUT0
if POP!($DATA(ZTSK))
GOTO QUIT
START ;
+1 FOR X="RN","LPN","NA"
SET (DTL(X),TL(X),NT(X),FT(X),FNT(X))=0
+2 KILL ^TMP($JOB),^TMP("NURBDSM",$JOB)
+3 DO ^NURARMH1
QUIT ; KILL LOCAL VARIABLES
+1 if $EXTRACT(IOST)="C"&'NUROUT
DO RERUNRPT^NURARPC3
IF $EXTRACT(IOST)="C"
IF 'NURQUEUE
IF 'NUROUT
GOTO HSKEEP
+2 KILL ^TMP($JOB)
DO CLOSE^NURSUT1
DO ^NURAKILL
+3 QUIT
ASKDAY ;
+1 DO EN8^NURSAGP1
if NUROUT
QUIT
+2 SET HDATE=NDATED
SET NURSHDR="Daily Report for "_$EXTRACT(+NDATED,4,5)_"/"_$EXTRACT(+NDATED,6,7)_"/"_$EXTRACT(+NDATED,2,3)_$SELECT(+NDATED'=$PIECE(NDATED,U,2):" - "_$EXTRACT($PIECE(NDATED,U,2),4,5)_"/"_$EXTRACT($PIECE(NDATED,U,2),6,7)_"/"_...
... $EXTRACT($PIECE(NDATED,U,2),2,3),1:"")
+3 QUIT
WARDSEL READ !!,"Select Nursing Unit: ",X:DTIME
IF "^"[X!('$TEST)
SET NUROUT=1
QUIT
+1 SET DIC="^NURSF(211.4,"
SET DIC(0)="EMZQ"
+2 DO ^DIC
KILL DIC
+3 IF +Y'>0
GOTO WARDSEL
+4 SET NURSWARD(0)=Y(0,0)
SET NURSWARD=+Y
+5 QUIT