From 93544483866c86704a627ab55a35bd55be0d00f1 Mon Sep 17 00:00:00 2001 From: Jake Aitchison Date: Thu, 15 Apr 2021 11:38:11 +0100 Subject: [PATCH] Add unit test for #51 --- .../PipeParserUnexpectedSegmentTests.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/NHapi.NUnit/Parser/PipeParserUnexpectedSegmentTests.cs b/tests/NHapi.NUnit/Parser/PipeParserUnexpectedSegmentTests.cs index d29a28a6c..bae411ad6 100644 --- a/tests/NHapi.NUnit/Parser/PipeParserUnexpectedSegmentTests.cs +++ b/tests/NHapi.NUnit/Parser/PipeParserUnexpectedSegmentTests.cs @@ -4,6 +4,9 @@ using NHapi.Base.Parser; + /// + /// Fixes https://github.com/nHapiNET/nHapi/issues/101. + /// public class PipeParserUnexpectedSegmentTests { #region v23 @@ -143,6 +146,33 @@ public void Parse_V25_ORM_O01_WithCustomEvnSegment() #region v251 + /// + /// fixes https://github.com/nHapiNET/nHapi/issues/51. + /// + [Test] + public void Parse_V251_RDE_O11() + { + var message = + "MSH|^~\\&|EXACTDATA||ALL|ALL|20101217181500||RDE^O11^RDE_O11|EF010000000071000000_4|T^T|2.5.1\r" + + "PID|1||7010566270^^^^DODID~EM010000008000000^^^^MR||ZZEDConner^Dean^J^^Mr.||19810611|MALE||WHITE^^HL70005|^^^^^USA^H||||ENGLISH^^HL70296|SINGLE^^HL70002||EF010000000071000000||||NOTHISPANICORLATINO^^HL70189|||||ACTIVEDUTY^^HL70172\r" + + "PV1|1|OUTPATIENT|^^^MBCC^^AMBLOC||||1853210951^Pennington^Zachary|||MEDICINEGENERAL|||||||1853210951^Pennington^Zachary|||||||||||||||||||01|||||ACTIVE|||20101217181500|20101217184500||||||V\r" + + "PV2|||V70.0^General medical examination^I9C|||||||||||||||||||||||||||||||||||||||||N\r" + + "AL1|1|DRUG^^HL70127|70618^Penicillin^RXNORM|MODERATE^^HL70128|Dry Mouth|20100928\r" + + "ORC|NW|101217-833651^ExD|||ORDERED\r" + + "RXE|^^^20101217184500|54569-4888-0^Oseltamivir|1||75 mg||^po bid x 5d||N|10||0||||||||||||||||||||20101217184500\r" + + "RXR|^Oral^HL70162"; + + var parser = new PipeParser(); + + var result = parser.Parse(message); + + var rdeO11 = result as NHapi.Model.V251.Message.RDE_O11; + + Assert.IsNotNull(rdeO11); + Assert.AreEqual("Oral", rdeO11.GetORDER().GetRXR().Route.Text.Value); + Assert.AreEqual("HL70162", rdeO11.GetORDER().GetRXR().Route.NameOfCodingSystem.Value); + } + [Test] public void Parse_V251_ORM_O01() {