source: WorldVistAEHR/trunk/r/DIETETICS-FH/FHWORI.m@ 846

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1FHWORI ; HISC/NCA - Initial Master File Population ;10/1/96 13:12
2 ;;5.5;DIETETICS;;Jan 28, 2005
3DO ; Code Diet Order
4 S PKG=$O(^DIC(9.4,"C","FH",0)) Q:'PKG
5 S VER=$P($G(^DIC(9.4,PKG,22,0)),"^",3) Q:'VER
6 S VER=+$G(^DIC(9.4,PKG,22,VER,0))
7 K ^TMP($J,"FHUPD"),MSG
8 S FILE="111",FILNM=$P($G(^FH(111,0)),"^",1),EVENT="REP",ACT="MAD"
9 F IEN=0:0 S IEN=$O(^FH(111,IEN)) Q:IEN<1 S X=$G(^(IEN,0)) S:$G(^("I"))="Y" ^TMP($J,"FHUPD",IEN)="" D CODE,D1
10 K ACT,EVENT,FHK,FILE,FILNM,IEN,IEN1,NAM,N1,N2,PREC,SYN,SYN1,X
11TF ; Code Tubefeeding
12 K ^TMP($J,"FHUPT")
13 S FILE="118.2",FILNM=$P($G(^FH(118.2,0)),"^",1),EVENT="REP",ACT="MAD" D CODE
14 F IEN=0:0 S IEN=$O(^FH(118.2,IEN)) Q:IEN<1 S X=$G(^(IEN,0)) S:$G(^("I"))="Y" ^TMP($J,"FHUPT",IEN)="" D CODE,T1
15 K ACT,EVENT,FILE,FILNM,IEN,IEN1,NAM,N1,N2,PKG,SYN,VER,X
16INACTD ; Code Update Inactive Diet Orders
17 G:'$D(^TMP($J,"FHUPD")) INACTT
18 S FILE="111",FILNM=$P($G(^FH(111,0)),"^",1),EVENT="UPD",ACT="MDC" D CODE
19 F IEN=0:0 S IEN=$O(^TMP($J,"FHUPD",IEN)) Q:IEN<1 S X=$G(^FH(111,IEN,0)) D CODE,D1
20 K ^TMP($J,"FHUPD"),ACT,EVENT,FILE,FILNM,IEN,NAM,N1,N2,PREC,SYN,X
21INACTT ; Code Update Inactive Tubefeedings
22 Q:'$D(^TMP($J,"FHUPT"))
23 S FILE="118.2",FILNM=$P($G(^FH(118.2,0)),"^",1),EVENT="UPD",ACT="MDC" D CODE
24 F IEN=0:0 S IEN=$O(^TMP($J,"FHUPT",IEN)) Q:IEN<1 S X=$G(^FH(118.2,IEN,0)) D CODE,T1
25 K ^TMP($J,"FHUPT"),ACT,EVENT,FILE,FILNM,IEN,IEN1,NAM,N1,N2,SYN,X
26 Q
27CODE ; Code MSH for Orderable Items
28 S N1=1
29 S MSG(N1)="MSH|^~\&|DIETETICS|"_^DD("SITE",1)_"|||||MFN"
30 ; code MFI
31 S N1=N1+1
32 S MSG(N1)="MFI|"_FILE_"^"_FILNM_"^99DD||"_EVENT_"|||NE"
33 Q
34D1 ; Code MFE, ZFH, and ZSY for Diet Orders
35 S NAM=$P(X,"^",1) Q:NAM="" S PREC=$P(X,"^",4) Q:'PREC
36 S SYN=$P(X,"^",2),N1=N1+1
37 S MSG(N1)="MFE|"_ACT_"|||^^^"_IEN_"^"_NAM_"^99FHD"
38 S N1=N1+1,MSG(N1)="ZFH|D|"_PREC_"||"_$P(X,"^",3)
39 S FHK=0 F IEN1=0:0 S IEN1=$O(^FH(111,IEN,"AN",IEN1)) Q:IEN1<1 S SYN1=$G(^(IEN1,0)) D
40 .S FHK=IEN1,SYN1=$P(SYN1,"^",1) Q:SYN1="" S N1=N1+1
41 .S MSG(N1)="ZSY|"_IEN1_"|"_SYN1 Q
42 I SYN'="" S N1=N1+1,MSG(N1)="ZSY|"_(FHK+1)_"|"_SYN
43 D SEND
44 Q
45T1 ; Code MFE, ZFH, and ZSY for Tubefeedings
46 S NAM=$P(X,"^",1) Q:NAM="" S N1=N1+1
47 S MSG(N1)="MFE|"_ACT_"|||^^^"_IEN_"^"_NAM_"^99FHT"
48 S N1=N1+1,MSG(N1)="ZFH|T"
49 F IEN1=0:0 S IEN1=$O(^FH(118.2,IEN,1,IEN1)) Q:IEN1<1 S SYN=$G(^(IEN1,0)) D
50 .S SYN=$P(SYN,"^",1) Q:SYN="" S N1=N1+1
51 .S MSG(N1)="ZSY|"_IEN1_"|"_SYN Q
52 D SEND
53 Q
54SEND ; Send Message to OE/RR
55 D MSG^XQOR("FH ORDERABLE ITEM UPDATE",.MSG)
56 K MSG Q
Note: See TracBrowser for help on using the repository browser.