firely-net-sdk
firely-net-sdk copied to clipboard
Validator doesn't validate cardinality on extension root
Our validator only applies the rules (for now) that are specified as constraints in fhirpath. It does not validate rules that are formulated text-only.
This causes issues when someone is distributing their extensions to their users a la the FHIR spec in an extensions library, rather than putting them on the profiles.
The spec on this issue says: If the Extension maximum cardinality is 1, then the extension is only allowed once on any element on which it appears. A profile that defines the use of an extension can only make the maximum cardinality 1 (or zero if the minimum cardinality is 0, and the profile constrains another profile that allows the extension).
So when an extension with the cardinality 0..1 is added to a profile twice the validator should pick this up as incorrect.
@MatthijsvdWielen, I edited the title of your issue: although it is true - it is also too broad. There are tons of textual rules that we don't yet catch - so I focused on the Extension issue that you have documented.
I think we have agreed offline that the prio for this issue is not too high?
@ewoutkramer Yes, the customer said they would like to see a solution for this in a "couple of months" but it was not an urgent issue.
We will implement this in the new Validator.