SCAPMSG ;ALB/SCK - PCMM MESSAGE GENERATOR ; 22 SEP 95
;;5.3;Scheduling;**41**;AUG 13, 1993
;;1
Q
; mailman message generator for the primary care management
; module.
;
PARSE(SC) ;
; -- array parsing for messages
; SCDUZ - DUZ of user triggering the message
; SCIENS - The Internal entry number of the team, position, or
; patient, etc.
; SCDATE - The date and/or time of the change or incident that
; triggered the notification in external format.
; SCSUBJ - The subject for the message
; SCMSG - The message type
; SCTEXT - text line to be added to the message
;
S SCDUZ=$G(SC("DUZ"))
S SCIENS=$G(SC("IENS"))
S SCDATE=$G(SC("DATE"))
S SCSUBJ=$G(SC("SUBJECT"))
S SCMSG=$G(SC("MESSAGE"))
S SCTEXT=$G(SC("TEXT"))
Q
;
MAILC(SCOK,SCROOT) ;
;
N SCTEXT,SCSUBJ,SCDUZ
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
;
D BLDMSG(.SCROOT,.SCSUBJ,.SCDUZ)
;
S XMDUZ=$S($G(SCDUZ)]"":SCDUZ,1:"PRIMARY CARE MANAGEMENT")
S XMSUB=$S($G(SCSUBJ)]"":SCSUBJ,1:"PCMM NOTIFICATION")
D XMZ^XMA2
G:XMZ<1 MAILQ
S XMTEXT="SCTEXT("
S XMY("G.PCM MESSAGING@DEVFEX.ISC-ALBANY.DOMAIN.EXT")=""
;
D ^XMD
S SCOK=XMZ
MAILQ Q
;
BLDMSG(SCROOT,SCSUBJ,SCDUZ) ;
;
N I
S SCDUZ=$P($G(SCROOT(1,0)),U,1)
S SCSUBJ=$P($G(SCROOT(1,0)),U,2)
;
S I=0
F S I=$O(SCROOT(1,I)) Q:'I S SCTEXT(I)=SCROOT(1,I)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCAPMSG 1412 printed Dec 13, 2024@02:38:24 Page 2
SCAPMSG ;ALB/SCK - PCMM MESSAGE GENERATOR ; 22 SEP 95
+1 ;;5.3;Scheduling;**41**;AUG 13, 1993
+2 ;;1
+3 QUIT
+4 ; mailman message generator for the primary care management
+5 ; module.
+6 ;
PARSE(SC) ;
+1 ; -- array parsing for messages
+2 ; SCDUZ - DUZ of user triggering the message
+3 ; SCIENS - The Internal entry number of the team, position, or
+4 ; patient, etc.
+5 ; SCDATE - The date and/or time of the change or incident that
+6 ; triggered the notification in external format.
+7 ; SCSUBJ - The subject for the message
+8 ; SCMSG - The message type
+9 ; SCTEXT - text line to be added to the message
+10 ;
+11 SET SCDUZ=$GET(SC("DUZ"))
+12 SET SCIENS=$GET(SC("IENS"))
+13 SET SCDATE=$GET(SC("DATE"))
+14 SET SCSUBJ=$GET(SC("SUBJECT"))
+15 SET SCMSG=$GET(SC("MESSAGE"))
+16 SET SCTEXT=$GET(SC("TEXT"))
+17 QUIT
+18 ;
MAILC(SCOK,SCROOT) ;
+1 ;
+2 NEW SCTEXT,SCSUBJ,SCDUZ
+3 DO CHK^SCUTBK
+4 DO TMP^SCUTBK
+5 ;
+6 SET SCOK=0
+7 ;
+8 DO BLDMSG(.SCROOT,.SCSUBJ,.SCDUZ)
+9 ;
+10 SET XMDUZ=$SELECT($GET(SCDUZ)]"":SCDUZ,1:"PRIMARY CARE MANAGEMENT")
+11 SET XMSUB=$SELECT($GET(SCSUBJ)]"":SCSUBJ,1:"PCMM NOTIFICATION")
+12 DO XMZ^XMA2
+13 if XMZ<1
GOTO MAILQ
+14 SET XMTEXT="SCTEXT("
+15 SET XMY("G.PCM MESSAGING@DEVFEX.ISC-ALBANY.DOMAIN.EXT")=""
+16 ;
+17 DO ^XMD
+18 SET SCOK=XMZ
MAILQ QUIT
+1 ;
BLDMSG(SCROOT,SCSUBJ,SCDUZ) ;
+1 ;
+2 NEW I
+3 SET SCDUZ=$PIECE($GET(SCROOT(1,0)),U,1)
+4 SET SCSUBJ=$PIECE($GET(SCROOT(1,0)),U,2)
+5 ;
+6 SET I=0
+7 FOR
SET I=$ORDER(SCROOT(1,I))
if 'I
QUIT
SET SCTEXT(I)=SCROOT(1,I)
+8 QUIT