Breaking out OBX Segment into Multiple OBX segments #4746
-
Also posted to the older mirthproject.io website: Make: Into:
I previously used iteration to break this down for a report writer but also had to lean on functionality for that to "kinda" succeed there, but as the evolution of the status quo goes, I now have to also do this for a channel writer destination. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Do note you posted this on the forums. Same answer. Give it a try. |
Beta Was this translation helpful? Give feedback.
-
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
Note that it assumes data in the components for which it creates OBXs. For a link to the getSegmentsAfter code template |
Beta Was this translation helpful? Give feedback.
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: