Daily using/supporting

Get Firefox browser!
Get Thunderbird!
Get Opera browser!
Get The Gimp!
Get Inkscape!
Get LibreOffice!
Get Videolan!
Get Linux!
Get Mandriva!
Get Joomla!
Hacker Emblem

Archives

Which topics would you like us to cover more?

Latest comments

Latest tweets

about 1 day ago Using REDIPS.drag to add drag and drop to your .Net webapplication #li #dib0 http://t.co/n8zY3s7d
about 7 days ago http://t.co/cknQcDbo #Kindle
about 15 days ago Freedom isn't the ability to choose what to do or say, but the ability to choose what not to do or say #freedom
about 29 days ago http://t.co/61KTQknI #Kindle
12 Apr 2012 Force the use of a networking adapter using C# #li #dib0 http://t.co/ZTJOPzOz
9 Apr 2012 Mandriva 2010.2 and USB devices in Virtualbox http://t.co/fwq9gbHB
9 Apr 2012 Execute a http request to you own site with PHP http://t.co/DIvWPrpd
Home Architecture, security and coding Understanding the HL7 piped message
Understanding the HL7 piped message
Written by Division by Zero   
Wednesday, 12 January 2011 10:06

Hl7 has two forms of formatting data. Piped messages and Xml. The Xml format is easier to understand for us humans. The piped message is a bit harder to understand. The format is a bit older, based on plain text. Let’s have a look at it. I will not explain every field in the standard (hey, what are standards for!), but just look at the message structure and how to read it. I’m using this example message to explain the message structure (the message is part of the ORU_R01 .Net example):

MSH|^~\&|Otogram||||||ORU^R01^ORU_R01|||2.4^^||||| USA|ASCII
PID|1||||Family^Given^Middle^^^^L|||||||||||||
OBR|1|9999^^^||28615-3^Audiology study^LN||||||||||||
OBX|1|ED|28615-3^Audiology study^LN|1|Acrobat^text^pdf^Base64^JVBERi0xLjMKJeT jz9IKNSAwI

Every message starts with a segment describing the message header (the MSH segment). A segment always starts with the segment name, following the separation character, which separates the fields of a segment as described by the HL7 standard. Segments are always separated by a newline character.

The second field of the header is a special one. It will almost always look like this ‘|^~\&’. This strange set of characters describes the format of the message: it defines which characters are used as special characters. For example: the first character ‘^’ is used as a separator between fields in a datatype. If we would change is to a ‘#’, the message would look like this:

MSH|#~\&|Otogram||||||ORU#R01#ORU_R01|||2.4##||||| USA|ASCII
PID|1||||Family#Given#Middle####L|||||||||||||
OBR|1|9999###||28615-3#Audiology study#LN||||||||||||
OBX|1|ED|28615-3#Audiology study#LN|1|Acrobat#text#pdf#Base64#JVBERi0xLjMKJeT jz9IKNSAwI

This build in flexibility is meant to overcome compatibility issues between encoding standards.

In this case the ‘|’ is used for segment separation and the ‘#’ is used for field seperations (sometimes called components) in data types. The ‘~’ is used for repetitions (fields that occur more than once). The ‘\’ is used to signify an escape character and the ‘&’ character is used as a subcomponent separation character.

Sometimes you’ll see multiple separation characters next to each other: ‘|||’. Data between these characters is sometimes optional. If it is optional, there’s no need to show the separation characters of the subfields, it’s enough to only show the ‘|’ separator.

I hope this helps in understanding the piped messages. If you have any questions: let me know!

 

Add comment


Security code
Refresh

He's the only genius with an IQ of 80. - Unknown


© 2009 - 2012, Division by Zero

Template based on the empire template by joomlashack 

Valid XHTML 1.0 Strict  Valid CSS!  Creative Commons License
This work by Division by Zero is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.