FHIR Chat · Overly zealous validation rules? · implementers

Stream: implementers

Topic: Overly zealous validation rules?


view this post on Zulip Michael Lawley (May 17 2019 at 01:50):

The InstanceValidator imposes the following rules on the default "all codes in the system" ValueSet of a CodeSystem:

vs.hasCompose() && !vs.hasExpansion(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but it is an expansion"

Why is no expansion allowed? We stumbled across this because we include the valueset-unclosed extension by default, and this extension goes on the expansion element.

vs.getCompose().getInclude().size() == 1, "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a single include"

This might be a problem in case the CodeSystem is some kind of composite as is commonly seen with OWL-based terminologies. Granted a canonical "all codes" ValueSet definition should only require a single include that specifies the system URI (and possibly the version as well), but there may be other semantically equivalent definitions that convey useful information to a person.

vs.getCompose().getInclude().get(0).getSystem().equals(url), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a matching system ("+vs.getCompose().getInclude().get(0).getSystem()+")"

See point above.

!vs.getCompose().getInclude().get(0).hasValueSet() && !vs.getCompose().getInclude().get(0).hasConcept() && !vs.getCompose().getInclude().get(0).hasFilter(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but the include has extra details"

Again, we ran into this because we included an explicit filter condition with the SNOMED ECL expression "*". Why should validation exclude this possibility?

view this post on Zulip Grahame Grieve (May 17 2019 at 01:53):

what I was thinking is that any enumeration in an expansion is problematic from a version control perspective

view this post on Zulip Grahame Grieve (May 17 2019 at 01:53):

but I accept that this is a policy thing not a base conformance issue

view this post on Zulip Grahame Grieve (May 17 2019 at 01:54):

also I didn't know how to validate an expansion in this context

view this post on Zulip Michael Lawley (May 17 2019 at 01:55):

Agreed. However the ValueSet itself may be version-specific (and ours is in this case)

view this post on Zulip Grahame Grieve (May 17 2019 at 01:56):

make an issue report (https://github.com/hapifhir/org.hl7.fhir.core/issues) and I'll get to it

view this post on Zulip Grahame Grieve (May 17 2019 at 01:56):

(or better, make an issue report + a PR)


Last updated: Apr 12 2022 at 19:14 UTC