use of org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent in project cqf-ruler by DBCG.
the class CodeSystemProviderIT method testCodeSystemUpdateValueSetIdNull.
@Test
@Order(2)
public void testCodeSystemUpdateValueSetIdNull() {
OperationOutcome outcome = codeSystemUpdateProvider.updateCodeSystems(new ValueSet().getIdElement());
assertEquals(1, outcome.getIssue().size());
OperationOutcomeIssueComponent issue = outcome.getIssue().get(0);
assertEquals(OperationOutcome.IssueSeverity.ERROR, issue.getSeverity());
assertTrue(issue.getDetails().getText().startsWith("Unable to find Resource: null"));
}
use of org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent in project elexis-server by elexis.
the class ResourceProviderUtil method generateOperationOutcome.
private OperationOutcome generateOperationOutcome(IFhirTransformerException e) {
OperationOutcome opOutcome = new OperationOutcome();
OperationOutcomeIssueComponent ooc = new OperationOutcomeIssueComponent();
OperationOutcome.IssueSeverity severity = OperationOutcome.IssueSeverity.valueOf(e.getSeverity().toUpperCase());
ooc.setSeverity(severity);
IssueType issueType = e.getCode() == 412 ? IssueType.PROCESSING : IssueType.BUSINESSRULE;
ooc.setCode(issueType);
ooc.setDiagnostics(e.getMessage());
opOutcome.addIssue(ooc);
return opOutcome;
}
use of org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent in project pathling by aehrc.
the class ErrorHandlingInterceptor method buildException.
@Nonnull
@SuppressWarnings("SameParameterValue")
private static BaseServerResponseException buildException(final int theStatusCode, @Nonnull final String message, @Nonnull final IssueType issueType) {
final OperationOutcome opOutcome = new OperationOutcome();
final OperationOutcomeIssueComponent issue = new OperationOutcomeIssueComponent();
issue.setSeverity(IssueSeverity.ERROR);
issue.setDiagnostics(message);
issue.setCode(issueType);
opOutcome.addIssue(issue);
final BaseServerResponseException ex = BaseServerResponseException.newInstance(theStatusCode, message);
ex.setOperationOutcome(opOutcome);
return ex;
}
use of org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent in project pathling by aehrc.
the class AsyncAspect method buildOperationOutcome.
@Nonnull
private static OperationOutcome buildOperationOutcome() {
final OperationOutcome opOutcome = new OperationOutcome();
final OperationOutcomeIssueComponent issue = new OperationOutcomeIssueComponent();
issue.setCode(IssueType.INFORMATIONAL);
issue.setSeverity(IssueSeverity.INFORMATION);
issue.setDiagnostics("Job accepted for processing, see the Content-Location header for the " + "URL at which status can be queried");
opOutcome.addIssue(issue);
return opOutcome;
}
use of org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent in project pathling by aehrc.
the class ErrorHandlingInterceptorTest method convertsAccessDeniedError.
@Test
void convertsAccessDeniedError() {
final BaseServerResponseException actualException = callInterceptor(new AccessDeniedError("Access denied", "operation:import"));
assertTrue(actualException instanceof ForbiddenOperationException);
assertEquals(403, actualException.getStatusCode());
assertEquals("Access denied", actualException.getMessage());
final OperationOutcomeIssueComponent expectedIssue = new OperationOutcomeIssueComponent();
expectedIssue.setSeverity(IssueSeverity.ERROR);
expectedIssue.setCode(IssueType.FORBIDDEN);
expectedIssue.setDiagnostics("Access denied");
assertTrue(expectedIssue.equalsDeep(((OperationOutcome) actualException.getOperationOutcome()).getIssueFirstRep()));
}
Aggregations