source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURARWL2.m@ 1397

Last change on this file since 1397 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.0 KB
Line 
1NURARWL2 ;HIRMFO/MD-(CURRENT) MANHOURS WORKLOAD STAT REPORT FOR HOSP. CON'T ;2/27/98 14:24
2 ;;4.0;NURSING SERVICE;**9**;Apr 25, 1997
3 I 'NHOS S NPFAC="" F S NPFAC=$O(NURSPC(NPFAC)) Q:NPFAC="" S NZ=0 F S NZ=$O(NURSPC(NPFAC,1,NZ)) Q:NZ'>0 S (NURSWARD,NPWARD)=$S($E(NZ,1,3)=999:$E(NZ,4,99),1:NZ) D EN6^NURSAUTL S NPLOC=NPWARD D Q:NURQUIT
4 . S NJ=0 F S NJ=$O(NURSPC(NPFAC,1,NZ,NJ)) D:NJ'>0 BRK^NURARWL3 Q:NJ'>0 D BEDSEC,ACUFTE,DETAIL^NURARWL3 Q:NURQUIT
5 . Q
6 I NHOS S:'NURMDSW NURFAC(2)=" BLANK" D Q:NURQUIT
7 . S NDA=0 F S NDA=$O(^NURSF(211.4,NDA)) Q:NDA'>0 S NPWARD=NDA D EN6^NURSAUTL I NPWARD'="" D Q:NURQUIT
8 . . I $G(NURFAC(2))'=" BLANK" S NURFAC(2)=$$EN12^NURSUT3($G(NDA)) Q:NURFAC(2)="" I '$G(NURFAC),$G(NURFAC(2))'=$G(NURFAC(1)) Q
9 . . S ^TMP($J,"WARD",NURFAC(2),NPWARD,NDA)=""
10 . . Q
11 . S NPFAC="" F S NPFAC=$O(^TMP($J,"WARD",NPFAC)) Q:NPFAC="" D:'$G(NURSUMSW) HEADER^NURARWL3 D Q:NURQUIT D:NURMDSW FACTOT^NURARWL9
12 . . S NPLOC="" F S NPLOC=$O(^TMP($J,"WARD",NPFAC,NPLOC)) Q:NPLOC=""!NURQUIT S NZ=$O(^(NPLOC,"")) I NZ'="",$D(NURSPC(NPFAC,1,NZ)) D Q:NURQUIT
13 . . . S NURSWARD=NZ,NJ=0 F S NJ=$O(NURSPC(NPFAC,1,NZ,NJ)) D:NJ'>0 BRK^NURARWL3 Q:NJ'>0 D BEDSEC,ACUFTE,DETAIL^NURARWL3 Q:NURQUIT
14 . . . Q
15 . . Q
16 . Q
17 Q
18ACUFTE ;
19 F X(1)=1,2,3 S $P(NREQ,U,X(1))=0,$P(NFTEE,U,X(1))=0,$P(NVAR,U,X(1))=0 S $P(NPROD,U,X(1))=$S(NURSZAP'>6:0,1:"")
20 S NURS213=^NURSF(213.3,NJ,1),DIC=213.4,DIC(0)="",X=NRPTDAT_NURSHFT_NURSWARD D ^DIC K DIC S NDA=+Y D
21 . F Z=1:1:5 Q:'$D(NURSPC(NPFAC,Z,NZ,NJ)) S $P(NPC,U,Z)=NURSPC(NPFAC,Z,NZ,NJ),NPCC=NPCC+$P(NPC,U,Z)
22 . S:NTCEN(NZ) NPERCEN=(NPCC/NTCEN(NZ))
23 . I NURSHFT="D" S NTLFTEE=(($P(NPC,U)*$P(NURS213,"^",2))+($P(NPC,U,2)*$P(NURS213,"^",3))+($P(NPC,U,3)*$P(NURS213,"^",4))+($P(NPC,U,4)*$P(NURS213,"^",5))+($P(NPC,U,5)*$P(NURS213,"^",14)))/8.5
24 . I NURSHFT="E" S NTLFTEE=(($P(NPC,U)*$P(NURS213,"^",6))+($P(NPC,U,2)*$P(NURS213,"^",7))+($P(NPC,U,3)*$P(NURS213,"^",8))+($P(NPC,U,4)*$P(NURS213,"^",9))+($P(NPC,U,5)*$P(NURS213,"^",15)))/8.5
25 . I NURSHFT="N" S NTLFTEE=(($P(NPC,U)*$P(NURS213,"^",10))+($P(NPC,U,2)*$P(NURS213,"^",11))+($P(NPC,U,3)*$P(NURS213,"^",12))+($P(NPC,U,4)*$P(NURS213,"^",13))+($P(NPC,U,5)*$P(NURS213,"^",16)))/8
26 . S X=$S($D(^NURSA(213.4,NDA,0)):^NURSA(213.4,NDA,0),1:"0^0^0^0") S $P(NFTEE,U)=$S($P(X,"^",2):$P(X,"^",2)/8,1:0) S $P(NFTEE,U,2)=$S($P(X,"^",3):$P(X,"^",3)/8,1:0) S $P(NFTEE,U,3)=$S($P(X,"^",4):$P(X,"^",4)/8,1:0)
27 . S X=NTLFTEE I $D(^NURSF(211.4,NURSWARD,1)),$P(^(1),"^",2) S Y=^NURSF(211.4,NURSWARD,1),NTLFTEE("PROF")=X/(100/$P(Y,"^",2)) S NTLFTEE("NPROF")=$S($P(Y,"^",2)<100:X/(100/(100-$P(Y,"^",2))),1:0)
28 . E S Y=^DIC(213.9,1,0),NTLFTEE("PROF")=X/(100/$P(Y,"^",7)) S NTLFTEE("NPROF")=$S($P(Y,"^",7)<100:X/(100/(100-$P(Y,"^",7))),1:0)
29 . S $P(NREQ,U)=NTLFTEE("PROF"),$P(NREQ,U,2)=NTLFTEE("NPROF")/2,$P(NREQ,U,3)=NTLFTEE("NPROF")/2
30 . F X=1:1:3 D
31 . . S $P(NDFTEE,U,X)=$S($D(NPERCEN):($P(NFTEE,U,X)*NPERCEN),1:($P(NFTEE,U,X)/NBSEC)) S $P(NVAR,U,X)=$J($P(NDFTEE,U,X),1,1)-$J($P(NREQ,U,X),1,1)
32 . . I $J($P(NDFTEE,U,X),1,1),$J($P(NREQ,U,X),1,1),NURSZAP'>6,NPCC S $P(NPROD,U,X)=($J($P(NREQ,U,X),1,1)/$J($P(NDFTEE,U,X),1,1))*100
33 . . Q
34 . K NPERCEN F X=1:1:3 S $P(NFTEE,U,X)=0
35 . Q
36 Q
37ADDTOT ; ACCUM. PT. CATEGORY TOT.
38 D ^NURSAPCH
39 I NURSX="LEAVE"!(NURSX="OTH. FAC.")!(NURSX="AWOL") Q
40 D EN6^NURSCUTL S NDATA=$P(^NURSF(214,DFN,0),U,4)
41 I NURSADM,NDATA=$O(^NURSF(213.3,"B","DOMICILIARY",0)) S NCAT=1,NBED=NDATA G ADD
42 I NDATA=$O(^NURSF(213.3,"B","RECOVERY ROOM",0))!(NDATA=$O(^NURSF(213.3,"B","HEMODIALYSYS",0))) S NCAT=1,NBED=NDATA G ADD
43 S RPTDATE=DT,NURSCLAS("CL")=1 D EN2^NURSCUTL
44 Q:NURSCLAS="" S NCAT=$S('$D(^NURSA(214.6,NURSCLAS,0)):"",1:$P(^(0),"^",3)),NBED=$S('$D(^NURSA(214.6,NURSCLAS,0)):"",1:$P(^(0),"^",9))
45 Q:(NCAT="")!(NBED="") Q:NURSWARD'=$P(^NURSA(214.6,NURSCLAS,0),"^",8)
46ADD ;
47 S:'$D(NURSPC(NURFAC(2),NCAT,NURSWARD,NBED)) NURSPC(NURFAC(2),NCAT,NURSWARD,NBED)=0 I $D(NTCEN(NURSWARD)) S NURSPC(NURFAC(2),NCAT,NURSWARD,NBED)=NURSPC(NURFAC(2),NCAT,NURSWARD,NBED)+1,NTCEN(NURSWARD)=(NTCEN(NURSWARD)+1)
48 Q
49BEDSEC ;
50 S (NBSEC,NI)=0 F S NI=$O(NURSPC(NPFAC,1,NZ,NI)) Q:NI'>0 S NBSEC=NBSEC+1
51 Q
Note: See TracBrowser for help on using the repository browser.