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

PXRMMSG.m

Go to the documentation of this file.
  1. PXRMMSG ;SLC/PKR - Routine for sending MailMan messages. ;23-Mar-2015 10:37;DU
  1. ;;2.0;CLINICAL REMINDERS;**1001,17,18,1005**;Feb 04, 2005;Build 23
  1. ;
  1. ;======================================================================
  1. SEND(NODE,SUBJECT,TO,FROM) ;Send a MailMan message whose text is in
  1. ;^TMP(NODE,$J,N,0). SUBJECT is the subject. TO is the optional
  1. ;list of addresses, setup exactly like ;the MailMan XMY array.
  1. ;If TO is not defined try to send to the Clinical Reminders mail
  1. ;group. If that is not defined send to the user. FROM is the
  1. ;optional message from, if it is not defined then from will be
  1. ;Clinical Reminders Support. This can be free text or a DUZ.
  1. N MGIEN,MGROUP,NL,REF,XMDUZ,XMSUB,XMY,XMZ
  1. ;
  1. ;If this is a test run write out the message.
  1. I $G(PXRMDEBG) D
  1. . S REF="^TMP(NODE,$J)"
  1. . D AWRITE^PXRMUTIL(REF)
  1. ;
  1. ;Make sure the subject does not exceed 64 characters.
  1. S XMSUB=$E(SUBJECT,1,64)
  1. ;
  1. ;Make the default sender Clinical Reminders.
  1. S XMDUZ=$S($G(FROM)="":"Clinical Reminders Support",1:FROM)
  1. ;
  1. RETRY ;Get the message number.
  1. I +$G(PXRMITEM)=999999 Q ;IHS/MSC/MGH Patch 1001
  1. D XMZ^XMA2
  1. I XMZ<1 G RETRY
  1. ;
  1. ;Load the message
  1. M ^XMB(3.9,XMZ,2)=^TMP(NODE,$J)
  1. K ^TMP(NODE,$J)
  1. S NL=$O(^XMB(3.9,XMZ,2,""),-1)
  1. S ^XMB(3.9,XMZ,2,0)="^3.92^"_+NL_U_+NL_U_DT
  1. ;
  1. ;Send message to TO list if it is defined.
  1. I $D(TO)=11 M XMY=TO D ENT1^XMD Q
  1. ;Send the message to the site defined mail group or the user if
  1. ;there is no mail group.
  1. S MGIEN=$G(^PXRM(800,1,"MGFE"))
  1. S MGROUP=$S(MGIEN'="":"G."_$$GET1^DIQ(3.8,MGIEN,.01),1:DUZ)
  1. S XMY(MGROUP)=""
  1. D ENT1^XMD
  1. Q
  1. ;