XMTDO ;ISC-SF/GMB-Deliver other (server,device) ;04/11/2002  07:05
 ;;8.0;MailMan;**45**;Jun 28, 2002;Build 8
 ; Replaces ZSER^, ZDEV^XMS1 (ISC-WASH/THM/CAP)
 ;
 ; Patch mod to attempt to sync mail message arrival with processing
 ; by building in 5 minute pause waiting for next mail msg line to
 ; arrive, and, if not, then xm send error server msg 
 ;
SERVER ; S.server TASKMAN ENTRY
 ; Variables supplied by TaskMan:  XMZ,XMSERVER,XMSVIENS
 ; XMSERVER  Name of the server option (includes leading S.)
 N XMZREC,XMFROM,XMSERR,XMSUBJ,XMZI
 D DUZ^XUP(.5)
 F XMZI=1:1 S XMZREC=$G(^XMB(3.9,XMZ,0)) Q:XMZREC'=""  H 1 I XMZI>300 D  Q   ;patch mod for timing lag with mail msg
 . N XMPARM,XMINSTR
 . S XMINSTR("FROM")=.5
 . S XMPARM(1)=XMSERVER
 . S XMPARM(2)=ZTSK
 . D TASKBULL^XMXBULL(.5,"XM SEND ERR SERVER MSG",.XMPARM,"",.5,.XMINSTR)
 Q:XMZREC=""     ;patch mode to quit if mail msg lag check occurs in for loop waiting for next line
 S XMSUBJ=$P(XMZREC,U,1)
 S:XMSUBJ["~U~" XMSUB=$$DECODEUP^XMXUTIL1(XMSUBJ)
 S XMFROM=$P(XMZREC,U,2)
 S:XMFROM["@" XMFROM=$$REPLYTO1^XMXREPLY(XMZ)
 D SETSTAT(XMSVIENS,$$EZBLD^DIALOG(39300)) ; Server hand off ready
 D DOSERV($E(XMSERVER,3,99),XMZ,XMFROM,XMSUBJ,.XMSERR)
 D SETSTAT(XMSVIENS,$S($D(XMSERR):XMSERR,1:$$EZBLD^DIALOG(39301))) ; Served (hand off done)
 S ZTREQ="@"
 Q
DOSERV(XMXX,XMZ,XMFROM,XMSUBJ,XQSRVOK) ;
 N XMCHAN,XMPROT,X,Y,XMSEN,XMREC,XMOPEN,XMCLOSE,XMSVIENS
 S XMCHAN="SERVER"
 D GET^XML
 S X=XMXX_U_XMZ_U_XMFROM_U_XMSUBJ
 D ^XQSRV
 ; ^XQSRV1 calls SETSB^XMA1C to put the msg in the postmaster's bskt.
 ; Instead, that line could read:
 ; D:XQSRV PUTSERV^XMXMSGS1(XQSOP,XQMSG)
 Q
DEVICE ; D.device or H.device TASKMAN ENTRY
 ; Variables supplied by TaskMan:  XMDUZ,XMZ,XMDVIENS,XMPRTHDR
 ; TaskMan opens and closes the device.
 N XMV
 I '$G(DUZ) D DUZ^XUP(XMDUZ)
 D INITAPI^XMVVITAE
 D PRTMSG^XMJMP(XMDUZ,"?",XMZ,"0-",0,$G(XMPRTHDR,1))
 D SETSTAT(XMDVIENS,$$EZBLD^DIALOG(39302)) ; Printed
 S ZTREQ="@"
 Q
SETSTAT(XMIENS,XMSTATUS) ; Record Time/Status in msg file
 N XMFDA
 S XMFDA(3.91,XMIENS,2)=$$NOW^XLFDT
 S XMFDA(3.91,XMIENS,5)=XMSTATUS
 D FILE^DIE("","XMFDA")
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMTDO   2174     printed  Sep 23, 2025@19:49:20                                                                                                                                                                                                       Page 2
XMTDO     ;ISC-SF/GMB-Deliver other (server,device) ;04/11/2002  07:05
 +1       ;;8.0;MailMan;**45**;Jun 28, 2002;Build 8
 +2       ; Replaces ZSER^, ZDEV^XMS1 (ISC-WASH/THM/CAP)
 +3       ;
 +4       ; Patch mod to attempt to sync mail message arrival with processing
 +5       ; by building in 5 minute pause waiting for next mail msg line to
 +6       ; arrive, and, if not, then xm send error server msg 
 +7       ;
SERVER    ; S.server TASKMAN ENTRY
 +1       ; Variables supplied by TaskMan:  XMZ,XMSERVER,XMSVIENS
 +2       ; XMSERVER  Name of the server option (includes leading S.)
 +3        NEW XMZREC,XMFROM,XMSERR,XMSUBJ,XMZI
 +4        DO DUZ^XUP(.5)
 +5       ;patch mod for timing lag with mail msg
           FOR XMZI=1:1
               SET XMZREC=$GET(^XMB(3.9,XMZ,0))
               if XMZREC'=""
                   QUIT 
               HANG 1
               IF XMZI>300
                   Begin DoDot:1
 +6                    NEW XMPARM,XMINSTR
 +7                    SET XMINSTR("FROM")=.5
 +8                    SET XMPARM(1)=XMSERVER
 +9                    SET XMPARM(2)=ZTSK
 +10                   DO TASKBULL^XMXBULL(.5,"XM SEND ERR SERVER MSG",.XMPARM,"",.5,.XMINSTR)
                   End DoDot:1
                   QUIT 
 +11      ;patch mode to quit if mail msg lag check occurs in for loop waiting for next line
           if XMZREC=""
               QUIT 
 +12       SET XMSUBJ=$PIECE(XMZREC,U,1)
 +13       if XMSUBJ["~U~"
               SET XMSUB=$$DECODEUP^XMXUTIL1(XMSUBJ)
 +14       SET XMFROM=$PIECE(XMZREC,U,2)
 +15       if XMFROM["@"
               SET XMFROM=$$REPLYTO1^XMXREPLY(XMZ)
 +16      ; Server hand off ready
           DO SETSTAT(XMSVIENS,$$EZBLD^DIALOG(39300))
 +17       DO DOSERV($EXTRACT(XMSERVER,3,99),XMZ,XMFROM,XMSUBJ,.XMSERR)
 +18      ; Served (hand off done)
           DO SETSTAT(XMSVIENS,$SELECT($DATA(XMSERR):XMSERR,1:$$EZBLD^DIALOG(39301)))
 +19       SET ZTREQ="@"
 +20       QUIT 
DOSERV(XMXX,XMZ,XMFROM,XMSUBJ,XQSRVOK) ;
 +1        NEW XMCHAN,XMPROT,X,Y,XMSEN,XMREC,XMOPEN,XMCLOSE,XMSVIENS
 +2        SET XMCHAN="SERVER"
 +3        DO GET^XML
 +4        SET X=XMXX_U_XMZ_U_XMFROM_U_XMSUBJ
 +5        DO ^XQSRV
 +6       ; ^XQSRV1 calls SETSB^XMA1C to put the msg in the postmaster's bskt.
 +7       ; Instead, that line could read:
 +8       ; D:XQSRV PUTSERV^XMXMSGS1(XQSOP,XQMSG)
 +9        QUIT 
DEVICE    ; D.device or H.device TASKMAN ENTRY
 +1       ; Variables supplied by TaskMan:  XMDUZ,XMZ,XMDVIENS,XMPRTHDR
 +2       ; TaskMan opens and closes the device.
 +3        NEW XMV
 +4        IF '$GET(DUZ)
               DO DUZ^XUP(XMDUZ)
 +5        DO INITAPI^XMVVITAE
 +6        DO PRTMSG^XMJMP(XMDUZ,"?",XMZ,"0-",0,$GET(XMPRTHDR,1))
 +7       ; Printed
           DO SETSTAT(XMDVIENS,$$EZBLD^DIALOG(39302))
 +8        SET ZTREQ="@"
 +9        QUIT 
SETSTAT(XMIENS,XMSTATUS) ; Record Time/Status in msg file
 +1        NEW XMFDA
 +2        SET XMFDA(3.91,XMIENS,2)=$$NOW^XLFDT
 +3        SET XMFDA(3.91,XMIENS,5)=XMSTATUS
 +4        DO FILE^DIE("","XMFDA")
 +5        QUIT