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

  • 0
  • 0
  • 117
  • 7
  • 1

Answers

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:

Comments

I updated my comment and turned it into an answer ... with DTL rather than ObjectScript since I didn't realize that was the specific type of solution you were looking for. Let me know if that doesn't get you where you need to be ...

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:

Well, I've verified that the DTL I provided works against the  HL7 2.4:ORU_R01 document type, so my assumption is that your messages don't conform to that specification.  If they don't have the structure below, they won't be parseable:

And if that's the case, you would need to create a custom message schema matching their layout to work with them in the DTL editor.

Thank You so much Jeff.. This has been so helpful. I appreciate your help in guiding me on this.