Fix problem with value set validator hiding errors
This commit is contained in:
parent
cb72792b7e
commit
4d16fe46c0
|
@ -1016,6 +1016,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String localError = null;
|
||||||
if (options.isUseClient()) {
|
if (options.isUseClient()) {
|
||||||
// ok, first we try to validate locally
|
// ok, first we try to validate locally
|
||||||
try {
|
try {
|
||||||
|
@ -1028,6 +1029,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
localError = e.getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1055,6 +1057,9 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
res = new ValidationResult(IssueSeverity.ERROR, e.getMessage() == null ? e.getClass().getName() : e.getMessage()).setTxLink(txLog == null ? null : txLog.getLastId()).setErrorClass(TerminologyServiceErrorClass.SERVER_ERROR);
|
res = new ValidationResult(IssueSeverity.ERROR, e.getMessage() == null ? e.getClass().getName() : e.getMessage()).setTxLink(txLog == null ? null : txLog.getLastId()).setErrorClass(TerminologyServiceErrorClass.SERVER_ERROR);
|
||||||
}
|
}
|
||||||
|
if (!res.isOk() && localError != null) {
|
||||||
|
res.setMessage("Local Error: "+localError+". Server Error: "+res.getMessage());
|
||||||
|
}
|
||||||
updateUnsupportedCodeSystems(res, code, codeKey);
|
updateUnsupportedCodeSystems(res, code, codeKey);
|
||||||
if (txCache != null) { // we never cache unsupported code systems - we always keep trying (but only once per run)
|
if (txCache != null) { // we never cache unsupported code systems - we always keep trying (but only once per run)
|
||||||
txCache.cacheValidation(cacheToken, res, TerminologyCache.PERMANENT);
|
txCache.cacheValidation(cacheToken, res, TerminologyCache.PERMANENT);
|
||||||
|
|
|
@ -240,7 +240,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe
|
||||||
return new ValidationResult(IssueSeverity.ERROR, context.formatMessage(I18nConstants.CODESYSTEM_CS_NO_SUPPLEMENT, cs.getUrl()));
|
return new ValidationResult(IssueSeverity.ERROR, context.formatMessage(I18nConstants.CODESYSTEM_CS_NO_SUPPLEMENT, cs.getUrl()));
|
||||||
}
|
}
|
||||||
if (cs!=null && cs.getContent() != CodeSystemContentMode.COMPLETE) {
|
if (cs!=null && cs.getContent() != CodeSystemContentMode.COMPLETE) {
|
||||||
warningMessage = "Resolved system "+system+", but the definition is not complete";
|
warningMessage = "Resolved system "+system+(cs.hasVersion() ? " (v"+cs.getVersion()+")" : "")+", but the definition is not complete";
|
||||||
if (!inExpansion && cs.getContent() != CodeSystemContentMode.FRAGMENT) { // we're going to give it a go if it's a fragment
|
if (!inExpansion && cs.getContent() != CodeSystemContentMode.FRAGMENT) { // we're going to give it a go if it's a fragment
|
||||||
throw new FHIRException(warningMessage);
|
throw new FHIRException(warningMessage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,6 @@ public class ValueSetValidator extends BaseValidator {
|
||||||
}
|
}
|
||||||
cf++;
|
cf++;
|
||||||
}
|
}
|
||||||
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), systemOk, version == null ? I18nConstants.VALUESET_UNC_SYSTEM_WARNING : I18nConstants.VALUESET_UNC_SYSTEM_WARNING_VER, system);
|
|
||||||
} else {
|
} else {
|
||||||
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), filters.size() == 0 && concepts.size() == 0, I18nConstants.VALUESET_NO_SYSTEM_WARNING);
|
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), filters.size() == 0 && concepts.size() == 0, I18nConstants.VALUESET_NO_SYSTEM_WARNING);
|
||||||
}
|
}
|
||||||
|
@ -191,6 +190,7 @@ public class ValueSetValidator extends BaseValidator {
|
||||||
if (version == null) {
|
if (version == null) {
|
||||||
ValidationResult vv = context.validateCode(ValidationOptions.defaults(), new Coding(system, code, null), null);
|
ValidationResult vv = context.validateCode(ValidationOptions.defaults(), new Coding(system, code, null), null);
|
||||||
if (vv.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED) {
|
if (vv.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED) {
|
||||||
|
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, I18nConstants.VALUESET_UNC_SYSTEM_WARNING, system, vv.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
boolean ok = vv.isOk();
|
boolean ok = vv.isOk();
|
||||||
|
@ -199,6 +199,7 @@ public class ValueSetValidator extends BaseValidator {
|
||||||
} else {
|
} else {
|
||||||
ValidationResult vv = context.validateCode(ValidationOptions.defaults(), new Coding(system, code, null).setVersion(version), null);
|
ValidationResult vv = context.validateCode(ValidationOptions.defaults(), new Coding(system, code, null).setVersion(version), null);
|
||||||
if (vv.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED) {
|
if (vv.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED) {
|
||||||
|
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, I18nConstants.VALUESET_UNC_SYSTEM_WARNING_VER, system+"#"+version, vv.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
boolean ok = vv.isOk();
|
boolean ok = vv.isOk();
|
||||||
|
|
Loading…
Reference in New Issue