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