Merge branch 'master' of https://github.com/hapifhir/org.hl7.fhir.core
This commit is contained in:
commit
216219cf5c
|
@ -87,7 +87,7 @@
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<addClasspath>true</addClasspath>
|
<addClasspath>true</addClasspath>
|
||||||
<mainClass>org.hl7.fhir.r4.validation.Validator</mainClass>
|
<mainClass>org.hl7.fhir.r5.validation.Validator</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -66,7 +66,10 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
|
||||||
return new EnableWhenResult(result, linkId, enableCondition, questionnaireResponse);
|
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());
|
Type b = new Factory().create(element.fhirType());
|
||||||
if (b instanceof PrimitiveType) {
|
if (b instanceof PrimitiveType) {
|
||||||
((PrimitiveType<?>) b).setValueAsString(element.primitiveValue());
|
((PrimitiveType<?>) b).setValueAsString(element.primitiveValue());
|
||||||
|
@ -92,6 +95,9 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
actualAnswer = convertToType(answer);
|
actualAnswer = convertToType(answer);
|
||||||
|
if (actualAnswer == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} catch (FHIRException e) {
|
} catch (FHIRException e) {
|
||||||
throw new UnprocessableEntityException("Unexpected answer type", e);
|
throw new UnprocessableEntityException("Unexpected answer type", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,10 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
|
||||||
return new EnableWhenResult(result, linkId, enableCondition, questionnaireResponse);
|
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());
|
Type b = new Factory().create(element.fhirType());
|
||||||
if (b instanceof PrimitiveType) {
|
if (b instanceof PrimitiveType) {
|
||||||
((PrimitiveType<?>) b).setValueAsString(element.primitiveValue());
|
((PrimitiveType<?>) b).setValueAsString(element.primitiveValue());
|
||||||
|
@ -92,6 +95,9 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
actualAnswer = convertToType(answer);
|
actualAnswer = convertToType(answer);
|
||||||
|
if (actualAnswer == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} catch (FHIRException e) {
|
} catch (FHIRException e) {
|
||||||
throw new UnprocessableEntityException("Unexpected answer type", e);
|
throw new UnprocessableEntityException("Unexpected answer type", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue