source: FOIAVistA/trunk/r/DIETETICS-FH/FHADR2.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1FHADR2 ; HISC/NCA/JH - Type of Service ;2/15/95 16:02
2 ;;5.5;DIETETICS;;Jan 28, 2005
3Q1 ; Bedside Tray, Cafeteria, and Dining Room Tray
4 ; Enter/Edit the Type of Service
5 S DP=0 D NOW^%DTC S NOW=%\1 K %
6 D YR^FHADR1 G:'PRE KIL
7 S X=$P($G(^XMB(1,1,"XUS")),"^",17) G:X="" MSG S FHX1=X
8 S ST=$G(^DIC(4,FHX1,0)) Q:ST=""
9 S X1=PRE,X2=-356 D C^%DTC S OLD=$E(X,1,4)_"400"
10 I '$D(^FH(117.3,PRE,0)) D S1^FHADR1 S OLD=PRE D SET^FHADR1 S PRE=OLD G F1
11 S OLD=PRE
12F1 W ! K DIC,DIE S DIE="^FH(117.3,",DA=PRE
13 L +^FH(117.3,PRE,0):0 I '$T W !?5,"Another user is editing this entry." G KIL
14 I '$D(^FH(117.3,PRE,0)) D
15 .S $P(^FH(117.3,PRE,0),"^",1)=PRE,^FH(117.3,"B",PRE,PRE)=""
16 .S Z=$G(^FH(117.3,0)),$P(^FH(117.3,0),"^",3,4)=PRE_"^"_($P(Z,"^",4)+1)
17 .S $P(ZZ,"^",2,12)=$P(ST,"^",7)_"^"_$P($G(^DIC(4,FHX1,"DIV")),"^",1)_"^^^^^^^^^"
18 .S $P(^FH(117.3,PRE,0),"^",2,13)=ZZ
19 .Q
20 S DR="15:17" D ^DIE L -^FH(117.3,PRE,0) K DA,DIC,DIE,DR
21SET ; Set all three quarters with the Type of Service
22 F QTR=2:1:4 S PRE=$E(OLD,1,4)_QTR_"00" D S1
23KIL G KILL^XUSCLEAN
24S1 Q:'$D(^FH(117.3,OLD,0))
25 I '$D(^FH(117.3,PRE,0)) S $P(^FH(117.3,PRE,0),"^",1)=PRE,^FH(117.3,"B",PRE,PRE)="",Z=^FH(117.3,0),$P(^FH(117.3,0),"^",3,4)=PRE_"^"_($P(Z,"^",4)+1)
26 S $P(^FH(117.3,PRE,0),"^",2,16)=$P($G(^FH(117.3,OLD,0)),"^",2,16)
27 Q
28MSG W !!,$C(7)," *** SITE NOT FOUND IN ^XMB GLOBAL ***" G KIL
29EN2 ; Print out the Type of Service
30 D:$Y'<(LIN-10) HDR^FHADRPT,HDR2^FHADR3A
31 W !!!!!,?13,"TYPE OF SERVICE SUMMARY"
32 S (N1,N2,N3,X2,X3)=""
33 W !?65,"Average Daily Meals Served",!?68,"By Type of Service",?93,"% of Workload"
34 S X="" F QR=1:1:4 S QTR=QR,PRE=FHYR_"0"_QTR_"00" S X3=$P($G(^FH(117.3,PRE,0)),"^",14,16) S:"^^"'[X3 X=X3
35 S N1=$P(X,"^",1),N2=$P(X,"^",2),N3=$P(X,"^",3),X2=$P(X,"^",1)+$P(X,"^",2)+$P(X,"^",3)
36 W !,?15,"Bedside Tray",?80 W $J($S(N1:N1,1:""),6),?100,$S(X2:$J(N1/X2*100,6,0),1:$J("",6))
37 W !?15,"Cafeteria",?80 W $J($S(N2:N2,1:""),6),?100,$S(X2:$J(N2/X2*100,6,0),1:$J("",6))
38 W !?15,"Dining Room Tray",?80 W $J($S(N3:N3,1:""),6),?100,$S(X2:$J(N3/X2*100,6,0),1:$J("",6))
39 W !,?15,"Total",?80 W $J($S(X2:X2,1:""),6)
40 K N1,N2,N3,X2,X3 Q
Note: See TracBrowser for help on using the repository browser.