Class ReferenceUtils
java.lang.Object
io.github.dizuker.tofhir.ReferenceUtils
Utility class for creating FHIR References to resources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hl7.fhir.r4.model.ReferencecreateReferenceTo(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.ReferencecreateReferenceTo(org.hl7.fhir.r4.model.Resource resource) Creates a FHIR Reference to the given resource.
-
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 toresourceType- the FHIR ResourceType to include in the reference- Returns:
- a Reference pointing to the given resource
-