Class IdUtils

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

public class IdUtils extends Object
Utility class for FHIR resource Ids
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hl7.fhir.instance.model.api.IIdType
    fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier)
    Computes a deterministic ID from a FHIR Identifier by hashing the system and value using SHA-256.
    static org.hl7.fhir.instance.model.api.IIdType
    fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier, MessageDigest digest)
    Computes a deterministic ID from a FHIR Identifier using the provided MessageDigest algorithm.
    static org.hl7.fhir.instance.model.api.IIdType
    fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier, MessageDigest digest, @Nullable org.hl7.fhir.r4.model.ResourceType resourceType)
    Computes a deterministic ID from a FHIR Identifier using the provided MessageDigest algorithm.
    static org.hl7.fhir.instance.model.api.IIdType
    fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier, org.hl7.fhir.r4.model.ResourceType resourceType)
    Computes a deterministic ID from a FHIR Identifier by hashing the system and value using SHA-256.

    Methods inherited from class Object

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

    • fromIdentifier

      public static org.hl7.fhir.instance.model.api.IIdType fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier, org.hl7.fhir.r4.model.ResourceType resourceType)
      Computes a deterministic ID from a FHIR Identifier by hashing the system and value using SHA-256.
      Parameters:
      identifier - the FHIR Identifier to compute the ID from
      resourceType - the FHIR ResourceType to include in the ID (optional)
      Returns:
      a deterministic ID string derived from the identifier's system and value
    • fromIdentifier

      public static org.hl7.fhir.instance.model.api.IIdType fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier)
      Computes a deterministic ID from a FHIR Identifier by hashing the system and value using SHA-256.
      Parameters:
      identifier - the FHIR Identifier to compute the ID from
      Returns:
      a deterministic ID string derived from the identifier's system and value
    • fromIdentifier

      public static org.hl7.fhir.instance.model.api.IIdType fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier, MessageDigest digest)
      Computes a deterministic ID from a FHIR Identifier using the provided MessageDigest algorithm.
      Parameters:
      identifier - the FHIR Identifier to compute the ID from
      digest - the MessageDigest to use for hashing (e.g., SHA-256)
      Returns:
      a deterministic ID string derived from the identifier's system and value
    • fromIdentifier

      public static org.hl7.fhir.instance.model.api.IIdType fromIdentifier(org.hl7.fhir.r4.model.Identifier identifier, MessageDigest digest, @Nullable org.hl7.fhir.r4.model.ResourceType resourceType)
      Computes a deterministic ID from a FHIR Identifier using the provided MessageDigest algorithm.
      Parameters:
      identifier - the FHIR Identifier to compute the ID from
      digest - the MessageDigest to use for hashing (e.g., SHA-256)
      resourceType - the FHIR ResourceType to include in the ID (optional)
      Returns:
      a deterministic ID string derived from the identifier's system, value and optional resource type