From c3bc29f06aba5def59ec21e9ab19acce7b81eaad Mon Sep 17 00:00:00 2001 From: Oliver Egger Date: Fri, 26 Apr 2019 16:26:55 +0200 Subject: [PATCH 1/3] GF#21004: validation examples to illustrate --- .../validation-examples/manifest.json | 15 +++ ...d-referencerangehighfixedquantitywrong.xml | 98 +++++++++++++++++ ...-cholesterol-bad-referencerangemissing.xml | 92 ++++++++++++++++ .../observation-cholesterol-bad-wrongcode.xml | 100 ++++++++++++++++++ .../observation-cholesterol-good.xml | 97 +++++++++++++++++ 5 files changed, 402 insertions(+) create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangehighfixedquantitywrong.xml create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangemissing.xml create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-wrongcode.xml create mode 100644 org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-good.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 9cf72caba..884a9a038 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 @@ -467,6 +467,21 @@ "source" : "extension-slice-profile.xml", "errorCount": 0 } + }, + "observation-cholesterol-good.xml" : { + "errorCount": 0 + }, + "observation-cholesterol-bad-referencerangemissing.xml" : { + "errorCount": 1, + "errors": ["ERROR: Observation: Profile http://hl7.org/fhir/StructureDefinition/cholesterol, Element 'Observation.referenceRange': minimum required = 1, but only found 0"] + }, + "observation-cholesterol-bad-referencerangehighfixedquantitywrong.xml" : { + "errorCount": 1, + "errors": ["ERROR: Observation.referenceRange.high.value: Value is '0' but must be '4.5'"] + }, + "observation-cholesterol-bad-wrongcode.xml" : { + "errorCount": 2, + "errors": ["ERROR: Observation.code.coding.code: Value is '13457-7' but must be '35200-5'","ERROR: Observation.code.coding.display: Value is 'Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation' but must be 'Cholesterol [Moles/​volume] in Serum or Plasma'"] } } } diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangehighfixedquantitywrong.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangehighfixedquantitywrong.xml new file mode 100644 index 000000000..09eba07e4 --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangehighfixedquantitywrong.xml @@ -0,0 +1,98 @@ + + + + + + + + +
+

+ Generated Narrative with Details +

+

+ id + : cholesterol +

+

+ status + : final +

+

+ code + : Cholesterol + (Details : {LOINC code '35200-5' = 'Cholesterol [Mass or + Moles/volume] in Serum or Plasma', + given as 'Cholesterol + [Moles/​volume] in Serum or Plasma'}) + +

+

+ subject + : + Patient/pat2 +

+

+ performer + : + Acme Laboratory, Inc +

+

+ value + : 6.3 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +

+

ReferenceRanges

+ + + + + + + + + +
- + High +
* + 4.5 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangemissing.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangemissing.xml new file mode 100644 index 000000000..b4c898ec6 --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-referencerangemissing.xml @@ -0,0 +1,92 @@ + + + + + + + + +
+

+ Generated Narrative with Details +

+

+ id + : cholesterol +

+

+ status + : final +

+

+ code + : Cholesterol + (Details : {LOINC code '35200-5' = 'Cholesterol [Mass or + Moles/volume] in Serum or Plasma', + given as 'Cholesterol + [Moles/​volume] in Serum or Plasma'}) + +

+

+ subject + : + Patient/pat2 +

+

+ performer + : + Acme Laboratory, Inc +

+

+ value + : 6.3 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +

+

ReferenceRanges

+ + + + + + + + + +
- + High +
* + 4.5 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-wrongcode.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-wrongcode.xml new file mode 100644 index 000000000..e95ab4b5c --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-bad-wrongcode.xml @@ -0,0 +1,100 @@ + + + + + + + + +
+

+ Generated Narrative with Details +

+

+ id + : cholesterol +

+

+ status + : final +

+

+ code + : Cholesterol + (Details : {LOINC code '35200-5' = 'Cholesterol [Mass or + Moles/volume] in Serum or Plasma', + given as 'Cholesterol + [Moles/​volume] in Serum or Plasma'}) + +

+

+ subject + : + Patient/pat2 +

+

+ performer + : + Acme Laboratory, Inc +

+

+ value + : 6.3 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +

+

ReferenceRanges

+ + + + + + + + + +
- + High +
* + 4.5 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-good.xml b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-good.xml new file mode 100644 index 000000000..b4b36c75f --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/observation-cholesterol-good.xml @@ -0,0 +1,97 @@ + + + + + + + + +
+

+ Generated Narrative with Details +

+

+ id + : cholesterol +

+

+ status + : final +

+

+ code + : Cholesterol + (Details : {LOINC code '35200-5' = 'Cholesterol [Mass or + Moles/volume] in Serum or Plasma', + given as 'Cholesterol + [Moles/​volume] in Serum or Plasma'}) + +

+

+ subject + : + Patient/pat2 +

+

+ performer + : + Acme Laboratory, Inc +

+

+ value + : 6.3 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +

+

ReferenceRanges

