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

WVBRNOT2.m

Go to the documentation of this file.
  1. WVBRNOT2 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE NOTIFICATIONS;
  1. ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
  1. ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
  1. ;; PROMPTS FOR SELECTION CRITERIA WHEN BROWSING NOTIFICATIONS.
  1. ;; CALLED BY WVBRNOT.
  1. ;
  1. D SETVARS^WVUTL5
  1. D TITLE^WVUTL5("BROWSE NOTIFICATIONS")
  1. D ONEALL Q:WVPOP
  1. D DATES Q:WVPOP
  1. D STATUS Q:WVPOP
  1. D CMGR Q:WVPOP
  1. D ORDER Q:WVPOP
  1. D DEVICE Q:WVPOP
  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 WVPOP=1 Q
  1. ;---> IF ALL PATIENTS, S WVA=1 AND QUIT.
  1. I Y="a" S WVA=1 Q
  1. ;
  1. W !!," Select the patient whose Notifications you wish to browse."
  1. D PATLKUP^WVUTL8(.Y)
  1. I Y<0 S WVPOP=1 Q
  1. ;---> FOR ONE PATIENT, SET WVA=0 AND WVDFN=PATIENT DFN, QUIT.
  1. S WVDFN=+Y,WVA=0,WVCMGR=$P(^WV(790,WVDFN,0),U,10)
  1. Q
  1. ;
  1. DATES ;EP
  1. ;---> ASK DATE RANGE. RETURN DATES IN WVBEGDT AND WVENDDT.
  1. ;---> IF LOOKING AT ONLY ONE PATIENT, SET DEFAULT BEGIN DATE=T-365.
  1. S WVBEGDF=$S(WVA:"T-30",1:"T-365")
  1. D ASKDATES^WVUTL3(.WVBEGDT,.WVENDDT,.WVPOP,WVBEGDF,"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 "or ALL Notifications?"
  1. S DIR("A")=" Select DELINQUENT, OPEN, QUEUED or ALL: "
  1. S DIR("B")="OPEN"
  1. S DIR(0)="SAM^d:DELINQUENT;o:OPEN;q:QUEUED;a:ALL" D HELP4
  1. D ^DIR K DIR
  1. I Y=-1!($D(DIRUT)) S WVPOP=1 Q
  1. S WVB=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(^WV(790.02,DUZ(2),0)) S WVE=1 Q
  1. I '$P(^WV(790.02,DUZ(2),0),U,5)!('WVA) S WVE=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 WVPOP=1 Q
  1. ;---> IF ALL CASE MANAGERS, S WVE=1 AND QUIT.
  1. I Y="a" S WVE=1 Q
  1. ;
  1. W !!," Select the Case Manager whose patients you wish to browse."
  1. ;
  1. D DIC^WVFMAN(790.01,"QEMA",.Y," Select CASE MANAGER: ")
  1. I Y<0 S WVPOP=1 Q
  1. ;---> FOR ONE CASE MANAGER, SET WVE=0 AND WVCMGR=^VA(200 DFN, QUIT.
  1. S WVCMGR=+Y,WVE=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 'WVA S WVC=1 Q
  1. ;
  1. ;---> SORT SEQUENCE IN WVC: 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 WVPOP=1 Q
  1. S WVC=Y
  1. Q
  1. ;
  1. DEVICE ;EP
  1. ;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
  1. S ZTRTN="DEQUEUE^WVBRNOT"
  1. F WVSV="A","B","C","D","E","CMGR","DFN","BEGDT","ENDDT" D
  1. .I $D(@("WV"_WVSV)) S ZTSAVE("WV"_WVSV)=""
  1. D ZIS^WVUTL2(.WVPOP,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 WVTAB=5,WVLINL="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 WVTAB=5,WVLINL="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. ;;"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 WVTAB=5,WVLINL="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 WVTAB=5,WVLINL="HELP5" D HELPTX
  1. Q
  1. ;
  1. HELPTX ;EP
  1. ;---> CREATES DIR ARRAY FOR DIR. REQUIRED VARIABLES: WVTAB,WVLINL.
  1. N I,T,X S T=$$REPEAT^XLFSTR(" ",WVTAB)
  1. F I=1:1 S X=$T(@WVLINL+I) Q:X'[";;" S DIR("?",I)=T_$P(X,";;",2)
  1. S DIR("?")=DIR("?",I-1) K DIR("?",I-1)
  1. Q