示例#1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new LocSegment();
         hl7Segment.FromDelimitedString("LOA|^~&|3|4|5|6");
     });
 }
示例#2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new LocSegment
            {
                PrimaryKeyValueLoc = new PersonLocation
                {
                    PointOfCare = new HierarchicDesignator
                    {
                        NamespaceId = "1"
                    }
                },
                LocationDescription = "2",
                LocationTypeLoc     = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                OrganizationNameLoc = new ExtendedCompositeNameAndIdNumberForOrganizations[]
                {
                    new ExtendedCompositeNameAndIdNumberForOrganizations
                    {
                        OrganizationName = "4"
                    }
                },
                LocationAddress = new ExtendedAddress[]
                {
                    new ExtendedAddress
                    {
                        StreetAddress = new StreetAddress
                        {
                            StreetOrMailingAddress = "5"
                        }
                    }
                },
                LocationPhone = new ExtendedTelecommunicationNumber[]
                {
                    new ExtendedTelecommunicationNumber
                    {
                        TelephoneNumber = "6"
                    }
                },
                LicenseNumber = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "7"
                    }
                },
                LocationEquipment = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "8"
                    }
                },
                LocationServiceCode = new CodedWithExceptions
                {
                    Identifier = "9"
                }
            };

            ISegment actual = new LocSegment();

            actual.FromDelimitedString("LOC|1|2|3|4|5|6|7|8|9");

            expected.Should().BeEquivalentTo(actual);
        }
示例#3
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new LocSegment
            {
                PrimaryKeyValueLoc = new PersonLocation
                {
                    PointOfCare = new HierarchicDesignator
                    {
                        NamespaceId = "1"
                    }
                },
                LocationDescription = "2",
                LocationTypeLoc     = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                OrganizationNameLoc = new ExtendedCompositeNameAndIdNumberForOrganizations[]
                {
                    new ExtendedCompositeNameAndIdNumberForOrganizations
                    {
                        OrganizationName = "4"
                    }
                },
                LocationAddress = new ExtendedAddress[]
                {
                    new ExtendedAddress
                    {
                        StreetAddress = new StreetAddress
                        {
                            StreetOrMailingAddress = "5"
                        }
                    }
                },
                LocationPhone = new ExtendedTelecommunicationNumber[]
                {
                    new ExtendedTelecommunicationNumber
                    {
                        TelephoneNumber = "6"
                    }
                },
                LicenseNumber = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "7"
                    }
                },
                LocationEquipment = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "8"
                    }
                },
                LocationServiceCode = new CodedWithExceptions
                {
                    Identifier = "9"
                }
            };

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

            Assert.Equal(expected, actual);
        }