예제 #1
0
        private Address GetAddressForPerson(entitystorematerialised_CorePersonaddress1 personAddress)
        {
            if (personAddress.IsNull())
            {
                return(null);
            }

            Address address = new Address();

            address.Line       = address.Line.Append(personAddress.Line1);
            address.Line       = address.Line.Append(", ");
            address.Line       = address.Line.Append(personAddress.Line2);
            address.Line       = address.Line.Append(", ");
            address.Line       = address.Line.Append(personAddress.Line3);
            address.City       = personAddress.City;
            address.State      = personAddress.Countystateprovince;
            address.Country    = personAddress.Country;
            address.PostalCode = personAddress.Postcodezip;
            address.Type       = Address.AddressType.Both;

            return(address);
        }
예제 #2
0
        public List <Address> Resolve(entitystorematerialised_CorePersonaddress1 personAddresses, Patient destination, List <Address> destMember, ResolutionContext context)
        {
            var addresses = new List <Address>();

            if (destination.Address.IsCollectionValid())
            {
                destination.Address.Each(addr => addresses.Add(addr));
            }

            if (personAddresses.IsNull())
            {
                return(addresses);
            }

            var addrPerson = GetAddressForPerson(personAddresses);

            if (addrPerson != null)
            {
                addresses.Add(addrPerson);
            }

            return(addresses);
        }