Searching for a library or framework that would provide an object model, parsing, validating, etc
The idea would be to be able to spin up a new object of type hl7 v2 or v3. Then perhaps call it message type ORU_R01 or ADT, or ORM.
Wouldn't life be great if we were able to do something like this:
HL7V2 myMessage = new HL7V2();
myMessage.Type = V2MsgTypes.ORU_R01;
myMessage.TryParse(someHL7_string);
if (myMessage.IsValid)
{
//do some work
//maybe access the PID segment
if (myMessage.Patient.Names.FamilyName =="Johnson")
{
//do more work
}
}
You want nHAPI I used it on a project previously, and it worked great. The fact that it's open source saved my bacon too, as one of the input sources didn't precisely follow the HL7 spec, so I had to hack on the source a little bit to make nHAPI's parser allow those messages (as I couldn't change them).
I've used nHAPI too and it works great. However you might need to watch out for some quirky behavior w.r.t escaping special characters. I've also had to manually hack the HL7 string to update some fields that were inaccessible using the object model.
Instead of using an API, try Mirth Connect, an open source tool that you can install on your server and integrate with .NET, databases, file directory etc.
Orion Helth has a toolkit called Symphonia which does something similar. There is also Chameleon toolset from Interfaceware which does the same.
I just stumbled across this product as well:
Managed Code Objects for Visual Studio .Net
From their web page:
A Visual Studio .Net HL7 Class Library DLL designed to allow HL7 software developers to provide HL7 integration for their existing solutions cheaply, quickly and reliably.
Chris Patterson has a library for HL7 2.x manipulation called Machete that is pretty good. https://github.com/phatboyg/Machete
NHapi is ok but suffers from poor performance in my experience.
来源:https://stackoverflow.com/questions/777933/hl7-object-model-for-net