Enumerations

For coded types in FHIR, the elements are bound to a ValueSet. When the specification states that the ValueSet is ‘Required’, this means it is a fixed list of codes. The SDK provides an enumeration for each fixed ValueSet. You can use these enumerations to fill in the correct value.

The Patient resource has a fixed ValueSet for the gender element.

../_images/fhir_patient_gender.png

Enumeration in the SDK:

../_images/sdk_patient_gender.png

Code example, adding a gender to our Patient:

pat.Gender = AdministrativeGender.Male;