Improve handling of terminology error and warning messages + handling of example and fragment code systems

This commit is contained in:
Grahame Grieve 2023-12-15 04:21:50 -05:00
parent d59080b45f
commit 09c2c8f81b
3 changed files with 21 additions and 3 deletions

View File

@ -1348,7 +1348,8 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
} else if (!res.isOk() && res.getUnknownSystems() != null && res.getUnknownSystems().contains(codeKey) && localWarning != null) {
// we had some problem evaluating locally, but the server doesn't know the code system, so we'll just go with the local error
res.setMessage(localWarning);
res.setDiagnostics("Local Error: "+localWarning.trim()+". Server Error: "+res.getMessage());
res.setSeverity(IssueSeverity.WARNING);
res.setDiagnostics("Local Warning: "+localWarning.trim()+". Server Error: "+res.getMessage());
}
updateUnsupportedCodeSystems(res, code, codeKey);
if (cachingAllowed && txCache != null) { // we never cache unsupported code systems - we always keep trying (but only once per run)

View File

@ -448,7 +448,24 @@ public class ValueSetValidator extends ValueSetProcessBase {
return new ValidationResult(IssueSeverity.ERROR, msg, makeIssue(IssueSeverity.ERROR, IssueType.NOTFOUND, path, msg));
}
if (cs!=null && cs.getContent() != CodeSystemContentMode.COMPLETE) {
warningMessage = "Resolved system "+system+(cs.hasVersion() ? " (v"+cs.getVersion()+")" : "")+", but the definition is not complete";
warningMessage = "Resolved system "+system+(cs.hasVersion() ? " (v"+cs.getVersion()+")" : "")+", but the definition ";
switch (cs.getContent()) {
case EXAMPLE:
warningMessage = warningMessage +"only has example content";
break;
case FRAGMENT:
warningMessage = warningMessage + "is only a fragment";
break;
case NOTPRESENT:
warningMessage = warningMessage + "doesn't include any codes";
break;
case SUPPLEMENT:
warningMessage = warningMessage + " is for a supplement to "+cs.getSupplements();
break;
default:
break;
}
warningMessage = warningMessage + ", so the code has not been validated";
if (!inExpansion && cs.getContent() != CodeSystemContentMode.FRAGMENT) { // we're going to give it a go if it's a fragment
throw new VSCheckerException(warningMessage, null, true);
}

View File

@ -140,7 +140,7 @@ Resource_RES_ID_Malformed_Length = Invalid Resource id: Too long ({0} chars)
Resource_RES_ID_Malformed_Chars = Invalid Resource id: Invalid Characters (''{0}'')
Resource_RES_ID_Missing = Resource requires an id, but none is present
Resource_RES_ID_Prohibited = Resource has an id, but none is allowed
Terminology_PassThrough_TX_Message = {0} for ''{1}#{2}''
Terminology_PassThrough_TX_Message = {0} (for ''{1}#{2}'')
Terminology_TX_Binding_CantCheck = Binding by URI reference cannot be checked
Terminology_TX_Binding_Missing = Binding for CodeableConcept {0} missing
Terminology_TX_Binding_Missing2 = Binding for Coding {0} missing