source: WorldVistAEHR/trunk/r/DIETETICS-FH/FHWOR7.m@ 619

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1FHWOR7 ; HISC/NCA - OE/RR Procedure Call ;2/17/95 10:28
2 ;;5.5;DIETETICS;;Jan 28, 2005
3EN1 ; OE/RR passes the Patient DFN and the information is stored in ^TMP
4 K ^TMP($J,"FHTF"),^TMP($J,"FHSF"),^TMP($J,"FHPF")
5 S FHZ115="P"_DFN D CHECK^FHOMDPA I FHDFN="" Q
6 S FHWRD=$G(^DPT(DFN,.1)) G:FHWRD="" KIL
7 S FHADM=$G(^DPT("CN",FHWRD,DFN)) G:FHADM<1 KIL
8 I '$D(^FHPT(FHDFN,"A",FHADM,0)) G KIL
9SF ; Get Current Supplemental Feeding order and store in ^TMP($J,"FHSF",1).
10 ; The information is stored in the following:
11 ;
12 ; ^TMP($J,"FHSF",1)=DATE ORDERED_"^"_10am fdg_"^"_2pm fdg_"^"_8pm fdg
13 ; Under each feeding it is stored as Quantity_" "_fdg name 1_";"_
14 ; Quantity_" "_fdg name 2... up to 4.
15 S FHNO=$P($G(^FHPT(FHDFN,"A",FHADM,0)),"^",7) G:'FHNO TF
16 S FHX=$G(^FHPT(FHDFN,"A",FHADM,"SF",FHNO,0)),FHX1=$P(FHX,"^",2)
17 S FHL=4 F FHK1=1:1:3 S FHN(FHK1)="" F FHK2=1:1:4 S FHX2=$P(FHX,"^",FHL+1),FHX3=$P(FHX,"^",FHL+2),FHL=FHL+2 I FHX2 S:FHN(FHK1)'="" FHN(FHK1)=FHN(FHK1)_";" S FHN(FHK1)=FHN(FHK1)_$S(FHX3:FHX3,1:1)_" "_$P($G(^FH(118,FHX2,0)),"^",1)
18 S FHX=FHX1_"^"_FHN(1)_"^"_FHN(2)_"^"_FHN(3)
19 S ^TMP($J,"FHSF",1)=FHX
20TF ; Get Tubefeeding total Kcal/Day and store in ^TMP($J,"FHTF",1).
21 S FHNO=$P($G(^FHPT(FHDFN,"A",FHADM,0)),"^",4) G:'FHNO FP
22 S FHX=$G(^FHPT(FHDFN,"A",FHADM,"TF",FHNO,0)) S FHX=$P(FHX,"^",7)
23 S ^TMP($J,"FHTF",1)=FHX
24FP ; Get Food Preferences and store all Likes in ^TMP($J,"FHFP","L")
25 ; and all Dislikes in ^TMP($J,"FHFP","D"). The information is store
26 ; in the following:
27 ;
28 ; ^TMP($J,"FHFP","L",1)=Quantity_" "_Food Preference name_"^"_Meal
29 ; ^TMP($J,"FHFP","D",1)=Food Preference name_"^"_Meals.
30 S (FHD,FHL)=0 F FHNO=0:0 S FHNO=$O(^FHPT(FHDFN,"P",FHNO)) Q:FHNO<1 S FHX=$G(^(FHNO,0)) D SP
31 G KIL
32SP S FHZ=$G(^FH(115.2,+FHX,0))
33 I $P(FHZ,"^",2)="L" S FHL=FHL+1,^TMP($J,"FHFP","L",FHL)=$S($P(FHX,"^",3):$P(FHX,"^",3),1:1)_" "_$P(FHZ,"^",1)_"^"_$P(FHX,"^",2) Q
34 E S FHD=FHD+1,^TMP($J,"FHFP","D",FHD)=$P(FHZ,"^",1)_"^"_$P(FHX,"^",2)
35 Q
36KIL K FHADM,FHD,FHK1,FHK2,FHL,FHN,FHNO,FHX,FHX1,FHX2,FHX3,FHWRD,FHZ Q
Note: See TracBrowser for help on using the repository browser.