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

CIAUALR.m

Go to the documentation of this file.
  1. CIAUALR ;MSC/IND/DKM - Send alert to user(s) via kernel or mail;04-May-2006 08:19;DKM
  1. ;;1.2;CIA UTILITIES;;Mar 20, 2007
  1. ;;Copyright 2000-2006, Medsphere Systems Corporation
  1. ;=================================================================
  1. ; Send an alert.
  1. ; XQAMSG = Message to send
  1. ; CIAUSR = A semicolon-delimited list of users to receive alert.
  1. ;=================================================================
  1. ALERT(XQAMSG,CIAUSR) ;
  1. N XQA,XQAOPT,XQAFLG,XQAROU,XQADATA,XQAID
  1. S @$$TRAP^CIAUOS("EXIT^CIAUALR"),CIAUSR=$G(CIAUSR,"*"),XQAMSG=$TR(XQAMSG,U,"~")
  1. D ENTRY^CIAUUSR(CIAUSR,.XQA),SETUP^XQALERT:$D(XQA)
  1. EXIT Q
  1. ;=================================================================
  1. ; Send a mail message
  1. ; CIAMSG = 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(CIAMSG,XMY,XMSUB,XMDUZ) ;
  1. N XMTEXT
  1. S:$D(CIAMSG)=1 CIAMSG(1)=CIAMSG
  1. S XMTEXT="CIAMSG(",@$$TRAP^CIAUOS("EXIT^CIAUALR"),XMY=$G(XMY)
  1. S:$G(XMSUB)="" XMSUB=CIAMSG
  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