FirelyTeam / firely-validator-api

Firely's official FHIR validator API for validating HL7 FHIR resources against profiles.
Other
8 stars 2 forks source link

[Validator] Handle incorrect type of fixed value in ElementDefinition #138

Closed njnikodym closed 1 year ago

njnikodym commented 2 years ago

When a profile states that a certain element should have a fixed code but the element is filled with an uri, neither Simplifier nor the validator report the resource as invalid.

Example: If a resource contains: "fixedCode": "http://terminology.hl7.org/CodeSystem/v3-ActClass". It should report an error as the element is not of type "code".

HL7 validator does report back an error, namely: Unable to generate snapshot for ca-on-ps-profile-composition from Composition because Profile CompositionPSON (http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-composition), element Coding.system. Error generating snapshot: The fixed value has type 'code' which is not valid (valid type: [uri])

mmsmits commented 2 years ago

We have to investigate what our current snapshot generator behavior is, and what have to discuss what the expected behavior is.

Options:

ewoutkramer commented 2 years ago

So, we should add this to the validator I think, and keep what we have in the snapshot generator.

ewoutkramer commented 2 years ago

I now understand the output in the message is the HL7 snapshot generator. Yes, so we should add it to both I think.