source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XQALERT.m@ 1318

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

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1XQALERT ;ISC-SF.SEA/JLI - ALERT HANDLER ;5/4/05 10:25
2 ;;8.0;KERNEL;**1,65,125,173,285,366**;Jul 10, 1995
3 ;;
4 Q
5 ;
6SETUP ;SR.
7 D SETUP^XQALSET
8 Q
9 ;
10SETUP1() ;SR.
11 N I S I=$$SETUP1^XQALSET()
12 Q I
13 ;
14DISPLAY ;SR. Display any new alerts
15 Q:$O(^XTV(8992,DUZ,"XQA",0))'>0
16 N X,XQI,XQX,XQX1,DIR,XQA,Y,XQON,XQOFF,XQ1ON,XQ1OFF,XQXDAT S XQX=0,XQX1=0,Y=1,DIR(0)="E" ; P285
17 I $$ACTVSURO^XQALSURO(DUZ)'>0 D RETURN^XQALSUR1(DUZ) ; P366
18 F XQI=0:0 D:XQX1&'(XQX1#20) ^DIR Q:'Y S XQI=$O(^XTV(8992,DUZ,"XQA",XQI)) Q:XQI'>0 S XQX=XQX+1,X=$G(^XTV(8992,DUZ,"XQA",XQI,0)) I $P(X,U,4) D
19 . N XQXXX,XQXX,XQXY
20 . S XQXXX=X,(XQXX,XQXY)=0,XQXX=$P(X,U,2) I XQXX'="" S XQXX=$O(^XTV(8992.1,"B",$E(XQXX,1,50),0)) I XQXX>0 S XQXY=$O(^XTV(8992.1,XQXX,20,"B",DUZ,0)) I XQXY>0 S XQXDAT=$$NOW^XLFDT(),$P(^XTV(8992.1,XQXX,20,XQXY,0),U,2)=XQXDAT ; P173
21 . S XQON="$C(0)",XQOFF="$C(0)"
22 . S XQOUT=$P(XQXXX,U,3) I ($$UP^XLFSTR(XQOUT)["CRITICAL")!($$UP^XLFSTR(XQOUT)["ABNORMAL IMA") D:'$D(XQ1ON) SETREV S XQON=XQ1ON,XQOFF=XQ1OFF ; P285 modified to highlight critical and abnormal imaging alerts
23 . S X=XQXXX W:XQX1=0 $C(7) W !,@XQON,$P(X,U,3),@XQOFF S XQX1=XQX1+1,$P(^XTV(8992,DUZ,"XQA",XQI,0),U,4)="" I $D(^(2)) S X1=^(2) D ; P285
24 . . S X2=$P(X1,U,3)
25 . . W !?5,"*** FORWARDED BY: ",$P(^VA(200,+X1,0),U)," Generated: " S X1=$P($P(X,U,2),";",3) W $$DAT8(X1,1)
26 . . I X2'="" W !?5,X2
27 . I $P(X,U,5)="D" S XQA=$P(X,U,2) K ^XTV(8992,DUZ,"XQA",XQI) D S XQX=XQX-1 D:XQA'="" D
28 . . I $G(XQXX)>0,$G(XQXY)>0 S $P(^XTV(8992.1,XQXX,20,XQXY,0),U,5)=XQXDAT
29 . K XQXX,XQXY
30 I XQX>0 W:XQX1=0 !!,"You have PENDING ALERTS" W !?10,"Enter ""VA to jump to VIEW ALERTS option",! ; ISL-0898-51279
31 W:XQX1>0 !
32 K XQI,XQX,XQX1,DIR,XQA,Y
33 Q
34D K ^XTV(8992,"AXQA",XQA,DUZ),^XTV(8992,"AXQAN",$P(XQA,";"),DUZ)
35 Q
36 ;
37 ;
38DAT8(FMDAT,TFLG) ;
39 N X
40 S X=$E(FMDAT,4,5)_"/"_$E(FMDAT,6,7)_"/"_$E(FMDAT,2,3)
41 I $G(TFLG)>0 S FMDAT=FMDAT_"0000000",X=X_" "_$E(FMDAT,9,10)_":"_$E(FMDAT,11,12)_":"_$E(FMDAT,13,14)
42 Q X
43DOIT ;OPT. Process Alerts
44 N XQALAST,XQALFWD,XQAUSER K DTOUT,DIRUT,DUOUT,DIROUT
45 S XQAUSER=DUZ D DOIT^XQALERT1,COUNT^XQALDEL(0,XQAUSER)
46 Q
47 ;
48DELETE ;
49 D DELETE^XQALDEL
50 Q
51 ;
52DELETEA ;
53 D DELETEA^XQALDEL
54 Q
55 ;
56OLDDEL ;OPT.
57 D OLDDEL^XQALDEL
58 Q
59 ;
60USERDEL ;OPT.
61 D USERDEL^XQALDEL
62 Q
63 ;
64USER(ROOT,XQAUSER,FRSTDATE,LASTDATE) ; Returns current alerts for the user in an array located under root
65 I '$D(XQAUSER) S XQAUSER=DUZ
66 I $$ACTVSURO^XQALSURO(XQAUSER)'>0 D RETURN^XQALSUR1(XQAUSER) ; P366
67 D GETUSER^XQALDATA(ROOT,XQAUSER,$G(FRSTDATE),$G(LASTDATE))
68 Q
69 ;
70PATIENT(ROOT,PATIENT,FRSTDATE,LASTDATE) ;
71 I $G(PATIENT)'>0 Q
72 D GETPAT^XQALDATA(ROOT,PATIENT,$G(FRSTDATE),$G(LASTDATE))
73 Q
74ACTION(ALERTID) ;
75 D ACTION^XQALDOIT(ALERTID)
76 Q
77GETACT(ALERTID) ; Return to calling routine the information needed to act on
78 ; the specified alert.
79 ; On return the following variables are defined:
80 ; XQAID = the full alert id
81 ; XQADATA = Any data passed as XQADATA at the time the alert was generated
82 ; XQAROU = Indicates routine to be run (includes tag if necessary)
83 ; This value may have three meanings
84 ; 1. A null value indicates no routine to be used (XQAOPT contains
85 ; option name to be run)
86 ; 2. A value of ^<space> indicates that the alert is information
87 ; only (no routine or option action involved).
88 ; 3. The name of the routine as ^ROUTINE or TAG^ROUTINE
89 ; XQAOPT = Indicates the name of the option to be run if not null.
90 ;
91 N XQX,XQZ,XQAGETAC
92 S XQAGETAC=1,XQX="",XQZ=""
93 D ACTION^XQALDOIT(ALERTID)
94 S XQAID=$P(XQX,U,2)
95 S XQADATA=$S(XQZ'="":XQZ,1:$P(XQX,U,9,99))
96 S XQAROU=$S($P(XQX,U,8)="":"",1:$P(XQX,U,7,8))
97 S XQAOPT=$S($P(XQX,U,8)="":$P(XQX,U,7),1:"")
98 Q
99 ;
100SETREV ; Set on (XQ1ON) and off (XQ1OFF) variables for Reverse video ; P285
101 N XQ1ON1,XQ1OFF1
102 S XQ1ON="$C(0)",XQ1OFF="$C(0)" I IOST(0)>0 D
103 . S XQ1ON1=$$GET1^DIQ(3.2,IOST(0)_",",14) I XQ1ON1'="" S XQ1ON=XQ1ON1
104 . S XQ1OFF1=$$GET1^DIQ(3.2,IOST(0)_",",15) I XQ1OFF1'="" S XQ1OFF=XQ1OFF1
105 . Q
106 Q
Note: See TracBrowser for help on using the repository browser.