Skip to content

Instantly share code, notes, and snippets.

@rectalogic
Created April 9, 2021 20:28
Show Gist options
  • Save rectalogic/4147ecc79ee8887cc3761fa81718fdab to your computer and use it in GitHub Desktop.
Save rectalogic/4147ecc79ee8887cc3761fa81718fdab to your computer and use it in GitHub Desktop.
from fhir.resources import fhirtypes, reference, patient, organization, humanname
org = organization.Organization(
id="org1",
active=True,
name="Acme Corp",
)
patient = patient.Patient(
id="p001",
active=True,
contained=[org],
name=[humanname.HumanName(given=["Adam"], family="Smith")],
birthDate=fhirtypes.Date(1985, 6, 12),
managingOrganization=reference.Reference(reference=org.id),
)
print(patient.dict())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment