Question
· Dec 22, 2020

Transform XML element with a delimiter in to multiple HL7 Segments

Hi all! 2nd time poster and still kind of a newbie. I Googled and searched the posts but did not find anything quite like my question.  I have an XML to HL7 2.6  MFN_M16 translation.  I created an XML schema and I am using it inside a DTL to translate data to HL7. The XML is rather simple EXCEPT one element as data separated by pipes. This only happens when one item has multiple PAR Locations.  To make a valid HL7 message these multiple PAR Locations each need their own IVT segment.

XML Par Location is equal to HL7 IVT:InventoryLocationIdentifier OR (IVT-2)

The Business process is of class: EnsLib.MsgRouter.RoutingEngine

Thus the source looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<wd:Report_Data xmlns:wd="urn:com.workday.report/CR_INT084_Epic_Item_Master_Outbound">
   <wd:Report_Entry>
      <wd:Item_Name>PLATE 5.4MM LWR 814100003</wd:Item_Name>
      <wd:Active>Y</wd:Active>
      <wd:Item_numbers>10190</wd:Item_numbers>
      <wd:Description>PLATE 5.4MM LWR 814100003</wd:Description>
      <wd:Type_of_item>42321505</wd:Type_of_item>
      <wd:Implant_type>42321505</wd:Implant_type>
      <wd:GTIN>00085412071060</wd:GTIN>
      <wd:Latex_product>Yes</wd:Latex_product>
      <wd:Chargeable>N</wd:Chargeable>
      <wd:Charge_code>IM010190</wd:Charge_code>
      <wd:Cost_per_unit>88.2</wd:Cost_per_unit>
      <wd:HCPCS_code>C1713</wd:HCPCS_code>
      <wd:Supplier_id>S-00000139</wd:Supplier_id>
      <wd:Supplier>BIOMET INC</wd:Supplier>
      <wd:Catalog_Number>814100003</wd:Catalog_Number>
      <wd:Package_Type>Each</wd:Package_Type>
      <wd:Ratio>1</wd:Ratio>
      <wd:Manufacturer>DEPUY ORTHOPAEDICS INC</wd:Manufacturer>
      <wd:Manufacturer_Catalog_Number>814100003</wd:Manufacturer_Catalog_Number>
      <wd:Location>MCVH CCH Operating Room Inventory</wd:Location>
      <wd:Par_Location>M071|M074|</wd:Par_Location>
      <wd:ID>10190</wd:ID>
      <wd:Shelf_Code>01A02B</wd:Shelf_Code>
   </wd:Report_Entry>
</wd:Report_Data>

The output should look like this output below (I manually added the second IVT segment)

 I understand how to use piece and count occurrence etc... but I can not figure out how to create 1 IVT segment for each value in Par Location.   

 

I hope I have included enough information in the post- I know that can be the frustrating part of being in a forum and helping to answer questions.

 

Thank you for your assistance in pointing me to a solution!!!!

  * MSH
| ^~\& | MMIS | VCUMC | EPIC | VCUMC |  · |  · | MFN ^ M16 |  · | T | 2.6
  * MFI
| INV | WORKDAY | NS |  · |  · | NE
  * MFE
| NS | NS | 2020-12-22 12:54:00.670 | NS | NS
  * ITM
| 10190 | PLATE 5.4MM LWR 814100003\R\PLATE 5.4MM LWR 814100003 | Y | SUPPLY | Plate |  · |  · | DEPUY ORTHOPAEDICS INC | 814100003 |  · | N | IM010190 | 88.2 |  · |  · |  · | Yes |  · |  · |  · |  · |  · |  · |  · |  · |  · | C1713
  * VND
| 1 |  · | BIOMET INC | 814100003
  * PKG
| 1 | Each |  · | 1
  * IVT
| 1 | M071 |  · |  · |  · |  · | 01A02B
  8   IVT |2|2|M074||||
Product version: IRIS 2020.1
Discussion (4)1
Log in or sign up to continue

Hi Blakely,

I assume you already have code that goes over your XML and extracts data into the HL7 fields.

So then you get to the Par_Location element, do something like this:

Set tPar_Location_Text = M071|M074|...

For i=1:1:$LENGTH(tPar_Location_Text) {

    Set word = $PIECE(tPar_Location_Text, "|", i)

    Do createSegment("IVT", i, word, field3, ...)

}

Note I assume you have a routine that creates the segments...

I hope this helps

Vitaly