source: FOIAVistA/trunk/r/WOMENS_HEALTH-WV/WVBRNOT.m@ 1540

Last change on this file since 1540 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1WVBRNOT ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE NOTIFICATIONS; ;7/30/98 11:02
2 ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
3 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
4 ;; CALLED BY OPTION: "WV BROWSE NOTIFICATIONS" TO BROWSE AND EDIT
5 ;; NOTIFICATIONS.
6 ;
7 ;---> VARIABLES:
8 ;---> WVA: 1=ALL PATIENTS, 0=ONE PATIENT
9 ;---> WVDFN: DFN OF SELECTED PATIENT
10 ;---> DATES: WVBEGDT=BEGINNING DATE, WVENDDT=ENDING DATE
11 ;---> WVB: d=DELINQUENT, o=OPEN, q=queued, a=ALL (includes CLOSED).
12 ;---> SORT SEQUENCE IN WVC: 1=DATE, PATIENT, PRIORITY
13 ;---> 2=PATIENT, DATE, PRIORITY
14 ;---> 3=PRIORITY, DATE, PATIENT
15 ;---> USE NODES 3 & 4 IN ^TMP GLOBAL.
16 ;
17 D SETVARS^WVUTL5
18 D ^WVBRNOT2 G:WVPOP EXIT
19 D SORT
20 D COPYGBL
21 D ^WVBRNOT1
22 ;
23EXIT ;EP
24 D KILLALL^WVUTL8
25 Q
26 ;
27 ;
28SORT ;EP
29 ;---> SORT AND STORE ARRAY IN ^TMP("WV",$J
30 K ^TMP("WV",$J)
31 ;---> WVBEGDT1=ONE SECOND BEFORE BEGIN DATE.
32 ;---> WVENDDT1=THE LAST SECOND OF END DATE.
33 S WVBEGDT1=WVBEGDT-.0001,WVENDDT1=WVENDDT+.9999
34 ;
35 ;**************************
36 ;---> WVA=1: ALL PATIENTS
37 I WVA D Q
38 .;---> BY DATE GET EITHER ALL OR OPEN ONLY.
39 .N WVDFN,WVIEN,Y
40 .S WVXREF=$S(WVB="a":"D",WVB="q":"APRT",1:"AOPEN")
41 .S WVDATE=WVBEGDT1
42 .F S WVDATE=$O(^WV(790.4,WVXREF,WVDATE)) Q:'WVDATE!(WVDATE>WVENDDT1) D
43 ..S WVIEN=0
44 ..F S WVIEN=$O(^WV(790.4,WVXREF,WVDATE,WVIEN)) Q:'WVIEN D
45 ...Q:'$D(^WV(790.4,WVIEN,0))
46 ...S Y=^WV(790.4,WVIEN,0),WVDFN=$P(Y,U)
47 ...;---> QUIT IF SELECTING FOR ONE CASE MANAGER AND THIS DOESN'T MATCH.
48 ...I 'WVE Q:$P(^WV(790,WVDFN,0),U,10)'=WVCMGR
49 ...;---> QUIT IF LISTING "DELINQUENT" AND THIS PROCDURE IS NOT DELINQ.
50 ...I WVB="d" Q:$P(Y,U,13)'<DT!($P(Y,U,13)="")
51 ...D STORE
52 ;
53 ;**************************
54 ;---> WVA=0: ONE PATIENT
55 N WVIEN,Y S WVIEN=0
56 F S WVIEN=$O(^WV(790.4,"B",WVDFN,WVIEN)) Q:'WVIEN D
57 .S Y=^WV(790.4,WVIEN,0)
58 .;---> QUIT IF NOT WITHIN DATE RANGE.
59 .S WVDATE=$P(Y,U,2)
60 .Q:WVDATE'>WVBEGDT1!(WVDATE>WVENDDT1)
61 .;---> QUIT IF "QUEUED" AND THIS NOTIFICATION IS NOT QUEUED.
62 .I WVB="q" Q:'$P(Y,U,11) Q:'$D(^WV(790.4,"APRT",$P(Y,U,11),WVIEN))
63 .;---> QUIT IF "DELINQUENT" OR OPEN ONLY AND THIS ENTRY IS CLOSED.
64 .Q:"do"[WVB&($P(Y,U,14)="c")
65 .I WVB="d" Q:$P(Y,U,13)'<DT!($P(Y,U,13)="")
66 .D STORE
67 Q
68 ;
69STORE ;EP
70 ;--->WVDATE IS ALREADY SET FROM LL SORT ABOVE. ;---> DATE
71 S WVCHRT=$$SSN^WVUTL1(WVDFN)_" " ;---> SSN#
72 S WVNAME=$$NAME^WVUTL1(WVDFN) ;---> NAME
73 S WVACC=$P(Y,U,6) ;---> ACCESSION#
74 I WVACC]"" S WVACC=$P(^WV(790.1,WVACC,0),U)
75 S WVSTAT=$$STATUS^WVUTL4 ;---> STATUS
76 S WVPRIO=9
77 S:$P(Y,U,4)]"" WVPRIO=$P(^WV(790.404,$P(Y,U,4),0),U,2) ;---> PRIORITY
78 ;
79 S X=WVCHRT_U_WVNAME_U_WVDATE_U_WVACC_U_WVSTAT_U_WVPRIO_U_WVIEN
80 I WVC=1 S ^TMP("WV",$J,3,WVDATE,WVNAME,WVPRIO,WVIEN)=X Q
81 I WVC=2 S ^TMP("WV",$J,3,WVNAME,WVDATE,WVPRIO,WVIEN)=X Q
82 I WVC=3 S ^TMP("WV",$J,3,WVPRIO,WVDATE,WVNAME,WVIEN)=X
83 Q
84 ;
85COPYGBL ;EP
86 ;---> COPY ^TMP("WV",$J,3 TO ^TMP("WV",$J,4 TO MAKE IT FLAT.
87 N I,M,N,P,Q
88 S N=0,I=0
89 F S N=$O(^TMP("WV",$J,3,N)) Q:N="" D
90 .S M=0
91 .F S M=$O(^TMP("WV",$J,3,N,M)) Q:M="" D
92 ..S P=0
93 ..F S P=$O(^TMP("WV",$J,3,N,M,P)) Q:P="" D
94 ...S Q=0
95 ...F S Q=$O(^TMP("WV",$J,3,N,M,P,Q)) Q:Q="" D
96 ....S I=I+1,^TMP("WV",$J,4,I)=^TMP("WV",$J,3,N,M,P,Q)
97 Q
98 ;
99 ;
100DEQUEUE ;EP
101 ;---> TASKMAN QUEUE OF PRINTOUT.
102 D SETVARS^WVUTL5,SORT,COPYGBL,^WVBRNOT1,EXIT
103 Q
104 ;
105FOLLOW(WVDFN) ;EP
106 ;---> CALLED FROM PROCEDURE FOLLOWUP MENU.
107 D SETVARS^WVUTL5
108 S WVA=0,WVB="o",WVBEGDT=(DT-50000),WVC=1,WVE=1,WVENDDT=DT
109 D DEVICE^WVBRNOT2 Q:WVPOP
110 S WVLOOP=1
111 D SORT,COPYGBL,^WVBRNOT1
112 Q
Note: See TracBrowser for help on using the repository browser.