Class FHIRPathResourceGeneratorR4<T extends org.hl7.fhir.r4.model.Resource>
java.lang.Object
org.hl7.fhir.common.hapi.validation.validator.FHIRPathResourceGeneratorR4<T>
This class can be used to generate resources using FHIRPath expressions.
Note that this is an experimental feature and the API is expected to change. Ideally
this will be made version independent and moved out of the validation module
in a future release.
- Author:
- Marcel Parciak invalid input: '<'marcel.parciak@med.uni-goettingen.de>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
A simple enum to diffirentiate between types of FHIRPaths in the special use case of generating FHIR Resources. -
Constructor Summary
ConstructorDescriptionConstructor without parameters, needs a call to `setMapping` later on in order to generate any Resources.FHIRPathResourceGeneratorR4
(Map<String, String> mapping) Constructor that allows to provide a mapping right away. -
Method Summary
Modifier and TypeMethodDescriptiongenerateResource
(Class<T> resourceClass) The generation method that yields a new instance of class `resourceClass` with every value set in the FHIRPath mapping.Getter for a generated Resource.void
setMapping
(Map<String, String> mapping) Setter for the FHIRPath mapping Map instance.
-
Constructor Details
-
FHIRPathResourceGeneratorR4
public FHIRPathResourceGeneratorR4()Constructor without parameters, needs a call to `setMapping` later on in order to generate any Resources. -
FHIRPathResourceGeneratorR4
Constructor that allows to provide a mapping right away.- Parameters:
mapping
- Mapinvalid input: '<'String, String> a mapping of FHIRPath to value Strings that will be used to create a Resource.
-
-
Method Details
-
setMapping
Setter for the FHIRPath mapping Map instance.- Parameters:
mapping
- Mapinvalid input: '<'String, String> a mapping of FHIRPath to value Strings that will be used to create a Resource.
-
getResource
Getter for a generated Resource. null if no Resource has been generated yet.- Returns:
- T the generated Resource or null.
-
generateResource
The generation method that yields a new instance of class `resourceClass` with every value set in the FHIRPath mapping.- Parameters:
resourceClass
- ClassThe class of the Resource that shall be created. - Returns:
- T a new FHIR Resource instance of class `resourceClass`.
-