Class ReferenceUtils

java.lang.Object
io.github.dizuker.tofhir.ReferenceUtils

public class ReferenceUtils extends Object
Utility class for creating FHIR References to resources.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hl7.fhir.r4.model.Reference
    createReferenceTo(org.hl7.fhir.r4.model.Identifier identifier, org.hl7.fhir.r4.model.ResourceType resourceType)
    Creates a FHIR Reference to a resource with the given identifier.
    static org.hl7.fhir.r4.model.Reference
    createReferenceTo(org.hl7.fhir.r4.model.Resource resource)
    Creates a FHIR Reference to the given resource.

    Methods inherited from class Object

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

    • createReferenceTo

      public static org.hl7.fhir.r4.model.Reference createReferenceTo(org.hl7.fhir.r4.model.Resource resource)
      Creates a FHIR Reference to the given resource. The reference will be in the format ResourceType/Id. The resource must have a non-blank ID set.
      Parameters:
      resource - the FHIR resource to create a reference to
      Returns:
      a Reference pointing to the given resource
    • createReferenceTo

      public static org.hl7.fhir.r4.model.Reference createReferenceTo(org.hl7.fhir.r4.model.Identifier identifier, org.hl7.fhir.r4.model.ResourceType resourceType)
      Creates a FHIR Reference to a resource with the given identifier. The reference will be in the format ResourceType/sha256(identifier.value). The identifier must have a non-blank system and value set.
      Parameters:
      identifier - an identifier of the FHIR resource to create a reference to
      resourceType - the FHIR ResourceType to include in the reference
      Returns:
      a Reference pointing to the given resource