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 4 days ago Noscript and fritz.box #dib0 http://t.co/zxHEedNf9Q
about 10 days ago Social engineering from India #dib0 http://t.co/ajjp43WkVS
about 19 days ago @unwoman Got the kickstarter Uncovered Vol. 2 today! Thank you! I love it! http://t.co/x0Tzovtq8u
about 21 days ago A query is running #dib0 http://t.co/cRZ8Dd3nVp
15 Apr 2013 Locally save attachments from Oulook using VBScript #dib0 http://t.co/l6RhWQsvFL
1 Apr 2013 Publishing Outlook calendar for use in Google calendar through http://t.co/sfh5eNxGXM #dib0 http://t.co/IzWNPlaqNA
21 Mar 2013 http://t.co/j3B0kSLGkM Really interesting article. The church of pirates. Gods preferential option for the poor in the broadest sense.
14 Mar 2013 Happy Pi-day! And this is what's wrong with it... funny, but true. http://t.co/A8GIB8fugC
14 Mar 2013 Hey guys @piwik ! Just looking at my site stats. I love the new page overlay feature. Well done! :-)
3 Mar 2013 Really funny! The Burning Hearts Revolution: How Sesame Street is Undermining Biblical Values http://t.co/z8XFk5P4d3
26 Feb 2013 Recursively check and correct mp3 files in Linux #dib0 http://t.co/U3nzOuWzWM
26 Feb 2013 Haha! Met zo'n antwoord een terechte reactie! http://t.co/NYXIb27aP5 via @snippers
20 Feb 2013 Create random password with C#, Java and PHP #dib0 http://t.co/WgF7DtcT
nHapi example
Written by Division by Zero   
Friday, 30 April 2010 14:22

A while ago I wrote a suggestion on how to write an application to support multiple version of HL7 using nHapi. After some questions I received, an example application seems to be helpful. My original post seems to be a little abstract. So here's the example solution I just hacked together. Enjoy! If you have any questions, let me know!

 

Comments  

 
0 # wangang 2010-10-19 09:29
hao dong xi
Reply | Reply with quote | Quote
 
 
0 # Bas 2010-10-21 09:59
Hi,

Thank you for your compliment! :lol: I just translated your comment from Pinyin to English. The translation is "Good thing." (Is that correct?)

Thanks again,

Division by Zero
Reply | Reply with quote | Quote
 
 
0 # Anup 2011-03-12 19:31
Thank you very much !!
Reply | Reply with quote | Quote
 
 
0 # Bas 2011-03-12 21:43
You're welcome! I really hope this example helps!
Reply | Reply with quote | Quote
 
 
+1 # slypete 2012-05-10 19:07
Hello,

Employing .Net dynamics, one can implement a factory without a naive switch implementation. For example:

IMessage message = parser.Parse(message);
dynamic o = Convert.ChangeType(mess age, message.GetType());
PL location = o.PV1.AssignedPatient Location;

The only disadvantage is that you lose compile-time checking, but this approach should drastically reduce boiler plate code.

Cheers,
Pete
Reply | Reply with quote | Quote
 
 
0 # Bas 2012-05-11 11:26
Hi Slypete,

Thank you for your comment. This way will absolutely shorten the code.

There are two reasons that I didn't use .Net dynamics. The first one is that it didn't yet exist at the time (I think... maybe it did and I didn't know about it at the time). The second one is that this code is an example. Statements like dynamic sure are code optimizations. On the other hand they make the code far less comprehensible for less experienced developers. In my opinion it is better to have more code that is better readable than to have less code that isn't.

Of course if an experienced developer would take this example. .Net dynamics will shorten the code and, therefore, make it easier to maintain.

Thanks,

Division by Zero
Reply | Reply with quote | Quote
 
 
0 # telahun 2012-10-01 19:43
Hi. I am having trouble using nhapi for hl7 2.1. Do you know if nhapi supports this version. I keep getting an error "version not supported". I see that there is a dll for 2.1
Reply | Reply with quote | Quote
 
 
0 # Bas 2012-10-02 10:02
Hi Telahun,

NHapi does support HL7 version 2.1. From where do you get the error? Maybe you could include the stacktrace of the error.

If you use the example solution I provided here to parse a 2.1 version message it will give you an error like this one. The solution is given as an example and support for other version must be added.

If you look at the file HL7VersionFacto ry.cs at line 16: there is a case statement that will check the HL7 version. You will see that only version 2.4 is added. You can add version 2.1 and add the parsing bit.

If you have any problems, please share the error with the stacktrace or bits of code where the error occures. Maybe I can help.
Reply | Reply with quote | Quote
 

Add comment


Security code
Refresh

I think, therefore I am. - R. Descartes


© 2009 - 2013, Division by Zero

Template based on the empire template by joomlashack 

 Creative Commons License
This work by Division by Zero is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.