From fb8b2dcd70e76f16a826b88d9cff886307159640 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 1 Aug 2019 10:54:17 +1000 Subject: [PATCH] add new test case --- .../validation-examples/manifest.json | 4 +- .../value-slicing-bad-1.xml | 68 +++++++++++++++++++ .../value-slicing-ok-1.xml | 68 +++++++++++++++++++ .../value-slicing-profile-open.xml | 66 ++++++++++++++++++ 4 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-bad-1.xml create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-ok-1.xml create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-profile-open.xml diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json b/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json index 59a4a5b34..34e580ec1 100644 --- a/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json @@ -149,7 +149,9 @@ ] }, "synthea.json": { - "errorCount": 1 + "version": "4.0", + "errorCount": 2, + "errors-for-debugging" : ["ERROR: /Encounter/reasonCode: This property must be an Array, not an Object", "ERROR: Encounter.status: The value provided ('completed') is not in the value set http://hl7.org/fhir/ValueSet/encounter-status|4.1.0 (http://hl7.org/fhir/ValueSet/encounter-status, and a code is required from this value set) (error message = Unknown Code http://hl7.org/fhir/encounter-status#completed in http://hl7.org/fhir/encounter-status)"] }, "patient-good.json": { "errorCount": 0, diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-bad-1.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-bad-1.xml new file mode 100644 index 000000000..4b2b3317b --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-bad-1.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-ok-1.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-ok-1.xml new file mode 100644 index 000000000..dd613032e --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-ok-1.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-profile-open.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-profile-open.xml new file mode 100644 index 000000000..67e42cdce --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/value-slicing-profile-open.xml @@ -0,0 +1,66 @@ + + + + + + + <status value="draft"/> + <date value="3017-09-06T06:30:54+00:00"/> + <publisher value="HL7"/> + <fhirVersion value="4.0.0"/> + <kind value="resource"/> + <abstract value="false"/> + <type value="List"/> + <baseDefinition value="http://hl7.org/fhir/StructureDefinition/List"/> + <derivation value="constraint"/> + <differential> + <element id="List.entry"> + <path value="List.entry"/> + <slicing> + <discriminator> + <type value="profile"/> + <path value="item.resolve().code"/> + </discriminator> + <ordered value="false"/> + <rules value="open"/> + </slicing> + </element> + <element id="List.entry:slice1"> + <path value="List.entry"/> + <sliceName value="slice1"/> + <min value="1"/> + </element> + <element id="List.entry:slice1.item"> + <path value="List.entry.item"/> + <type> + <code value="Reference"/> + <targetProfile value="http://hl7.org/fhir/test/StructureDefinition/profile-slicing-profile-1"/> + </type> + </element> + <element id="List.entry:slice2"> + <path value="List.entry"/> + <sliceName value="slice2"/> + <min value="1"/> + <max value="3"/> + </element> + <element id="List.entry:slice2.item"> + <path value="List.entry.item"/> + <type> + <code value="Reference"/> + <targetProfile value="http://hl7.org/fhir/test/StructureDefinition/profile-slicing-profile-2"/> + </type> + </element> + <element id="List.entry:slice3"> + <path value="List.entry"/> + <sliceName value="slice3"/> + <max value="1"/> + </element> + <element id="List.entry:slice3.item"> + <path value="List.entry.item"/> + <type> + <code value="Reference"/> + <targetProfile value="http://hl7.org/fhir/test/StructureDefinition/profile-slicing-profile-3"/> + </type> + </element> + </differential> +</StructureDefinition> \ No newline at end of file