NURARWL8 ;HIRMFO/MD-HOSPITAL TOTAL ROUTINE FOR WORKLOAD STATISTICS REPORTS ;9/20/96
;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
HTOT ; HOSPITAL TOTALS
I +$G(NDATED)=$P($G(NDATED),U,2) Q
F Y=1,2,3 D
.S $P(NHVAR,U,Y)=$J($P(NHFTEE,U,Y),1,1)-$J($P(NHREQ,U,Y),1,1) I $J($P(NHFTEE,U,Y),1,1),$J($P(NHREQ,U,Y),1,1),NURSZAP'>6 S $P(NHPROD,U,Y)=($J($P(NHREQ,U,Y),1,1)/$J($P(NHFTEE,U,Y),1,1))*100
.Q
I +NHREQ!(+$P(NHREQ,U,2))!(+$P(NHREQ,U,3)) W:'$G(NURSUMSW) !,?18,$$REPEAT^XLFSTR("-",114) D
.W !,"REPORT SUMMARY",?22,$J($P(NHREQ,U),4,1),?28,$J($P(NHFTEE,U),4,1),?34,$J($P(NHVAR,U),5,1) W:NURSZAP'>6 ?41,$J($P(NHPROD,U),3,0) W ?48,$J($P(NHREQ,U,2),4,1),?54,$J($P(NHFTEE,U,2),4,1)
.W ?60,$J($P(NHVAR,U,2),5,1) W:NURSZAP'>6 ?67,$J($P(NHPROD,U,2),3,0) W ?74,$J($P(NHREQ,U,3),4,1),?80,$J($P(NHFTEE,U,3),4,1),?86,$J($P(NHVAR,U,3),5,1) W:NURSZAP'>6 ?92,$J($P(NHPROD,U,3),3,0)
.W ?97,$J($P(NHPC,U),4,1),?103,$J($P(NHPC,U,2),4,1),?109,$J($P(NHPC,U,3),4,1),?115,$J($P(NHPC,U,4),4,1),?121,$J($P(NHPC,U,5),3,1),?126,$J(NHPCC,5,1)
F Z="DOM","REC","HEM" I +MNHRS(Z)!(+$P(MNHRS(Z),U,2))!(+$P(MNHRS(Z),U,3))!(+COUNT(Z)) D
.W !,"REPORT ",Z," COUNT",?28,$J(+MNHRS(Z),4,1),?54,$J($P(MNHRS(Z),U,2),4,1),?80,$J($P(MNHRS(Z),U,3),4,1)
.W ?97,$J(+COUNT(Z),4,1),?103,$J($P(COUNT(Z),U,2),4,1),?109,$J($P(COUNT(Z),U,3),4,1),?115,$J($P(COUNT(Z),U,4),4,1),?121,$J($P(COUNT(Z),U,5),3,1),?126,$J(+COUNT(Z),5,1)
.Q
Q
AVG ;CENSUS AVG
Q:'NAVG F X=1:1:5 S:$P(NBPC,U,X) $P(NBPC,U,X)=$P(NBPC,U,X)/NAVG
S:NBPCC NBPCC=NBPCC/NAVG,NAVG=0
Q
I 'NURQUEUE,$E(IOST)="C",NSW1 D ENDPG^NURSUT1 Q:NUROUT
S NSW1=1,NPCT=NPCT+1,NPWARD=NWARD D EN6^NURSAUTL
U IO W:$E(IOST)="C"!(NPCT>1) @IOF
I NURMDSW,'$G(NWARD) W !,?61,$S($G(NPFAC)=" BLANK":"NO FACILITY",1:$G(NPFAC))
S HDRDT=$S(+NDATED'=$P(NDATED,U,2):"FROM ",1:"")_$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:"")
W !,$E(DT,4,5),"/",$E(DT,6,7),"/",$E(DT,2,3),?44,"AMIS WORKLOAD "_$S($D(NURSUMSW):"SUMMARY",1:"STATISTICS")_" FOR " W $S(NWARD:NPWARD,'NWARD:"THE SERVICE",1:"")_" "_HDRDT
W ?124,"PAGE: ",NPCT
W ! W:'$D(NURSUMSW) ?16,"BED" W ?29,"RN FTEE",?57,"LPN FTEE",?83,"NA FTEE"
W !,"UNIT" W:'$D(NURSUMSW) ?16,"SECT" W ?22,"REQ S OD VAR" W:NURSZAP'>6 ?39,"%/PRO" W ?49,"REQ S OD VAR" W:NURSZAP'>6 ?66,"%/PRO" W ?75,"REQ S OD VAR" W:NURSZAP'>6 ?91,"%/PRO" W ?99,"PC1 PC2 PC3 PC4 PC5 PTOT"
W !,$$REPEAT^XLFSTR("-",132)
D DATE
Q
DATE ;
W !,?61," " S Y=NDATE I +Y D DT^DIQ W !,?61,$$REPEAT^XLFSTR("-",13)
Q
NURARWL8 ;HIRMFO/MD-HOSPITAL TOTAL ROUTINE FOR WORKLOAD STATISTICS REPORTS ;9/20/96
+1 ;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
HTOT ; HOSPITAL TOTALS
+1 IF +$GET(NDATED)=$PIECE($GET(NDATED),U,2)
QUIT
+2 FOR Y=1,2,3
Begin DoDot:1
+3 SET $PIECE(NHVAR,U,Y)=$JUSTIFY($PIECE(NHFTEE,U,Y),1,1)-$JUSTIFY($PIECE(NHREQ,U,Y),1,1)
IF $JUSTIFY($PIECE(NHFTEE,U,Y),1,1)
IF $JUSTIFY($PIECE(NHREQ,U,Y),1,1)
IF NURSZAP'>6
SET $PIECE(NHPROD,U,Y)=($JUSTIFY($PIECE(NHREQ,U,Y),1,1)/$JUSTIFY($PIECE(NHFTEE,U,Y),1,1))*100
+4 QUIT
End DoDot:1
+5 IF +NHREQ!(+$PIECE(NHREQ,U,2))!(+$PIECE(NHREQ,U,3))
IF '$GET(NURSUMSW)
WRITE !,?18,$$REPEAT^XLFSTR("-",114)
Begin DoDot:1
+6 WRITE !,"REPORT SUMMARY",?22,$JUSTIFY($PIECE(NHREQ,U),4,1),?28,$JUSTIFY($PIECE(NHFTEE,U),4,1),?34,$JUSTIFY($PIECE(NHVAR,U),5,1)
IF NURSZAP'>6
WRITE ?41,$JUSTIFY($PIECE(NHPROD,U),3,0)
WRITE ?48,$JUSTIFY($PIECE(NHREQ,U,2),4,1),?54,$JUSTIFY($PIECE(NHFTEE,U,2),4,1)
+7 WRITE ?60,$JUSTIFY($PIECE(NHVAR,U,2),5,1)
IF NURSZAP'>6
WRITE ?67,$JUSTIFY($PIECE(NHPROD,U,2),3,0)
WRITE ?74,$JUSTIFY($PIECE(NHREQ,U,3),4,1),?80,$JUSTIFY($PIECE(NHFTEE,U,3),4,1),?86,$JUSTIFY($PIECE(NHVAR,U,3),5,1)
IF NURSZAP'>6
WRITE ?92,$JUSTIFY($PIECE(NHPROD,U,3),3,0)
+8 WRITE ?97,$JUSTIFY($PIECE(NHPC,U),4,1),?103,$JUSTIFY($PIECE(NHPC,U,2),4,1),?109,$JUSTIFY($PIECE(NHPC,U,3),4,1),?115,$JUSTIFY($PIECE(NHPC,U,4),4,1),?121,$JUSTIFY($PIECE(NHPC,U,5),3,1),?126,$JUSTIFY(NHPCC,5,1)
End DoDot:1
+9 FOR Z="DOM","REC","HEM"
IF +MNHRS(Z)!(+$PIECE(MNHRS(Z),U,2))!(+$PIECE(MNHRS(Z),U,3))!(+COUNT(Z))
Begin DoDot:1
+10 WRITE !,"REPORT ",Z," COUNT",?28,$JUSTIFY(+MNHRS(Z),4,1),?54,$JUSTIFY($PIECE(MNHRS(Z),U,2),4,1),?80,$JUSTIFY($PIECE(MNHRS(Z),U,3),4,1)
+11 WRITE ?97,$JUSTIFY(+COUNT(Z),4,1),?103,$JUSTIFY($PIECE(COUNT(Z),U,2),4,1),?109,$JUSTIFY($PIECE(COUNT(Z),U,3),4,1),?115,$JUSTIFY($PIECE(COUNT(Z),U,4),4,1),?121,$JUSTIFY($PIECE(COUNT(Z),U,5),3,1),?126,$JUSTIFY(+COUNT(Z),5,1)
+12 QUIT
End DoDot:1
+13 QUIT
AVG ;CENSUS AVG
+1 IF 'NAVG
QUIT
FOR X=1:1:5
IF $PIECE(NBPC,U,X)
SET $PIECE(NBPC,U,X)=$PIECE(NBPC,U,X)/NAVG
+2 IF NBPCC
SET NBPCC=NBPCC/NAVG
SET NAVG=0
+3 QUIT
+1 IF 'NURQUEUE
IF $EXTRACT(IOST)="C"
IF NSW1
DO ENDPG^NURSUT1
IF NUROUT
QUIT
+2 SET NSW1=1
SET NPCT=NPCT+1
SET NPWARD=NWARD
DO EN6^NURSAUTL
+3 USE IO
IF $EXTRACT(IOST)="C"!(NPCT>1)
WRITE @IOF
+4 IF NURMDSW
IF '$GET(NWARD)
WRITE !,?61,$SELECT($GET(NPFAC)=" BLANK":"NO FACILITY",1:$GET(NPFAC))
+5 SET HDRDT=$SELECT(+NDATED'=$PIECE(NDATED,U,2):"FROM ",1:"")_$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:"")
+6 WRITE !,$EXTRACT(DT,4,5),"/",$EXTRACT(DT,6,7),"/",$EXTRACT(DT,2,3),?44,"AMIS WORKLOAD "_$SELECT($DATA(NURSUMSW):"SUMMARY",1:"STATISTICS")_" FOR "
WRITE $SELECT(NWARD:NPWARD,'NWARD:"THE SERVICE",1:"")_" "_HDRDT
+7 WRITE ?124,"PAGE: ",NPCT
+8 WRITE !
IF '$DATA(NURSUMSW)
WRITE ?16,"BED"
WRITE ?29,"RN FTEE",?57,"LPN FTEE",?83,"NA FTEE"
+9 WRITE !,"UNIT"
IF '$DATA(NURSUMSW)
WRITE ?16,"SECT"
WRITE ?22,"REQ S OD VAR"
IF NURSZAP'>6
WRITE ?39,"%/PRO"
WRITE ?49,"REQ S OD VAR"
IF NURSZAP'>6
WRITE ?66,"%/PRO"
WRITE ?75,"REQ S OD VAR"
IF NURSZAP'>6
WRITE ?91,"%/PRO"
WRITE ?99,"PC1 PC2 PC3 PC4 PC5 PTOT"
+10 WRITE !,$$REPEAT^XLFSTR("-",132)
+11 DO DATE
+12 QUIT
DATE ;
+1 WRITE !,?61," "
SET Y=NDATE
IF +Y
DO DT^DIQ
WRITE !,?61,$$REPEAT^XLFSTR("-",13)
+2 QUIT