diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 660d9a0a8..9535dd489 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,11 @@ ## Validator -* Allow both -output and -output-style parameters (output-style applies to output now) +* Allow both -output and -output-style parameters (output-style applies to output now) + add csv output style * Implement the ```-level``` parameter +* Add support for R4B validation +* fix bug in deep profiles (profiles that don't start at the root) ## Other code changes +* Regenerate R5 code for 5.0.0-snapshot1 & many consequential changes +* Add version support for R4B and R5 (R4B code generation still to be done) diff --git a/org.hl7.fhir.convertors/readme.md b/org.hl7.fhir.convertors/readme.md index e69de29bb..c9faf8154 100644 --- a/org.hl7.fhir.convertors/readme.md +++ b/org.hl7.fhir.convertors/readme.md @@ -0,0 +1,32 @@ +About the version conversion routines + +The version conversion routines are maintained as part of +the development of the standard, but always under considerable +time pressure. Implementers should regard these as 'scaffolds' for +an actual reliable conversion routine. + +The FHIR project maintains and tests conversions on the following +resources, from old versions to R5: +* CodeSystem +* ValueSet +* ConceptMap +* StructureDefinition +* StructureMap +* ImplementationGuide +* CapabilityStatement +* OperationDefinition +* NamingSystem + +These can be relied on and are subject to extensive testing. + +In addition to this, some of the conversions have test cases +for particular resources and particular version combinations. +Where test cases exist, they will continue to pass and be +maintained. + +So: +* test the conversion routines before using them in production +* contribute test cases to ensure that your use cases continue to be reliable + +Test cases are welcome - make them as PRs to the core library, or even better, +to the FHIR test cases library \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientFactory.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientFactory.java index 99b175c69..2499ddf23 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientFactory.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientFactory.java @@ -51,6 +51,8 @@ public class TerminologyClientFactory { return new TerminologyClientR2(checkEndsWith("/r2", url), userAgent); case R4: return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); + case R4B: + return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); case R5: return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); // r4 for now, since the terminology is currently the same case STU3: diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/StructureDefinitionHacker.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/StructureDefinitionHacker.java index 26d8cfcb3..9151db05b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/StructureDefinitionHacker.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/StructureDefinitionHacker.java @@ -6,6 +6,12 @@ import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.utilities.VersionUtilities; +/** + * This doesn't do anythign at this time + * + * @author graha + * + */ public class StructureDefinitionHacker { private String version; @@ -16,33 +22,8 @@ public class StructureDefinitionHacker { } public Resource fixSD(StructureDefinition sd) { - if (VersionUtilities.isR4BVer(version) && sd.getUrl().equals("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) { - // the definition of this one is wrong in R4B - return fixR4BFhirType(sd); - } return sd; } - private Resource fixR4BFhirType(StructureDefinition sd) { - for (ElementDefinition ed : sd.getDifferential().getElement()) { - if (ed.getPath().equals("Extension.value[x]")) { - fixEDType(ed, "url", "uri"); - } - } - for (ElementDefinition ed : sd.getSnapshot().getElement()) { - if (ed.getPath().equals("Extension.value[x]")) { - fixEDType(ed, "url", "uri"); - } - } - return sd; - } - - private void fixEDType(ElementDefinition ed, String orig, String repl) { - for (TypeRefComponent t : ed.getType()) { - if (orig.equals(t.getCode())) { - t.setCode(repl); - } - } - } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/FhirPublication.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/FhirPublication.java index 4548f220d..e69e97631 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/FhirPublication.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/FhirPublication.java @@ -46,6 +46,7 @@ public enum FhirPublication { DSTU2016May, STU3, R4, + R4B, R5; public static FhirPublication fromCode(String v) { @@ -57,12 +58,10 @@ public enum FhirPublication { return FhirPublication.STU3; if (VersionUtilities.isR4Ver(v)) return FhirPublication.R4; + if (VersionUtilities.isR4BVer(v)) + return FhirPublication.R4B; if (VersionUtilities.isR5Ver(v)) return FhirPublication.R5; - if ("3.5.0".equals(v)) - return FhirPublication.R4; - if ("3.5".equals(v)) - return FhirPublication.R4; return null; } @@ -72,7 +71,9 @@ public enum FhirPublication { case DSTU2: return "1.0.2"; case DSTU2016May: return "1.4.0"; case STU3: return "3.0.1"; - case R4: return Constants.VERSION; + case R4: return "4.0.1"; + case R4B: return "4.3.0"; + case R5: return "5.0.0"; default: return "??"; } diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java index 1180262cd..a8bcf35f1 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java @@ -142,10 +142,12 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe if (!ve.containsKey(version)) { if (version.startsWith("5.0")) ve.put(version, new ValidationEngine("hl7.fhir.r5.core#4.5.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R5, true, "4.5.0", "fhir/test-cases")); - else if (version.startsWith("3.0")) - ve.put(version, new ValidationEngine("hl7.fhir.r3.core#3.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2", "fhir/test-cases")); + else if (version.startsWith("4.3")) + ve.put(version, new ValidationEngine("hl7.fhir.r4b.core#4.3.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R4B, true, "4.3.0", "fhir/test-cases")); else if (version.startsWith("4.0")) ve.put(version, new ValidationEngine("hl7.fhir.r4.core#4.0.1", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R4, true, "4.0.1", "fhir/test-cases")); + else if (version.startsWith("3.0")) + ve.put(version, new ValidationEngine("hl7.fhir.r3.core#3.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2", "fhir/test-cases")); else if (version.startsWith("1.0")) ve.put(version, new ValidationEngine("hl7.fhir.r2.core#1.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2, true, "1.0.2", "fhir/test-cases")); else if (version.startsWith("1.4"))