Class FhirEntryReplacer

java.lang.Object
de.gematik.test.erezept.fhir.util.FhirEntryReplacer

public class FhirEntryReplacer extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C extends org.hl7.fhir.r4.model.Resource>
    C
    cast(Class<C> childType, org.hl7.fhir.r4.model.Bundle.BundleEntryComponent entry, Function<org.hl7.fhir.r4.model.Resource,C> childMapper)
    When we use the FHIR-Parser, the profiled Parser will map the entries automatically.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • cast

      public static <C extends org.hl7.fhir.r4.model.Resource> C cast(Class<C> childType, org.hl7.fhir.r4.model.Bundle.BundleEntryComponent entry, Function<org.hl7.fhir.r4.model.Resource,C> childMapper)
      When we use the FHIR-Parser, the profiled Parser will map the entries automatically. However, once we copy a resource, the child entries will be copied to their base classes. This method helps to cast and replace the resource within the entry to correct type
      Type Parameters:
      C - the generic type of the entry-resource
      Parameters:
      childType - is the expected resource type of the entry
      entry - is envelope entry containing the resource
      childMapper - is a function mapping the resource to its expected type
      Returns:
      the entry-resource of its expected type