Skip to content
Duane Edwards edited this page Jun 10, 2016 · 10 revisions
string message = @"MSH|^~\&|CohieCentral|COHIE|Clinical Data Provider|TCH|20060228155525||QRY^R02^QRY_R02|1|P|2.3|QRD|20060228155525|R|I||||10^RD&Records&0126|38923^^^^^^^^&TCH|||";

PipeParser parser = new PipeParser();
IMessage m = parser.Parse(message);
QRY_R02 qryR02 = m as QRY_R02;
Assert.IsNotNull(qryR02);
Assert.AreEqual("38923", qryR02.QRD.GetWhoSubjectFilter(0).IDNumber.Value);

Event Map to Code Structure Mappings

Some message types are not mapped to their exact same event type and this can cause some confusion when you first encounter it.

For example ADT^A01, ADT^A04, ADT^A08 and ADT^A13 event types will all be parsed into the ADT^01 structure.

The following unit test illustrates this behaviour:

[Test]
public void TestADTA04IsMappedAsA01()
{
	string hl7Data = @"MSH|^~\&|CohieCentral|COHIE|Clinical Data Provider|TCH|20060228155525||ADT^A04|1|P|2.5.1|
EVN|
PID|1|12345
PV1|1";
	PipeParser parser = new PipeParser();
	IMessage msg = parser.Parse(hl7Data);

	Assert.IsNotNull(msg, "Message should not be null");
	ADT_A01 a04 = (ADT_A01)msg;

	Assert.AreEqual("A04", a04.MSH.MessageType.TriggerEvent.Value);
	Assert.AreEqual("1", a04.PID.SetIDPID.Value);
}

The Event to Structure Map for each version of HL7 supported can be found below:

Clone this wiki locally