Class IdUtils

Namespace
ToFhir
Assembly
ToFhir.dll

Utility class for FHIR resource ids.

public static class IdUtils
Inheritance
IdUtils
Inherited Members

Methods

FromIdentifier(Identifier)

Computes a deterministic id from a FHIR Hl7.Fhir.Model.Identifier by hashing its system and value with SHA-256.

public static string FromIdentifier(Identifier identifier)

Parameters

identifier Identifier

The FHIR identifier to compute the id from.

Returns

string

A deterministic id derived from the identifier's system and value.

Exceptions

ArgumentException

The identifier's system or value is null, empty or whitespace.

FromIdentifier(Identifier, ResourceType)

Computes a deterministic, type-qualified id from a FHIR Hl7.Fhir.Model.Identifier by hashing its system and value with SHA-256.

public static string FromIdentifier(Identifier identifier, ResourceType resourceType)

Parameters

identifier Identifier

The FHIR identifier to compute the id from.

resourceType ResourceType

The resource type to qualify the id with.

Returns

string

A relative reference of the form ResourceType/id.

Exceptions

ArgumentException

The identifier's system or value is null, empty or whitespace.

FromIdentifier(Identifier, ResourceType, HashAlgorithmName)

Computes a deterministic, type-qualified id from a FHIR Hl7.Fhir.Model.Identifier using the given hash algorithm.

public static string FromIdentifier(Identifier identifier, ResourceType resourceType, HashAlgorithmName hashAlgorithm)

Parameters

identifier Identifier

The FHIR identifier to compute the id from.

resourceType ResourceType

The resource type to qualify the id with.

hashAlgorithm HashAlgorithmName

The hash algorithm to use, e.g. SHA256.

Returns

string

A relative reference of the form ResourceType/id.

Exceptions

ArgumentException

The identifier's system or value is null, empty or whitespace.

FromIdentifier(Identifier, HashAlgorithmName)

Computes a deterministic id from a FHIR Hl7.Fhir.Model.Identifier using the given hash algorithm.

public static string FromIdentifier(Identifier identifier, HashAlgorithmName hashAlgorithm)

Parameters

identifier Identifier

The FHIR identifier to compute the id from.

hashAlgorithm HashAlgorithmName

The hash algorithm to use, e.g. SHA256.

Returns

string

A deterministic id derived from the identifier's system and value.

Exceptions

ArgumentException

The identifier's system or value is null, empty or whitespace.