1 | FHWOR31 ; HISC/NCA - HL7 Early/Late Tray (Cont.) ;10/10/00 14:56
|
---|
2 | ;;5.5;DIETETICS;;Jan 28, 2005
|
---|
3 | CUR(FHDFN,ADM,FHDTE,FHV1,FHV2) ; This fuction pass the variable FHORD and FHLD back.
|
---|
4 | N A1,FHN,KK,X
|
---|
5 | S A1=0,(FHV1,FHV2)="" F KK=0:0 S KK=$O(^FHPT(FHDFN,"A",ADM,"AC",KK)) Q:KK<1!(KK>FHDTE) S A1=KK
|
---|
6 | Q:'A1 S FHN=$P(^FHPT(FHDFN,"A",ADM,"AC",A1,0),"^",2),X=^FHPT(FHDFN,"A",ADM,"DI",FHN,0),FHV1=$P(X,"^",2,6),FHV2=$P(X,"^",7) Q
|
---|
7 | PROC ; Process Add E/L Trays
|
---|
8 | D NOW^%DTC S NOW=%
|
---|
9 | I FHV2'="" S TXT="Patient is on a WITHHOLD ORDER at that time!" D ERR^FHWOR Q
|
---|
10 | I "^^^^"[FHV1 S TXT="Patient has NO DIET ORDER at that time!" D ERR^FHWOR Q
|
---|
11 | I SDT=EDT,SDT<NOW S TXT="Can Not Order a Meal for a Date/Time before now!" D ERR^FHWOR Q
|
---|
12 | S FILL="E"_";"_ADM_";;"_SDT_";"_EDT_";"_WKD_";"_MEAL_";"_TIM_";"_BAG
|
---|
13 | D ^FHORE1A
|
---|
14 | I 'FHDAY S TXT="Day of Week Not Within Start and Stop Date." D ERR^FHWOR G EXIT^FHWOR3
|
---|
15 | D SEND^FHWOR Q
|
---|
16 | WKD ; Get week days
|
---|
17 | S X=EDT D H^%DTC S:%Y=0 %Y=7 Q:%Y<0
|
---|
18 | S WKD=WKD_$E("MTWRFSX",%Y)
|
---|
19 | Q
|
---|
20 | SET ; Set Date/Time in HL7 format
|
---|
21 | S:SDT SDT=$$FMTHL7^XLFDT(SDT)
|
---|
22 | S:EDT EDT=$$FMTHL7^XLFDT(EDT)
|
---|
23 | S:NOW NOW=$$FMTHL7^XLFDT(NOW)
|
---|
24 | Q
|
---|