VistA-WorldVistAEHR/r/NURSING_SERVICE-NUR/NURARWL6.m

66 lines
4.4 KiB
Mathematica

NURARWL6 ;HIRMFO/MD/-MANHOURS AMIS 1106a WORKLOAD STATISTICS CONT OF NURARWL5 ;9/20/96
;;4.0;NURSING SERVICE;;Apr 25, 1997
BEDTOT ;BEDSECTION SUMMARY
I COUNTSW S:'$D(WMNHRS(NPLOC,SECT)) WMNHRS(NPLOC,SECT)=0 S:'$D(WCOUNT(NPLOC,SECT)) WCOUNT(NPLOC,SECT)=0
F X=1,2,3 D
. I 'COUNTSW D
. . S $P(NBVAR,U,X)=$J($P(NBFTEE,U,X),1,1)-$J($P(NBREQ,U,X),1,1) I $J($P(NBFTEE,U,X),1,1),$J($P(NBREQ,U,X),1,1),NURSZAP'>6 S $P(NBPROD,U,X)=$S($P(NAPROD,U,X):$J($P(NAPROD,U,X),1,1)/3,1:($J($P(NBREQ,U,X),1,1)/$J($P(NBFTEE,U,X),1,1))*100)
. . S $P(NWREQ,U,X)=$P(NWREQ,U,X)+$J($P(NBREQ,U,X),0,1),$P(NDREQ,U,X)=$P(NDREQ,U,X)+$J($P(NBREQ,U,X),0,1),$P(NHREQ,U,X)=$P(NHREQ,U,X)+$J($P(NBREQ,U,X),0,1)
. . I NURMDSW S $P(NFREQ,U,X)=$P(NFREQ,U,X)+$J($P(NBREQ,U,X),0,1),$P(NFFTEE,U,X)=$P(NFFTEE,U,X)+$J($P(NBFTEE,U,X),0,1)
. . S $P(NWFTEE,U,X)=$P(NWFTEE,U,X)+$J($P(NBFTEE,U,X),0,1),$P(NHFTEE,U,X)=$P(NHFTEE,U,X)+$J($P(NBFTEE,U,X),0,1),$P(NDFTEE,U,X)=$P(NDFTEE,U,X)+$J($P(NBFTEE,U,X),0,1)
. . Q
. I COUNTSW D
. . S $P(WMNHRS(NPLOC,SECT),U,X)=$P(WMNHRS(NPLOC,SECT),U,X)+$J($P(NBFTEE,U,X),0,1)
. . I NURMDSW S $P(MFHRS(SECT),U,X)=$P(MFHRS(SECT),U,X)+$J($P(NBFTEE,U,X),0,1)
. . S $P(DMNHRS(SECT),U,X)=$P(DMNHRS(SECT),U,X)+$J($P(NBFTEE,U,X),0,1)
. . S $P(MNHRS(SECT),U,X)=$P(MNHRS(SECT),U,X)+$J($P(NBFTEE,U,X),0,1)
. . Q
. Q
I COUNTSW D
. S WCOUNT(NPLOC,SECT)=WCOUNT(NPLOC,SECT)+NBPCC
. I NURMDSW S FCOUNT(SECT)=FCOUNT(SECT)+NBPCC
. S DCOUNT(SECT)=DCOUNT(SECT)+NBPCC
. S COUNT(SECT)=COUNT(SECT)+NBPCC
G:$D(NURSUMSW) TOTAL
W !,?18,$$REPEAT^XLFSTR("-",114),!,?3,SECT,$S(COUNTSW:" COUNT",1:" SUMMARY")
I 'COUNTSW W ?23,$S(SECT="ATC":" N/A",1:$J($P(NBREQ,U),3,1))
W ?29,$J($P(NBFTEE,U),3,1)
I 'COUNTSW W ?35,$J($P(NBVAR,U),4,1) W:NURSZAP'>6 ?41,$J($P(NBPROD,U),3,0) W ?49,$S(SECT="ATC":" N/A",1:$J($P(NBREQ,U,2),3,1))
W ?55,$J($P(NBFTEE,U,2),3,1)
I 'COUNTSW W ?61,$J($P(NBVAR,U,2),4,1) W:NURSZAP'>6 ?67,$J($P(NBPROD,U,2),3,0) W ?75,$S(SECT="ATC":" N/A",1:$J($P(NBREQ,U,3),3,1))
W ?81,$J($P(NBFTEE,U,3),3,1)
I 'COUNTSW W ?87,$J($P(NBVAR,U,3),4,1) W:NURSZAP'>6 ?93,$J($P(NBPROD,U,3),3,0)
W ?98,$J($P(NBPC,U),3,1),?104,$J($P(NBPC,U,2),3,1),?110,$J($P(NBPC,U,3),3,1),?116,$J($P(NBPC,U,4),3,1),?122,$J($P(NBPC,U,5),3,1),?127,$J(NBPCC,4,1),!
TOTAL F X=1,2,3 S $P(NBREQ,U,X)=0,$P(NBVAR,U,X)=0,$P(NBPROD,U,X)=0,$P(NBFTEE,U,X)=0,$P(NAPROD,U,X)=0
I '$G(COUNTSW) D
. F X=1:1:5 S $P(NWPC,U,X)=$P(NWPC,U,X)+$P(NBPC,U,X),$P(NDPC,U,X)=$P(NDPC,U,X)+$P(NBPC,U,X),$P(NHPC,U,X)=$P(NHPC,U,X)+$P(NBPC,U,X) S:NURMDSW $P(NFPC,U,X)=$P(NFPC,U,X)+$P(NBPC,U,X) S $P(NBPC,U,X)=0
. S NWPCC=NWPCC+NBPCC,NDPCC=NDPCC+NBPCC,NHPCC=NHPCC+NBPCC S:NURMDSW NFPCC=NFPCC+NBPCC
. Q
S (COUNTSW,NBPCC)=0,NBR=1
Q
BRK ; LOCATION SUMMARY
F X=1,2,3 D
. I 'COUNTSW(1) D
. . S $P(NWVAR,U,X)=$J($P(NWFTEE,U,X),1,1)-$J($P(NWREQ,U,X),1,1) I $J($P(NWFTEE,U,X),1,1),$J($P(NWREQ,U,X),1,1),NURSZAP'>6,NWPCC S $P(NWPROD,U,X)=($J($P(NWREQ,U,X),1,1)/$J($P(NWFTEE,U,X),1,1))*100
. . Q
. Q
I $D(NURSUMSW),NWARD G TOTAL1
W:'$D(NURSUMSW) ?18,$$REPEAT^XLFSTR("-",114)
I COUNTSW(1) S ZCNT=0,Z1="" F S Z1=$O(^TMP($J,NDATE,NPFAC,NPLOC,Z1)) Q:Z1="" S ZCNT=ZCNT+1
I $S('COUNTSW(1):1,COUNTSW(1)&(ZCNT>1):1,1:0) D
. K ZCNT W !,$E(NPLOC,1,10)," SUMMARY",?23,$J($P(NWREQ,U),3,1),?29,$J($P(NWFTEE,U),3,1),?34,$J($P(NWVAR,U),5,1) W:NURSZAP'>6 ?41,$J($P(NWPROD,U),3,0) W ?49,$J($P(NWREQ,U,2),3,1),?55,$J($P(NWFTEE,U,2),3,1)
. W ?61,$J($P(NWVAR,U,2),4,1) W:NURSZAP'>6 ?67,$J($P(NWPROD,U,2),3,0) W ?75,$J($P(NWREQ,U,3),3,1),?81,$J($P(NWFTEE,U,3),3,1)
. W ?87,$J($P(NWVAR,U,3),4,1) W:NURSZAP'>6 ?93,$J($P(NWPROD,U,3),3,0) W ?98,$J($P(NWPC,U),3,1),?104,$J($P(NWPC,U,2),3,1),?110,$J($P(NWPC,U,3),3,1),?116,$J($P(NWPC,U,4),3,1),?122,$J($P(NWPC,U,5),3,1),?127,$J(NWPCC,4,1)
. Q
I COUNTSW(1) F Y="REC","HEM","DOM" I $D(WMNHRS(NPLOC,Y)) D
. I (+$G(WMNHRS(NPLOC,Y))!(+$P($G(WMNHRS(NPLOC,Y)),U,2)!(+$P($G(WMNHRS(NPLOC,Y)),U,3)!(+$G(WCOUNT(NPLOC,Y)))))) D
. . W !,$E(NPLOC,1,10)," "_Y_" COUNT",?29,$J($P(WMNHRS(NPLOC,Y),U),3,1),?55,$J(+$P(WMNHRS(NPLOC,Y),U,2),3,1),?81,$J(+$P(WMNHRS(NPLOC,Y),U,3),3,1)
. . W ?98,$J($P(WCOUNT(NPLOC,Y),U),3,1),?104,$J($P(WCOUNT(NPLOC,Y),U,2),3,1),?110,$J($P(WCOUNT(NPLOC,Y),U,3),3,1),?116,$J($P(WCOUNT(NPLOC,Y),U,4),3,1),?122,$J($P(WCOUNT(NPLOC,Y),U,5),3,1),?127,$J(+WCOUNT(NPLOC,Y),4,1)
. . Q
. Q
TOTAL1 ;
F X=1,2,3 S $P(NWVAR,U,X)=0,$P(NWPROD,U,X)=0,$P(NWPC,U,X)=0,WCOUNT(NPLOC,Y)=0,$P(NWREQ,U,X)=0,$P(NWFTEE,U,X)=0
F X=1:1:5 S $P(NWPC,U,X)=0
S (COUNTSW(1),NWPCC)=0
Q