Ejemplo n.º 1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new Om3Segment();
         hl7Segment.FromDelimitedString("OMA|^~&|3|4|5|6");
     });
 }
Ejemplo n.º 2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new Om3Segment
            {
                SequenceNumberTestObservationMasterFile = 1,
                PreferredCodingSystem = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ValidCodedAnswers = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                NormalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "4"
                    }
                },
                AbnormalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "5"
                    }
                },
                CriticalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "6"
                    }
                },
                ValueType = "7"
            };

            ISegment actual = new Om3Segment();

            actual.FromDelimitedString("OM3|1|2|3|4|5|6|7");

            expected.Should().BeEquivalentTo(actual);
        }
Ejemplo n.º 3
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new Om3Segment
            {
                SequenceNumberTestObservationMasterFile = 1,
                PreferredCodingSystem = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ValidCodedAnswers = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                NormalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "4"
                    }
                },
                AbnormalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "5"
                    }
                },
                CriticalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "6"
                    }
                },
                ValueType = "7"
            };

            string expected = "OM3|1|2|3|4|5|6|7";
            string actual   = hl7Segment.ToDelimitedString();

            Assert.Equal(expected, actual);
        }