nazrulworld / fhir.resources

FHIR Resources https://www.hl7.org/fhir/resourcelist.html
https://pypi.org/project/fhir.resources/
Other
372 stars 104 forks source link

code validation questions #76

Open Healthedata1 opened 3 years ago

Healthedata1 commented 3 years ago

Description

when instantiate a FHIR Resource with a required valueset - Observation.status, I expected it to be validated based upon the fixed set of codes ( http://hl7.org/fhir/valueset-observation-status.html ). What is the status of code validataion? I think that it would possble to at least validate the required bindings where the codes are enumerated.

What I Did

from fhir.resources import construct_fhir_element
obs = construct_fhir_element('Observation', {"status":"foo", "code": {}})

I expected the value "foo" to cause a pydantic validation error.

Healthedata1 commented 3 years ago

I just saw this: https://github.com/nazrulworld/fhir.resources#enum-validator