So, on re-reading your question and looking at your example, I'm wondering whether you really wish to check whether the fields are empty, or that they contain more than 1 character? A single character value isn't "empty" and your expression will return true if either field has zero or 1 character in it.

If you're simply checking for a condition where both fields are empty, this is a solution:

'(..Length(source.LABRSLTNUMRSLTVAL) && ..Length(source.TSTRLTVAL))

Or this, which is a bit closer to what you had come up with:

'(..Length(source.LABRSLTNUMRSLTVAL)) && '(..Length(source.TSTRLTVAL))

A non-zero numeric return value evaluates to true, so no need to provide a comparison operator for the individual length checks.

Yes, in the %SYS namespace you can use the ^SECURITY utility. The export will be in XML format.

USER> zn "%SYS"

%SYS> d ^SECURITY

1) User setup
2) Role setup
3) Service setup
4) Resource setup
5) Application setup
6) Auditing setup
8) SSL configuration setup
9) Mobile phone service provider setup
10) OpenAM Identity Services setup
11) Encryption key setup
12) System parameter setup
13) X509 User setup
14) KMIP server setup
15) Exit

Option? 1

1) Create user
2) Edit user
3) List users
4) Detailed list users
5) Delete user
6) Export users
7) Import users
8) Exit

Option? 6

Hey Doug,

It's been a very long time :)

So ... no, you don't need a complex record map to do this, but the mechanism takes just a little more work using a "simple" record map. The record map feature doesn't let you set a Composite field as repeating, which is why we need to deal with those "grouped" OBX segments/fields using a different method.

What I've done is define the RecordMap with individual fields for everything before the first OBX field, and then define the rest of the record as a single, repeating field. You can then iterate over that last field and parse out the individual HL7 field values with $PIECE, or turn them into a $LIST and  reference the elements by numeric index. The only delimiters you'll need to set for the record map are a "|" as the field delimiter and a "~" for the repetition delimiter.

Here's a sample record map layout:

Along with setting OBXSegs as repeating, I set the MAXLEN DataType parameter to something large enough to accommodate all of the fields. Also note the Discard field; the sample data in your post included a leading "|," so that needs to be treated as though there's an initial empty field in each record. Including a dummy field to consume it makes things a bit more understandable when addressing the subsequent fields.

Here's one way you might iterate over the repeating record map field:

As you surmised in a follow-up to Nora's earlier posts, the Complex Record Map functionality is really only required when the record structure varies from line to line in the input data.

It's not normally a property of the message header or body objects. You can often find the port number in the Source property of the Body, but not the IP address. To get that, you'll need to look at the Event Log for the service. It will look something like this:

As for what you're doing wrong ... hard to say at this point; not much to go on. Does the connection complete successfully without restricting the allowed IP addresses?

If you don't care about any unsent/completed/suspended messages, try calling the CleanProduction() method in class Ens.Director:

Do ##class(Ens.Director).CleanProduction()

This is strongly discouraged for PROD environments ... be forewarned. Would recommend you contact the WRC if you're getting this error in a PROD environment.

@Robert C. Cemper has you on the right track, but I'm curious as to whether the vendor of the foreign (i.e. non-HealthShare/HealthConnect) system has provided a specification. Do you need to accommodate Acknowledgement messages for both sending/receiving? Is there some sort of handshake protocol that is used to indicate when it's safe to send, a sort of RTS/CTS-type mechanism? Or is this being designed "on the fly?"

If I were designing something like this, I'd go with a web service ... always over the same port, and when you want to send something you'd POST it. When there's nothing to POST, you'd periodically GET to see if anything is waiting.

Anything else would most likely be a one-off in healthcare integration.