Class IdUtils
java.lang.Object
io.github.dizuker.tofhir.IdUtils
Utility class for FHIR resource Ids
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hl7.fhir.instance.model.api.IIdTypefromIdentifier(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.IIdTypefromIdentifier(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.IIdTypefromIdentifier(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.IIdTypefromIdentifier(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.
-
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 fromresourceType- 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 fromdigest- 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 fromdigest- 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
-