1 | TIUALRT1 ; SLC/JER - More alert processing ;4/9/01
|
---|
2 | ;;1.0;TEXT INTEGRATION UTILITIES;**100**;Jun 20, 1997
|
---|
3 | SENDID(DA) ; Generates "ID Entry attached" alert
|
---|
4 | N TIU0,TIU12,TIU13,TIU14,TIU15,TIU21,TIUPNM,TIUSSN,TIUTRAN,TIU,TIUTITLE
|
---|
5 | N TIUDPRM,XQA,XQAMSG,XQAFLG,XQADATA,XQAROU,TIUESNR,TIUDATE,TIUESNM
|
---|
6 | N TIUO0,TIUO12,TIUO13,TIUECSNR
|
---|
7 | I '$D(TIUPRM0)!'$D(TIUPRM1) D SETPARM^TIULE
|
---|
8 | D IDDEL(DA)
|
---|
9 | ; Don't send if notifications not enabled
|
---|
10 | I '+$P(TIUPRM1,U,7) Q
|
---|
11 | S TIU0=$G(^TIU(8925,+DA,0))
|
---|
12 | S TIU12=$G(^TIU(8925,+DA,12)),TIU13=$G(^(13)),TIU14=$G(^(14))
|
---|
13 | S TIU15=$G(^TIU(8925,+DA,15)),TIU21=$G(^(21))
|
---|
14 | Q:+TIU21'>0
|
---|
15 | S TIUO0=$G(^TIU(8925,+TIU21,0)),TIUO12=$G(^(12)),TIUO13=$G(^(13))
|
---|
16 | ; Only send if document parameter indicates you should
|
---|
17 | D DOCPRM^TIULC1(+TIUO0,.TIUDPRM,DA)
|
---|
18 | Q:'+$P(TIUDPRM(0),U,19)
|
---|
19 | S TIUPNM=$E($$PTNAME^TIULC1(+$P(TIU0,U,2)),1,9)
|
---|
20 | S TIUESNM=$$NAME^TIULS($$PERSNAME^TIULC1(+$P(TIU12,U,2)),"LAST,FI MI")
|
---|
21 | S TIUTITLE=$E($$PNAME^TIULC1(+TIUO0),1,20)
|
---|
22 | S TIUDATE=$S(+$P(TIUO13,U):$P(TIUO13,U),1:$G(DT))
|
---|
23 | S TIUDATE=$$DATE^TIULS(TIUDATE)
|
---|
24 | D PATVADPT^TIULV(.TIU,+$P(TIU0,U,2)) ;Used to get SSN. Date not important.
|
---|
25 | S TIUSSN=$E(TIUPNM,1)_$P($G(TIU("SSN")),"-",3)
|
---|
26 | S TIUTRAN=$P(TIU13,U,2)
|
---|
27 | ;Expected Cosigner and Author of original document
|
---|
28 | S TIUECSNR=$P($G(^TIU(8925,+TIU21,12)),U,8),TIUESNR=$P($G(^(12)),U,4)
|
---|
29 | ; Not attached by Expected Signer: SET Expected Signer as recipient
|
---|
30 | I TIUESNR'=DUZ,$D(^VA(200,+TIUESNR,0)) S XQA(TIUESNR)=""
|
---|
31 | ; Not attached by Expected Cosigner: SET Expected Cosigner as recipient
|
---|
32 | I +TIUECSNR,(TIUECSNR'=DUZ),$D(^VA(200,+TIUECSNR,0)) S XQA(TIUECSNR)=""
|
---|
33 | Q:$D(XQA)'>9
|
---|
34 | S XQAID="TIUID"_+DA_";",XQADATA=+DA_U,XQAROU="ACTID^TIUALRT1"
|
---|
35 | S XQAMSG=TIUPNM_" ("_TIUSSN_"): ID Entry added by "_TIUESNM_" for "_TIUTITLE_" of "_TIUDATE
|
---|
36 | D SETUP^XQALERT
|
---|
37 | Q
|
---|
38 | ;
|
---|
39 | ACTID ; Act on ID Entry alerts
|
---|
40 | N TIUQUIK,TIUDA,TIUPRM0,TIUPRM1,TIUPRM3 S TIUQUIK=1 K XQAKILL
|
---|
41 | S TIUDA=$P(XQADATA,U),XQAKILL=1
|
---|
42 | I '$D(^TIU(8925,+TIUDA,0)) D IDDEL(TIUDA) Q
|
---|
43 | W !!,"A NEW Interdisciplinary Entry has been added to your document...",!
|
---|
44 | W:$L($P($G(XQX),U,3)) !,$P($G(XQX),U,3),!
|
---|
45 | I '+$$READ^TIUU("YAO","Do you wish to Browse the Interdisciplinary Entry now? ","NO") Q
|
---|
46 | D:'$D(TIUPRM0)!'$D(TIUPRM1) SETPARM^TIULE
|
---|
47 | D EN^VALM("TIU BROWSE FOR CLINICIAN")
|
---|
48 | Q
|
---|
49 | ;
|
---|
50 | IDDEL(DA) ; Delete alert associated with ID Entry added
|
---|
51 | N XQA,XQAID,XQAKILL S XQAID="TIUID"_DA_";"
|
---|
52 | D DELETEA^XQALERT
|
---|
53 | Q
|
---|