Skip to content

Set HL7 fields in reverse/random order leads to wrong output #4917

Answered by tonygermano
tom08zehn asked this question in Q&A
Discussion options

You must be logged in to vote

It has to do with the way that the mirth serializer works going from xml to hl7. It expects them to appear in the correct order in the xml. If you unable to ensure that elements will be added in the correct order, you can use this code template to fix them https://github.com/nextgenhealthcare/connect-examples/tree/master/Code%20Templates/Fix%20HL7%20Node%20Order

To elaborate a little bit more on why they are getting created out of order, from your template tmp['OBR']['OBR.16'] will exist, but it will have no children. When you assign to tmp['OBR']['OBR.16']['OBR.16.7'], since it doesn't already exist, it will be appended to the tmp['OBR']['OBR.16'] child list (as the first and only child.…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tonygermano
Comment options

@tonygermano
Comment options

@tom08zehn
Comment options

Answer selected by pacmano1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants