Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8721245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:11:26+00:00 2026-06-13T07:11:26+00:00

I am maintaining a legacy mirth system. We get some incoming HL7 messages with

  • 0

I am maintaining a legacy mirth system. We get some incoming HL7 messages with a repeating ZP1.36 segment. As far as I can tell, mirth is dividing these repeating segments into an array of repeating segments via a split function.

var repeat36 = msg['ZP1']['ZP1.36'].toString().split("</ZP1.36>"); //I think returns an array of ZP1.36 segments

But in the raw data, I don’t see the string ZP1.36…

I’m used to using split functions in VB/Java/C# that divide strings into tokens around a certain character, like this:

var myTokens = "hello^world".toString().Split("^"); //returns a 2 item array {"hello", "world"}

Mirth’s split function doesn’t seem to be working this way. It seems to be parsing the messages based on the assumed structure of the HL7 message.

Is this what’s going on? Am I missing something? What are the rules for the split function in mirth?

Cross-posted on mirth community http://www.mirthcorp.com/community/forums/showthread.php?p=26203#post26203

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:11:27+00:00Added an answer on June 13, 2026 at 7:11 am

    I know you already found and accepted a sufficient answer to your question (reposted from the Mirth forums), but I thought it might be helpful to give a bit more information in a separate answer.

    At its heart, Mirth leverages a couple of pre-existing technologies in order to work with HL7 data.

    1. HAPI (pronounced “Happy”): This is a library of Java code for re-interpretting pipe-delimited V2.x HL7 as XML. The V2.XML format itself is also an official HL7 specification (not to be confused with V3 HL7 which is natively XML). The product name “Mirth” was obviously chosen as a synonym for “happy.”
    2. E4X: This is a JavaScript standard for working with XML. It failed to gain significant traction as a standard web technology, however, it is leveraged by Mirth due to its availability in the Rhino JavaScript engine.

    From the examples that Dans provided you on the Mirth forums:

    This snippet is in the standard XML format for HL7 v.2x:

    <ZP1.36>
        <ZP1.36.1>Hello</ZP1.36.1>
        <ZP1.36.2>World</ZP1.36.2>
    <ZP1.36>
    

    This JavaScript code is utilizing E4X notation to parse and access HL7 data that has been reinterpreted into E4X XML and XMLList data types:

    var zp1361 = msg['ZP1']['ZP1.36']['ZP1.36.1'].toString();
    var zp1362 = msg['ZP1']['ZP1.36']['ZP1.36.2'].toString();
    
    • msg is the E4X XML object holding the HL7 data
    • msg['ZP1'] produces an E4X XMLList object that holds a list of ZP1 segments.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am maintaining some legacy Visual Basic ASP code and I keep seeing <%
A programmer on your team is great at maintaining the old legacy system. But
I'm currently maintaining an "old" system written in C# .NET, removing some obsolete features
I'm maintaining a script that can get its input from various sources, and works
I'm maintaining a legacy system (pre .NET). Is there any way to fetch the
I have the following function from some legacy code that I am maintaining. long
I have been tasked with maintaining a legacy unmanaged c++ system. I do not
I am maintaining some legacy code here. Most of the code consists of huge
I'm maintaining some legacy Java LDAP code. I know next to nothing about LDAP.
I have some legacy code I'm maintaining and there's a SQL query in there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.