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

HDISVM00.m

Go to the documentation of this file.
  1. HDISVM00 ;BPFO/JRP - SERVER TO RECEIVE XML MESSAGE;1/4/2005
  1. ;;1.0;HEALTH DATA & INFORMATICS;**6**;Feb 22, 2005
  1. ;
  1. XML ;Main entry point for XML server options
  1. ; Input: (As defined by MailMan and Kernel)
  1. ; XMREC - Executable code to "read" next line of message
  1. ; XQSUB - Subject of received message
  1. ; XQSOP - Server option name
  1. ; XQMSG,XMZ - Msg IEN in file 3.9
  1. ; XQSND,XMFROM - Msg sender
  1. ;Output: None
  1. ; Note: Input is not checked (assumes existence)
  1. ;
  1. N XMLARR,PRSARR,ERRARR,STOP,LINE,TYPE
  1. ;Establish temporary globals
  1. S XMLARR=$NA(^TMP(XQSOP,$J,"XML"))
  1. S PRSARR=$NA(^TMP(XQSOP,$J,"PARSED"))
  1. S ERRARR=$NA(^TMP(XQSOP,$J,"ERROR"))
  1. K @XMLARR,@PRSARR,@ERRARR
  1. ;Copy message to temporary global
  1. S STOP=0
  1. F LINE=1:1 D Q:STOP
  1. .X XMREC
  1. .I $D(XMER) I (XMER<0) S STOP=1 Q
  1. .S @XMLARR@(LINE)=XMRG
  1. ;Parse message
  1. D SAX^HDISVM01(XMLARR,PRSARR)
  1. ;Get type of system out of parameter file
  1. S TYPE=+$$GETTYPE^HDISVF02()
  1. ;Process messages on centralized server
  1. I TYPE=2 D MAIN^HDISVS00(PRSARR,ERRARR)
  1. ;Process messages on VistA (client) system
  1. I TYPE=1 D MAIN^HDISVC00(PRSARR,ERRARR)
  1. ;Error(s) occurred
  1. I $D(@ERRARR) D
  1. .;Send error message
  1. .D ERROR(ERRARR,XQMSG,XQSOP,XMFROM)
  1. .;Set message status
  1. .S X=$$SRVTIME^XMS1(XQMSG,"S."_XQSOP,"ERROR FOUND DURING PROCESSING")
  1. ;Delete message (don't delete if errors found)
  1. I '$D(@ERRARR) D ZAPSERV^XMXAPI("S."_XQSOP,XQMSG)
  1. ;Done
  1. K @XMLARR,@PRSARR,@ERRARR
  1. Q
  1. ;
  1. ERROR(ERRARR,MSGNUM,SRVR,SNDR) ;Send error message
  1. ; Input : ERRARR - Error array (closed root)
  1. ; MSGNUM - Message number of received message (XMZ)
  1. ; SRVR - Name of server option (XQSOP)
  1. ; SNDR - Sender of message (XMFROM)
  1. ;Output : None
  1. ; Notes : Existance/validity of input assumed (internal call)
  1. N NAME,HDISPRAM,HDISFLAG,HDISTASK
  1. ;Set bulletin parameters
  1. S HDISPRAM(1)=MSGNUM
  1. S HDISPRAM(2)=SNDR
  1. S HDISPRAM(3)=SRVR
  1. ;Send bulletin
  1. S NAME="HDIS XML MSG PROCESS ERROR"
  1. S HDISFLAG("FROM")="HDIS XML MESSAGE SERVER"
  1. D TASKBULL^XMXAPI(DUZ,NAME,.HDISPRAM,ERRARR,,.HDISFLAG,.HDISTASK)
  1. I $G(XMERR) D
  1. .;Error generating bulletin - log error text
  1. .D ERR2XTMP^HDISVU01("HDI-XM","Server error bulletin",$NA(^TMP("XMERR",$J)))
  1. .K XMERR,^TMP("XMERR",$J)
  1. Q