use of org.hl7.fhir.instance.model.api.IBaseOperationOutcome in project camel-spring-boot by apache.
the class FhirDeleteTest method testDeleteResource.
@Test
public void testDeleteResource() throws Exception {
assertTrue(patientExists());
// using org.hl7.fhir.instance.model.api.IBaseResource message body for single parameter "resource"
IBaseOperationOutcome result = requestBody("direct://RESOURCE", this.patient);
LOG.debug("resource: " + result);
assertNotNull(result, "resource result");
assertFalse(patientExists());
}
use of org.hl7.fhir.instance.model.api.IBaseOperationOutcome in project camel-spring-boot by apache.
the class FhirDeleteTest method testDeleteResourceById.
@Test
public void testDeleteResourceById() throws Exception {
assertTrue(patientExists());
// using org.hl7.fhir.instance.model.api.IIdType message body for single parameter "id"
IBaseOperationOutcome result = requestBody("direct://RESOURCE_BY_ID", this.patient.getIdElement());
LOG.debug("resourceById: " + result);
assertNotNull(result, "resourceById result");
assertFalse(patientExists());
}
use of org.hl7.fhir.instance.model.api.IBaseOperationOutcome in project camel-spring-boot by apache.
the class FhirDeleteTest method testDeleteResourceConditionalByUrl.
@Test
public void testDeleteResourceConditionalByUrl() throws Exception {
assertTrue(patientExists());
IBaseOperationOutcome result = requestBody("direct://RESOURCE_CONDITIONAL_BY_URL", "Patient?given=Vincent&family=Freeman");
LOG.debug("resourceConditionalByUrl: " + result);
assertNotNull(result, "resourceConditionalByUrl result");
assertFalse(patientExists());
}
use of org.hl7.fhir.instance.model.api.IBaseOperationOutcome in project openmrs-module-fhir2 by openmrs.
the class BaseFhirR3ResourceProviderWebTest method describeOperationOutcome.
@Override
public void describeOperationOutcome(Description mismatchDescription, IBaseOperationOutcome baseOperationOutcome) {
if (baseOperationOutcome instanceof OperationOutcome) {
OperationOutcome operationOutcome = (OperationOutcome) baseOperationOutcome;
if (operationOutcome.hasIssue() && operationOutcome.getIssue().stream().anyMatch(o -> o.getSeverity().ordinal() <= OperationOutcome.IssueSeverity.WARNING.ordinal())) {
mismatchDescription.appendText(" with message ");
mismatchDescription.appendValue(operationOutcome.getIssue().stream().filter(o -> o.getSeverity().ordinal() <= OperationOutcome.IssueSeverity.WARNING.ordinal()).map(OperationOutcome.OperationOutcomeIssueComponent::getDiagnostics).collect(Collectors.joining(". ")));
}
}
}
use of org.hl7.fhir.instance.model.api.IBaseOperationOutcome in project openmrs-module-fhir2 by openmrs.
the class BaseFhirR4IntegrationTest method describeOperationOutcome.
@Override
public void describeOperationOutcome(Description mismatchDescription, IBaseOperationOutcome baseOperationOutcome) {
if (baseOperationOutcome instanceof OperationOutcome) {
OperationOutcome operationOutcome = (OperationOutcome) baseOperationOutcome;
if (operationOutcome.hasIssue()) {
mismatchDescription.appendText(" with message ");
mismatchDescription.appendValue(operationOutcome.getIssue().stream().map(OperationOutcome.OperationOutcomeIssueComponent::getDiagnostics).collect(Collectors.joining(". ")));
}
}
}
Aggregations