source: FOIAVistA/tag/r/DIETETICS-FH/FHOMGR1.m@ 949

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1FHOMGR1 ;Hines OIFO/RTK GUEST MEALS REQUEST MEAL ;4/17/03 09:45
2 ;;5.5;DIETETICS;**5**;Jan 28, 2005;Build 53
3 ;
4 D NOW^%DTC S STDT=X,FHDSDT=$$FMTE^XLFDT(STDT,"P") W !!,FHDSDT
5 S FHMSG1="G" D ^FHOMDPA I FHDFN="" Q
6 I '$D(^FHPT(FHDFN,0)) W !!,"UNKNOWN SELECTION !" Q
7CLASS ;Prompt for classification
8 W ! K DIR,DIC S DIR("A")="Select Classification: "
9 S DIR(0)="SAO^E:Employee;G:Gratuitous;O:OOD;P:Paid;V:Volunteer"
10 D ^DIR I $D(DIRUT) D EXMSG^FHOMUTL Q
11 I Y'=-1 S FHCLASS=Y
12LOC ;Prompt for location
13 D OUTLOC^FHOMUTL I FHLOC="" D EXMSG^FHOMUTL Q
14 W ! D RMBED^FHOMUTL
15 S FHCOMM=$P($G(^FH(119.6,FHLOC,0)),U,8)
16MEAL ;Prompt for meal
17 K DIR,DIC S DIR("A")="Select Meal: "
18 S DIR(0)="SAO^B:Breakfast;N:Noon;E:Evening"
19 D ^DIR I $D(DIRUT) D EXMSG^FHOMUTL Q
20 I Y'=-1 S FHMEAL=Y
21DIET ;Stuff diet
22 S FHDIET=$P($G(^FH(119.9,1,0)),U,2)
23 I FHDIET="" W !!,"NO DEFAULT OUTPATIENT DIET SET!!",! Q
24CHARGE ;Get charge
25 S FHCHAR=""
26 S F=$S(FHCLASS="E":12,FHCLASS="P":13,FHCLASS="O":14,FHCLASS="V":15,1:16)
27 S FHYN=$P($G(^FH(119.9,1,0)),U,F) I FHYN'="Y" W ! D SET1 Q
28 S F=$S(FHCLASS="E":21,FHCLASS="P":24,FHCLASS="O":27,FHCLASS="V":30,1:33)
29 S FHP=F+$S(FHMEAL="B":0,FHMEAL="N":1,1:2)
30 S FHCHAR=$P($G(^FH(119.9,1,0)),U,FHP)
31 W !!,"Payment amount = $",FHCHAR,!
32SET1 K DIR S DIR("A")="Is this correct?: ",DIR(0)="YA",DIR("B")="Y" D ^DIR
33 S CONT=Y I CONT'=1 D EXMSG^FHOMUTL Q
34 S FHGML=1 D SMGM^FHOMRO2 I SKIP=1 Q
35SETNODE ;
36 S MLT=$S(FHMEAL="B":".08",FHMEAL="N":".13",1:".18")
37 S STDTIM=STDT_MLT
38 I $D(^FHPT(FHDFN,"GM","B",STDTIM)),$P($G(^FHPT(FHDFN,"GM",STDTIM,0)),U,9)'="C" D MESSAGE Q
39 S DA(1)=FHDFN,DA=STDTIM,DIK="^FHPT("_DA(1)_",""GM""," D ^DIK ;delete if there is a previous canceled GM for this date/meal
40 S Y=STDTIM K DIC,DO S DA(1)=FHDFN,DIC="^FHPT("_DA(1)_",""GM"","
41 S DIC(0)="L",DIC("P")=$P(^DD(115,18,0),U,2),X=+Y,DINUM=X
42 D FILE^DICN I Y=-1 Q
43 K DIE S DA(1)=FHDFN,DIE="^FHPT("_DA(1)_",""GM"","
44 S DA=+Y,FHDA=DA
45 S DR="1////^S X=FHCLASS;2////^S X=FHMEAL;3////^S X=FHCHAR;4////^S X=FHLOC;4.5////^S X=FHRMBD;5////^S X=FHDIET"
46 D ^DIE,OKMSG^FHOMUTL
47 S FHZN=$G(^FHPT(FHDFN,"GM",FHDA,0))
48 S FHACT="O",FHOPTY="G",FHOPDT=STDT D SETGM^FHOMRO2 ;set event
49 Q
50MESSAGE ;
51 D PATNAME^FHOMUTL S FHPREDT=$$FMTE^XLFDT(STDT,"P")
52 W !!?3,FHPTNM," ALREADY HAS A "
53 W $S(FHMEAL="B":"BREAKFAST",FHMEAL="N":"NOON",1:"EVENING")
54 W " GUEST MEAL ORDERED FOR ",FHPREDT
55 Q
Note: See TracBrowser for help on using the repository browser.