Skip to content

Add explicit Task coding validation for CodeSystem and ValueSet with separate ERROR issues #38

@khalilmalla95

Description

@khalilmalla95

Description

Current Task terminology validation checks coding.system + coding.code via cache lookup and emits a generic error when unknown.
However, we need stricter and more explicit validation for Task.input.type.coding entries, including separate issue types and explicit ValueSet validation.

For Task inputs like:

<input>
  <type>
    <coding>
      <system value="http://example.org/fhir/CodeSystem/tutorial"/>
      <code value="tutorial-input"/>
    </coding>
  </type>
  <valueString value="Hello from the DSF tutorial – this is my tutorial-input for Exercise 2."/>
</input>

we want the following behavior.

Required validations

  1. Validate coding.system against known CodeSystem resources

    • If coding.system URI is not found in available CodeSystem resources, emit ERROR.
    • Create a dedicated issue for this case.
  2. Validate coding.system against relevant ValueSet resources

    • Check whether the system is referenced by the expected ValueSet context (profile/binding-driven or configured rule scope).
    • If system is not part of the expected ValueSet context, emit ERROR.
    • Create a dedicated issue for this case.
  3. Validate coding.code against CodeSystem under the relevant URI

    • Resolve code validity specifically under the provided coding.system URI (important when multiple CodeSystems exist).
    • If code is missing in that specific CodeSystem, emit ERROR.
    • Create a dedicated issue for this case.

Why

  • Current behavior is too coarse-grained for diagnostics (unknown code only).
  • We need actionable feedback:
    • system unknown
    • system not allowed by ValueSet context
    • code invalid for that exact system URI
  • This is especially important when multiple CodeSystem resources exist and code values overlap across systems.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions