Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cknaap
Created December 7, 2017 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cknaap/15fa48f72bfa7ccba9fefa3cd8c7eed0 to your computer and use it in GitHub Desktop.
Save cknaap/15fa48f72bfa7ccba9fefa3cd8c7eed0 to your computer and use it in GitHub Desktop.
Map data in Vonk FHIR Facade
public IResource MapPatient(ViSiPatient source)
{
var patient = new Patient();
patient.Id = source.Id.ToString();
patient.Identifier.Add(new Identifier("http://mycompany.org/patientnumber", source.PatientNumber));
patient.Name.Add(new HumanName().WithGiven(source.FirstName).AndFamily(source.FamilyName));
patient.BirthDate = new FhirDateTime(source.DateOfBirth).ToString();
patient.Telecom.Add(new ContactPoint(ContactPoint.ContactPointSystem.Email, ContactPoint.ContactPointUse.Home, source.EmailAddress));
return patient.AsIResource();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment