fhir.resources icon indicating copy to clipboard operation
fhir.resources copied to clipboard

code validation questions

Open Healthedata1 opened this issue 3 years ago • 1 comments

  • fhir.resources version: current
  • Python version: 3.7
  • Operating System: Mac OS

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 avatar Jul 01 '21 00:07 Healthedata1

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

Healthedata1 avatar Jul 01 '21 00:07 Healthedata1