+ + + + + + + + + +
- + High +
* + 4.5 mmol/L + (Details: UCUM code mmol/L = 'mmol/L') +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file From bce35251f3a929da5e645d661e176fc410fad11d Mon Sep 17 00:00:00 2001 From: Oliver Egger Date: Fri, 26 Apr 2019 16:28:16 +0200 Subject: [PATCH 2/3] GF#21004: fixed values for complex types --- .../java/org/hl7/fhir/r5/validation/InstanceValidator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java index 82cc9ad70..54ed3f6e8 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java @@ -3817,6 +3817,9 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L checkPrimitive(hostContext, errors, ei.path, type, ei.definition, ei.element, profile); } else { // checkNonPrimitive(appContext, errors, ei.path, type, ei.definition, ei.element, profile); + if (ei.definition.hasFixed()) { + checkFixedValue(errors,ei.path, ei.element, ei.definition.getFixed(), ei.definition.getSliceName(), null); + } } if (type.equals("Identifier")) { checkIdentifier(errors, ei.path, ei.element, ei.definition); @@ -3833,7 +3836,7 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L } else if (type.equals("Resource")) { validateContains(hostContext, errors, ei.path, ei.definition, definition, resource, ei.element, localStack, idStatusForEntry(element, ei)); // if // (str.matches(".*([.,/])work\\1$")) - } + } } else { if (rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), stack.getLiteralPath(), ei.definition != null, "Unrecognised Content " + ei.name)) validateElement(hostContext, errors, profile, ei.definition, null, null, resource, ei.element, type, localStack, false); From 88646a8216637856b84e6837e18836553e25622c Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 27 Apr 2019 09:10:16 +1000 Subject: [PATCH 3/3] Release new version --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- .../org/hl7/fhir/r5/validation/InstanceValidator.java | 1 - .../test/resources/validation-examples/manifest.json | 2 +- pom.xml | 2 +- release.bat | 10 ++++++---- 13 files changed, 17 insertions(+), 16 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 967ffb2e6..b6f881489 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index c1500808e..c92423117 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index ef32a55b9..df1c550ff 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index a7fec192a..55fd10a04 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 36bd35a7c..522d95392 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 1e3cb691e..2afdd98f6 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 5a2563e20..dc15c7a91 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 93e018a33..fb86f27da 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 27cbca8bf..57b6e2e53 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java index 54ed3f6e8..fcd1ca15e 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java @@ -3816,7 +3816,6 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L if (isPrimitiveType(type)) { checkPrimitive(hostContext, errors, ei.path, type, ei.definition, ei.element, profile); } else { -// checkNonPrimitive(appContext, errors, ei.path, type, ei.definition, ei.element, profile); if (ei.definition.hasFixed()) { checkFixedValue(errors,ei.path, ei.element, ei.definition.getFixed(), ei.definition.getSliceName(), null); } 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 884a9a038..526495352 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 @@ -481,7 +481,7 @@ }, "observation-cholesterol-bad-wrongcode.xml" : { "errorCount": 2, - "errors": ["ERROR: Observation.code.coding.code: Value is '13457-7' but must be '35200-5'","ERROR: Observation.code.coding.display: Value is 'Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation' but must be 'Cholesterol [Moles/​volume] in Serum or Plasma'"] + "errors": ["ERROR: Observation.code.coding.code: Value is '13457-7' but must be '35200-5'","ERROR: Observation.code.coding.display: Value is 'Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation' but must be 'Cholesterol [Moles/?volume] in Serum or Plasma'"] } } } diff --git a/pom.xml b/pom.xml index 7c0ab864e..1494558bc 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ each other. It is fine to bump the point version of this POM without affecting HAPI FHIR. --> - 3.7.29-SNAPSHOT + 3.7.30-SNAPSHOT 3.7.0-SNAPSHOT diff --git a/release.bat b/release.bat index ed62cdebe..e54cea6bb 100644 --- a/release.bat +++ b/release.bat @@ -4,16 +4,18 @@ REM make sure you are committed echo echo =============================================================== -echo upgrade and release fhir.core from 3.7.28-SNAPSHOT to 3.7.29-SNAPSHOT +echo upgrade and release fhir.core from 3.7.29-SNAPSHOT to 3.7.30-SNAPSHOT echo =============================================================== pause -call mvn versions:set -DnewVersion=3.7.29-SNAPSHOT +call mvn versions:set -DnewVersion=3.7.30-SNAPSHOT call git commit -a -m "Release new version" call git push origin master -call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "3.7.28-SNAPSHOT" --replace "3.7.29-SNAPSHOT" -call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --excludeFileMask "*.dll, *.exe" --find "3.7.28-SNAPSHOT" --replace "3.7.29-SNAPSHOT" +call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --includeSubDirectories --find "3.7.29-SNAPSHOT" --replace "3.7.30-SNAPSHOT" +call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\fhir-ig-publisher" --fileMask "*.xml" --includeSubDirectories --find "3.7.29-SNAPSHOT" --replace "3.7.30-SNAPSHOT" +call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --find "3.7.29-SNAPSHOT" --replace "3.7.30-SNAPSHOT" call mvn deploy +call python c:\tools\zulip-api\zulip\zulip\send.py --stream committers/notification --subject "java core" -m "New Java Core v3.7.30-SNAPSHOT released." --config-file zuliprc echo =============================================================== echo all done