Class FhirEntryReplacer
java.lang.Object
de.gematik.test.erezept.fhir.util.FhirEntryReplacer
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends org.hl7.fhir.r4.model.Resource>
Ccast(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.
-
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 entryentry- is envelope entry containing the resourcechildMapper- is a function mapping the resource to its expected type- Returns:
- the entry-resource of its expected type
-