diff --git a/validator/manifest.json b/validator/manifest.json index d309ce0b..723fb967 100644 --- a/validator/manifest.json +++ b/validator/manifest.json @@ -50508,7 +50508,7 @@ "structuredefinition-version-range.xml" ], "version": "3.0", - "description": "testing combinations of earliestAllowedFHIRVersion and latestAllowedFHIRVersion", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", "java": { "outcome": { "resourceType": "OperationOutcome", @@ -50535,7 +50535,7 @@ "structuredefinition-version-range.xml" ], "version": "4.0", - "description": "testing combinations of earliestAllowedFHIRVersion and latestAllowedFHIRVersion", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", "java": {} }, { @@ -50545,7 +50545,7 @@ "structuredefinition-version-range.xml" ], "version": "4.3", - "description": "testing combinations of earliestAllowedFHIRVersion and latestAllowedFHIRVersion", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", "java": {} }, { @@ -50555,7 +50555,7 @@ "structuredefinition-version-range.xml" ], "version": "5.0", - "description": "testing combinations of earliestAllowedFHIRVersion and latestAllowedFHIRVersion", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", "java": { "outcome": { "resourceType": "OperationOutcome", @@ -50575,6 +50575,121 @@ } } }, + { + "name": "extension-version-restriction-range-ctxt-r3", + "file": "patient-version-range.json", + "supporting5": [ + "structuredefinition-version-range-ctxt.xml" + ], + "version": "3.0", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", + "java": { + "outcome": { + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "error", + "code": "structure", + "details": { + "text": "The extension http://hl7.org/fhir/test/StructureDefinition/version-range is not allowed to be used at this point (allowed for this version = e:CodeSystem.property; this element is [Patient])" + }, + "diagnostics": "[1,2]", + "expression": [ + "Patient" + ] + } + ] + } + } + }, + { + "name": "extension-version-restriction-range-ctxt-r4", + "file": "patient-version-range.json", + "supporting5": [ + "structuredefinition-version-range-ctxt.xml" + ], + "version": "4.0", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", + "java": {} + }, + { + "name": "extension-version-restriction-range-ctxt-r4b", + "file": "patient-version-range.json", + "supporting5": [ + "structuredefinition-version-range-ctxt.xml" + ], + "version": "4.3", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", + "java": {} + }, + { + "name": "extension-version-restriction-range-ctxt-r5", + "file": "patient-version-range.json", + "supporting5": [ + "structuredefinition-version-range-ctxt.xml" + ], + "version": "5.0", + "description": "testing usage of http://hl7.org/fhir/StructureDefinition/version-specific-use", + "java": { + "outcome": { + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "error", + "code": "structure", + "details": { + "text": "The extension http://hl7.org/fhir/test/StructureDefinition/version-range is not allowed to be used at this point (allowed for this version = e:CodeSystem.property; this element is [Patient])" + }, + "diagnostics": "[1,2]", + "expression": [ + "Patient" + ] + } + ] + } + } + }, + { + "name": "vs-wrong-vs", + "file": "vs-wrong-vs.xml", + "version": "5.0", + "description": "it's an actual error if the value set tries to use a value set url as the code system - check that", + "java": { + "outcome": { + "resourceType": "OperationOutcome", + "issue": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl": "http://tx-dev.fhir.org/r4" + } + ], + "severity": "information", + "code": "business-rule", + "details": { + "text": "Reference to deprecated ValueSet http://hl7.org/fhir/ValueSet/jurisdiction|5.0.0" + }, + "diagnostics": "[23,17]", + "expression": [ + "ValueSet.jurisdiction[0]" + ] + }, + { + "severity": "error", + "code": "invalid", + "details": { + "text": "The system 'http://hl7.org/fhir/ValueSet/FHIR-version' is actually a value set, which itself refers to the system 'http://hl7.org/fhir/FHIR-version' so that may be what is intended here" + }, + "diagnostics": "[31,14]", + "expression": [ + "ValueSet.compose.include[0]" + ] + } + ] + } + } + }, { "name": "zzz", "file": "zzz.json", diff --git a/validator/structuredefinition-version-range-ctxt.xml b/validator/structuredefinition-version-range-ctxt.xml new file mode 100644 index 00000000..f475c776 --- /dev/null +++ b/validator/structuredefinition-version-range-ctxt.xml @@ -0,0 +1,62 @@ + + + + + + + <status value="active"/> + <experimental value="false"/> + <publisher value="HL7 International / FHIR Infrastructure"/> + <contact> + <telecom> + <!-- Or whatever URL and/or email address(es) are appropriate --> + <system value="url"/> + <value value="http://hl7.org/Special/committees/fhir-i"/> + </telecom> + </contact> + <description value="Allowed R3-R4"/> + <fhirVersion value="4.0.1"/> + <kind value="complex-type"/> + <abstract value="false"/> + <context> + <extension url="http://hl7.org/fhir/StructureDefinition/version-specific-use"> + <extension url="startFhirVersion"> + <valueCode value="4.0"/> + </extension> + <extension url="endFhirVersion"> + <valueCode value="4.3"/> + </extension> + </extension> + <type value="element"/> + <expression value="Patient"/> + </context> + <context> + <type value="element"/> + <expression value="CodeSystem.property"/> + </context> + <type value="Extension"/> + <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension"/> + <derivation value="constraint"/> + <differential> + <element id="Extension"> + <path value="Extension"/> + <short value="Additional Binding"/> + <definition value="Additional bindings applied to bindable elements."/> + <min value="0"/> + <max value="*"/> + </element> + + <element id="Extension.url"> + <path value="Extension.url"/> + <fixedUri value="http://hl7.org/fhir/test/StructureDefinition/version-range"/> + </element> + <element id="Extension.value[x]"> + <path value="Extension.value[x]"/> + <min value="1"/> + <max value="1"/> + <type> + <code value="code"/> + </type> + </element> + </differential> +</StructureDefinition> diff --git a/validator/structuredefinition-version-range.xml b/validator/structuredefinition-version-range.xml index 97291b38..634a80d3 100644 --- a/validator/structuredefinition-version-range.xml +++ b/validator/structuredefinition-version-range.xml @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <StructureDefinition xmlns="http://hl7.org/fhir" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir ../../input-cache/schemas/R4/fhir-single.xsd"> <id value="version-range"/> - <extension url="http://hl7.org/fhir/StructureDefinition/earliestAllowedFHIRVersion"> - <valueCode value="4.0"/> - </extension> - <extension url="http://hl7.org/fhir/StructureDefinition/latestAllowedFHIRVersion"> - <valueCode value="4.3"/> + <extension url="http://hl7.org/fhir/StructureDefinition/version-specific-use"> + <extension url="startFhirVersion"> + <valueCode value="4.0"/> + </extension> + <extension url="endFhirVersion"> + <valueCode value="4.3"/> + </extension> </extension> <url value="http://hl7.org/fhir/test/StructureDefinition/version-range"/> <name value="VersionRangeExtension"/> diff --git a/validator/vs-wrong-vs.xml b/validator/vs-wrong-vs.xml new file mode 100644 index 00000000..328ea6db --- /dev/null +++ b/validator/vs-wrong-vs.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<ValueSet xmlns="http://hl7.org/fhir"> + <id value="major-fhir-version"/> + <url value="http://hl7.org/fhir/ValueSet/major-fhir-version"/> + <identifier> + <system value="urn:ietf:rfc:3986"/> + <value value="urn:oid:2.16.840.1.113883.4.642.3.3330"/> + </identifier> + <version value="5.0.0"/> + <name value="MajorFHIRVersions"/> + <title value="Major FHIR Versions"/> + <status value="active"/> + <experimental value="false"/> + <publisher value="HL7 International / FHIR Infrastructure"/> + <contact> + <telecom> + <system value="url"/> + <value value="http://www.hl7.org/Special/committees/fiwg"/> + </telecom> + </contact> + <description value="The milestone releases of FHIR versions, identified by their major.minor versions (no patch versions)"/> + <jurisdiction> + <coding> + <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/> + <code value="001"/> + <display value="World"/> + </coding> + </jurisdiction> + <compose> + <include> + <system value="http://hl7.org/fhir/ValueSet/FHIR-version"/> + <version value="5.0.0"/> + <concept> + <code value="1.0"/> + </concept> + <concept> + <code value="3.0"/> + </concept> + <concept> + <code value="4.0"/> + </concept> + <concept> + <code value="4.3"/> + </concept> + <concept> + <code value="5.0"/> + </concept> + </include> + </compose> +</ValueSet> \ No newline at end of file