Fix NPE reading results of batch code validation

This commit is contained in:
Grahame Grieve 2020-12-09 10:04:56 +11:00
parent c85cbf59aa
commit 2c4b4c4ca2
1 changed files with 18 additions and 16 deletions

View File

@ -1049,23 +1049,25 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
String display = null;
TerminologyServiceErrorClass err = TerminologyServiceErrorClass.UNKNOWN;
for (ParametersParameterComponent p : pOut.getParameter()) {
if (p.getName().equals("result")) {
ok = ((BooleanType) p.getValue()).getValue().booleanValue();
} else if (p.getName().equals("message")) {
message = ((StringType) p.getValue()).getValue();
} else if (p.getName().equals("display")) {
display = ((StringType) p.getValue()).getValue();
} else if (p.getName().equals("cause")) {
try {
IssueType it = IssueType.fromCode(((StringType) p.getValue()).getValue());
if (it == IssueType.UNKNOWN) {
err = TerminologyServiceErrorClass.UNKNOWN;
} else if (it == IssueType.NOTFOUND) {
err = TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED;
} else if (it == IssueType.NOTSUPPORTED) {
err = TerminologyServiceErrorClass.VALUESET_UNSUPPORTED;
if (p.hasValue()) {
if (p.getName().equals("result")) {
ok = ((BooleanType) p.getValue()).getValue().booleanValue();
} else if (p.getName().equals("message")) {
message = ((StringType) p.getValue()).getValue();
} else if (p.getName().equals("display")) {
display = ((StringType) p.getValue()).getValue();
} else if (p.getName().equals("cause")) {
try {
IssueType it = IssueType.fromCode(((StringType) p.getValue()).getValue());
if (it == IssueType.UNKNOWN) {
err = TerminologyServiceErrorClass.UNKNOWN;
} else if (it == IssueType.NOTFOUND) {
err = TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED;
} else if (it == IssueType.NOTSUPPORTED) {
err = TerminologyServiceErrorClass.VALUESET_UNSUPPORTED;
}
} catch (FHIRException e) {
}
} catch (FHIRException e) {
}
}
}