source: WorldVistAEHR/trunk/r/DIETETICS-FH/FHOMPP.m@ 1211

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

revised back to 6/30/08 version

File size: 3.5 KB
RevLine 
[623]1FHOMPP ; OIFO/RTK - Patient Profile for Outpatients ;6/23/03 1:04
2 ;;5.5;DIETETICS;;Jan 28, 2005
3 D DEV Q
4DEV ;get device and set up queue
5 W ! K %ZIS,IOP S %ZIS="Q" D ^%ZIS Q:POP
6 I '$D(IO("Q")) U IO D DISP,^%ZISC,END Q
7 S ZTRTN="DISP^FHOMPP"
8 S ZTSAVE("FHDFN")=""
9 S ZTDESC="Outpatient Meals Recurring Meals Display" D ^%ZTLOAD
10 D ^%ZISC K %ZIS,IOP
11 D END Q
12DISP ;
13 S EX="" D HDR
14 D ALG^FHCLN I ALG'="" W !!,"Allergies: ",ALG
15 K ^TMP($J) F FHFP=0:0 S FHFP=$O(^FHPT(FHDFN,"P",FHFP)) Q:FHFP'>0 D
16 .S FHFPZN=$G(^FHPT(FHDFN,"P",FHFP,0))
17 .S FHFPIEN=$P(FHFPZN,U,1),FHMEAL=$P(FHFPZN,U,2),FHQTY=$P(FHFPZN,U,3)
18 .Q:FHFPIEN=""
19 .S FHNORD=$S($L(FHMEAL)=3:1,$E(FHMEAL)="B":2,$E(FHMEAL)="N":3,1:4)
20 .S FHMEAL=FHNORD_FHMEAL
21 .S FHFPLD=$P($G(^FH(115.2,FHFPIEN,0)),U,2) Q:FHFPLD=""
22 .S FHFPNM=$P($G(^FH(115.2,FHFPIEN,0)),U,1) Q:FHFPNM=""
23 .S ^TMP($J,FHFPLD,FHMEAL,FHFPIEN)=FHQTY_" "_FHFPNM
24 .Q
25 W !!,"Food Preferences Currently on file: "
26 I $D(^TMP($J,"L")) W !!?20,"Likes"
27 S FHM="" F S FHM=$O(^TMP($J,"L",FHM)) Q:FHM=""!(EX=U) D
28 .F FHP=0:0 S FHP=$O(^TMP($J,"L",FHM,FHP)) Q:FHP'>0 W !!,^TMP($J,"L",FHM,FHP) I $Y>(IOSL-4) D PG I EX=U Q
29 I $D(^TMP($J,"D")) W !!?20,"Dislikes"
30 S FHM="" F S FHM=$O(^TMP($J,"D",FHM)) Q:FHM=""!(EX=U) D
31 .F FHP=0:0 S FHP=$O(^TMP($J,"D",FHM,FHP)) Q:FHP'>0 W !!,^TMP($J,"D",FHM,FHP) I $Y>(IOSL-4) D PG I EX=U Q
32 ;
33 S FHIPX=$P($G(^FHPT(FHDFN,0)),U,5) I FHIPX'="" W !!,"Isolation/Precaution type is ",$P($G(^FH(119.4,FHIPX,0)),"^",1) I $Y>(IOSL-4) D PG I EX=U Q
34 W !!,"Recurring Meals on File: " I $Y>(IOSL-4) D PG I EX=U Q
35 W ! S STDT=DT S FHPP=1 D DISP^FHOMRR1 K FHPP
36 I EX'=U,IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR
37 Q
38PG ;
39 I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y S EX=U Q
40 D HDR Q
41HDR ;
42 W:$Y @IOF
43 W !!,"OUTPATIENT NAME: " D PATNAME^FHOMUTL W FHPTNM," ",FHSSN
44 W ?65,FHSEX," Age ",FHAGE Q
45END ;
46 K FHM,FHP,FHT Q
47 ;
48CPRS ; Call from FHWOR71 to get outpatient profile for CPRS
49 ; Data is returned in ^TMP($J,"FHPROF",DFN,FHX)
50 S FHZ115="P"_DFN D CHECK^FHOMDPA I FHDFN="" Q "-1^Invalid outpatient"
51 K ^TMP($J,"FHPROF",DFN) S (FHX,N)=0 D PATNAME^FHOMUTL
52 S FHB="" F I=1:1:80 S FHB=FHB_" "
53 S ^TMP($J,"FHPROF",DFN,FHX)="OUTPATIENT NAME: "_FHPTNM_" "_FHSSN
54 S FHJ=66 D PAD^FHOMPP1 S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_FHSEX_" Age "_FHAGE
55 D ALG^FHCLN I ALG'="" S N=1 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)="Allergies: "_ALG
56 F FHFP=0:0 S FHFP=$O(^FHPT(FHDFN,"P",FHFP)) Q:FHFP'>0 D
57 .S FHFPZN=$G(^FHPT(FHDFN,"P",FHFP,0))
58 .S FHFPIEN=$P(FHFPZN,U,1),FHMEAL=$P(FHFPZN,U,2),FHQTY=$P(FHFPZN,U,3)
59 .Q:FHFPIEN=""
60 .S FHNORD=$S($L(FHMEAL)=3:1,$E(FHMEAL)="B":2,$E(FHMEAL)="N":3,1:4)
61 .S FHMEAL=FHNORD_FHMEAL
62 .S FHFPLD=$P($G(^FH(115.2,FHFPIEN,0)),U,2) Q:FHFPLD=""
63 .S FHFPNM=$P($G(^FH(115.2,FHFPIEN,0)),U,1) Q:FHFPNM=""
64 .S ^TMP($J,FHFPLD,FHMEAL,FHFPIEN)=FHQTY_" "_FHFPNM
65 .Q
66 S N=1 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)="Food Preferences Currently on file: "
67 I $D(^TMP($J,"L")) S N=1 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)="Likes"
68 S FHM="" F S FHM=$O(^TMP($J,"L",FHM)) Q:FHM="" D
69 .F FHP=0:0 S FHP=$O(^TMP($J,"L",FHM,FHP)) Q:FHP'>0 S N=0 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"L",FHM,FHP) Q
70 I $D(^TMP($J,"D")) S N=1 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)="Dislikes"
71 S FHM="" F S FHM=$O(^TMP($J,"D",FHM)) Q:FHM="" D
72 .F FHP=0:0 S FHP=$O(^TMP($J,"D",FHM,FHP)) Q:FHP'>0 S N=0 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"D",FHM,FHP) Q
73 ;
74 S N=1 D NEWL S ^TMP($J,"FHPROF",DFN,FHX)="Recurring Meals on File: "
75 S STDT=DT D ^FHOMPP1
76 Q
77NEWL ;New line before next line of text in ^TMP global
78 I N=1 S FHX=FHX+1,^TMP($J,"FHPROF",DFN,FHX)=" "
79 S FHX=FHX+1
80 Q
Note: See TracBrowser for help on using the repository browser.