Question
· Jul 16, 2019

How to separate OBX segments based on .

Hi, I am trying to transform a message to meet a third party specification, and would like to know if you can advice me on how to separate a single OBX segment into several segments based on a '.'

I would like to separate the segment where the . [marked in red] is into another OBX segment. So the next segment would be:

OBX|2|TX|R^REPORT^L|1|Patient had lumbar spine MRI ~ Patient also had barium swallow ~ Patient has good alignment 99%perfect ~ Patient has aspiration visible

Is there a way to do that?

Would appreciate your advice on this

Regards,

Eric

Discussion (8)0
Log in or sign up to continue

Is that screen shot from the Ensemble Message Viewer? If yes, than what you're seeing is Ensemble's visualization of an empty field/component/subcomponent/repetition. The tilde (~) character is the repetition delimiter at the field level; InterSystems uses the "·" character as an indicator that the repetition was left empty. There's no actual character there to split on, but you can certainly iterate through repetitions within OBX:5 and build a new message segment for each.

The DTL would be something like this:

Hi Jeff, thank you for responding to my query. Yes, I found that when I output to string the '.' doesnt appear. so am trying to do it in a different way. Do you by any chance have a sample code to build new message segments?

I was able to split the messages, but now trying to find out how to create additional OBX segments.  I tried InsertSegmentAt, NewSegment, but all of them are giving me errors.

Thank you once again

Just an observation ... generally speaking, the reasoning behind the repetition delimiters in OBX:5 is to provide a form of line-orientation to the resulted report; sort of like <br/> tags in HTML.  The receiving system can use these as guidelines for displaying text that should display as separate lines. The repetitions are rarely more than 80 characters long, the "standard" reading width for a fixed-pitch terminal. "Empty" delimiters ("~~") often serve to indicate paragraph endings, aka "blank lines."

Separating the repetitions into individual segments is also a common method of keeping report formatting intact. However, I've yet to see a vendor expecting each segment to represent a "paragraph."

I'm concerned that the vendor you're working with will be presenting the result report in a format other than as intended by the source.

Hi Jeff, thank you so much for guiding me on this. I tried to do it the DTL way, but getting an error. Can you advice what I am missing? Tried adding the segments but still getting the same error.

Unfortunately, the vendors want it that way that the notes are in separate OBX segments. they are charging us a bomb if they need to make changes so trying to modify it

Below is the error I am getting: