Skip to content

Commit

Permalink
Install: FH*5.5*43
Browse files Browse the repository at this point in the history
Patch Subject:  EPIP FH REMEDIATION 1.0
Description:

============
 FH*5.5*43 provides the following enhancements to VistA:
 - Modifies the VistA Dietetics Report Queuing software to automatically
 queue Nutrition and Food Service (NFS) reports and labels to run daily,
 or as often as necessary, without requiring Dietetics staff to manually
 queue them each day. With many standard reports and labels currently
 available to NFS staff, it is inefficient and time consuming for users to
 manually set up and run reports daily.
 This enhancement enables an NFS Manager, Clinical Application Coordinator
 (CAC), or Automated Data Processing Application Coordinator (ADPAC) to
 set pre-defined options for printing NFS reports and labels
 automatically, including the routine name and the setup of variables
 required for the reports to run unattended.
 Three new options enabling this functionality are added to the existing
 Tray Tickets [FHMTKM] menu. The Manager/CAC/ADPAC must be assigned the
 NFS security key FHMGR to access these options:
   - Queued Options Edit [FHQUE OPTION EDIT] displays a list of available
 reports that can be selected and configured. When configuring a report,
 the user is prompted for the desired printer and whether it is active, the
 days of the week to run the report, and the time at which to run the
 report (e.g., T-1@18:00, if applicable. A new report option, Print Tray
 Tickets [FHMTKP], prompts the user for the meal ticket to print
 (Breakfast, Noon, or Evening).
   - Queue Diet Reports [FHQUE QUEUE DIET REPORTS] passes the configured
 reports and labels to TaskMan to be executed and printed at the scheduled
 time. Typically, Queue Diet Reports is scheduled to run once per day,
 soon after midnight. This option is used for testing to ensure all
 configured reports print as expected.
   - Test an Individual Queued Option [FHQUE TEST] is used to immediately
 run a single configured report to validate selected options.
 Three new files store the values required for printing NFS reports and
 labels automatically. The FHQUE AVAILABLE OPTIONS file (#117.0243) stores
 values such as the time the report is scheduled to run and the printer to
 which it will be sent. The FHQUE QUEUED REPORTS/LABELS file (#117.024)
 stores a meaningful description for each of the available reports that
 display when Queued Options Edit is selected. The FHQUE REPORT DAYS file
 (#117.0241) stores the days of the week to enable a user to select the
 day to run the report.
 - Enhances the existing Patient Supplemental Feeding List to display the
 most recent patient Diet Order. Diet orders can change frequently based on
 a patient's medical needs; sometimes diet orders are changed in VistA
 after a supplemental feeding is prepared by a food service worker.
 Currently, there is no easy way to check supplemental feeding orders
 against the patient's most recent diet order before delivering the
 supplemental nutrition.
 The enhanced Patient Supplemental Feeding List is accessible from
 the "Run SF Labels/Consolid Ingred List" [FHNO2] option, which is
 available from the SUPPLEMENTAL FEEDINGS [FHNOM] menu. This
 enhancement reduces the risk of improper feeding by retrieving
 current diet order information from VistA and using that data to
 prepare the Patient Supplemental Feeding List, so that both the
 current diet order and the supplemental feeding order are included.
 - Adds three new fields to the NUTRITION PERSON file (#115) that the
 staff in a Community Living Center (CLC) can use to enter meal
 instructions for morning, midday, and evening meals. The new free-text
 fields include the BREAKFAST FLAG field (#22), the NOON FLAG field
 (#22.1), and the EVENING FLAG field (#22.2).
 The existing Tray Tickets [FHMTKM] menu is further modified to include
 the new option Tray Ticket Flag Edit [FHMTK1D TRAY TICKET EDIT], which
 enables CLC staff to enter flag text in the new fields. To use this
 option, the Ward to which a patient is assigned must include "CLC" in the
 Ward name. The user is prompted to select either a Ward or a Patient. The
 BREAKFAST FLAG, NOON FLAG, and EVENING FLAG fields display so that text
 can be entered in one or more of the fields. The existing Print Tray
 Tickets [FHMTK1P TRAY TICKET PRINT] option is modified to print flag text
 on the bottom of the tray ticket where it can be easily seen by clinical
 staff at mealtime.
 This enhancement provides a simple and consistent way to ensure that each
 patient's mealtime instructions and needs are communicated between team
 members to ensure patient safety and quality of care.
 Patch Components:
 -----------------
 Files & Fields Associated:
 File Name (Number)         Field Name (Number)
 New/Modified/Deleted
 ------------------         -------------------
 --------------------
 FHQUE AVAILABLE            OPTION NAME (.01)            NEW
 OPTIONS (117.0243)         TIME TO RUN (1)              NEW
                            PRINTER (2)                  NEW
                            ENTRY TAG (3)                NEW
                            CALLED ROUTINE (4)           NEW
                            ACTIVE (5)                   NEW
                            VARIABLES
                            (MULTIPLE) (10)              NEW
                            DAYS TO RUN
                            (MULTIPLE) (20)              NEW
 FHQUE QUEUED               OPTION (.01)                 NEW
 REPORTS/LABELS (117.024)   ADDITIONAL
                             DESCRIPTION (1)             NEW
                            VARIABLES                    NEW
                             (MULTIPLE) (2)
                            TAG (3)                      NEW
                            ROUTINE (4)                  NEW
 FHQUE REPORT DAYS          DAY OF WEEK (.01)            NEW
 (117.0241)                 NUMBER (1)                   NEW
 NUTRITION PERSON (115)     BREAKFAST FLAG (22)          NEW
                            NOON FLAG (22.1)             NEW
                            EVENING FLAG (22.2)          NEW
 Forms Associated:
 Form Name                  File #                  New/Modified/Deleted
 ---------                  ------                  --------------------
 N/A
 Mail Groups Associated:
 Mail Group Name            New/Modified/Deleted
 ---------------            --------------------
 N/A
 Options Associated:
 Option Name                Type                New/Modified/Deleted
 -----------                ----                --------------------
 FHQUE QUEUE DIET REPORTS   RUN ROUTINE         NEW
 FHQUE OPTION EDIT          RUN ROUTINE         NEW
 FHQUE TEST                 RUN ROUTINE         NEW
 FHMTK1D TRAY TICKET EDIT   RUN ROUTINE         NEW
 FHMTK1P TRAY TICKET PRINT  RUN ROUTINE         Modified
 FHMTKM Tray Tickets        MENU                Modified
 Protocols Associated:
 Protocol Name              New/Modified/Deleted
 -------------              --------------------
 N/A
 Parameters Associated:
 Parameter Name             New/Modified/Deleted
 ---------------            --------------------
 N/A
 Security Keys Associated:
 Security Key Name
 -----------------
 FHMGR
 Templates Associated:
 Template Name      Type   File Name (Number)  New/Modified/Deleted
 -------------      ----   ------------------  --------------------
 N/A
 Additional Information:
 N/A
 New Service Requests (NSRs):
 ----------------------------
 20141207 Dietetics Report for Queuing Software
 20170510 Print Flag on Bottom of Tray Ticket
 20170519 Add Diet Order to the Patient Supplemental Feeding List
 Patient Safety Issues (PSIs):
 -----------------------------
 N/A
 Defect Tracking System Ticket(s) & Overview:
 --------------------------------------------
 N/A
 Problem:
 -------
 N/A
 Resolution:
 ----------
 N/A
 Test Sites:
 ----------
 San Francisco VA Health Care System, San Francisco, CA
 VA Salt Lake City Health Care System, Salt Lake City, UT
 Software and Documentation Retrieval Instructions:
 ----------------------------------------------------
 The software is released as a PackMan message and is distributed from
 FORUM.
 Software documentation describing the new functionality introduced by
 this patch is available for downloading.
 The preferred method is to retrieve files from download.vista.domain.ext.
 This transmits the files from the first available server. Sites may also
 elect to retrieve files directly from a specific server.
 Sites may retrieve the documentation directly using Secure File Transfer
 Protocol (SFTP) from the ANONYMOUS.SOFTWARE directory at the following OI
 Field Offices:
 Hines:                 domain.ext
 Salt Lake City:        domain.ext
 Documentation can also be found in the VA Software Document Library (VDL)
 at:
 https://wwww.domain.ext/vdl/.
 Title                                    File Name             FTP Mode
 -----------------------------------------------------------------------
 VistA Nutrition and Food Service        fh_5_5_p43_ag_cp.doc   Binary
   Manager/ADPAC Guide Change Pages
   for Patch FH*5.5*43
 VistA Nutrition and Food Service        fh_5_5_p43_ag_cp.pdf   Binary
   Manager/ADPAC Guide Change Pages
   for Patch FH*5.5*43
 VistA Nutrition and Food Service        fh_5_5_p43_um_cp.doc   Binary
   User Manual Change Pages
   for Patch FH*5.5*43
 VistA Nutrition and Food Service        fh_5_5_p43_um_cp.pdf   Binary
   User Manual Change Pages
   for Patch FH*5.5*43
 VistA Nutrition and Food Service        fh_5_5_p43_tm_cp.doc   Binary
   Outpatient Meals Technical Manual
   and Security Guide
   Change Pages for Patch FH*5.5*43
 VistA Nutrition and Food Service        fh_5_5_p43_tm_cp.pdf   Binary
   Outpatient Meals Technical Manual
   and Security Guide
   Change Pages for Patch FH*5.5*43
 Patch Installation:
 Pre/Post Installation Overview:
 -------------------------------

Use default answers for KIDS load/install questions.

Patch-Files: http://code.osehra.org/VistA.git/tree/master/Packages/Dietetics/Patches/FH_5.5_43
  • Loading branch information
josephsnyder committed Mar 15, 2019
1 parent 016af38 commit 26b56d5
Show file tree
Hide file tree
Showing 15 changed files with 750 additions and 32 deletions.
15 changes: 15 additions & 0 deletions Packages/Dietetics/Routines/FH43P.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FH43P ;EPIP/WLE - Remove three FILES for file ;9/14/18 3:45 PM
;;5.5;DIETETICS;**43**;Jan 28, 2005;Build 66
; PRE install routine for patch FH*5.5*43 to remove the entries from File 117.0243, 117.0241, 117.024
; created in previous patch versions
;
EN ;
I $D(^FH(117.0243,"B","FHNO2"))=0 Q
S DIK="^FH(117.0243,"
S DA="" F S DA=$O(^FH(117.0243,DA)) Q:DA="" D ^DIK
S DIK="^FH(117.024,"
S DA="" F S DA=$O(^FH(117.024,DA)) Q:DA="" D ^DIK
S DIK="^FH(117.0241,"
S DA="" F S DA=$O(^FH(117.0241,DA)) Q:DA="" D ^DIK
K DIK,DA
Q
13 changes: 4 additions & 9 deletions Packages/Dietetics/Routines/FHMTK1C.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FHMTK1C ; HISC/NCA/RVD - Print Tray Tickets ;4/13/95 13:45
;;5.5;DIETETICS;;Jan 28, 2005
FHMTK1C ; HISC/NCA/RVD - Print Tray Tickets ;6/21/2017 13:45
;;5.5;DIETETICS;**43**;Jan 28, 2005;Build 66
PRT ; Print 3 person per page
START I $G(TABREC)="YES" QUIT
S TL=0 D CHKH
Expand All @@ -12,7 +12,6 @@
.I $D(MM(0,N1)) W ?$S(N1=1:2,N1=2:45,1:88),MEALDT
.Q
W ! S TL=TL+1 F N1=1:1 Q:'$D(PP(N1)) W ! S TL=TL+1 F NBR=1:1:3 I $D(PP(N1,NBR)) W ?$S(NBR=1:2,NBR=2:45,1:88),PP(N1,NBR)
;W ! S TL=TL+1 F N1=1:1 Q:'$D(PP(N1)) W ! S TL=TL+1
W ! S TL=TL+1
F N1=1:1 Q:'$D(MM(N1)) D:(TL+2)'<($S(FHBOT="Y":LN-5,1:LN-3)) NXT W !! S TL=TL+2 F NBR=1:1:3 I $D(MM(N1,NBR)) W ?$S(NBR=1:2,NBR=2:45,1:88),MM(N1,NBR)
I TL<LN F L1=TL:1:$S(FHBOT="Y":LN-2,1:LN) W !
Expand Down Expand Up @@ -40,6 +39,8 @@
Q
HEAD F NM=1:1:3 W ! S TL=TL+1 F NBR=1:1:3 S X=$P($G(MM(0,NBR)),"^",NM) I X'="" D
.S S1=$S(NBR=1:2,NBR=2:45,1:88) I NM=1 W ?S1,X Q
.; Print special flags
.I NM=3 W ?S1,$$NOTE^FHMTK1D(MM(0,NBR),NBR,MFLG,MEAL)
.W ?(S1+38-$L(X)),X Q
Q
FOOT W ! S TL=TL+1 F NBR=1:1:3 S S1=$S(NBR=1:2,NBR=2:45,1:88) W:$D(MM(0,NBR)) ?S1,HD
Expand All @@ -60,10 +61,8 @@
.F K=0:0 S K=$O(DP(MEAL,X,K)) Q:K<1 D
..S Z=$G(P(MEAL,X,K)),TOT=TOT+Z
..I 'Z W $J("",8)_" " Q
..;W $S(Z#1>0:$J(Z,8,1),1:$J(Z,6)_" ")_" " Q
..W $S(Z#1>0:$J(Z,8,2),1:$J(Z,8))_" " Q
.Q
;W $S(TOT#1>0:$J(TOT,9,1),1:$J(TOT,7)) W:MFLG @IOF Q
W $S(TOT#1>0:$J(TOT,9,2),1:$J(TOT,9)) W:MFLG @IOF Q
PRO S FTOT=0,X="" F S X=$O(DP(MEAL,X)) Q:X="" D
.F K=0:0 S K=$O(DP(MEAL,X,K)) Q:K<1 D
Expand All @@ -72,7 +71,6 @@
..;W $S(Z#1>0:$J(Z,8,1),1:$J(Z,6)_" ")_" " Q
..W $S(Z#1>0:$J(Z,8,2),1:$J(Z,8))_" " Q
.Q
;W $S(FTOT#1>0:$J(FTOT,9,1),1:$J(FTOT,7)_" ")
W $S(FTOT#1>0:$J(FTOT,9,2),1:$J(FTOT,9)_" ")
Q
SUM S:SL<80 SL=80 S MEALDT="All Meals "_MDT S PG=0 D HDR
Expand All @@ -83,10 +81,8 @@
.F K=0:0 S K=$O(TP(X,K)) Q:K<1 D
..S Z=$G(T1(X,K)),TOT=TOT+Z
..I 'Z W $J("",8)_" " Q
..;W $S(Z#1>0:$J(Z,8,1),1:$J(Z,6)_" ")_" " Q
..W $S(Z#1>0:$J(Z,8,2),1:$J(Z,8))_" " Q
.Q
;W $S(TOT#1>0:$J(TOT,9,1),1:$J(TOT,7)) Q
W $S(TOT#1>0:$J(TOT,9,2),1:$J(TOT,9)) Q
PR1 S FTOT=0,X="" F S X=$O(TP(X)) Q:X="" D
.F K=0:0 S K=$O(TP(X,K)) Q:K<1 D
Expand All @@ -95,7 +91,6 @@
..;W $S(Z#1>0:$J(Z,8,1),1:$J(Z,6)_" ")_" " Q
..W $S(Z#1>0:$J(Z,8,2),1:$J(Z,8))_" " Q
.Q
;W $S(FTOT#1>0:$J(FTOT,9,1),1:$J(FTOT,7)_" ")
W $S(FTOT#1>0:$J(FTOT,9,2),1:$J(FTOT,9)_" ")
Q
HDR ; Consolidated Recipe List Heading
Expand Down
83 changes: 83 additions & 0 deletions Packages/Dietetics/Routines/FHMTK1D.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
FHMTK1D ;SFVAMC/APC - MEAL TICKET UTILITIES ; 5/29/2017 12:10
;;5.5;DIETETICS;**43**;Jan 28, 2005;Build 66
;
;ICR# Type Description
;----- ---- --------------------------------------
;10006 Sup ^DIC
;10018 Sup ^DIE
;10026 Sup ^DIR
; 2051 Sup FIND^DIC
; 2051 Sup FIND1^DIC
;10035 Sup File #2
;
DRV(DATA,PART,MFLG,MEAL) ;
S MESS=$$NOTE(DATA,PART,$G(MFLG),$G(MEAL))
W !,MESS
Q
;
NOTE(MTID,PART,MFLG,MEAL) ;Called from HEAD^FHMTK1C
N FHWARD,PATNM,ARHCDFN,BID,FOUND,MSG,X
S MSG=""
S FHWARD=$P(MTID,U,2),X=$P(MTID,"("),X=$E(X,1,$L(X)-1)
I FHWARD="GA(L)" D NOTE2(X,FHWARD) S:MSG="" MSG="PPAPER ISOL/PLASTW"
I $E(FHWARD,1,3)="CLC" D NOTE2(X,FHWARD)
Q MSG
;
NOTE2(X,FHWARD) ;
N FHNODE,FHP,FHIENP,FHTMP,FHIEN,FLDS,FLG,FHERR,DIERR
S FLDS="@;.1"
S FLG="PQ"
D FIND^DIC(2,,FLDS,FLG,X,,"B","I $E($G(^(.1)),1,3)=""CLC""",,"FHTMP","FHERR")
S FHIENP=0 F S FHIENP=$O(FHTMP("DILIST",FHIENP)) Q:FHIENP="" D
.S FHIEN=$P($G(FHTMP("DILIST",FHIENP,0)),U)
.S FHNODE=$G(^FHPT($$IEN(FHIEN),22))
.I 'MFLG S MSG=$S(MEAL="B":$P(FHNODE,U,1),MEAL="N":$P(FHNODE,U,2),1:$P(FHNODE,U,3)) Q
.S MSG=$S(PART=1:$P(FHNODE,U,1),PART=2:$P(FHNODE,U,2),1:$P(FHNODE,U,3))
Q
;
TTFLAG ;Edit tray ticket flag
N DIR,DIROUT,DIRUT,DTOUT,DUOUT
K DIR S DIR(0)="S^P:PATIENT;W:WARD",DIR("A")="Select by (P)atient or (W)ard",DIR("B")="P" D ^DIR
Q:$D(DIRUT)
I Y="P" D TTFP Q
I Y="W" D TTFW Q
Q
;
TTFP ;Edit tray ticket flag by patient
N FHCDFN,FHCFDFN,DIE,DA,DIC,DR,DTOUT,DUOUT
F K DIC S DIC="^DPT(",DIC(0)="AZEMQ" D ^DIC Q:Y'>0 D
.S FHCDFN=+Y
.S FHCFDFN=$$IEN(FHCDFN)
.I $$GET1^DIQ(2,FHCDFN,.1)'["CLC" W !!,?7,"Patient is not a CLC patient" Q
.I '$D(^FHPT(FHCFDFN,0)) W !!,*7,$$GET1^DIQ(2,FHCFDFN,.01)," is not in the Dietetics Patient file." Q
.S DIE="^FHPT(",DA=FHCFDFN,DR="22;22.1;22.2" D ^DIE
.W !
Q
;
TTFW ;Edit tray ticket flag by ward
N FHCDFN,FHCFDFN,FHWARD,EXIT,FHTMP,FHERR,FLDS,FLG,FHIEN,FHPTIEN,DIE,DTOUT,DUOUT,Y
S FHCDFN=0,EXIT=0
S FLDS="@;.01"
S FLG="PQ"
D FIND^DIC(2,,FLDS,FLG,"CLC",,"CN",,,"FHTMP","FHERR")
F S FHCDFN=$O(FHTMP("DILIST",FHCDFN)) Q:'FHCDFN D Q:EXIT
.N DA,DIE,DR,DTOUT,DUOUT
.S FHCFDFN=FHTMP("DILIST",FHCDFN,0),FHIEN=+FHCFDFN
.S FHPTIEN=$$IEN(FHIEN) ;Get the FH file IEN
.I '$D(^FHPT(FHPTIEN)) W !,*7,$P(FHTMP("DILIST",FHCDFN,0),U,2)," is not in the Dietetics Patient file." Q
.W !!,?5,$$GET1^DIQ(2,FHIEN,.01)," ",$$GET1^DIQ(2,FHIEN,.1)," ",$$GET1^DIQ(2,FHIEN,.101)
.S DIE="^FHPT(",DA=FHPTIEN,DR="22;22.1;22.2" D ^DIE
.I $D(DTOUT)!$D(Y) S EXIT=1
Q
;
IEN(FHD0,FHDFILE) ;
; ;
; Get pointer to NUTRITION PERSON (#115) given
; the PATIENT (#2) or NEW PERSON (#200) pointer
; Input
; FHD0 = PATIENT (#2) or NEW PERSON (#200) pointer (Req)
; FHDFILE = PATIENT (#2) or NEW PERSON (#200) file # (Opt, Dflt=2)
; Output
; $$IEN() = Pointer to NUTRITION PERSON (#115)
N DFN,FOUND,LN,MFLG,MM,MSG,N1,NBR,NM,PART,PG,S1,SL,TL,X,Y,Z,DIERR,FHERR
Q +$$FIND1^DIC(115,"","X",$S($G(FHDFILE,2)=200:"N",1:"P")_FHD0,"B")
35 changes: 30 additions & 5 deletions Packages/Dietetics/Routines/FHNO21.m
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
FHNO21 ; HISC/REL/NCA - Print Feeding Labels ;8/26/94 12:01
;;5.5;DIETETICS;**5,8**;Jan 28, 2005;Build 28
FHNO21 ; HISC/REL/NCA - Print Feeding Labels ; 6/21/2017 12:01
;;5.5;DIETETICS;**5,8,43**;Jan 28, 2005;Build 66
;;
;ICR# Type Description
;----- ---- --------------------------------------
;325 Controlled ADM^VADPT2
;
S DTP=DT\1 D DTP^FH S DTE=DTP_" "_TIM_$S(TIM=10:"AM",1:"PM")
S S1=$S(LAB=1:6,1:9),S2=LAB=2*5+33
K N F L=0:0 S L=$O(^FH(118,L)) Q:L<1 S Y=^(L,0),N1=$P(Y,"^",1),^TMP($J,"I",$E(N1,1,26)_","_L)=L I '$D(^FH(118,L,"I")) S N(L)=$P(Y,"^",1,2)
S LNOD="" F S LNOD=$O(^TMP($J,"L",LNOD)) Q:LNOD="" D P2
Q
P2 S PNOD="",N1=0 K C F S PNOD=$O(^TMP($J,"L",LNOD,PNOD)) Q:PNOD="" S Y2=^(PNOD) D P3
;I LAB<3 D P5 Q
Q
P3 S N1=N1+1
S FHDFN=$P(PNOD,"~",3),WRD=$P(Y2,"^",10)
D PATNAME^FHOMUTL I FHPTNM="" Q
S ALG="" D ALG^FHCLN
S NAM=FHPTNM,IS=$P(Y2,"^",9)
;S NAM=$P(^DPT(DFN,0),"^",1),IS=$P(Y2,"^",9) D PID^FHDPA
I LAB>2 D LL Q
I $P(FHPAR,"^",4)="Y" G P4
W !,$E(NAM,1,S2-$L(WRD)),?(S2+2-$L(WRD)),$E(WRD,3,99),!?$S(LAB=1:3,1:0),FHBID,$S(ALG="":"",1:" *ALG") W:IS'="" ?(S2-22),"*NURSE" W ?(S2-15),DTE S LN=2 I LAB=2 W !! S LN=4
; FH*5.5*43 BEGIN Add patient's diet orders
W !,$E(NAM,1,S2-$L(WRD)),?(S2+2-$L(WRD)),$E(WRD,3,99)
; *** Print Diet 1, 2, 3
D DIETORD(DFN,FHDFN,"^1^2^3^")
W !?$S(LAB=1:3,1:0),FHBID W:IS'="" ?(S2-22),"*NURSE" W ?(S2-15),DTE
; *** Print Diet 4, 5
D DIETORD(DFN,FHDFN,"^4^5^")
S LN=2 I LAB=2 W !! S LN=4
; FH*5.5*43 END Add patient's diet orders
F L=1:2:7 S Z=$P(Y2,"^",L) I Z'="" D
.S Q=$P(Y2,"^",L+1) S:'Q Q=1
.W !,$J(Q,2)," "
Expand All @@ -42,6 +53,20 @@
P6 W !!?4,"**** PATIENTS = ",N1," ****",! S LN=LN+3
S LN=LN#S1 I LN F L=LN+1:1:S1 W !
Q
; FH*5.5*43 BEGIN Add patient's diet orders
DIETORD(DFN,FHDFN,DIETS) ;
N DIET,DIETORD,DIETORD0,PIECE,VADMVT,VAERR,VAINDT2
D ADM^VADPT2
I $G(VAERR)'>0,$G(VADMVT) D
.S DIETORD0=+$P($G(^FHPT(FHDFN,"A",VADMVT,0)),U,2)
.S DIETORD=$P($G(^FHPT(FHDFN,"A",VADMVT,"DI",DIETORD0,0)),U,2,6)
.F PIECE=1:1:5 I DIETS[(U_PIECE_U) D
..N DIERR,DTOUT,DUOUT,FHERR
..S DIET=+$P(DIETORD,U,PIECE)
..W ?$P("36^51^66^36^51",U,PIECE),$$GET1^DIQ(111,DIET,6,,,"FHERR")
..Q
.Q
; FH*5.5*43 END Add patient's diet orders
LL ;
D ALG^FHCLN
S FHCOL=$S(LAB=3:3,1:2)
Expand Down
109 changes: 109 additions & 0 deletions Packages/Dietetics/Routines/FHQUE.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
FHQUE ;EPIP/KLD - AUTO-QUEUE DIETETICS REPORTS & LABELS ;04/27/2017 3:31 PM
;;5.5;DIETETICS;**43**;Jan 28, 2005;Build 66
; Run shortly after midnight
; Original version June 2004
;ICR# Type Description
;----- ---- --------------------------------------
;2056 Sup GETI^DIQ
;10000 Sup DW^%DTC
;10003 Sup ^%DT
;10006 Sup ^DIC
;10009 Sup ^DICN: FILE, YN
;10013 Sup ^DIK
;10018 Sup ^DIE
;10063 Sup ^%ZTLOAD
;10075 Sup File 19, field .01, read w/Fileman
;10114 Sup File 3.5, field .01, read w/Fileman
;
ST F FHI=0:0 S FHI=$O(^FH(117.024,FHI)) Q:'FHI D:$$GET1^DIQ(117.024,FHI,5)="YES" ML
FHK K %,DA,DIC,DIE,DIK,DR,FH,FHI,FHII,FHIII,FHIEN,FHANS,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,^TMP("FHQUE",$J) Q
;
ML ;Main loop
S FH("FLAG")=0
I $O(^FH(117.024,FHI,2,0)) D Q:'FH("FLAG") ;Only run certain days of the week
.S X=DT D DW^%DTC S Y=Y+1,FH("FLAG")=$D(^FH(117.024,FHI,2,"B",Y))
S FH("TIME")=$$GET1^DIQ(117.024,FHI,1)
S:FH("TIME")<600 FH("TIME")=0_FH("TIME")
S %DT="R",X="T@"_FH("TIME") D ^%DT S ZTDTH=$S($D(FH("TEST")):$H,1:Y)
S ZTDESC=$$GET1^DIQ(117.024,FHI,.01)_" Auto Queue"
S ZTIO=$$GET1^DIQ(117.024,FHI,2)
S ZTRTN=$$GET1^DIQ(117.024,FHI,3)_U_$$GET1^DIQ(117.024,FHI,4)
F FHII=0:0 S FHII=$O(^FH(117.024,FHI,1,FHII)) Q:'FHII D ;Get necessary variables
.S FH("VAR")=$$GET1^DIQ(117.0242,FHII_","_FHI,.01)
.S @FH("VAR")=$TR($$GET1^DIQ(117.0242,FHII_","_FHI,1),"|",U)
.D:$$GET1^DIQ(117.0242,FHII_","_FHI,2)="YES" ;Date variable
..S X=$TR($$GET1^DIQ(117.0242,FHII_","_FHI,1),"|",U),%DT=$S(X["@":"R",1:"")
..D ^%DT S @FH("VAR")=Y
.S X=$TR($$GET1^DIQ(117.0242,FHII_","_FHI,3),"|",U) X:X]"" X ;Xecutable code to set the variable
.S ZTSAVE(FH("VAR"))=@FH("VAR")
D ^%ZTLOAD W !!,"ZTSK=",$G(ZTSK) Q
;
TEST ;Test one particular option
R !!,"IEN: ",FHI:DTIME Q:U[FHI!'$T S FH("TEST")=""
I FHI["?" S FHIEN=0 F S FHIEN=$O(^FH(117.024,FHIEN)) G:'+FHIEN TEST W !,FHIEN,?10,$P(^FH(117.024,FHIEN,0),"^")
I '$D(^FH(117.024,FHI)) W !,"Invalid IEN!" G TEST
W ! S DIC="^%ZIS(1,",DIC(0)="QEAM",DIC("A")="Select printer: " D ^DIC
G TEST:Y<1 S ZTIO=$P(Y,U,2) D ML,FHK Q
;
UEDIT ;User edit of options
K ^TMP("FHQUE",$J) S FH("CNT")=0,FHI=""
F S FHI=$O(^FH(117.0243,"B",FHI)) Q:FHI="" D
.F FHII=0:0 S FHII=$O(^FH(117.0243,"B",FHI,FHII)) Q:'FHII D
..S X=$$GET1^DIQ(117.0243,FHII,.01) Q:X=""
..S X(1)=$$GET1^DIQ(117.0243,FHII,1) S:X(1)="" X(1)="NULL"
..S DIC(0)="BZ",DIC="^DIC(19," D ^DIC
..S ^TMP("FHQUE",$J,X,X(1))=$P($G(Y(0)),U,2)_U_FHII
S (FHI,FHII)="" W !!,"Available options are:"
F S FHI=$O(^TMP("FHQUE",$J,FHI)) Q:FHI="" D
.F S FHII=$O(^TMP("FHQUE",$J,FHI,FHII)) Q:FHII="" D
..S FH("CNT")=FH("CNT")+1,FH("SEL",FH("CNT"))=FHI_U_$P(^TMP("FHQUE",$J,FHI,FHII),U,2)
..W !?3,$J(FH("CNT"),2),". ",FHI W:FHII'="NULL" ?18,FHII
..W ?32,$P(^TMP("FHQUE",$J,FHI,FHII),U)
UEDIT1 R !,"Your choice, choose by number: ",FH("OPT"):DTIME I U[FH("OPT")!'$T D FHK Q
I FH("OPT")["?" D FHSHOW R !!,?5,"Return to continue: ",FHANS:DTIME Q:'$T G UEDIT
I FH("OPT")'?1.2N!('$D(FH("SEL",FH("OPT")))) W " ??" G UEDIT1
UEDIT2 R !!,"Time to run the option (use 4 digit military time): ",FH("TIME"):DTIME I U[FH("TIME")!'$T D FHK Q
I FH("TIME")'?4N!(FH("TIME")>2359)!($E(FH("TIME"),3)>5) W " ??" G UEDIT2
S FH("NAME")=$P(FH("SEL",FH("OPT")),U)_" "_FH("TIME")
S FH("DA")=$P(FH("SEL",FH("OPT")),U,2)
S (DIC,DIE)="^FH(117.024,",DIC(0)="M",X=FH("NAME") D ^DIC S DA=+Y
I Y=-1 D G UEDIT:%'=1
.W !!,"Add entry ",$C(34),FH("NAME"),$C(34) S %=1 D YN^DICN Q:%'=1
.S DIC(0)="L" K DD,DO D FILE^DICN
.S DA=+Y,DR="1///"_$P(FH("NAME")," ",2),FH("ADDED")=""
.D ^DIE W !,"Entry added."
W !!,"Now add/change the printer and whether it's active.",!
S DR="3///"_$$GET1^DIQ(117.0243,FH("DA"),3)_";4///"_$$GET1^DIQ(117.0243,FH("DA"),4)_";2R;5R//YES;20"
D ^DIE S ^FH(117.024,DA,1,0)="^117.0242^",X=DA
K DA,DIC,DIE,DR S DIC="^FH(117.024,"_X_",1,",DIC(0)="L",DA(1)=X,FH("BAD")=0
F FHI=0:0 S FHI=$O(^FH(117.0243,FH("DA"),1,FHI)) Q:'FHI!(FH("BAD")) D
.S X=$$GET1^DIQ(117.024302,FHI_","_FH("DA"),.01),DIC("DR")=""
.D:$$GET1^DIQ(117.024302,FHI_","_FH("DA"),1)="YES" ASK Q:FH("BAD")
.K DIC("DR"),DD,DO D FILE^DICN S DA=+Y
.S DR="",DIE=DIC D DR,^DIE K FH("QUES")
.S:DR["3//" ^FH(117.024,DA(1),1,DA,1)=$TR(^FH(117.024,DA(1),1,DA,1),"|",U)
I 'FH("BAD") W !!,"Option ",$S($D(FH("ADDED")):"add",1:"chang"),"ed!" H 3
I FH("BAD") S DIK="^FH(117.024," D ^DIK W !!,"Invalid entry - deleted!"
K FH("ADDED") G UEDIT
;
ASK N %DT,FHII,FHWP,X,Y S FHWP=$$GET1^DIQ(117.024302,FHI_","_FH("DA"),5,"","FHWP")
F FHII=0:0 S FHII=$O(FHWP(FHII)) Q:'FHII W !,FHWP(FHII)
R X:DTIME I U[X!'$T S FH("BAD")=1 Q
I FHWP(1)["meal","BNE"'[X W !,"B, N or E" G ASK
I FHWP(1)["meal","BNE"[X S FH("QUES")=$E(X,1) Q
I $$GET1^DIQ(117.024302,FHI_","_FH("DA"),3)="YES" S %DT="ET" D ^%DT I Y<1 W !,"Invalid date/time!" G ASK
S FH("QUES")=X Q
;
DR N X,FHFD S DR=""
F FHFD=1,2,3 D
.I $G(FH("QUES"))]"",FHFD=1 S X=FH("QUES")
.E S X=$$GET1^DIQ(117.024302,FHI_","_FH("DA"),FHFD+1) Q:X=""
.S DR=DR_FHFD_"///"_X_";"
Q
FHSHOW ;Display the print options that have been setup
N FHIEN
W !!,?5,"Print options and times currently set up",!!
S FHIEN="" F S FHIEN=$O(^FH(117.024,FHIEN)) Q:FHIEN="" D
. W !,?5,$P($G(^FH(117.024,FHIEN,0)),U)
. Q
Q
37 changes: 35 additions & 2 deletions Packages/Kernel/Globals/14.4+TASKS.zwr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OSEHRA ZGO Export: TASKS
15-MAR-2019 07:06:17 ZWR
^%ZTSK(-1)=4326
15-MAR-2019 07:53:53 ZWR
^%ZTSK(-1)=4329
^%ZTSK(0)="TASKS^14.4^4237"
^%ZTSK(1001,0)="TASK^XMXBULL^16^^63957,36927^63957,36927^R^^^PATCH,USER^PLA^PLA^ZTDESC^^"
^%ZTSK(1001,.02)="^PLA^^"
Expand Down Expand Up @@ -39304,6 +39304,39 @@ OSEHRA ZGO Export: TASKS
^%ZTSK(4326,.3,"DUZ(",0)="@"
^%ZTSK(4326,.3,"XQSCH")=8
^%ZTSK(4326,.3,"XQY")=9891
^%ZTSK(4327,0)="ZTSK^XQ1^.5^VISTA^65087,28218^65087,28218^O^8853^HL AUTOSTART LINK MANAGER^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^"
^%ZTSK(4327,.02)="^VISTA^^"
^%ZTSK(4327,.03)="No Description (%ZTLOAD)"
^%ZTSK(4327,.04)=5623545018
^%ZTSK(4327,.1)="B^65087,28218^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4327,.2)=""
^%ZTSK(4327,.21)=""
^%ZTSK(4327,.25)=""
^%ZTSK(4327,.3,"DUZ(",0)="@"
^%ZTSK(4327,.3,"XQSCH")=10
^%ZTSK(4327,.3,"XQY")=8853
^%ZTSK(4328,0)="ZTSK^XQ1^.5^VISTA^65087,28218^65087,28218^O^8412^HL TASK RESTART^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^"
^%ZTSK(4328,.02)="^VISTA^^"
^%ZTSK(4328,.03)="No Description (%ZTLOAD)"
^%ZTSK(4328,.04)=5623545018
^%ZTSK(4328,.1)="B^65087,28220^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4328,.2)=""
^%ZTSK(4328,.21)=""
^%ZTSK(4328,.25)=""
^%ZTSK(4328,.3,"DUZ(",0)="@"
^%ZTSK(4328,.3,"XQSCH")=11
^%ZTSK(4328,.3,"XQY")=8412
^%ZTSK(4329,0)="ZTSK^XQ1^.5^VISTA^65087,28218^65087,28218^O^9891^XOBV LISTENER STARTUP^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^"
^%ZTSK(4329,.02)="^VISTA^^"
^%ZTSK(4329,.03)="No Description (%ZTLOAD)"
^%ZTSK(4329,.04)=5623545018
^%ZTSK(4329,.1)="B^65087,28222^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4329,.2)=""
^%ZTSK(4329,.21)=""
^%ZTSK(4329,.25)=""
^%ZTSK(4329,.3,"DUZ(",0)="@"
^%ZTSK(4329,.3,"XQSCH")=8
^%ZTSK(4329,.3,"XQY")=9891
^%ZTSK(1082462,.1)="E^64013,39495^Interrupted While Running"
^%ZTSK(1082463,.1)="E^64013,39495^Interrupted While Running"
^%ZTSK(1082464,.1)="E^64013,39495^Interrupted While Running"
Expand Down
Loading

0 comments on commit 26b56d5

Please sign in to comment.