update test case dependency to 1.1.22 (#263)

* fix for new test case about profiles restricting types

* update release notes

* fix NPEs doing ProfileComparison

* fix non-translated messages in InstanceValidator

* Fix validation issues

* update to 1.1.22 tests
This commit is contained in:
Grahame Grieve 2020-06-27 10:07:30 +10:00 committed by GitHub
parent 03a4224424
commit b08c12f2c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 8 deletions

View File

@ -1,3 +1,8 @@
* Two significant bug fixes for the validator (thanks Mark Burnett from Babylon Health for finding them):
* The validator was not enforcing type restrictions when some profiles restricted elements with choices to a single type
* The validator was only creating warnings not errors for required bindings on some Quantities
* + Fix handling of infrastructural terminology failings on Codings - treat them as warnings not errors
* Add extra validation for value sets (check concept codes are valid)
* Add extra code to check derivation consisteny for SearchParameter resources
* More Improvements to Questionnaire Rendering

View File

@ -0,0 +1,26 @@
package org.hl7.fhir.r5.utils;
import org.hl7.fhir.r5.model.Observation;
import org.hl7.fhir.r5.model.ObservationDefinition;
import org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType;
public class ObservationUtilities {
public static Observation fromDefinition(ObservationDefinition def) {
Observation obs = new Observation();
obs.setCode(def.getCode());
obs.getCategory().addAll(def.getCategory());
if (def.hasBodySite()) {
obs.setBodySite(def.getBodySite());
}
if (def.hasMethod()) {
obs.setMethod(def.getMethod());
}
if (def.hasPermittedDataType(ObservationDataType.QUANTITY) && def.getQuantitativeDetails().hasUnit() && def.getQuantitativeDetails().getUnit().hasCoding("http://unitsofmeasure.org")) {
obs.getValueQuantity().setSystem("http://unitsofmeasure.org").setCode(def.getQuantitativeDetails().getUnit().getCode("http://unitsofmeasure.org"));
}
// todo: set up reference ranges
return obs;
}
}

View File

@ -134,13 +134,11 @@ public class TranslatorXml implements TranslationServices {
@Override
public String toStr(float value) {
// TODO Auto-generated method stub
return null;
}
@Override
public String toStr(Date value) {
// TODO Auto-generated method stub
return null;
}

View File

@ -130,7 +130,7 @@ public class NativeHostServices {
@Override
public org.hl7.fhir.r4.model.Resource convertR4(Resource resource) throws FHIRException {
// TODO Auto-generated method stub
// still to do
return null;
}

View File

@ -741,7 +741,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
return true;
if (s.isOk()) {
if (s.getMessage() != null)
txWarning(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage());
txWarning(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, I18nConstants.INTERNAL_ERROR, s.getMessage());
return true;
}
if (s.getErrorClass() != null && s.getErrorClass().isInfrastructure())
@ -1120,7 +1120,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (vr != null && !vr.isOk()) {
if (vr.IsNoService())
txHint(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_BINDING_NOSERVER);
else if (vr.getErrorClass() != null && !vr.getErrorClass().isInfrastructure()) {
else if (vr.getErrorClass() != null && vr.getErrorClass().isInfrastructure()) {
if (binding.getStrength() == BindingStrength.REQUIRED)
txWarning(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_CONFIRM_4, describeReference(binding.getValueSet(), valueset));
else if (binding.getStrength() == BindingStrength.EXTENSIBLE) {
@ -1341,7 +1341,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
txHint(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_BINDING_NOSERVER);
else if (vr.getErrorClass() != null && !vr.getErrorClass().isInfrastructure()) {
if (binding.getStrength() == BindingStrength.REQUIRED)
txWarning(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_CONFIRM_4, describeReference(binding.getValueSet(), valueset));
txRule(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_CONFIRM_4, describeReference(binding.getValueSet(), valueset));
else if (binding.getStrength() == BindingStrength.EXTENSIBLE) {
if (binding.hasExtension("http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet"))
checkMaxValueSet(errors, path, element, profile, ToolingExtensions.readStringExtension(binding, "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet"), c, stack);

View File

@ -449,7 +449,7 @@ public class MeasureValidator extends BaseValidator {
}
private void validateMeasureReportGroupStratifier(ValidatorHostContext hostContext, MeasureContext m, MeasureGroupStratifierComponent mgs, List<ValidationMessage> errors, Element mrgs, NodeStack ns, boolean inProgress) {
// TODO Auto-generated method stub
// still to be done
}

View File

@ -17,7 +17,7 @@
<properties>
<hapi_fhir_version>5.0.0</hapi_fhir_version>
<validator_test_case_version>1.1.22-SNAPSHOT</validator_test_case_version>
<validator_test_case_version>1.1.22</validator_test_case_version>
<junit_jupiter_version>5.6.2</junit_jupiter_version>
<maven_surefire_version>3.0.0-M4</maven_surefire_version>
<jacoco_version>0.8.5</jacoco_version>