source: WorldVistAEHR/trunk/r/DIETETICS-FH/FHADM21.m@ 1036

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

initial load of WorldVistAEHR

File size: 2.8 KB
RevLine 
[613]1FHADM21 ; HISC/REL/NCA - Served Meals Report ;1/23/98 16:07
2 ;;5.5;DIETETICS;;Jan 28, 2005
3EN2 ; Print Meals Report
4 ; Check for multidivisional site
5 I $P($G(^FH(119.9,1,0)),U,20)'="N" D ^FHMADM21 Q
6 D NOW^%DTC S DT=%\1 D DT^FHADM2 G:"^"[X KIL
7 W !!,"The report requires a 132 column printer.",!
8 K IOP,%ZIS S %ZIS("A")="Print on Device: ",%ZIS="MQ" W ! D ^%ZIS K %ZIS,IOP G:POP KIL
9 I $D(IO("Q")) S FHPGM="Q1^FHADM21",FHLST="EDT^SDT" D EN2^FH G KIL
10 U IO D Q1 D ^%ZISC K %ZIS,IOP G KIL
11Q1 S DTP=SDT\1 D DTP^FH S DTE=DTP_" to " S DTP=EDT\1 D DTP^FH S DTE=DTE_DTP
12 S X=SDT D DOW^%DTC S DOW=Y+1
13 D NOW^%DTC S DTP=% D DTP^FH S HDT=DTP,PG=0 D HDR
14 K S F K=1:1:21 S S(K)=0
15 S D1=SDT,(ND,TD)=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
16 F K=1:1:18 S N(K)=$J($S(ND:S(K)/ND,1:0),0,0),N(K)=$J($S(N(K)<1:"",1:N(K)),5)_" ",S(K)=$S(S(K)<1:$J("",6),S(K)<100000:$J(S(K),5)_" ",1:$J(S(K),6))
17 F K=19:1:21 S N(K)=$J($S(TD:S(K)/TD,1:0),0,0),N(K)=$J($S(N(K)<1:"",1:N(K)),5)_" ",S(K)=$S(S(K)<1:$J("",6),S(K)<100000:$J(S(K),5)_" ",1:$J(S(K),6))
18 D LN W !?4,"Total",?15,"|",S(1),S(2),S(3),"|",S(4),S(5),S(6),"|",S(7),S(8),S(9),"|",S(10),"|",S(11),S(13),S(16),"|",S(17),"|",S(18),"|",S(19),S(20),S(21),!
19 W:ND ?4,"Avg. ",?15,"|",N(1),N(2),N(3),"|",N(4),N(5),N(6),"|",N(7),N(8),N(9),"|",N(10),"|",N(11),N(13),N(16),"|",N(17),"|",N(18),"|",N(19),N(20),N(21),!
20 Q
21HDR W:'($E(IOST,1,2)'="C-"&'PG) @IOF S PG=PG+1 W !,HDT,?44,"S E R V E D M E A L S W O R K S H E E T",?125,"Page ",PG
22 W !!?(131-$L(DTE)\2),DTE
23 W !!,?15,"|",?32,"MEALS SERVED ON INPATIENT BASIS",?79,"|",?82,"MEALS SERVED TO OTHERS",?105,"| TOTAL| SERVED TRAYS DATA"
24 W !,?15,"|",?19,"DOMICILIARY",?34,"| NURSING HOME CU",?53,"|",?59,"HOSPITAL",?72,"| TOTAL|",?98,"| TOTAL| MEALS|"
25 W !,?15,"| Inp. Abs. Meal| Inp. Abs. Meal| Inp. Abs. Meal| | Outp. Paid Grat.| | | Cafe NPO Trays"
26 W !,?15,"| A B C | D E F | G H I | J | K M Q | | R | T U V"
27LN W ! F K=1:1:131 W "-"
28 Q
29N1 S Y0=$G(^FH(117,D1,0)),Y1=$G(^(1))
30 K N S K=1 F L=1,2,4,5,7,8 S K=K+1,N(L)=$P(Y0,"^",K)
31 S K=10 F L=1:3:16 S K=K+1,N(K)=$P(Y1,"^",L)+$P(Y1,"^",L+1)+$P(Y1,"^",L+2)
32 S N(19)=$P(Y1,"^",19),N(20)=$P(Y1,"^",20)
33 S N(3)=N(1)-N(2)*3,N(6)=N(4)-N(5)*3,N(9)=N(7)-N(8)*3,N(10)=N(3)+N(6)+N(9)
34 S N(16)=N(14)+N(15)+N(16),N(13)=N(12)+N(13),N(17)=N(11)+N(13)+N(16),N(18)=N(10)+N(17),N(19)=N(19)+N(17),N(21)=N(18)-N(19)-N(20) S:N(18) ND=ND+1 S:N(20) TD=TD+1
35 F K=1:1:21 S S(K)=S(K)+N(K)
36 F K=1:1:21 S N(K)=$J($S(N(K)<1:"",1:N(K)),5)_" "
37 S DTP=D1 D DTP^FH D:$Y>(IOSL-8) HDR
38 W !,$P("Sun Mon Tue Wed Thu Fri Sat"," ",DOW)," ",DTP
39 W ?15,"|",N(1),N(2),N(3),"|",N(4),N(5),N(6),"|",N(7),N(8),N(9),"|",N(10),"|",N(11),N(13),N(16),"|",N(17),"|",N(18),"|",N(19),N(20),N(21) Q
40KIL ; Kill all used Variables
41 G KILL^XUSCLEAN
Note: See TracBrowser for help on using the repository browser.