// Mappings from ViSi model to FHIR resources public IResource MapPatient(ViSiPatient source) { var patient = new Patient { Id = source.Id.ToString(), BirthDateElement = new Date(source.DateOfBirth.ToString("yyyy-MM-dd")) }; patient.Identifier.Add(new Identifier("http://mycompany.org/patientnumber", source.PatientNumber)); patient.Name.Add(new HumanName().WithGiven(source.FirstName).AndFamily(source.FamilyName)); if (source.EmailAddress != null) { patient.Telecom.Add(new ContactPoint(ContactPoint.ContactPointSystem.Email, ContactPoint.ContactPointUse.Home, source.EmailAddress)); } return(patient.AsIResource()); }