From 5a9ef0b57ca6c94e16256e99865878ffdaa1bb99 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 10 May 2024 08:58:20 +1000 Subject: [PATCH] move supplement version test cases to normal test cases --- .../validation/ResourceValidationTests.java | 23 ---- .../org.hl7.fhir.validation/4.0.1/loinc.cache | 79 ++++++------ .../org.hl7.fhir.validation/5.0.0/5.0.0.cache | 22 ++++ .../5.0.0/all-systems.cache | 112 +++++++++++++++--- .../5.0.0/system-map.json | 5 + 5 files changed, 163 insertions(+), 78 deletions(-) create mode 100644 org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/5.0.0.cache diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/ResourceValidationTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/ResourceValidationTests.java index e49726978..141bea396 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/ResourceValidationTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/ResourceValidationTests.java @@ -128,27 +128,4 @@ public class ResourceValidationTests { runTest("codesystem-example.xml"); } - - @Test - public void testCodesystemSupplementsVersion() throws Exception { - List errors = runTest("codesystem-example-supplement-version.xml"); - assertNoErrors(errors); - } - - - private void assertNoErrors(List errors) { - List errorMessages = new ArrayList<>(); - for(ValidationMessage message : errors) { - // we will skip the message that WG citation is needed - if(I18nConstants.VALIDATION_HL7_WG_NEEDED.equals(message.getMessageId())) { - continue; - } - if(message.getLevel().isError()) { - errorMessages.add(message.getMessage()); - } - } - assertThat("No error message expected in validation outcome.", errorMessages, is(empty())); - } - - } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache index 92b31fb08..d0bdbdd3d 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache @@ -6495,7 +6495,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6519,7 +6518,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6543,7 +6541,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6567,7 +6564,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6591,7 +6587,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6615,7 +6610,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6639,7 +6633,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6663,7 +6656,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6687,7 +6679,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6711,7 +6702,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6735,7 +6725,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6758,7 +6747,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6782,7 +6770,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6806,7 +6793,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6829,7 +6815,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6853,7 +6838,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6877,7 +6861,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6900,7 +6883,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6924,7 +6906,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6948,7 +6929,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6971,7 +6951,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6995,7 +6974,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7019,7 +6997,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7042,7 +7019,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7066,7 +7042,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7090,7 +7065,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7113,7 +7087,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7137,7 +7110,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7161,7 +7133,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7184,7 +7155,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7208,7 +7178,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7232,7 +7201,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7255,7 +7223,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7279,7 +7246,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7303,7 +7269,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7326,7 +7291,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7350,7 +7314,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7374,7 +7337,6 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7398,7 +7360,6 @@ v: { "error" : "The provided code 'http://loinc.org#883-9' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -7422,3 +7383,43 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "test" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "test", + "severity" : "error", + "error" : "Unknown code 'test' in the CodeSystem 'http://loinc.org' version '2.77'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Unknown code 'test' in the CodeSystem 'http://loinc.org' version '2.77'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/5.0.0.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/5.0.0.cache new file mode 100644 index 000000000..f1b7cef0f --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/5.0.0.cache @@ -0,0 +1,22 @@ +------------------------------------------------------------------------------------- +{"code" : { + "system" : "5.0.0", + "version" : "http://hl7.org/fhir/composition-status", + "code" : "final" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "severity" : "error", + "error" : "A definition for CodeSystem '5.0.0' version 'http://hl7.org/fhir/composition-status' could not be found, so the code cannot be validated. Valid versions: []", + "class" : "CODESYSTEM_UNSUPPORTED", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache index bb3fcd4f1..650d2983c 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache @@ -221,7 +221,6 @@ v: { "code" : "text/plain", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -242,7 +241,6 @@ v: { "code" : "text/plain", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -267,7 +265,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#271649006 ('Systolic blood pressure')' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|5.0.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -312,7 +309,6 @@ v: { "code" : "json", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -333,7 +329,6 @@ v: { "code" : "json", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -361,7 +356,6 @@ v: { "code" : "en-US", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -382,7 +376,6 @@ v: { "code" : "en-US", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -404,7 +397,6 @@ v: { "code" : "001", "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -447,7 +439,6 @@ v: { "code" : "nl-NL", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -468,7 +459,6 @@ v: { "code" : "nl-NL", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -496,7 +486,6 @@ v: { "code" : "image/gif", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -517,7 +506,6 @@ v: { "code" : "image/gif", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -545,7 +533,6 @@ v: { "code" : "en-AU", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -566,7 +553,6 @@ v: { "code" : "en-AU", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -587,7 +573,6 @@ v: { "code" : "en", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -610,7 +595,6 @@ v: { "code" : "001", "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -632,3 +616,99 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "code" : "de" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "German", + "code" : "de", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "de" +}, "url": "http://hl7.org/fhir/ValueSet/all-languages", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "German", + "code" : "de", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "de" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "German", + "code" : "de", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "de" +}, "url": "http://hl7.org/fhir/ValueSet/all-languages", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "German", + "code" : "de", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json index a6a411509..88db6d1fe 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json @@ -1,5 +1,10 @@ { "systems" : [ + { + "system" : "5.0.0|http://hl7.org/fhir/composition-status", + "authoritative" : [], + "candidates" : [] + }, { "system" : "http://acme.com/config/fhir/codesystems/internal", "authoritative" : [],