Skip to content
You must be logged in to vote

Answer was proved by jkrebs when posted this fantastic code here: https://forums.mirthproject.io/forum/mirth-connect/support/7226-spliting-a-obx-record?p=178718#post178718)

But since there is a terrible habit on the internet to have links break eventually here are the contents of that post. Again thanks jkrebs where ever you are.

05-06-2021, 01:14 PM
The below will traverse OBX groups for repeating OBX.5, create an OBX segment for all but the first iteration, populate OBX.5 in the new OBX, delete all but the first OBX.5 from originating OBX, insert the new OBXs then re-sequence the set IDs.
Code:

for each (obr in msg.OBR) {
  for each (obx in getSegmentsAfter(msg,obr,'OBX',false)) {
     …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@pacmano1
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by noMoreUserNamesAvailableAnymore
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