source: FOIAVistA/tag/r/DIETETICS-FH/FHMADM2.m@ 1251

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1FHMADM2 ; HISC/AAC - Multidivisional Enter/Edit Served Meals ;10/9/03 09:53
2 ;;5.5;DIETETICS;;Jan 28, 2005
3EN1 ; Enter/Edit Served Meals
4 D NOW^%DTC S DT=%\1 K %,%H,%I
5 S (ZZOUT,COMM)=0,ZOUT=$P($G(^FH(119.6,0)),"^",4)
6 ;
7E1 S %DT="AEPX",%DT("A")="SERVED MEALS Date: " W ! D ^%DT G KIL^FHMADM21:"^"[X!$D(DTOUT),E1:Y<1
8 ;
9 S DA=+Y,(FHRM,FHSM,FHGM)=DA I DA'<DT W *7,!!,"** Input must be for a date before today in order to collect ADT data!",! G E1
10 ;
11 ;Enter Communications Office
12 K DIC,DIE S DIE="^FH(117," I '$D(^FH(117,DA,0)) S ^FH(117,DA,0)=DA,^FH(117,"B",DA,DA)="",X0=^FH(117,0),$P(^FH(117,0),"^",3,4)=DA_"^"_($P(X0,"^",4)+1)
13 S DA=+Y I $G(^FH(117,DA,"I"))="Y" W !," ** INACTIVE COMM OFFICE **" Q
14 S ^FH(117,DA,0)=DA
15 S DR="[FHMADM2]" D ^DIE
16 Q
17 ;
18C1 ;
19 K FHN W !!,"Calculating Census Values ...",!
20 F W1=0:0 S W1=$O(^DG(41.9,W1)) Q:W1'>0 D C2
21 W !,"Calculating Outpatient Values ...",! D CALCOP
22 Q
23C2 ;
24 I '$D(^DG(41.9,W1,"C",DA(1))) Q
25 S X0=^DG(41.9,W1,"C",DA(1),0),X1=$G(^(1)) I $D(^DIC(42,W1,0)) S FHWARD=$O(^FH(119.6,"AW",W1,"")) Q:FHWARD=""
26 S FHCOM19=$P($G(^FH(119.6,FHWARD,0)),"^",8) Q:FHCOMM'=FHCOM19
27 S TYP=$P(^DIC(42,W1,0),"^",3),TYP=$S(TYP="D":"D",TYP="NH":"N",1:"H")
28 I '$D(FHN(TYP)) S FHN(TYP,0)=0,FHN(TYP,1)=0
29 S Y0=$P(X0,"^",2),Y1=$P(X1,"^",5)
30 S:Y0 FHN(TYP,0)=FHN(TYP,0)+Y0 S:Y1 FHN(TYP,1)=FHN(TYP,1)+Y1 Q
31 Q
32DT ; Get From/To Dates
33D1 S %DT="AEPX",%DT("A")="Starting Date: " W ! D ^%DT S:$D(DTOUT) X="^" Q:U[X G:Y<1 D1 S SDT=+Y
34 I SDT'<DT W *7," [Must Start before Today!] " G D1
35D2 S %DT="AEPX",%DT("A")=" Ending Date: " D ^%DT S:$D(DTOUT) X="^" Q:U[X G:Y<1 D2 S EDT=+Y
36 I EDT'<DT W *7," [Must End before Today!] " G D2
37 I EDT<SDT W *7," [End before Start?] " G D1
38 Q
39CALCOP ; Calculate Outpatient totals (Recurring and Special Meals) for the
40 ; selected Communication Office
41 ;
42 K FHOPC S FHEND=FHRM_.9999,X1=FHRM,X2=-1 D C^%DTC S FHRM=X
43 F IX="B","N","E" S FHOPC(IX)=0 F FC="E","G","O","P","V" S FHOPC(FC,IX)=0
44 ; Count recurring meals totals in FHOPC(INDX)
45 F FHRM=FHRM:0 S FHRM=$O(^FHPT("RM",FHRM)) Q:FHRM=""!(FHRM'<FHEND) D
46 .F FHDFN=0:0 S FHDFN=$O(^FHPT("RM",FHRM,FHDFN)) Q:FHDFN="" D
47 ..F FHRNUM=0:0 S FHRNUM=$O(^FHPT("RM",FHRM,FHDFN,FHRNUM)) Q:FHRNUM="" D
48 ...S FHLOC=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,3)
49 ...I $P($G(^FH(119.6,FHLOC,0)),U,8)'=FHCOMM Q
50 ...S FHMEAL=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,4)
51 ...Q:"BNE"'[FHMEAL!(FHMEAL="")
52 ...I $P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,15)="C" Q
53 ...S FHOPC(FHMEAL)=FHOPC(FHMEAL)+1
54 ; Add special meals to recurring meals totals in FHOPC(INDX)
55 F FHSM=FHSM:0 S FHSM=$O(^FHPT("SM",FHSM)) Q:FHSM>FHEND!(FHSM="") D
56 .F FHDFN=0:0 S FHDFN=$O(^FHPT("SM",FHSM,FHDFN)) Q:FHDFN'>0 D
57 ..S FHLOC=$P($G(^FHPT(FHDFN,"SM",FHSM,0)),U,3)
58 ..I $P($G(^FH(119.6,FHLOC,0)),U,8)'=FHCOMM Q
59 ..S FHMEAL=$P($G(^FHPT(FHDFN,"SM",FHSM,0)),U,9)
60 ..Q:"BNE"'[FHMEAL!(FHMEAL="")
61 ..S FHOPC(FHMEAL)=FHOPC(FHMEAL)+1
62 ; Calculate Employee, Paid, OOD, Grat and Volunteer totals (Guest Meals)
63 F FHGM=FHGM:0 S FHGM=$O(^FHPT("GM",FHGM)) Q:FHGM>FHEND!(FHGM="") D
64 .F FHDFN=0:0 S FHDFN=$O(^FHPT("GM",FHGM,FHDFN)) Q:FHDFN'>0 D
65 ..S FHLOC=$P($G(^FHPT(FHDFN,"GM",FHGM,0)),U,5)
66 ..I $P($G(^FH(119.6,FHLOC,0)),U,8)'=FHCOMM Q
67 ..S FHCLASS=$P($G(^FHPT(FHDFN,"GM",FHGM,0)),U,2)
68 ..Q:"EGOPV"'[FHCLASS!(FHCLASS="")
69 ..S FHMEAL=$P($G(^FHPT(FHDFN,"GM",FHGM,0)),U,3)
70 ..Q:"BNE"'[FHMEAL!(FHMEAL="")
71 ..S FHOPC(FHCLASS,FHMEAL)=FHOPC(FHCLASS,FHMEAL)+1
72 Q
Note: See TracBrowser for help on using the repository browser.