0

I'm trying to build a channel to read an HL7 ADT text file, extract an MRN and write output to a SQLite table (Database Writer).

My SQLite table contains my data but all my PatientIDs are appearing as a concatenated string in one very wide column. As opposed to a PatientID per row/record.

I'm noticing some weird illegal(?) characters in my HL7 file (which come from a Meditech EMR). In QuickViewHL7 they appear in the MSH-22 and MSH-30.

enter image description here

In the VIM editor -

enter image description here

My question is, are these supposed to be delimiters? If so, what are they? Carriage Returns?

I've posted this question on the Mirth Connect forums but seen little but tumbleweeds. I'm hoping someone here might have seen this before and tell me what's going on.

UPDATE: Hex dump suggests it's a 0x7f (0111 1111). This looks like a backspace character. Should I simply strip it or substitute it with something?

Colin
  • 930
  • 3
  • 19
  • 42
  • hl7 v2 uses `` as [segment terminator](https://msdn.microsoft.com/en-us/library/ee409415.aspx) – xmojmr Nov 03 '15 at 06:47
  • What HL7v2 version is that? Even in the latest v2.8.1 there are no fields after MSH-25. Your MSH-22 actually looks as EVN segment and MSH-30 is the beginning of the PID segment. – Shamil Nov 05 '15 at 16:55

1 Answers1

1

This illegal character should be a line feed carriage return to delimit the start of the next HL7 segment.

Using VIM, highlight the illegal character and press 'ga'. This will tell you the hex value of the character. In my case 0xfa (which appears to be a back space!?).

Again in Vim, do a global substitute for a \r

:%s/\%x7f/\r/g

Then save the file.

Everything parses out nicely now.

Colin
  • 930
  • 3
  • 19
  • 42