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

HDISVM02.m

Go to the documentation of this file.
  1. HDISVM02 ;;CT/GRR SEND MESSAGE ; 02 Mar 2005 4:25 PM
  1. ;;1.0;HEALTH DATA & INFORMATICS;**6**;Feb 22, 2005
  1. ;
  1. SNDXML(ARRY,SRVR,HDISINP,SYSPTR) ;Send XML document to server
  1. ; Input: ARRY - Array containing XML document (closed root)
  1. ; SRVR - 1 = VUID Server, 2 = Status Update Server
  1. ; HDISINP - Array containing additional info (closed root) (optional)
  1. ; @HDISINP@(variable) = Value
  1. ; @HDISINP@(array,subscript) = Value
  1. ; @HDISINP@(array,subscript_1,subscript_2,...) = Value
  1. ;
  1. ; Example:
  1. ; @HDISINP@("TEST1")=1
  1. ; @HDISINP@("TEST2")=2
  1. ; @HDISINP@("TEST2","SUB1")="2A"
  1. ; @HDISINP@("TEST3","SUB1","SUB2")="3B"
  1. ;
  1. ; Results in the following variables/arrays being set:
  1. ; TEST1=1
  1. ; TEST2=2
  1. ; TEST2("SUB1")="2A"
  1. ; TEST3("SUB1","SUB2")="3B"
  1. ; SYSPTR - Pointer to HDIS System file (optional)
  1. ; If passed, the destination information is obtained
  1. ; from the HDIS Parameter file entry for the referenced
  1. ; system. By default, the destination information is
  1. ; pulled from the HDIS Parameter entry for the current
  1. ; system (which contains the destination information for
  1. ; the centrally located server)
  1. ;Output: None
  1. ; XML document sent to Data Standardization server option
  1. ; at given MailMan domain
  1. ;
  1. I ARRY=""!(SRVR="") Q "0^Required parameter missing"
  1. I SRVR'=1&(SRVR'=2) Q "0^SRVR Parameter invalid"
  1. N SUBJECT,HDITO,HDINSTR,HDIXMZ,SERVER,SRVTYP,MAXLIN,SRVROPT
  1. S SYSPTR=+$G(SYSPTR)
  1. I 'SYSPTR K SYSPTR I '$$CURSYS^HDISVF07(.SYSPTR) Q "0^Unable to determine current system"
  1. ;Get location information for VUID Server
  1. I SRVR=1 D
  1. .S SERVER=$$GETVLOC^HDISVF02(SYSPTR)
  1. .S SRVTYP=$$GETVCON^HDISVF02(SYSPTR)
  1. .S SRVROPT=$$GETVSRV^HDISVF02(SYSPTR)
  1. ;Get location information for Status Server
  1. I SRVR=2 D
  1. .S SERVER=$$GETSLOC^HDISVF03(SYSPTR)
  1. .S SRVTYP=$$GETSCON^HDISVF03(SYSPTR)
  1. .S SRVROPT=$$GETSSRV^HDISVF03(SYSPTR)
  1. ;Instantiate variables included in input array
  1. I $G(HDISINP)]"" D
  1. .N ROOT,RSCNT,NODE,NSCNT,TROOT
  1. .S ROOT=$$OREF^DILF(HDISINP)
  1. .S RSCNT=$QL(HDISINP)
  1. .S NODE=HDISINP
  1. .F S NODE=$Q(@NODE) Q:(NODE="")!(NODE'[ROOT) I $D(@NODE)#2 D
  1. ..S NSCNT=$QL(NODE)
  1. ..I (NSCNT-RSCNT)=1 S @$QS(NODE,NSCNT)=$G(@NODE) Q
  1. ..S TROOT=$QS(NODE,RSCNT+1)_"("_$P(NODE,",",RSCNT+2,NSCNT)
  1. ..S @TROOT=$G(@NODE)
  1. ;Set message subject
  1. I $G(SUBJECT)="" S SUBJECT="XML FORMATTED DATA FROM "_$P($$SITE^VASITE(),"^",2)
  1. ;Set message sender
  1. S HDINSTR("FROM")="Data Standardization Toolset"
  1. ;Set recipient list (includes server option on target server)
  1. N HDITO
  1. I SERVER="" S HDITO("S."_SRVROPT)=""
  1. I SERVER'="" S HDITO("S."_SRVROPT_"@"_SERVER)=""
  1. ;Send message to target server
  1. D SENDMSG^XMXAPI(DUZ,SUBJECT,ARRY,.HDITO,.HDINSTR,.HDIXMZ)
  1. I $G(XMERR) D
  1. .;Error sending message - log error text
  1. .D ERR2XTMP^HDISVU01("HDI-XM","Message sending",$NA(^TMP("XMERR",$J)))
  1. .K XMERR,^TMP("XMERR",$J)
  1. Q 1
  1. ;