Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RGUTALR

RGUTALR.m

Go to the documentation of this file.
  1. RGUTALR ;CAIRO/DKM - Send alert to user(s) via kernel or mail;04-Sep-1998 11:26;DKM
  1. ;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
  1. ;=================================================================
  1. ; Send an alert.
  1. ; XQAMSG = Message to send
  1. ; RGUSR = A semicolon-delimited list of users to receive alert.
  1. ;=================================================================
  1. ALERT(XQAMSG,RGUSR) ;
  1. N XQA,XQAOPT,XQAFLG,XQAROU,XQADATA,XQAID
  1. S @$$TRAP^RGZOSF("EXIT^RGUTALR"),RGUSR=$G(RGUSR,"*"),XQAMSG=$TR(XQAMSG,U,"~")
  1. D ENTRY^RGUTUSR(RGUSR,.XQA),SETUP^XQALERT:$D(XQA)
  1. EXIT Q
  1. ;=================================================================
  1. ; Send a mail message
  1. ; RGMSG = Message to send (single node or array)
  1. ; XMY = A semicolon-delimited list (or array) of users
  1. ; XMSUB = Subject line (optional)
  1. ; XMDUZ = DUZ of sender (optional)
  1. ;=================================================================
  1. MAIL(RGMSG,XMY,XMSUB,XMDUZ) ;
  1. N XMTEXT
  1. S:$D(RGMSG)=1 RGMSG(1)=RGMSG
  1. S XMTEXT="RGMSG(",@$$TRAP^RGZOSF("EXIT^RGUTALR"),XMY=$G(XMY)
  1. S:$G(XMSUB)="" XMSUB=RGMSG
  1. S:$G(XMDUZ)="" XMDUZ=$G(DUZ)
  1. F Q:'$L(XMY) S X=$P(XMY,";"),XMY=$P(XMY,";",2,999) S:$L(X) XMY(X)=""
  1. D ^XMD:$D(XMY)>9
  1. Q