firely-net-sdk
firely-net-sdk copied to clipboard
Validate incorrect slicing in StructureDefinition directly
Is your feature request related to a problem? Please describe. When validating Cyprus' eHealth4U, it complains on a bunch of Observation instances about the profile it is validating against:
BusinessRule : The value discriminator should have a 'fixed[x]', 'pattern[x]' or binding element set on 'http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-bloodpressure#Observation.component.code.coding.code (Observation.component.code.coding.code)'. - Code 2012
https://simplifier.net/ehealth4u/cyehrbloodpressure-andreasioannou1/$validate
They are indeed slicing component on code.coding.code, but do not fix anything about that code.coding.code. (Same for code.coding.system, but there's no output on that.)
However, when validating the profile/StructureDefinition itself there is no warning on this issue.
Describe the solution you'd like Add validation on StructureDefinition that already captures this issue on slicing in the SD itself, not only when validating a resource against it.
Describe alternatives you've considered Accept that it only has this validation 'runtime'.
Additional context Continued from internal Slack discussion: https://firelyteam.slack.com/archives/C011XD1TKL0/p1662639023271319
I now realize this is pretty hard - not because we can't, but because the new validator is version independent (R3/R4 etc), but the code we wrote to validate this businessrule is written for a specific version (since it's written against StructureDefinition). So, we can do it, but that would currently require us to have two version of the validator :-(
This functionality is out of scope for the open-source validator. It will be added to the enterprise (to be developed yet) Firely validator. For internal, see here the Jira issue (VONK-4819).