source: FOIAVistA/trunk/r/DIETETICS-FH/FHMADM4.m@ 1123

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

initial load of FOIAVistA 6/30/08 version

File size: 6.2 KB
Line 
1FHMADM4 ; HISC/AAC - Multidivisional Staffing Data Report ;10/10/03 16:08
2 ;;5.5;DIETETICS;;Jan 28, 2005
3EN1 ; Enter/Edit Staffing Data
4 D NOW^%DTC S DT=%\1
5 ;
6 ;
7E1 S %DT="AEPX",%DT("A")="STAFFING DATA Date: " W ! D ^%DT G KIL:"^"[X!$D(DTOUT),E1:Y<1
8 S DA=+Y I DA>DT W *7,!!,"** Date must not be in the future!",! G E1
9 K DIC,DIE S DIE="^FH(117.1," I '$D(^FH(117.1,DA,0)) S ^FH(117.1,DA,0)=DA,^FH(117.1,"B",DA,DA)="",X0=^FH(117.1,0),$P(^FH(117.1,0),"^",3,4)=DA_"^"_($P(X0,"^",4)+1)
10 S X1=DA,X2=-1 D C^%DTC S DM1=X,FHX1=$P($G(^FH(117.1,DM1,0)),"^",2,6)
11 S DR="[FHMADM4]" D ^DIE G EN1
12 ;
13EN2 ; Print Staffing Data Report
14 D DT^FHMADM2 G:"^"[X KIL
15 ;
16 S (CONUM,ZCO,COXX,CO,CONAME,CONAM)="",(COUNT,SSND,SSTOT,SSTO1,SMAN)=0
17 F K=1:1:23 S SS(K)=0
18 ;S ZZOUT=$G(^FH(119.73,0)),(CONUMX,ZOUT)=$P(ZZOUT,"^",4)
19 S ZZCOUNT=0 F ZZCOUNT=0:0 S ZZCOUNT=$O(^FH(119.73,ZZCOUNT)) Q:ZZCOUNT'>0 S ZOUT=ZZCOUNT
20 R !,"Print report all Communications Offices Y or N: ",ZCO:DTIME W ! S ZCO=$TR(ZCO,"y","Y") I ZCO'="Y" D N2 Q
21 ;
22PRINT W !!,"The report requires a 132 column printer.",!
23 K IOP,%ZIS S %ZIS("A")="Print on Device: ",%ZIS="MQ" W ! D ^%ZIS K %ZIS,IOP G:POP KIL
24 I $D(IO("Q")) S FHPGM="Q1^FHMADM4",FHLST="EDT^SDT^ZCO^CONUMX^COUNT^ZOUT^SSND^SSTOT^CO^CONAME^SMAN^SSTO1^SS(" D EN2^FH G KIL
25 U IO D Q1 D ^%ZISC K %ZIS,IOP G KIL
26 ;
27Q1 ; Process Printing Staffing Report
28 S DTP=SDT\1 D DTP^FH S DTE=DTP_" to " S DTP=EDT\1 D DTP^FH S DTE=DTE_DTP
29 S X=SDT D DOW^%DTC S DOW=Y+1
30 D NOW^%DTC S DTP=% D DTP^FH S HDT=DTP,PG=0
31 K S,AV F K=1:1:23 S S(K)=0
32 S SIZ="61 51 51 51 51 50 30 30 30 30 30 30 30 30 30 30 30 30 30 51 50 50 50"
33 ;
34Q3 ;
35 ;Get Communication Office data drivers
36 I ZCO'="Y" S CONUMX=CONUMX-1 G:CONUMX=0 QUIT S COXX=$P(CO,"^",CONUMX),NAME=$P(CONAME,"^",CONUMX) G:$D(^FH(119.73,COXX,"I")) Q3 G:'$D(^FH(119.73,COXX,0)) Q3
37 I ZCO="Y" S COUNT=COUNT+1 G:COUNT>ZOUT QUIT S NAME=$G(^FH(119.73,COUNT,0)),NAME=$P(NAME,"^") G:$D(^FH(119.73,COUNT,"I")) Q3 G:'$D(^FH(119.73,COUNT,0)) Q3
38 ;W @IOF
39 D HDR
40 D Q4
41 I ZCO'="Y" I CONUM>0 G Q3
42 I ZCO="Y" G Q3
43 Q
44 ;
45QUIT ;
46 ;End of routine drivers
47 ;W @IOF
48 S NAME="Total all Communications Offices "
49 D HDR
50 D FTOTALS
51 D LN
52 D LN
53 Q
54Q4 ;
55 ;Get detail information for Communciation Office, Start/End dates, etc.
56 F K=1:1:23 S S(K)=0
57 S D1=SDT,(ND,FHTOT,TO1,TOT,SFHTOT,MAN)=0 F L1=0:0 D N1 S X1=D1,X2=1 D C^%DTC Q:X>EDT S D1=X,DOW=DOW+1 S:DOW=8 DOW=1
58 D LN G:ND>62 Q2
59 W !?7,"Total",?15 F K=1:1:5,20,21,6:1:10,22,11:1:19,23 S X=$P(SIZ," ",K),SS(K)=SS(K)+S(K) W $J(S(K),$E(X,1)+1,$E(X,2))
60 ;
61Q2 ;Print Averages
62 I ND W !?7,"Avg.",?15 F K=1:1:5,20,21,6:1:10,22,11:1:19,23 S X=$P(SIZ," ",K) W $J(S(K)/ND,$E(X,1)+1,$E(X,2))
63 I S(22) W !?7,"% Paid",?68 F K=8,9,10,22,11:1:19,23 S X=$P(SIZ," ",K) W $J(S(K)/S(22)*100,$E(X,1)+1,0)
64 I TOT W !!?7,"Adjustment for Unscheduled and Intermittent",!!?7,"UNS/INT Total " S TOT=TOT/8 W $J(TOT,5,1)," FTEE",!?7,"Adjusted Measured FTEE " S TOT=TOT+TO1 W $J(TOT,6,1) ;I ND W !?7,"Avg Measured FTEE ",$J(TOT/ND,5,1)
65 I FHTOT S MAN=S(22)*60 W !!?7,"Man Minutes/Meal: ",$J(MAN/FHTOT,0,0) S SFHTOT=SFHTOT+FHTOT,SMAN=SMAN+MAN
66 W ! Q
67 ;
68FTOTALS ;Print Final Totals
69 ;
70 W !?6,"All Total",?13 F K=1:1:5,20,21,6:1:10,22,11:1:19,23 S X=$P(SIZ," ",K) W $J(SS(K),$E(X,1)+1,$E(X,2))
71 ;
72 ;I ND W !?6,"All Avg.",?15 F K=1:1:5,20,21,6:1:10,22,11:1:19,23 S X=$P(SIZ," ",K) W $J(SS(K)/SSND,$E(X,1)+1,$E(X,2))
73 I SS(22) W !?6,"All % Paid",?68 F K=8,9,10,22,11:1:19,23 S X=$P(SIZ," ",K) W $J(SS(K)/SS(22)*100,$E(X,1)+1,0)
74 I SSTOT W !!?6,"All Adjustment for Unscheduled and Intermittent",!!?6,"All UNS/INT Total " S SSTOT=SSTOT/8 W $J(TOT,5,1)," FTEE",!?6,"All Adjusted Measured FTEE "
75 S SSTOT=SSTOT+SSTO1 W $J(SSTOT,6,1) ;I ND W !?6,"All Avg Measured FTEE ",$J(SSTOT/ND,5,1)
76 I SFHTOT S SMAN=SS(22)*60 W !!?6,"Man Minutes/Meal: ",$J(SMAN/SFHTOT,0,0)
77 W ! Q
78 ;
79HDR ;Print page headers
80 W:'($E(IOST,1,2)'="C-"&'PG) @IOF S PG=PG+1 W !?4,HDT,?44,"S T A F F I N G D A T A W O R K S H E E T",?122,"Page ",PG
81 W !!,?1,NAME
82 W !!?(132-$L(DTE)\2),DTE
83 W !!?15,"| DAILY| CLIN|ADMIN| SUPP| SUPV| MEAS| POT | OFF |WOP| OT|UNS|INT| PAID|COP| AL| SL|OTH|LND|CMP|TRN|VOL|BOR|TOTAL"
84 W !?15,"| FTEE| FTEE| FTEE| FTEE| FTEE| FTEE| HRS | HRS |HRS|HRS|HRS|HRS| HRS |HRS|HRS|HRS|HRS|HRS|HRS|HRS|HRS|HRS| HRS"
85LN W !?4,"----------------------------------------------------------------------------------------------------------------------------" Q
86 ;
87N1 ;Get specific records
88 I ZCO'="Y" F CONUM=1:1 Q:CONUM>ZOUT S Y3=$G(^FH(117.1,D1,1,CONUM,0)),Y5=$P(Y3,"^"),Y4=$P(Y3,"^",2,99) Q:COXX=Y5
89 I ZCO="Y" F CONUM=1:1 Q:CONUM>ZOUT S Y3=$G(^FH(117.1,D1,1,CONUM,0)),Y5=$P(Y3,"^"),Y4=$P(Y3,"^",2,99) Q:COUNT=Y5
90 ;
91 S ND=ND+1,SSND=SSND+1
92 S DTP=D1 D DTP^FH D:$Y>(IOSL-8) HDR
93 K N F L=1:1:20 S N(L)=$P(Y4,"^",L)
94 S N(20)=N(1)-N(2)-N(3)-N(4)-N(5),N(21)=N(20)*8
95 S N(22)=N(21)-N(6)-N(7)+N(8)+N(9)+N(10),N(23)=N(22)-N(11)-N(12)-N(13)-N(14)-N(15)+N(16)+N(17)+N(18)+N(19),TOT=TOT+N(9)+N(10),TO1=TO1+N(20),SSTOT=SSTOT+TOT,SSTO1=SSTO1+TO1
96 W !?4,$P("Sun Mon Tue Wed Thu Fri Sat"," ",DOW)," ",$E(DTP,1,6)," "
97 F K=1:1:5,20,21,6:1:10,22,11:1:19,23 S S(K)=S(K)+N(K),X=$P(SIZ," ",K),N(K)=$S('N(K):$J("",$E(X,1)),1:$J(N(K),$E(X,1),$E(X,2))) W "|",N(K)
98 D M1
99 Q
100 ;
101M1 ; Get total Meals
102 ; S Y1=$G(^FH(117,D1,0)) Q:Y1="" I '$D(^FH(117,D1,1)) Q S Y2=$G(^FH(117,D1,1)) Q
103 ;
104 ;I ZCO'="Y" F CONUM=1:1 Q:CONUM>ZOUT S Y1=$G(^FH(117,D1,2,CONUM,1)) S Y0=$G(^FH(117,D1,2,CONUM,0)),Y2=$P(Y0,"^",2,99) Q:COXX=CONUM
105 ;BREAK I ZCO="Y" F CONUM=1:1 Q:CONUM>ZOUT S Y1=$G(^FH(117,D1,2,CONUM,1)) Q:Y1="" S Y0=$G(^FH(117,D1,2,CONUM,0)),Y6=$P(Y0,U,1),Y2=$P(Y0,U,2,99) Q:COUNT=CONUM
106 ;
107 ;S Y1=$G(^FH(117,D1,0)) Q:Y1="" S Y2=$G(^FH(117,D1,1))
108 Q:$G(^FH(117,D1,2,0))="" S Y1=$G(^FH(117,D1,2,CONUM,1)),Y2=$G(^FH(117,D1,2,CONUM,0))
109 K M S K=0 F L=1,2,4,5,7,8 S K=K+1,M(L)=$P(Y1,"^",K)
110 S K=10 F L=2:3:17 S K=K+1,M(K)=$P(Y2,"^",L)+$P(Y2,"^",L+1)+$P(Y2,"^",L+2)
111 S M(3)=M(1)-M(2)*3,M(6)=M(4)-M(5)*3,M(9)=M(7)-M(8)*3
112 S M(10)=M(3)+M(6)+M(9)
113 S M(16)=M(14)+M(15)+M(16),M(13)=M(12)+M(13),M(17)=M(11)+M(13)+M(16),M(18)=M(10)+M(17)
114 S FHTOT=FHTOT+M(18) Q
115 ;
116N2 ;Get Communications Offices
117 S DIC=119.73,DIC(0)="AEQ",DIC("A")="Select Communication Offices: "
118 D ^DIC I (Y=-1)&(CO="") Q
119 I Y=-1 G PRINT Q
120 S CON=$P(Y,"^",1),CO=CON_"^"_CO,CONAM=$P(Y,"^",2),CONAME=CONAM_"^"_CONAME,CONUMX=$L(CO,"^") G N2
121 I Y=-1 K DIC Q
122 Q
123 ;
124KIL G KILL^XUSCLEAN
Note: See TracBrowser for help on using the repository browser.