Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSJMDIR

PSJMDIR.m

Go to the documentation of this file.
  1. PSJMDIR ;BIR/MV-MED DUE WORKSHEET DIR CALLS ;25 AUG 94 / 11:08 AM
  1. ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
  1. ;
  1. MEDTYPE(PSGMARWD) ;*** Ask for Med choices
  1. ;PSGMARWD will be defined if the user was selected by ward.
  1. ;If PSJMPRN is defined, that mean this module is calling from the MDWS.
  1. ;
  1. K DIR S DIR(0)="LAO^1:6^I X[1&($L(X)>1) K X" S DIR("A")="Enter medication type(s): "
  1. S DIR("?",1)="1. All medications",DIR("?",2)="2. Non-IV medications only",DIR("?",3)="3. IVPB (Includes IV syringe orders with a med route of IV or IVPB."
  1. S DIR("?",4)=" All other IV syringe orders are included with non-IV medications).",DIR("?",5)="4. LVPs",DIR("?",6)="5. TPNs",DIR("?",7)="6. Chemotherapy medications (IV)",DIR("?",8)=""
  1. N XTYPE S:$G(PSGMARWD) XTYPE=$P($G(^PS(59.6,+$O(^PS(59.6,"B",+PSGMARWD,0)),0)),"^",2) S DIR("B")=$S($G(XTYPE):XTYPE,1:2)
  1. S DIR("?")="e.g. Enter 1 or 2-4,5 or 2."
  1. S DIR("?",9)="A combination of choices can be entered here except for option 1."
  1. W !! D ^DIR
  1. Q $$STOP
  1. ;
  1. STDATE() ;*** Ask for starting date and time
  1. ;
  1. K DIR S DIR(0)="DO^::EXAR",DIR("A")="Enter Start Date and Time",DIR("?")="Date and time must be entered." W !! D ^DIR
  1. Q $$STOP
  1. ;
  1. ENDATE(PSGTMP,PSGTMP1) ;*** Ask for eding date and time
  1. ;
  1. K DIR S DIR(0)="DAO^"_PSGTMP_":"_PSGTMP1_":EXAR",DIR("A")="Enter Ending Date and Time: "
  1. S DIR("?")="Time must be entered.",DIR("?",1)="The worksheet will list only medications due for a 24 hour",DIR("?",2)="period. Please keep ending date and time within that range."
  1. W !! D ^DIR
  1. Q $$STOP
  1. ;
  1. PRN() ;
  1. ;
  1. K DIR S DIR(0)="YO",DIR("A")="Would you like to include PRN Medications (Y/N)",DIR("B")="NO"
  1. S DIR("?")="Answer ""YES"" to include PRN orders in the Medication Due Worksheet. (The PRN medications will print after the Continuous medications.)"
  1. W !! D ^DIR
  1. Q $$STOP
  1. ;
  1. ADMTM ;*** Askif user want to sort by admin team
  1. ;
  1. S (PSGTM,PSGTMALL)=0
  1. K DIR S DIR(0)="YO",DIR("A")="Do you want to sort by Administration Team (Y/N)",DIR("B")="NO"
  1. S DIR("?",1)="Enter ""Y"" for ""YES"" if you wish to sort by Administration",DIR("?",2)="team. Enter ""N"" for ""NO"" if you do not wish to sort by",DIR("?",3)="Administration Team."
  1. S DIR("?",4)="",DIR("?",5)="If you choose to sort by Adminstration Team, you",DIR("?")="may choose which teams will be included in the report."
  1. W !! D ^DIR Q:$$STOP!'+Y
  1. ;
  1. ;*** Because "ALL" is not a team, must use DIR to include "ALL"
  1. ; default and then call DIC to look up the selected team
  1. ;
  1. F Q:$$STOP!(X="")!$G(PSGTMALL) D ADMTM2
  1. S PSGTM=$S($O(PSGTM(0))'="":1,1:0)
  1. Q
  1. ADMTM2 ;
  1. K DIR S DIR(0)="FAO",DIR("A")="Select Administration Team: ",DIR("B")="ALL",DIR("?")="^D DICTM^PSJMDIR" W ! D ^DIR Q:$$STOP I Y="ALL" S PSGTMALL=1 Q
  1. D DICTM
  1. S PSJSTOP=$S($D(DTOUT):1,$D(DUOUT):1,(Y<0)&'$D(PFLG):1,1:0)
  1. Q
  1. ;
  1. DICTM ;*** LooK up a team.
  1. ;
  1. K DIC S DIC="^PS(57.7,"_PSGWD_",1,",DIC(0)="QEMIZ"
  1. F PFLG=0:1 D ^DIC Q:Y<0 I PFLG S DIC(0)=DIC(0)_"A",DIC("A")="Select another Administration Team: " S PSGTM(Y(0,0))=+Y
  1. Q
  1. ;
  1. RBADM ;*** Sort by PATIENT, ROOM-BED or ADMIN TIME
  1. ;
  1. K DIR S DIR(0)="SAO^A:Administration Time;R:Room-Bed;P:Patient",DIR("A")="Do you wish to sort by Administration Time (A), Room-Bed (R), Patient (P): ",DIR("B")="A"
  1. S DIR("?",1)="Enter an ""A"" if you want orders to display in order of Administration Time.",DIR("?",2)="Enter a ""R"" if you want orders to display in order of patient room-bed."
  1. S DIR("?")="Enter a ""P"" if you want orders to display in order of patient name."
  1. W ! D ^DIR Q:$$STOP S PSGRBADM=Y
  1. Q
  1. ;
  1. RBPPN ;*** Sort by ROOM-BED or PATIENT(when selected by WARD).
  1. ;
  1. K DIR S DIR(0)="SAO^R:Room-Bed;P:PATIENT",DIR("A")="Do you wish to sort by Room-Bed (R), Patient (P): ",DIR("B")="R"
  1. S DIR("?",1)="Enter an ""R"" if you want orders to display in order of patient room-bed.",DIR("?")="Enter a ""P"" if you want orders to display in order of patient name."
  1. W ! D ^DIR Q:$$STOP S PSGRBPPN=Y
  1. Q
  1. ;
  1. STOP() ;
  1. ;
  1. S PSJSTOP=$S($D(DTOUT):1,$D(DUOUT):1,$D(DIRUT):1,1:0)
  1. Q PSJSTOP