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

SCAPMSG.m

Go to the documentation of this file.
  1. SCAPMSG ;ALB/SCK - PCMM MESSAGE GENERATOR ; 22 SEP 95
  1. ;;5.3;Scheduling;**41**;AUG 13, 1993
  1. ;;1
  1. Q
  1. ; mailman message generator for the primary care management
  1. ; module.
  1. ;
  1. PARSE(SC) ;
  1. ; -- array parsing for messages
  1. ; SCDUZ - DUZ of user triggering the message
  1. ; SCIENS - The Internal entry number of the team, position, or
  1. ; patient, etc.
  1. ; SCDATE - The date and/or time of the change or incident that
  1. ; triggered the notification in external format.
  1. ; SCSUBJ - The subject for the message
  1. ; SCMSG - The message type
  1. ; SCTEXT - text line to be added to the message
  1. ;
  1. S SCDUZ=$G(SC("DUZ"))
  1. S SCIENS=$G(SC("IENS"))
  1. S SCDATE=$G(SC("DATE"))
  1. S SCSUBJ=$G(SC("SUBJECT"))
  1. S SCMSG=$G(SC("MESSAGE"))
  1. S SCTEXT=$G(SC("TEXT"))
  1. Q
  1. ;
  1. MAILC(SCOK,SCROOT) ;
  1. ;
  1. N SCTEXT,SCSUBJ,SCDUZ
  1. D CHK^SCUTBK
  1. D TMP^SCUTBK
  1. ;
  1. S SCOK=0
  1. ;
  1. D BLDMSG(.SCROOT,.SCSUBJ,.SCDUZ)
  1. ;
  1. S XMDUZ=$S($G(SCDUZ)]"":SCDUZ,1:"PRIMARY CARE MANAGEMENT")
  1. S XMSUB=$S($G(SCSUBJ)]"":SCSUBJ,1:"PCMM NOTIFICATION")
  1. D XMZ^XMA2
  1. G:XMZ<1 MAILQ
  1. S XMTEXT="SCTEXT("
  1. S XMY("G.PCM MESSAGING@DEVFEX.ISC-ALBANY.DOMAIN.EXT")=""
  1. ;
  1. D ^XMD
  1. S SCOK=XMZ
  1. MAILQ Q
  1. ;
  1. BLDMSG(SCROOT,SCSUBJ,SCDUZ) ;
  1. ;
  1. N I
  1. S SCDUZ=$P($G(SCROOT(1,0)),U,1)
  1. S SCSUBJ=$P($G(SCROOT(1,0)),U,2)
  1. ;
  1. S I=0
  1. F S I=$O(SCROOT(1,I)) Q:'I S SCTEXT(I)=SCROOT(1,I)
  1. Q