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