Question
· Apr 11, 2019

Anyway to Create Multiple transactions using an Ensemble transformation

I have a transformation that the incoming schema is an XML file and I will need to write multiple HL7 transactions.  Is there anyway to do this? 

Discussion (10)3
Log in or sign up to continue

The problem is not transforming the XML to HL7 the issue I need to write multiple HL7 records from the one XML file.  So there is a repeating Encounter Container that I need to write a HL7 transaction (MSH, PID, PV1) for each Encounter - just wondering is there anything within the transformation that can trigger multiple writes of transactions for 1 record read.

If each Encounter element in the document contains all of the data necessary to create your individual HL7 messages, you could potentially use the EnsLib.XML.Object.Service.FileService (or FTPService) class for a Business Service that will "chunk" the document into individual Encounter documents. Those would then be mapped to HL7 via a routing rule and DTL ... no BPL required. You'll need to create an Encounter class that matches the Encounter element structure; this will be used subsequently for creating routing rules and DTLs.

Hi Blake,

Can you provide a bit more detail? If you need to create an individual HL7 message for each repeating element in the XML document, my answer here is probably the easiest way to get there. If there's a "master/detail" relationship within the XML, though, you'll need to handle that in a BPL, and perhaps still "chunk" the XML before handing it off to the BPL if there are multiple elements with master/detail relationships. You'd do that with the XML Object file service mentioned in the link (assuming you're getting these XML documents as local files ... there's also an FTP version of the service).

There are tutorials on BPLs in ISC's Learning library.

Hi Jeff! thanks for the reply.  Thus far I have actually tried the XML file service idea. My implementation (attempt) has a left to right path of

  • XML file placed in ARCO by a foreign process
  • Service reads the file (class: EnsLib.EDI.XML.Service.FileService) using my XML schemaname and sends the xml to a
  • Business process (class: EnsLib.MsgRouter.RoutingEngine) I think my issue is one of these settings->that uses a rule of
    • Rule Type: General Business Rule
    • Rule Assist Class: Ens.Rule.GeneralBusinessRuleAssist
    • with a context class of: EnsLib.HL7.MsgRouter.RoutingEngine
      • DTL transforms
      • my XML schemaname to
      • HL7 2.6 MFN_16

All of this "seems" to work perfectly. My output HL7 message has no errors and every field maps.

I even have a lookup table in there right now.

the XML schema is VERY simple...

The only issue is that my integration does one read and then stops even though my source file has 4 records.

I will lookup the BPL that you suggest and thank you for that. Hopefully I can figure it out soon!

Thank you for that!

I'm thinking that the value you provided for ElementName  in the service's configuration is incorrect. Your class definition also needs to match the structure of the repeating element, not the entire XML document.

Here's an example XML structure:

<Persons>
    <Person>
        <LastName>Drumm</LastName>
        <FirstName>Jeff</FirstName>
        <FavoriteColor>Red</FavoriteColor>
    </Person>
    <Person>
        <LastName>Herlick</LastName>
        <FirstName>Blakely</FirstName>
        <FavoriteColor>Teal</FavoriteColor>
    </Person>
</Persons>

The classname you'd create would be something like User.Custom.Person, with properties FirstName, LastName and FavoriteColor.

In the service's ElementName field, you'd enter Person. When the file is read, each Person element from the XML would end up in a separate message. You can then filter in the routing rule by using the variables Document.FirstName, Document.LastName, etc. and transform it in the DTL by selecting the Persistent Class User.Custom.Person as the source and your HL7 schema as the target.

Make sense?