Skip to content

Main content

FHIR Reference Target Token Tool

Extract the target token from supplied contained or relative versioned FHIR references without server resolution.

Loading tool…

Description

For a leading hash, validate the remaining 1-64-character identifier and return it as a contained target with empty resourceType.

Clinical identifiers and references have a namespace, target, and sometimes a version or contained-resource scope. Parsing their spelling does not resolve the target or establish semantic identity.

For a leading hash, validate the remaining 1-64-character identifier and return it as a contained target with empty resourceType.

When to use this tool

Use FHIR Reference Target Token when you need one supported clinical-reference or scoped-identifier component.

How to use the tool and how it works

  1. Enter reference. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read targetId, contained, resourceType. Inspect contained before interpreting the associated values.

For a leading hash, validate the remaining 1-64-character identifier and return it as a contained target with empty resourceType. Otherwise delegate to the linked relative reference parser and return its type and ID.1

The linked version-history reference parser handles the noncontained branch and supplies its resource type and identifier.2

FHIR distinguishes contained-resource fragment references from references to other resources. A contained identifier needs its surrounding resource context, which this extractor does not inspect.3

Input fieldMeaning and unitsAccepted input
referenceSupplied reference token under the supported grammar.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
targetIdTarget IdRequired. Text; maximum UTF-16 length 8192.
containedContainedRequired. Boolean.
resourceTypeRelative resource type, or empty-string placeholder for a contained reference.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "reference": "#local-1"
  },
  "output": {
    "targetId": "local-1",
    "contained": true,
    "resourceType": ""
  }
}

Limitations and assumptions

  • No referenced resource is fetched or checked, and an empty type is the documented contained-reference placeholder rather than a missing parsed relative type.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a complete standard-aware resolver and verify terminology, resource identity, and applicable profiles separately.

References

  1. Calculation and input contract: health-informatics/fhir-reference-target-token — tool.io

  2. Calculation or validation: health-informatics/fhir-reference-version-history-token — tool.io

  3. FHIR R4: References — Health Level Seven International

Similar or alternative tools

  • FHIR Reference Relative Type ID

    Parse exactly an uppercase-leading alphanumeric resource-type token, slash, and 1-64 ASCII letters, digits, dots, or hyphens for logicalId.

  • FHIR Reference Depth Count

    Separate the first fragment, remove a scheme-and-authority prefix and query, then count nonempty slash path segments.