- CIAUALR ;MSC/IND/DKM - Send alert to user(s) via kernel or mail;04-May-2006 08:19;DKM
- ;;1.2;CIA UTILITIES;;Mar 20, 2007
- ;;Copyright 2000-2006, Medsphere Systems Corporation
- ;=================================================================
- ; Send an alert.
- ; XQAMSG = Message to send
- ; CIAUSR = A semicolon-delimited list of users to receive alert.
- ;=================================================================
- ALERT(XQAMSG,CIAUSR) ;
- N XQA,XQAOPT,XQAFLG,XQAROU,XQADATA,XQAID
- S @$$TRAP^CIAUOS("EXIT^CIAUALR"),CIAUSR=$G(CIAUSR,"*"),XQAMSG=$TR(XQAMSG,U,"~")
- D ENTRY^CIAUUSR(CIAUSR,.XQA),SETUP^XQALERT:$D(XQA)
- EXIT Q
- ;=================================================================
- ; Send a mail message
- ; CIAMSG = Message to send (single node or array)
- ; XMY = A semicolon-delimited list (or array) of users
- ; XMSUB = Subject line (optional)
- ; XMDUZ = DUZ of sender (optional)
- ;=================================================================
- MAIL(CIAMSG,XMY,XMSUB,XMDUZ) ;
- N XMTEXT
- S:$D(CIAMSG)=1 CIAMSG(1)=CIAMSG
- S XMTEXT="CIAMSG(",@$$TRAP^CIAUOS("EXIT^CIAUALR"),XMY=$G(XMY)
- S:$G(XMSUB)="" XMSUB=CIAMSG
- S:$G(XMDUZ)="" XMDUZ=$G(DUZ)
- F Q:'$L(XMY) S X=$P(XMY,";"),XMY=$P(XMY,";",2,999) S:$L(X) XMY(X)=""
- D ^XMD:$D(XMY)>9
- Q
- 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
- +2 ;;Copyright 2000-2006, Medsphere Systems Corporation
- +3 ;=================================================================
- +4 ; Send an alert.
- +5 ; XQAMSG = Message to send
- +6 ; CIAUSR = A semicolon-delimited list of users to receive alert.
- +7 ;=================================================================
- ALERT(XQAMSG,CIAUSR) ;
- +1 NEW XQA,XQAOPT,XQAFLG,XQAROU,XQADATA,XQAID
- +2 SET @$$TRAP^CIAUOS("EXIT^CIAUALR")
- SET CIAUSR=$GET(CIAUSR,"*")
- SET XQAMSG=$TRANSLATE(XQAMSG,U,"~")
- +3 DO ENTRY^CIAUUSR(CIAUSR,.XQA)
- IF $DATA(XQA)
- DO SETUP^XQALERT
- EXIT QUIT
- +1 ;=================================================================
- +2 ; Send a mail message
- +3 ; CIAMSG = Message to send (single node or array)
- +4 ; XMY = A semicolon-delimited list (or array) of users
- +5 ; XMSUB = Subject line (optional)
- +6 ; XMDUZ = DUZ of sender (optional)
- +7 ;=================================================================
- MAIL(CIAMSG,XMY,XMSUB,XMDUZ) ;
- +1 NEW XMTEXT
- +2 IF $DATA(CIAMSG)=1
- SET CIAMSG(1)=CIAMSG
- +3 SET XMTEXT="CIAMSG("
- SET @$$TRAP^CIAUOS("EXIT^CIAUALR")
- SET XMY=$GET(XMY)
- +4 IF $GET(XMSUB)=""
- SET XMSUB=CIAMSG
- +5 IF $GET(XMDUZ)=""
- SET XMDUZ=$GET(DUZ)
- +6 FOR
- IF '$LENGTH(XMY)
- QUIT
- SET X=$PIECE(XMY,";")
- SET XMY=$PIECE(XMY,";",2,999)
- IF $LENGTH(X)
- SET XMY(X)=""
- +7 IF $DATA(XMY)>9
- DO ^XMD
- +8 QUIT