Class ReferenceUtils
- Namespace
- ToFhir
- Assembly
- ToFhir.dll
Utility class for creating FHIR references to resources.
public static class ReferenceUtils
- Inheritance
-
ReferenceUtils
- Inherited Members
Methods
CreateReferenceTo(Identifier, ResourceType)
Creates a FHIR reference to the resource identified by the given identifier, in the form
ResourceType/sha256(system|value). The identifier must have a non-blank system and
value.
public static ResourceReference CreateReferenceTo(Identifier identifier, ResourceType resourceType)
Parameters
identifierIdentifierAn identifier of the FHIR resource to create a reference to.
resourceTypeResourceTypeThe resource type to include in the reference.
Returns
- ResourceReference
A reference pointing to the identified resource.
Exceptions
- ArgumentException
The identifier's system or value is
null, empty or whitespace.
CreateReferenceTo(Resource)
Creates a FHIR reference to the given resource, in the form ResourceType/id. The
resource must have a non-blank Hl7.Fhir.Model.Resource.Id.
public static ResourceReference CreateReferenceTo(Resource resource)
Parameters
resourceResourceThe FHIR resource to create a reference to.
Returns
- ResourceReference
A reference pointing to the given resource.
Exceptions
- ArgumentException
The resource's id is
null, empty or whitespace.