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 API 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
Enumeration in the API:
Code example, adding a gender to our Patient:
pat.Gender = AdministrativeGender.Male;