java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.support.FhirUtils

public final class FhirUtils extends Object
Common utilities for handling FHIR resources
Since:
3.6
Author:
Christian Ohr
  • 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 a Bundle into a map grouped by the entry resources types
      Parameters:
      bundle - Bundle
      Returns:
      map of entries grouped by their resource type
    • getResources

      public static <T extends org.hl7.fhir.r4.model.Resource> List<T> getResources(org.hl7.fhir.r4.model.Bundle bundle, Class<T> clazz)
      See Also:
    • getOptionalResource

      public static <T extends org.hl7.fhir.r4.model.Resource> Optional<T> getOptionalResource(org.hl7.fhir.r4.model.Bundle bundle, Class<T> clazz)
    • 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

      public static <T extends BaseServerResponseException> T exception(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)
    • exception

      public static <T extends BaseServerResponseException> T exception(Function<String,T> func, IBaseOperationOutcome operationOutcome, String msg, Object... args)