public List <ContactPoint> Resolve(entitystorematerialised_CorePersoncontactinfo1 personContact, Patient destination, List <ContactPoint> destMember, ResolutionContext context) { var contactPoints = new List <ContactPoint>(); if (destination.Telecom.IsCollectionValid()) { destination.Telecom.Each(tel => contactPoints.Add(tel)); } if (personContact.IsNull()) { return(contactPoints); } var contactPoint = ContactSystemMapper(personContact); if (contactPoint != null) { contactPoints.Add(contactPoint); } return(contactPoints); }
private ContactPoint ContactSystemMapper(entitystorematerialised_CorePersoncontactinfo1 personContact) { if (personContact == null) { return(null); } var contact = new ContactPoint(); switch (personContact.Contacttypecode.ToLower()) { case "email": contact.System = ContactPoint.ContactPointSystem.Email; break; case "home": contact.System = ContactPoint.ContactPointSystem.Phone; contact.Use = ContactPoint.ContactPointUse.Home; break; case "personal": contact.System = ContactPoint.ContactPointSystem.Phone; contact.Use = ContactPoint.ContactPointUse.Mobile; break; case "work": contact.System = ContactPoint.ContactPointSystem.Other; contact.Use = ContactPoint.ContactPointUse.Work; break; default: contact.System = ContactPoint.ContactPointSystem.Other; break; } return(contact); }