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 HL7 event grouping in version 2.4 (nHapi)
HL7 event grouping in version 2.4 (nHapi)
Written by Division by Zero   
Tuesday, 27 September 2011 09:30

Recently someone posted a question on an older post of mine. Since the question is one of the kind that more people will encounter, I want to highlight it.

In the nHapi HL7 versions before 2.4 the event mapping was quite clear. The header would describe the event type, for example ADT_A08 would describe a ADT A08 event. In version 2.4 Hl7 grouped events that needs the same data. In the nHapi implementation this grouping means that for some event there won't be a specific class. You won't be able to find an A08 class implementation. Let's keep working with the A08 event as an example.

In 2.4 the A08 event is a kind of subtype of the ADT_A01 event.

The header should look like this:
MSH|^~&|SomeApp||||20110215100411||ADT^A08^ADT_A01|11873630|P^T|2.4|||AL|EN

Instead of this:

MSH|^~&|SomeApp||||20110215100411||ADT^A08|11873630|P^T|2.4|||AL|EN

This way nHapi will parse the message as an ADT_A01 type object. If you have parsed is to an object you can do the following to get the 'sub-event':

string eventType = message.MSH.MessageType.TriggerEvent.Value;
 
 This will result in "A08" with the header as described above.
 
 So to parse the message do something like this (with the header as described above):
 PipeParser hl7Parser = new PipeParser();
 IMessage hl7Message = hl7Parser.Parse(message);
 if (hl7Message.Version == "2.4")
 {
 if (hl7Message.Message.GetStructureNam e() == "ADT_A01")
 {
 ADT_A01 message = (ADT_A01) hl7Message;
 // now you can determine if it's an A08 type
 if (message.MSH.MessageType.TriggerEvent.Value == "A08")
 {
 // Do something with the A08 event
 }
 }
 }


The ADT_A01 in version 2.4 contains different A?? events. For example A08, A01, A04 and A13. All these 'sub-events' use the same message structure. Of course, if you want to handle multiple types you have to rewrite the code I've posted here.

Tags:
 

Add comment


Security code
Refresh

Only put off until tomorrow what you are willing to die having left undone. - Pablo Picasso


© 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.