Question
Colin Brough · Dec 1, 2022

HL7 contents and metadata, Ensemble/Cache

I'm testing an HL7 2.4 -> HL7 2.3.1 set of transformations. For the time being the source (service) and sink (operation) are file adapters. What I'd really like is to be able to save the output file with a name matching/containing the input file name - but as the DTL transformation in between uses "new" rather than "copy" it looks like I'm losing (some of?) the metadata, including the "Source" field (Body tab, message viewer).

Is there any way of preserving the Source field so the OutboundAdapter has access to it?


More generally, is there documentation on how message metadata is handled as messages pass through productions?

Thanks!

Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1 (Build 184U) Wed Sep 19 2018 09:09:22 EDT
0
0 202
Discussion (3)1
Log in or sign up to continue

@Colin Brough I have found generally the message header and body data is a bit putzy to access, but not impossible.  

I'm fairly new at all of this but in the spirit of trying to be helpful: I think a business process in-between that holds on to the metadata for the message in a context object and then pass that all to a custom business operation that uses the data to generate the file name.

I am thinking though that if you are using a message router you can't send the context over, but I think if you use a call operation in the BPL you can pass in the context to the custom operation that you are calling.  You could define a rule then that picks the correct operation to route to and use indirection to call that in the BPL while passing the context.  

Someone more experienced will have to fact check me there.

You can use the following:

<assign property='target.Source' value='source.Source' action='set'/>

This applies to any body property. Notice the difference between source (lowercase 's') representing the source message and Source (uppercase 'S') representing the body property. The more general syntax would be:

<assign property='target.BodyPropName' value='source.BodyPropName' action='set'/>

If you are using the graphical editor, you add a set action and type in the Property and Value.

 

Shamus, thanks, works perfectly. Much appreciated.