This commit is contained in:
Grahame Grieve 2019-05-05 09:21:06 +10:00
commit 216219cf5c
3 changed files with 15 additions and 3 deletions

View File

@ -87,7 +87,7 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.hl7.fhir.r4.validation.Validator</mainClass>
<mainClass>org.hl7.fhir.r5.validation.Validator</mainClass>
</manifest>
</archive>
</configuration>

View File

@ -66,7 +66,10 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
return new EnableWhenResult(result, linkId, enableCondition, questionnaireResponse);
}
public Type convertToType(Element element) throws FHIRException {
private Type convertToType(Element element) throws FHIRException {
if (element.fhirType().equals("BackboneElement")) {
return null;
}
Type b = new Factory().create(element.fhirType());
if (b instanceof PrimitiveType) {
((PrimitiveType<?>) b).setValueAsString(element.primitiveValue());
@ -92,6 +95,9 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
}
try {
actualAnswer = convertToType(answer);
if (actualAnswer == null) {
return false;
}
} catch (FHIRException e) {
throw new UnprocessableEntityException("Unexpected answer type", e);
}

View File

@ -66,7 +66,10 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
return new EnableWhenResult(result, linkId, enableCondition, questionnaireResponse);
}
public Type convertToType(Element element) throws FHIRException {
private Type convertToType(Element element) throws FHIRException {
if (element.fhirType().equals("BackboneElement")) {
return null;
}
Type b = new Factory().create(element.fhirType());
if (b instanceof PrimitiveType) {
((PrimitiveType<?>) b).setValueAsString(element.primitiveValue());
@ -92,6 +95,9 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
}
try {
actualAnswer = convertToType(answer);
if (actualAnswer == null) {
return false;
}
} catch (FHIRException e) {
throw new UnprocessableEntityException("Unexpected answer type", e);
}