PRCNMESG ;SSI/ALA-Build Mail Messages ;[ 03/28/96 11:24 AM ]
;;1.0;Equipment/Turn-In Request;;Sep 13, 1996
CON ; Get the selected concurring officials to send message to
S CFL=0 Q:'$D(^PRCN(413,DA,5))
S N=0 F S N=$O(^PRCN(413,DA,5,N)) Q:'N D
. S CFL=1,NUM=^PRCN(413,DA,5,N,0)
. S XMY(+^PRCN(413.3,+NUM,0))=""
Q
FND ; Find holders
S PDZ="" F S PDZ=$O(^XUSEC(KEY,PDZ)) Q:PDZ="" S XMY(PDZ)=""
K KEY,PDZ
Q
MES ; Send mail message to requestor and CMR Official
S PRCNCMR=$P(^PRCN(413,IN,0),U,6),PRCNRQS=$P(^(0),U,2)
S XMB(1)=$P(^PRCN(413,IN,0),U) S:$G(MSGN)=53 XMB(2)=$P(^PRCN(413,IN,0),U,18)
S XMDUZ=DUZ,XMY(PRCNCMR)="",XMY(PRCNRQS)=""
S XMB=$S(MSGN=39:"PRCNEQC1",MSGN=40:"PRCNEQC2",MSGN=43:"PRCNEQC3",MSGN=44:"PRCNEQC4",MSGN=53:"PRCNEQFN",1:$G(XMB))
I $G(NOD)="" G MS
; Append the explanation text to end of this mail message
S NL=$P($G(^PRCN(413,IN,NOD,0)),U,3)
I NL'="" F II=1:1:NL S MSG(II)=$G(^PRCN(413,IN,NOD,II,0))
MS S XMTEXT="MSG(" D ^XMB
K NL,MSGN,II,MSG,NOD,XMY,XMDUZ,PRCNCMR,PRCNRQS,XMB
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCNMESG 1049 printed Oct 16, 2024@17:55:13 Page 2
PRCNMESG ;SSI/ALA-Build Mail Messages ;[ 03/28/96 11:24 AM ]
+1 ;;1.0;Equipment/Turn-In Request;;Sep 13, 1996
CON ; Get the selected concurring officials to send message to
+1 SET CFL=0
if '$DATA(^PRCN(413,DA,5))
QUIT
+2 SET N=0
FOR
SET N=$ORDER(^PRCN(413,DA,5,N))
if 'N
QUIT
Begin DoDot:1
+3 SET CFL=1
SET NUM=^PRCN(413,DA,5,N,0)
+4 SET XMY(+^PRCN(413.3,+NUM,0))=""
End DoDot:1
+5 QUIT
FND ; Find holders
+1 SET PDZ=""
FOR
SET PDZ=$ORDER(^XUSEC(KEY,PDZ))
if PDZ=""
QUIT
SET XMY(PDZ)=""
+2 KILL KEY,PDZ
+3 QUIT
MES ; Send mail message to requestor and CMR Official
+1 SET PRCNCMR=$PIECE(^PRCN(413,IN,0),U,6)
SET PRCNRQS=$PIECE(^(0),U,2)
+2 SET XMB(1)=$PIECE(^PRCN(413,IN,0),U)
if $GET(MSGN)=53
SET XMB(2)=$PIECE(^PRCN(413,IN,0),U,18)
+3 SET XMDUZ=DUZ
SET XMY(PRCNCMR)=""
SET XMY(PRCNRQS)=""
+4 SET XMB=$SELECT(MSGN=39:"PRCNEQC1",MSGN=40:"PRCNEQC2",MSGN=43:"PRCNEQC3",MSGN=44:"PRCNEQC4",MSGN=53:"PRCNEQFN",1:$GET(XMB))
+5 IF $GET(NOD)=""
GOTO MS
+6 ; Append the explanation text to end of this mail message
+7 SET NL=$PIECE($GET(^PRCN(413,IN,NOD,0)),U,3)
+8 IF NL'=""
FOR II=1:1:NL
SET MSG(II)=$GET(^PRCN(413,IN,NOD,II,0))
MS SET XMTEXT="MSG("
DO ^XMB
+1 KILL NL,MSGN,II,MSG,NOD,XMY,XMDUZ,PRCNCMR,PRCNRQS,XMB
+2 QUIT