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

BWBRNOT2.m

Go to the documentation of this file.
  1. BWBRNOT2 ;IHS/ANMC/MWR - BROWSE NOTIFICATIONS;03-Sep-2003 20:09;PLS
  1. ;;2.0;WOMEN'S HEALTH;**8,9**;MAY 16, 1996
  1. ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
  1. ;; PROMPTS FOR SELECTION CRITERIA WHEN BROWSING NOTIFICATIONS.
  1. ;; CALLED BY BWBRNOT.
  1. ;
  1. D SETVARS^BWUTL5
  1. D TITLE^BWUTL5("BROWSE NOTIFICATIONS")
  1. D ONEALL Q:BWPOP
  1. D DATES Q:BWPOP
  1. D STATUS Q:BWPOP
  1. D CMGR Q:BWPOP
  1. D ORDER Q:BWPOP
  1. D DEVICE Q:BWPOP
  1. Q
  1. ;
  1. ONEALL ;EP
  1. ;---> SELECT ONE PATIENT OR ALL PATIENTS.
  1. K DIR
  1. W !!?3,"Browse Notifications for ONE individual patient,"
  1. W !?3,"or browse Notifications for ALL patients?"
  1. S DIR("A")=" Select ONE or ALL: ",DIR("B")="ALL"
  1. S DIR(0)="SAM^o:ONE;a:ALL" D HELP2
  1. D ^DIR K DIR
  1. I Y=-1!($D(DIRUT)) S BWPOP=1 Q
  1. ;---> IF ALL PATIENTS, S BWA=1 AND QUIT.
  1. I Y="a" S BWA=1 Q
  1. ;
  1. W !!," Select the patient whose Notifications you wish to browse."
  1. D PATLKUP^BWUTL8(.Y)
  1. I Y<0 S BWPOP=1 Q
  1. ;---> FOR ONE PATIENT, SET BWA=0 AND BWDFN=PATIENT DFN, QUIT.
  1. S BWDFN=+Y,BWA=0,BWCMGR=$P(^BWP(BWDFN,0),U,10)
  1. Q
  1. ;
  1. DATES ;EP
  1. ;---> ASK DATE RANGE. RETURN DATES IN BWBEGDT AND BWENDDT.
  1. ;---> IF LOOKING AT ONLY ONE PATIENT, SET DEFAULT BEGIN DATE=T-365.
  1. S BWBEGDF=$S(BWA:"T-30",1:"T-365")
  1. D ASKDATES^BWUTL3(.BWBEGDT,.BWENDDT,.BWPOP,BWBEGDF,"T")
  1. Q
  1. ;
  1. STATUS ;EP
  1. ;---> GET XREF: OPEN OR ALL
  1. W !!?3,"Do you wish to browse DELINQUENT, OPEN, QUEUED, "
  1. W "ERROR, or ALL Notifications?"
  1. S DIR("A")=" Select DELINQUENT, OPEN, QUEUED, ERROR or ALL: "
  1. S DIR("B")="OPEN"
  1. S DIR(0)="SAM^d:DELINQUENT;o:OPEN;q:QUEUED;e:ERROR;a:ALL" D HELP4
  1. D ^DIR K DIR
  1. I Y=-1!($D(DIRUT)) S BWPOP=1 Q
  1. S BWB=Y
  1. Q
  1. ;
  1. CMGR ;EP
  1. ;---> SELECT CASES FOR ONE CASE MANAGER OR ALL.
  1. ;---> DO NOT PROMPT FOR CASE MANAGER IF SITE PARAMETERS SAY NOT TO,
  1. ;---> OR IF LOOKING AT PROCEDURES FOR ONLY ONE PATIENT.
  1. I '$D(^BWSITE(DUZ(2),0)) S BWE=1 Q
  1. I '$P(^BWSITE(DUZ(2),0),U,5)!('BWA) S BWE=1 Q
  1. W !!?3,"Browse Notifications for ONE particular Case Manager,"
  1. W !?3,"or browse Notifications for ALL Case Managers?"
  1. S DIR("A")=" Select ONE or ALL: ",DIR("B")="ALL"
  1. S DIR(0)="SAM^o:ONE;a:ALL" D HELP5
  1. D ^DIR K DIR
  1. I Y=-1!($D(DIRUT)) S BWPOP=1 Q
  1. ;---> IF ALL CASE MANAGERS, S BWE=1 AND QUIT.
  1. I Y="a" S BWE=1 Q
  1. ;
  1. W !!," Select the Case Manager whose patients you wish to browse."
  1. ;
  1. D DIC^BWFMAN(9002086.01,"QEMA",.Y," Select CASE MANAGER: ")
  1. I Y<0 S BWPOP=1 Q
  1. ;---> FOR ONE CASE MANAGER, SET BWE=0 AND BWCMGR=^VA(200 DFN, QUIT.
  1. S BWCMGR=+Y,BWE=0
  1. Q
  1. ;
  1. ;
  1. ORDER ;EP
  1. ;---> ASK ORDER BY DATE OR BY PATIENT OR BY PRIORITY.
  1. ;---> IF LOOKING AT ONLY ONE PATIENT, ORDER BY DATE AND QUIT.
  1. I 'BWA S BWC=1 Q
  1. ;
  1. ;---> SORT SEQUENCE IN BWC: 1=DATE, PATIENT, PRIORITY
  1. ;---> 2=PATIENT, DATE, PRIORITY
  1. ;---> 3=PRIORITY, DATE, PATIENT
  1. ;
  1. W !!?3,"Display Notifications in order of:"
  1. W ?39,"1) DATE OF NOTIFICATION (earliest first)"
  1. W !?39,"2) NAME OF PATIENT (alphabetically)"
  1. W !?39,"3) PRIORITY (beginning with URGENT)"
  1. S DIR("A")=" Select 1, 2, or 3: ",DIR("B")=1
  1. S DIR(0)="SAM^1:DATE;2:NAME;3:PRIORITY" D HELP3
  1. D ^DIR K DIR
  1. I Y=-1!($D(DIRUT)) S BWPOP=1 Q
  1. S BWC=Y
  1. Q
  1. ;
  1. DEVICE ;EP
  1. ;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
  1. S ZTRTN="DEQUEUE^BWBRNOT"
  1. F BWSV="A","B","C","D","E","CMGR","DFN","BEGDT","ENDDT" D
  1. .I $D(@("BW"_BWSV)) S ZTSAVE("BW"_BWSV)=""
  1. D ZIS^BWUTL2(.BWPOP,1,"HOME")
  1. Q
  1. ;
  1. HELP2 ;EP
  1. ;;Answer "ONE" to browse Notifications for ONE particular patient.
  1. ;;Answer "ALL" to browse Notifications for ALL patients.
  1. S BWTAB=5,BWLINL="HELP2" D HELPTX
  1. Q
  1. ;
  1. HELP3 ;EP
  1. ;;Enter "DATE" to list Notifications in chronological order beginning
  1. ;; with the oldest first.
  1. ;;Enter "NAME" to list Notifications by Patient Name in alphabetical
  1. ;; order.
  1. ;;Enter "PRIORITY" to list Notifications by degree of urgency,
  1. ;; beginning with the most urgent first.
  1. S BWTAB=5,BWLINL="HELP3" D HELPTX
  1. Q
  1. ;
  1. HELP4 ;EP
  1. ;;"OPEN Notifications" are ones that have not yet been closed,
  1. ;; in other words, the patient has not yet been reached or has not
  1. ;; yet responded.
  1. ;;
  1. ;;"DELINQUENT Notifications" are OPEN Notifications that have remained
  1. ;; open past the date they were due to be closed (as determined by
  1. ;; the "DATE DELINQUENT BY" field in the Edit Notification screen).
  1. ;;
  1. ;;"QUEUED Notifications" are only LETTERS waiting to be printed.
  1. ;; They do not include letters that have already been printed.
  1. ;;
  1. ;;"ERROR Notifications" are those notifications which have been marked
  1. ;; as entered in error.
  1. ;;
  1. ;;"ALL Notifications" includes DELINQUENT, OPEN and CLOSED.
  1. ;; CLOSED notifications are ones that have been brought to closure,
  1. ;; in other words, either the patient has been contacted or the
  1. ;; case is no longer active.
  1. S BWTAB=5,BWLINL="HELP4" D HELPTX
  1. Q
  1. ;
  1. HELP5 ;EP
  1. ;;Answer "ONE" to browse Notifications for ONE particular Case Manager.
  1. ;;Answer "ALL" to browse Notifications for ALL Case Managers.
  1. S BWTAB=5,BWLINL="HELP5" D HELPTX
  1. Q
  1. ;
  1. HELPTX ;EP
  1. ;---> CREATES DIR ARRAY FOR DIR. REQUIRED VARIABLES: BWTAB,BWLINL.
  1. N I,T,X S T="" F I=1:1:BWTAB S T=T_" "
  1. F I=1:1 S X=$T(@BWLINL+I) Q:X'[";;" S DIR("?",I)=T_$P(X,";;",2)
  1. S DIR("?")=DIR("?",I-1) K DIR("?",I-1)
  1. Q