Class FhirUtils
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.support.FhirUtils
Common utilities for handling FHIR resources
- Since:
- 3.6
- Author:
- Christian Ohr
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends BaseServerResponseException>
Texception
(Function<String, T> func, IBaseOperationOutcome operationOutcome, String msg, Object... args) static <T extends BaseServerResponseException>
Texception
(Function<String, T> func, org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) static ForbiddenOperationException
forbiddenOperation
(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) static Map<org.hl7.fhir.r4.model.ResourceType,
List<org.hl7.fhir.r4.model.Bundle.BundleEntryComponent>> getBundleEntries
(org.hl7.fhir.r4.model.Bundle bundle) Converts aBundle
into a map grouped by the entry resources typesstatic <T extends org.hl7.fhir.r4.model.Resource>
Optional<T>getOptionalResource
(org.hl7.fhir.r4.model.Bundle bundle, Class<T> clazz) static <T extends org.hl7.fhir.r4.model.Resource>
TgetResource
(org.hl7.fhir.r4.model.Bundle bundle, Class<T> clazz) static <T extends org.hl7.fhir.r4.model.Resource>
List<T>getResources
(org.hl7.fhir.r4.model.Bundle bundle, Class<T> clazz) static InternalErrorException
internalError
(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) static InvalidRequestException
invalidRequest
(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) static ResourceNotFoundException
resourceNotFound
(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) static UnprocessableEntityException
unprocessableEntity
(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args)
-
Constructor Details
-
FhirUtils
public FhirUtils()
-
-
Method Details
-
getBundleEntries
public static Map<org.hl7.fhir.r4.model.ResourceType,List<org.hl7.fhir.r4.model.Bundle.BundleEntryComponent>> getBundleEntries(org.hl7.fhir.r4.model.Bundle bundle) Converts aBundle
into a map grouped by the entry resources types- Parameters:
bundle
- Bundle- Returns:
- map of entries grouped by their resource type
-
getResources
-
getOptionalResource
-
getResource
public static <T extends org.hl7.fhir.r4.model.Resource> T getResource(org.hl7.fhir.r4.model.Bundle bundle, Class<T> clazz) -
internalError
public static InternalErrorException internalError(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) -
unprocessableEntity
public static UnprocessableEntityException unprocessableEntity(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) -
invalidRequest
public static InvalidRequestException invalidRequest(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) -
resourceNotFound
public static ResourceNotFoundException resourceNotFound(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) -
forbiddenOperation
public static ForbiddenOperationException forbiddenOperation(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) -
exception
-
exception
public static <T extends BaseServerResponseException> T exception(Function<String, T> func, IBaseOperationOutcome operationOutcome, String msg, Object... args)
-