WVBRNOT2 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE NOTIFICATIONS;
;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
;; PROMPTS FOR SELECTION CRITERIA WHEN BROWSING NOTIFICATIONS.
;; CALLED BY WVBRNOT.
;
D SETVARS^WVUTL5
D TITLE^WVUTL5("BROWSE NOTIFICATIONS")
D ONEALL Q:WVPOP
D DATES Q:WVPOP
D STATUS Q:WVPOP
D CMGR Q:WVPOP
D ORDER Q:WVPOP
D DEVICE Q:WVPOP
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 WVPOP=1 Q
;---> IF ALL PATIENTS, S WVA=1 AND QUIT.
I Y="a" S WVA=1 Q
;
W !!," Select the patient whose Notifications you wish to browse."
D PATLKUP^WVUTL8(.Y)
I Y<0 S WVPOP=1 Q
;---> FOR ONE PATIENT, SET WVA=0 AND WVDFN=PATIENT DFN, QUIT.
S WVDFN=+Y,WVA=0,WVCMGR=$P(^WV(790,WVDFN,0),U,10)
Q
;
DATES ;EP
;---> ASK DATE RANGE. RETURN DATES IN WVBEGDT AND WVENDDT.
;---> IF LOOKING AT ONLY ONE PATIENT, SET DEFAULT BEGIN DATE=T-365.
S WVBEGDF=$S(WVA:"T-30",1:"T-365")
D ASKDATES^WVUTL3(.WVBEGDT,.WVENDDT,.WVPOP,WVBEGDF,"T")
Q
;
STATUS ;EP
;---> GET XREF: OPEN OR ALL
W !!?3,"Do you wish to browse DELINQUENT, OPEN, QUEUED, "
W "or ALL Notifications?"
S DIR("A")=" Select DELINQUENT, OPEN, QUEUED or ALL: "
S DIR("B")="OPEN"
S DIR(0)="SAM^d:DELINQUENT;o:OPEN;q:QUEUED;a:ALL" D HELP4
D ^DIR K DIR
I Y=-1!($D(DIRUT)) S WVPOP=1 Q
S WVB=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(^WV(790.02,DUZ(2),0)) S WVE=1 Q
I '$P(^WV(790.02,DUZ(2),0),U,5)!('WVA) S WVE=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 WVPOP=1 Q
;---> IF ALL CASE MANAGERS, S WVE=1 AND QUIT.
I Y="a" S WVE=1 Q
;
W !!," Select the Case Manager whose patients you wish to browse."
;
D DIC^WVFMAN(790.01,"QEMA",.Y," Select CASE MANAGER: ")
I Y<0 S WVPOP=1 Q
;---> FOR ONE CASE MANAGER, SET WVE=0 AND WVCMGR=^VA(200 DFN, QUIT.
S WVCMGR=+Y,WVE=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 'WVA S WVC=1 Q
;
;---> SORT SEQUENCE IN WVC: 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 WVPOP=1 Q
S WVC=Y
Q
;
DEVICE ;EP
;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
S ZTRTN="DEQUEUE^WVBRNOT"
F WVSV="A","B","C","D","E","CMGR","DFN","BEGDT","ENDDT" D
.I $D(@("WV"_WVSV)) S ZTSAVE("WV"_WVSV)=""
D ZIS^WVUTL2(.WVPOP,1,"HOME")
Q
;
HELP2 ;EP
;;Answer "ONE" to browse Notifications for ONE particular patient.
;;Answer "ALL" to browse Notifications for ALL patients.
S WVTAB=5,WVLINL="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 WVTAB=5,WVLINL="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.
;;
;;"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 WVTAB=5,WVLINL="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 WVTAB=5,WVLINL="HELP5" D HELPTX
Q
;
HELPTX ;EP
;---> CREATES DIR ARRAY FOR DIR. REQUIRED VARIABLES: WVTAB,WVLINL.
N I,T,X S T=$$REPEAT^XLFSTR(" ",WVTAB)
F I=1:1 S X=$T(@WVLINL+I) Q:X'[";;" S DIR("?",I)=T_$P(X,";;",2)
S DIR("?")=DIR("?",I-1) K DIR("?",I-1)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWVBRNOT2 5217 printed Dec 13, 2024@02:46:47 Page 2
WVBRNOT2 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE NOTIFICATIONS;
+1 ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
+2 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
+3 ;; PROMPTS FOR SELECTION CRITERIA WHEN BROWSING NOTIFICATIONS.
+4 ;; CALLED BY WVBRNOT.
+5 ;
+6 DO SETVARS^WVUTL5
+7 DO TITLE^WVUTL5("BROWSE NOTIFICATIONS")
+8 DO ONEALL
if WVPOP
QUIT
+9 DO DATES
if WVPOP
QUIT
+10 DO STATUS
if WVPOP
QUIT
+11 DO CMGR
if WVPOP
QUIT
+12 DO ORDER
if WVPOP
QUIT
+13 DO DEVICE
if WVPOP
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 WVPOP=1
QUIT
+9 ;---> IF ALL PATIENTS, S WVA=1 AND QUIT.
+10 IF Y="a"
SET WVA=1
QUIT
+11 ;
+12 WRITE !!," Select the patient whose Notifications you wish to browse."
+13 DO PATLKUP^WVUTL8(.Y)
+14 IF Y<0
SET WVPOP=1
QUIT
+15 ;---> FOR ONE PATIENT, SET WVA=0 AND WVDFN=PATIENT DFN, QUIT.
+16 SET WVDFN=+Y
SET WVA=0
SET WVCMGR=$PIECE(^WV(790,WVDFN,0),U,10)
+17 QUIT
+18 ;
DATES ;EP
+1 ;---> ASK DATE RANGE. RETURN DATES IN WVBEGDT AND WVENDDT.
+2 ;---> IF LOOKING AT ONLY ONE PATIENT, SET DEFAULT BEGIN DATE=T-365.
+3 SET WVBEGDF=$SELECT(WVA:"T-30",1:"T-365")
+4 DO ASKDATES^WVUTL3(.WVBEGDT,.WVENDDT,.WVPOP,WVBEGDF,"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 "or ALL Notifications?"
+4 SET DIR("A")=" Select DELINQUENT, OPEN, QUEUED or ALL: "
+5 SET DIR("B")="OPEN"
+6 SET DIR(0)="SAM^d:DELINQUENT;o:OPEN;q:QUEUED;a:ALL"
DO HELP4
+7 DO ^DIR
KILL DIR
+8 IF Y=-1!($DATA(DIRUT))
SET WVPOP=1
QUIT
+9 SET WVB=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(^WV(790.02,DUZ(2),0))
SET WVE=1
QUIT
+5 IF '$PIECE(^WV(790.02,DUZ(2),0),U,5)!('WVA)
SET WVE=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 WVPOP=1
QUIT
+12 ;---> IF ALL CASE MANAGERS, S WVE=1 AND QUIT.
+13 IF Y="a"
SET WVE=1
QUIT
+14 ;
+15 WRITE !!," Select the Case Manager whose patients you wish to browse."
+16 ;
+17 DO DIC^WVFMAN(790.01,"QEMA",.Y," Select CASE MANAGER: ")
+18 IF Y<0
SET WVPOP=1
QUIT
+19 ;---> FOR ONE CASE MANAGER, SET WVE=0 AND WVCMGR=^VA(200 DFN, QUIT.
+20 SET WVCMGR=+Y
SET WVE=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 'WVA
SET WVC=1
QUIT
+4 ;
+5 ;---> SORT SEQUENCE IN WVC: 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 WVPOP=1
QUIT
+17 SET WVC=Y
+18 QUIT
+19 ;
DEVICE ;EP
+1 ;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
+2 SET ZTRTN="DEQUEUE^WVBRNOT"
+3 FOR WVSV="A","B","C","D","E","CMGR","DFN","BEGDT","ENDDT"
Begin DoDot:1
+4 IF $DATA(@("WV"_WVSV))
SET ZTSAVE("WV"_WVSV)=""
End DoDot:1
+5 DO ZIS^WVUTL2(.WVPOP,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 WVTAB=5
SET WVLINL="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 WVTAB=5
SET WVLINL="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 ;;"ALL Notifications" includes DELINQUENT, OPEN and CLOSED.
+13 ;; CLOSED notifications are ones that have been brought to closure,
+14 ;; in other words, either the patient has been contacted or the
+15 ;; case is no longer active.
+16 SET WVTAB=5
SET WVLINL="HELP4"
DO HELPTX
+17 QUIT
+18 ;
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 WVTAB=5
SET WVLINL="HELP5"
DO HELPTX
+4 QUIT
+5 ;
HELPTX ;EP
+1 ;---> CREATES DIR ARRAY FOR DIR. REQUIRED VARIABLES: WVTAB,WVLINL.
+2 NEW I,T,X
SET T=$$REPEAT^XLFSTR(" ",WVTAB)
+3 FOR I=1:1
SET X=$TEXT(@WVLINL+I)
if X'[";;"
QUIT
SET DIR("?",I)=T_$PIECE(X,";;",2)
+4 SET DIR("?")=DIR("?",I-1)
KILL DIR("?",I-1)
+5 QUIT