Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HL7 questions, after some experience

Status
Not open for further replies.

OrthoDocSoft

Programmer
May 7, 2004
291
US
Folks,

I was literally looking for "<cr>" to know when the end of my first segement (MSH) was. Now that I'm getting real messages, I don't see these four characters anywhere, and I'm betting I was looking at "fake" messages where <cr> means "carriage return", but that's ok. This practice was returning essentially a blank MSH segement (no good), so I'm abandoning it.

My real world MSH segments have 20 pipes > | < in them, so I can count them to find the end, I think,

OR

I could look for "PID" (the next segment) as a signal for the end of the MSH segment.

Does anyone have an opinion which is better?

Does anyone know a better way to parse this portion of the HL7 message? I only need the date and time bits, and the MessageType data, so....

Thanks,

Ortho

[lookaround] "you cain't fix 'stupid'...
 
I had the idea these were designed to be pretty simple to parse. Are you sure you can't find the end of each message by looking for vbCr characters?

Waiting for a new segment ID like that "PID" has the disadvantage that you may have to wait some time for a new one to arrive, holding the current one buffered for possibly a very long time. Plus these messages probably come as a sequence of messages for each patient, so patient IDs may have other messages following them instead of another PID immediately.

I agree that the <cr> you were seeing in documentation was just a "meta-linquistic variable" standing in for the CR character (value 13 or &H0D, i.e. a vbCr character).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top