Description
The linter currently validates several StructureDefinition and Task aspects (metadata, placeholders, differential/snapshot structure, slice cardinality, basic Task input checks), but it does not yet enforce some important cross-resource/profile-driven constraints.
We should extend linting to support the following cases:
-
Validate binding.valueSet references in StructureDefinition
- When an element contains:
binding.strength
binding.valueSet
- Resolve the canonical URL in
binding.valueSet against available ValueSet resources in the project.
- If no matching
ValueSet is found:
- emit ERROR when
binding.strength = required
- emit WARNING for other strengths (
extensible, preferred, example)
-
Validate fixedUri constraints against Task instances
- For relevant
StructureDefinition differential elements (e.g. Task.input:*...coding.system), ensure the fixed URI value is present in corresponding Task instances.
- Missing required fixed URI in Task should emit ERROR.
-
Validate fixedCode in the context of the corresponding URI/system
- For profile elements like
Task.input:*...coding.code with fixedCode, validate that Task instances contain the expected (system, code) pair.
- Example target pair:
system = http://example.org/fhir/CodeSystem/tutorial
code = tutorial-input
- If code exists under wrong system, or expected pair is missing, emit ERROR.
Example profile fragment
<binding>
<strength value="required" />
<valueSet value="http://example.org/fhir/ValueSet/tutorial" />
</binding>
<element id="Task.input:tutorial-input.type.coding.system">
<path value="Task.input.type.coding.system" />
<fixedUri value="http://example.org/fhir/CodeSystem/tutorial" />
</element>
<element id="Task.input:tutorial-input.type.coding.code">
<path value="Task.input.type.coding.code" />
<fixedCode value="tutorial-input" />
</element>
Expected Task coding:
<coding>
<system value="http://example.org/fhir/CodeSystem/tutorial"/>
<code value="tutorial-input"/>
</coding>
Description
The linter currently validates several
StructureDefinitionandTaskaspects (metadata, placeholders, differential/snapshot structure, slice cardinality, basic Task input checks), but it does not yet enforce some important cross-resource/profile-driven constraints.We should extend linting to support the following cases:
Validate
binding.valueSetreferences inStructureDefinitionbinding.strengthbinding.valueSetbinding.valueSetagainst availableValueSetresources in the project.ValueSetis found:binding.strength = requiredextensible,preferred,example)Validate
fixedUriconstraints against Task instancesStructureDefinitiondifferential elements (e.g.Task.input:*...coding.system), ensure the fixed URI value is present in correspondingTaskinstances.Validate
fixedCodein the context of the corresponding URI/systemTask.input:*...coding.codewithfixedCode, validate that Task instances contain the expected(system, code)pair.system = http://example.org/fhir/CodeSystem/tutorialcode = tutorial-inputExample profile fragment
Expected Task coding: