Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: NURARWL3

NURARWL3.m

Go to the documentation of this file.
NURARWL3 ;HIRMFO/MD,FT-CONTINUATION OF THE (CURRENT) WORKLOAD STATISTICS ;12/11/96  10:45
 ;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
DETAIL ;PRINT DATA LINES
 S NPWARD=NURSWARD D EN6^NURSAUTL I $P(NURS213,U)="DOM"!($P(NURS213,U)="REC")!($P(NURS213,U)="HEM") S COUNTSW=1
 I ($Y>(IOSL-6)!'NSW1) D HEADER Q:NURQUIT
 S SECT=$P(NURS213,U) G:$G(NURSUMSW) A W !,$S(NBR:$E(NPWARD,1,10),1:""),?17,SECT S:NBR NBR=0
 I '$G(COUNTSW) W ?23,$S(SECT="ATC":" N/A",1:$J($P(NREQ,U),3,1))
 W ?29,$J($P(NDFTEE,U),3,1)
 I '$G(COUNTSW) W ?35,$J($P(NVAR,U),4,1) W:NURSZAP'>6!(DUZ(0)="@") ?41,$J($P(NPROD,U),3,0) W ?49,$S(SECT="ATC":" N/A",1:$J($P(NREQ,U,2),3,1))
 W ?55,$J($P(NDFTEE,U,2),3,1)
 I '$G(COUNTSW) W ?61,$J($P(NVAR,U,2),4,1) W:NURSZAP'>6!(DUZ(0)="@") ?67,$J($P(NPROD,U,2),3,0) W ?75,$S(SECT="ATC":" N/A",1:$J($P(NREQ,U,3),4,1))
 W ?81,$J($P(NDFTEE,U,3),4,1)
 I '$G(COUNTSW) W ?87,$J($P(NVAR,U,3),4,1) W:NURSZAP'>6!(DUZ(0)="@") ?93,$J($P(NPROD,U,3),3,0)
 W ?98,$J($P(NPC,U),3),?104,$J($P(NPC,U,2),3),?110,$J($P(NPC,U,3),3),?116,$J($P(NPC,U,4),3),?121,$J($P(NPC,U,5),3),?127,$J(NPCC,4)
A I 'COUNTSW D
 .F X=1,2,3 D
 ..S:+$P(NREQ,U,X) $P(NWREQ,U,X)=$P(NWREQ,U,X)+$J($P(NREQ,U,X),0,1) S:+$P(NDFTEE,U,X) $P(NWFTEE,U,X)=$P(NWFTEE,U,X)+$J($P(NDFTEE,U,X),0,1)
 ..I NURMDSW,NHOS S $P(NFREQ,U,X)=$P(NFREQ,U,X)+$J($P(NREQ,U,X),0,1) S:+$P(NDFTEE,U,X) $P(NFFTEE,U,X)=$P(NFFTEE,U,X)+$J($P(NDFTEE,U,X),0,1)
 ..Q
 .F Z=1:1:5 S $P(NWPC,U,Z)=$P(NWPC,U,Z)+$P(NPC,U,Z) S:NURMDSW $P(NFPC,U,Z)=$P(NFPC,U,Z)+$P(NPC,U,Z) S $P(NPC,U,Z)=0
 .S NWPCC=NWPCC+NPCC S:NURMDSW NFPCC=NFPCC+NPCC
 .Q
 I COUNTSW D
 .F X=1,2,3 S $P(MNHRS(SECT),U,X)=$P(MNHRS(SECT),U,X)+$J($P(NDFTEE,U,X),0,1) S:NURMDSW $P(MFHRS(SECT),U,X)=$P(MNHRS(SECT),U,X)+$J($P(NDFTEE,U,X),0,1)
 .I NURMDSW,NHOS S FCOUNT(SECT)=FCOUNT(SECT)+NPCC,NFCNT=NFCNT+NPCC
 .S COUNT(SECT)=COUNT(SECT)+NPCC,NWCNT=NWCNT+NPCC
 .Q
 S (COUNTSW,NPCC)=0,NSW1=1
 Q
 I 'NUROUT,$E(IOST)="C",NSW1 D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
 S NPCT=NPCT+1,NSW1=1
 U IO W:$E(IOST)="C"!(NPCT>1) @IOF
 I NURMDSW,NHOS,'$G(NURSUMSW) W ?65,$S($G(NPFAC)="  BLANK":"NO FACILITY",1:$G(NPFAC))
 W ! D NOW^%DTC S Y=% D DT^DIQ W ?46,$S(NURSHFT="D":"DAY",NURSHFT="N":"NIGHT",1:"EVENING")," SHIFT "_$S($D(NRPTDAT("PWLS")):"PROJECTED",1:"CURRENT")_" WORKLOAD STATISTICS FOR ",$S('NHOS:$G(NPWARD),NHOS:"THE SERVICE",1:"")
 I $D(NRPTDAT("PWLS")) W " FOR ",$$FMTE^XLFDT(NRPTDAT,"2D")
 W ?124,"PAGE: ",NPCT
 W !,?16,"BED",?29,"RN FTEE",?57,"LPN FTEE",?83,"NA FTEE",!,"UNIT",?16,"SECT",?22,"REQ   S OD  VAR" W:NURSZAP'>6!(DUZ(0)="@") ?39,"%/PRO"
 W ?49,"REQ   S OD  VAR" W:NURSZAP'>6 ?66,"%/PRO" W ?75,"REQ   S OD  VAR" W:NURSZAP'>6!(DUZ(0)="@") ?91,"%/PRO" W ?99,"PC1  PC2   PC3   PC4   PC5  PTOT"
 S $P(NURSZ,"-",133)="" W !,NURSZ
 Q
BRK ; LOCATION TOTALS CURRENT WORKLOAD REPORTS
 G:$G(NURSUMSW) B
 W !,?18,$E(NURSY,1,114) F X=1,2,3 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
 I $D(NURSPC(NPFAC,1,NURSWARD,$O(^NURSF(213.3,"B","DOMICILIARY",0))))!($D(NURSPC(NPFAC,1,NURSWARD,$O(^NURSF(213.3,"B","HEMODIALYSIS",0)))))!($D(NURSPC(NPFAC,1,NURSWARD,$O(^NURSF(213.3,"B","RECOVERY ROOM",0))))) S COUNTSW=1
 W !,$E(NPLOC,1,10) W $S(COUNTSW&'(+NWPCC):" COUNT",1:" SUMMARY")
 I 'COUNTSW W ?23,$J($P(NWREQ,U),3,1)
 W ?29,$J($P(NWFTEE,U),3,1)
 I 'COUNTSW W ?35,$J($P(NWVAR,U),4,1) W:NURSZAP'>6 ?41,$J($P(NWPROD,U),3,0) W ?49,$J($P(NWREQ,U,2),3,1)
 W ?55,$J($P(NWFTEE,U,2),3,1)
 I 'COUNTSW W ?61,$J($P(NWVAR,U,2),4,1) W:NURSZAP'>6 ?67,$J($P(NWPROD,U,2),3,0) W ?76,$J($P(NWREQ,U,3),3,1)
 W ?82,$J($P(NWFTEE,U,3),3,1)
 I 'COUNTSW 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),?121,$J($P(NWPC,U,5),3,1),?127,$J(NWPCC,4,1),!
 I $G(COUNTSW) W ?98,$J($P(NWCNT,U),3,1),?104,$J($P(NWCNT,U,2),3,1),?110,$J($P(NWCNT,U,3),3,1),?116,$J($P(NWCNT,U,4),3,1),?121,$J($P(NWCNT,U,5),3,1),?127,$J(+NWCNT,4,1),!
B ; VARIABLE AND GLOBAL SET FOR STAFF VARIANCE WORKSHEET
 I '$G(NURSUMSW) D
 . S UNIT=$S($E(NPLOC,1,3)="ZZZ":$E(NPLOC,4,99),1:NPLOC)
 . S ARN=$J($P(NWREQ,U),3,1),ALPN=$J($P(NWREQ,U,2),3,1),ANA=$J($P(NWREQ,U,3),3,1),BRN=$J($P(NWFTEE,U),3,1),BLPN=$J($P(NWFTEE,U,2),3,1),BNA=$J($P(NWFTEE,U,3),3,1),AA=$G(UNIT)_U_ARN_U_ALPN_U_ANA_U_BRN_U_BLPN_U_BNA
 . I $G(UNIT)'="",$G(NPFAC)'="" S ^TMP("NURVAR",$J,NPFAC,UNIT)=AA
 . Q
 I $G(NURSUMSW) D
 . S ARN=$J($P(NWREQ,U),3,1),ALPN=$J($P(NWREQ,U,2),3,1),ANA=$J($P(NWREQ,U,3),3,1),BRN=$J($P(NWFTEE,U),3,1),BLPN=$J($P(NWFTEE,U,2),3,1),BNA=$J($P(NWFTEE,U,3),3,1),AA=ARN_U_ALPN_U_ANA_U_BRN_U_BLPN_U_BNA
 . I $G(NPFAC)'="" S:'$D(^TMP("NURVAR",$J,NPFAC)) ^(NPFAC)="" F X=1:1:6 S $P(^TMP("NURVAR",$J,NPFAC),U,X)=+$P(^(NPFAC),U,X)+$P(AA,U,X)
 . Q
 I '$G(COUNTSW) F X=1,2,3 D
 .S $P(NHREQ,U,X)=$P(NHREQ,U,X)+$J($P(NWREQ,U,X),0,1),$P(NHFTEE,U,X)=$P(NHFTEE,U,X)+$J($P(NWFTEE,U,X),0,1)
 .I NHOS S $P(NWREQ,U,X)=0,$P(NWFTEE,U,X)=0,$P(NWVAR,U,X)=0,$P(NWPROD,U,X)=0
 .Q
 S NHPCC=NHPCC+NWPCC
 F X=1:1:5 S $P(NHPC,U,X)=$P(NHPC,U,X)+$P(NWPC,U,X),$P(NWPC,U,X)=0
 S (COUNTSW,NWCNT,NWPCC)=0,NBR=1
 Q