fix NPE in IG publisher

This commit is contained in:
Grahame Grieve 2019-12-13 09:25:07 +11:00
parent 75e701ec8d
commit 4287b1ae68
2 changed files with 9 additions and 0 deletions

View File

@ -515,24 +515,29 @@ public abstract class BaseWorkerContext implements IWorkerContext {
@Override @Override
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display) { public ValidationResult validateCode(ValidationOptions options, String system, String code, String display) {
assert options != null;
Coding c = new Coding(system, code, display); Coding c = new Coding(system, code, display);
return validateCode(options, c, null); return validateCode(options, c, null);
} }
@Override @Override
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display, ValueSet vs) { public ValidationResult validateCode(ValidationOptions options, String system, String code, String display, ValueSet vs) {
assert options != null;
Coding c = new Coding(system, code, display); Coding c = new Coding(system, code, display);
return validateCode(options, c, vs); return validateCode(options, c, vs);
} }
@Override @Override
public ValidationResult validateCode(ValidationOptions options, String code, ValueSet vs) { public ValidationResult validateCode(ValidationOptions options, String code, ValueSet vs) {
assert options != null;
Coding c = new Coding(null, code, null); Coding c = new Coding(null, code, null);
return validateCode(options.guessSystem(), c, vs); return validateCode(options.guessSystem(), c, vs);
} }
@Override @Override
public ValidationResult validateCode(ValidationOptions options, Coding code, ValueSet vs) { public ValidationResult validateCode(ValidationOptions options, Coding code, ValueSet vs) {
assert options != null;
CacheToken cacheToken = txCache != null ? txCache.generateValidationToken(options, code, vs) : null; CacheToken cacheToken = txCache != null ? txCache.generateValidationToken(options, code, vs) : null;
ValidationResult res = null; ValidationResult res = null;
if (txCache != null) if (txCache != null)

View File

@ -69,4 +69,8 @@ public class ValidationOptions {
public String toJson() { public String toJson() {
return "\"lang\":\""+language+"\", \"useServer\":\""+Boolean.toString(useServer)+"\", \"useClient\":\""+Boolean.toString(useClient)+"\", \"guessSystem\":\""+Boolean.toString(guessSystem)+"\""; return "\"lang\":\""+language+"\", \"useServer\":\""+Boolean.toString(useServer)+"\", \"useClient\":\""+Boolean.toString(useClient)+"\", \"guessSystem\":\""+Boolean.toString(guessSystem)+"\"";
} }
public static ValidationOptions defaults() {
return new ValidationOptions("en-US");
}
} }