Class FHIRPathResourceGeneratorR4<T extends org.hl7.fhir.r4.model.Resource>

java.lang.Object
org.hl7.fhir.common.hapi.validation.validator.FHIRPathResourceGeneratorR4<T>

public class FHIRPathResourceGeneratorR4<T extends org.hl7.fhir.r4.model.Resource> extends Object
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>
  • Constructor Details

    • 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

      public void setMapping(Map<String,String> mapping)
      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

      public T getResource()
      Getter for a generated Resource. null if no Resource has been generated yet.
      Returns:
      T the generated Resource or null.
    • generateResource

      public T generateResource(Class<T> resourceClass)
      The generation method that yields a new instance of class `resourceClass` with every value set in the FHIRPath mapping.
      Parameters:
      resourceClass - Class The class of the Resource that shall be created.
      Returns:
      T a new FHIR Resource instance of class `resourceClass`.