Oops, instead of hr.SetParam() try hr.InsertFormData("name","value").

This works for me:

USER>set req=##class(%Net.HttpRequest).%New()
USER>set req.Server = "blah.org"
USER>do req.SetParam("name","value")
USER>do req.Post("method",1,0) // 2nd param is output to current device; 3rd is no reset


POST /method?name=value HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; InterSystems IRIS;)
Host: blah.org
Accept-Encoding: gzip
Content-Length: 0

A <code> section would work, but if you're going to use this regularly within your DTLs, it might make sense to create a custom method that would be available through the Function drop-down list in the DTL Editor. For Example:

Class User.Test.FunctionSet Extends Ens.Util.FunctionSet
{
/// Unescapes the field value provided in <var>pPath</var> and returns it as a String.
ClassMethod UnEscapeHL7(pPath As %String, pSeps As %String = "|^~\&", pEsc As %String = "\") As %String
{
    Return ##class(EnsLib.HL7.Segment).UnescapeEx(pPath, pSeps, pEsc)
}
}

Call it like this (replacing the field in my example with the field containing your note comment):

I've updated the method to optionally accept separators and the escape character as arguments; you would use source.Separators and source.ESC to override the default values with the ones supplied in the source message.

You appear to be attempting to set the value of a field following the location of the stream object in the segment, and you can't do that directly ... this is a limitation specifically of working with stream objects in segments. You'll need to modify the string returned from GetFieldStreamRaw() in tRemainder and supply that as the 3rd argument to the StoreFieldStreamRaw() method.

I don't have a request of type EnsLib.EDI.XML.Document handy to test, but I do know that setting the Source property of the request (for an HL7 message, at least) to the desired filename will enable you to use the %f formatting token to obtain the Source contents as the filename. This should theoretically allow you to use the unmodified EnsLib.EDI.XML.Operation.FileOperation class ...

If the length of the encoded PDF is less than MAXSTRING (roughly 3.6MB) it will be populated in the message as type %String. Otherwise it's a %Stream.GobalCharacter, and working with them using property paths in many of the IRIS functions will cause problems. GetFieldStreamRaw() guarantees you have a stream to work with.

Things may work out fine with your current code, but I've always taken the precaution of making sure I'm working with a stream when there's a chance the field content may be large.

You will want to fetch the stream using the GetFieldStreamRaw() method in EnsLib.HL7.Message rather than just referencing the field directly.

Set tSC=source.GetFieldStreamRaw(.varBase64,"PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:5(1).5")
Return:$$$ISERR(tSC) tSC

This will have varBase64 as a proper stream object for use with your DecodeBase64HL7 method. GetFieldStreamRaw() supplies the stream as type %Stream.GlobalCharacter, so you may want to adjust your method ...

You can change the message DocType, but you can't change the message content:

HICG > s msg=##class(EnsLib.HL7.Message).%OpenId(7463)
HICG > w msg.IsMutable
0
HICG > w msg.DocType
2.3.1:ORU_R01
HICG > s msg.DocType="2.5.1:ADT_A01"
HICG > d msg.%Save()
HICG > w msg.DocType
2.5.1:ADT_A01
HICG >

Unfortunately there's no easy way to "reset" the source document type in the DTL editor dynamically. You could, however, dynamically set the document type in either a BPL or COS business process and then invoke the appropriate DTL for translation.

The class query MemberStatusList in SYS.Mirror (found in the %SYS namespace) will give you a list of mirror members and some useful status information:

%SYS>d ##class(%ResultSet).RunQuery("SYS.Mirror","MemberStatusList")

Member Name:Current Role:Current Status:Journal Transfer Latency:Dejournal Latency:Journal Transfer Latency:Dejournal Latency:Display Type:Display Status:
MDCHCNDBSL1.HICGRP.COM/STAGE:Primary:Active:N/A:N/A:N/A:N/A:Failover:Primary:
MDCHCNDBSL2.HICGRP.COM/STAGE:Backup:Active:Active:Caught up:Active:Caught up:Failover:Backup:
CDCHCNDRSL.HICGRP.COM/STAGE:Async:Async:Caught up:Caught up:Caught up:Caught up:Disaster Recovery:Connected:

Hi Robert! I'm not sure how this addresses my issue ...

I don't think it's a DNS problem. The IP address resolved is the same regardless of whether the domain portion is appended to the hostname or not. And as I said, I have 4 servers with identical local httpd configurations that work fine, and they're all using the same name resolution servers.

The only thing I could find that's different is that the iris.cpf file for the problem servers had a FQDN specified for the WebServerName entry while the working ones had no host specified at all. But changing the entry on one of the problem servers and restarting it made no difference.

Are the values in AIS:3.1 sequential integers ranging from 1 to the number of AIS segments? If yes, it's very easy.

If not ... just a little harder. You'd populate a subscripted variable using the values in AIS:3.1 as the index and the segment repetition number as the array element value. Then $ORDER() through it get the source segment repetition number and assign that segment to the target in AIS:3.1 order. For example:

The variable tAISArr will be subscripted by the values in AIS:3.1. So now we just $ORDER() through tAISArr in a code action:

 set tIdx = 1
 set tKey = $ORDER(tAISArr(""))
 while (tKey '= "")
 {
      // Grab the segment identified by the value of the array subscript
      set AISSeg = source.GetValueAt("RGSgrp(1).AISgrp("_tAISArr(tKey)_").AIS")
      // stuff it into the target segment at the current position of the value of the loop counter tIdx
      do target.SetValueAt(AISSeg,"RGSgrp(1).AISgrp("_tIdx_").AIS")
      // Don't forget to renumber the Set ID
      do target.SetValueAt(tIdx,"RGSgrp(1).AISgrp("_tIdx_").AIS:1")
      set tIdx = tIdx + 1
      set tKey = $ORDER(tAISArr(tKey))
 }

Sample Input:

Sample Output: