1 | FHORD6 ; HISC/REL/NCA/JH/RTK - Diet Inquiry ;5/3/01 11:04
|
---|
2 | ;;5.5;DIETETICS;**1,5**;Jan 28, 2005;Build 53
|
---|
3 | S FHALL=1 D ^FHOMDPA I 'FHDFN G KIL
|
---|
4 | D MONUM^FHOMUTL I FHNUM="" Q
|
---|
5 | I FHDFN,DFN="" D ^FHOMPP Q ;profile for file #200 outpatients
|
---|
6 | I FHDFN,$G(^DPT(DFN,.1))="" D ^FHOMPP Q ;profile for file #2 outpts
|
---|
7 | K IOP S %ZIS="MQ",%ZIS("B")="HOME" W ! D ^%ZIS K %ZIS,IOP G:POP KIL
|
---|
8 | I $D(IO("Q")) S FHPGM="F0^FHORD6",FHLST="FHDFN^DFN^PID^ADM^FHNUM" D EN2^FH G KIL
|
---|
9 | U IO D F0 D ^%ZISC K %ZIS,IOP G FHORD6
|
---|
10 | F0 ; Display Diet
|
---|
11 | D NOW^%DTC S NOW=%,DT=NOW\1,QT=""
|
---|
12 | S WARD=$P($G(^FHPT(FHDFN,"A",ADM,0)),"^",8) S:WARD WARD=$P($G(^FH(119.6,WARD,0)),"^",1)
|
---|
13 | S Y(0)=^DPT(DFN,0),SEX=$P(Y(0),"^",2),DOB=$P(Y(0),"^",3)
|
---|
14 | S AGE=$E(NOW,1,3)-$E(DOB,1,3)-($E(NOW,4,7)<$E(DOB,4,7)),X=$P($G(^DPT(DFN,.101)),"^",1),RM=$E(WARD,1,15) S:X'="" RM=RM_"/"_X
|
---|
15 | S QT="",PG=0 D HDR
|
---|
16 | D ALG^FHCLN I ALG'="" W !!,"Allergies: ",ALG
|
---|
17 | K N S P1=1 F K=0:0 S K=$O(^FHPT(FHDFN,"P",K)) Q:K<1 S X=^(K,0),M=$P(X,"^",2) S:M="A" M="BNE" D SP
|
---|
18 | I $O(N(""))="" W !!,"No Food Preferences on file",! G A0
|
---|
19 | W !!,"Food Preferences Currently on file",!!?23,"Likes",?57,"Dislikes",!
|
---|
20 | W ! S (M,MM)="" F S M=$O(N(M)) Q:M="" I $D(N(M)) W $P(M,"~",2) D Q:QT="^" S MM=M ;P32
|
---|
21 | . S (P1,P2)=0 F S:P1'="" P1=$O(N(M,"L",P1)) S X1=$S(P1>0:N(M,"L",P1),1:"") S:P2'="" P2=$O(N(M,"D",P2)) S X2=$S(P2>0:N(M,"D",P2),1:"") Q:P1=""&(P2="") D W0 Q:QT="^" W:MM'=M ! ;P32
|
---|
22 | . Q
|
---|
23 | W ! K L,N,M,M1,M2
|
---|
24 | G:QT="^" KIL ;P32
|
---|
25 | A0 S X(0)=^FHPT(FHDFN,"A",ADM,0),X=$P(X(0),"^",10) G:X="" F1
|
---|
26 | D:$Y>(IOSL-3) HDR G:QT="^" KIL W !!,"Isolation/Precaution Type is ",$P($G(^FH(119.4,X,0)),"^",1)
|
---|
27 | F1 D CUR^FHORD7 D:$Y>(IOSL-6) HDR G:QT="^" KIL W !!,"Current Diet: ",$S(Y'="":Y,1:"No current order")
|
---|
28 | I Y'="",FHORD>0 I $D(^FHPT(FHDFN,"A",ADM,"DI",FHORD,1)) S COM=^(1) W:COM'="" !,"Comment: ",COM
|
---|
29 | S TYP=$P(X,"^",8) I TYP'="" W !,"Service: ",$S(TYP="T":"Tray",TYP="D":"Dining Room",1:"Cafeteria")
|
---|
30 | S DTP=$P(X(0),"^",3) I DTP D DTP^FH W !,"Expires: ",DTP
|
---|
31 | S TF=$P(X(0),"^",4) G:TF<1 F2
|
---|
32 | S Y=^FHPT(FHDFN,"A",ADM,"TF",TF,0)
|
---|
33 | S DTP=$P(Y,"^",1),COM=$P(Y,"^",5),TQU=$P(Y,"^",6),CAL=$P(Y,"^",7)
|
---|
34 | D DTP^FH W !!,"Tubefeed Ordered: ",DTP
|
---|
35 | F TF2=0:0 S TF2=$O(^FHPT(FHDFN,"A",ADM,"TF",TF,"P",TF2)) Q:TF2<1 S XY=^(TF2,0) D LP
|
---|
36 | W !,"Total Quantity: ",TQU," ml",?42,"Total KCAL: ",CAL
|
---|
37 | W:COM'="" !,"Comment: ",COM
|
---|
38 | F2 S NO=$P(X(0),"^",7),Y=$S('NO:"",1:^FHPT(FHDFN,"A",ADM,"SF",NO,0)) D:$Y>(IOSL-3) HDR G:QT="^" KIL
|
---|
39 | S L=$P(Y,"^",4) W !!,"Supplemental Feeding: ",$S('L:"No Order",1:$P(^FH(118.1,L,0),"^",1)) G:'NO F3
|
---|
40 | S DTP=$P(Y,"^",30) D DTP^FH W ?50,"Reviewed: ",DTP
|
---|
41 | S L=4 F K1=1:1:3 S K=0,N(K1)="" F K2=1:1:4 S Z=$P(Y,U,L+1),Q=$P(Y,U,L+2),L=L+2 I Z'="" S:'Q Q=1 S:N(K1)'="" N(K1)=N(K1)_"; " S N(K1)=N(K1)_Q_" "_$P(^FH(118,Z,0),"^",1)
|
---|
42 | D:$Y>(IOSL-4) HDR G:QT="^" KIL F K1=1:1:3 I N(K1)'="" W !?5,$P("10am; 2pm; 8pm",";",K1),":",?13,N(K1)
|
---|
43 | F3 G ^FHORD61
|
---|
44 | LP S TUN=$P(XY,"^",1),STR=$P(XY,"^",2),QUA=$P(XY,"^",3)
|
---|
45 | I QUA["CC" S QUAFI=$P(QUA,"CC",1),QUASE=$P(QUA,"CC",2),QUA=QUAFI_"ML"_QUASE
|
---|
46 | W !,"Product: ",$P($G(^FH(118.2,TUN,0)),"^",1),", ",$S(STR=4:"Full",STR=1:"1/4",STR=2:"1/2",1:"3/4")," Str., ",QUA Q
|
---|
47 | SP S Z=$G(^FH(115.2,+X,0)),L1=$P(Z,"^",1),KK=$P(Z,"^",2),M1="",DAS=$P(X,"^",4)
|
---|
48 | I KK="L" S Q=$P(X,"^",3),L1=$S(Q:Q,1:1)_" "_L1
|
---|
49 | I M="BNE" S M1="1~All Meals" G SP1
|
---|
50 | S Z1=$E(M,1) I Z1'="" S M1=$S(Z1="B":"2~Break",Z1="N":"3~Noon",1:"4~Even")
|
---|
51 | S Z1=$E(M,2) I Z1'="" S M1=M1_","_$S(Z1="B":"Break",Z1="N":"Noon",1:"Even")
|
---|
52 | SP1 S:'$D(N(M1,KK,P1)) N(M1,KK,P1)="" I $L(N(M1,KK,P1))+$L(L1)<255 S N(M1,KK,P1)=N(M1,KK,P1)_$S(N(M1,KK,P1)="":"",1:", ")_L1_$S(DAS="Y":" (D)",1:"")
|
---|
53 | E S:'$D(N(M1,KK,K)) N(M1,KK,K)="" S N(M1,KK,K)=L1_$S(DAS="Y":" (D)",1:"") S P1=K
|
---|
54 | Q
|
---|
55 | W0 I X1'="" W ?12 S X=X1 D W1 S X1=X
|
---|
56 | I X2'="" W ?46 S X=X2 D W1 S X2=X
|
---|
57 | Q:X1=""&(X2="") D:$Y'<(IOSL-2) HDR Q:QT="^" W ! G W0 ;P32
|
---|
58 | W1 I $L(X)<34 W X S X="" Q
|
---|
59 | F KK=35:-1:1 Q:$E(X,KK-1,KK)=", "
|
---|
60 | W $E(X,1,KK-2) S X=$E(X,KK+1,999) Q
|
---|
61 | PAUSE ; Pause For Scroll
|
---|
62 | I $E(IOST,1,2)="C-",PG R !!,"Press return to continue ",YN:DTIME S:'$T!(YN["^") QT="^" Q:QT="^" I "^"'[YN W !,"Enter a RETURN to Continue." G PAUSE
|
---|
63 | Q
|
---|
64 | HDR ; Print Header
|
---|
65 | D PAUSE Q:QT="^"
|
---|
66 | W:'($E(IOST,1,2)'="C-"&'PG) @IOF S PG=PG+1
|
---|
67 | W !,PID,?16,$P(Y(0),"^",1),?48,SEX," Age ",AGE,?(79-$L(RM)),RM Q
|
---|
68 | KIL ; Final variable kill
|
---|
69 | K %,%H,%I,%T,%ZIS,A1,ADM,AGE,ALG,ALL,BAG,C,CAL,COM,CON,CT,D3,DA,DAS,FHDU,FHDFN,DFN,DOB,DTP,FHOR,FHLD,I,IOP,K,K1,K2,KK,L,L1,LST,MEAL,N,NO,NOW,FHORD,FHWF,FHPV
|
---|
70 | K POP,Q,QUA,QT,QTY,RM,SEX,PID,BID,STR,TYP,TF,TF2,TIM,TQU,TUN,WARD,X,X1,X2,XY,Y,YN,Z,Z1 Q
|
---|