# Using TermHub with Form.io

In many modern systems, patient intake data is often captured as free text that must be interpreted later.

For example, a patient’s gender might be stored as ‘Male’ in one system, ‘M’ in another, and ‘1’\
in a third. Each system defines and maintains its own representations for common demographic\
fields. That same data is then exchanged across internal systems and with external partners,\
even though each system stores it differently.

## The Problem

This inconsistency in data collection creates friction and overhead everywhere the data moves.

Internally, analytics and reporting systems have to interpret and reconcile those differences. Externally, partners and exchange networks receive values that are technically valid according to the source but semantically inconsistent with the native application.\
Using the gender example, every downstream system requires logic that recognizes ‘Male,’ ‘M,’\
and ‘1’ as having one single meaning. This work may be repeated at every integration point. Normalization becomes an ongoing operational burden rather than a one time fix at a single point of processing.

## The Solution

A viable solution to this problem requires defining a single source of truth and propagating that to all data inputs; as the patient enters information each field is captured at the time of input as structured, standards-aligned data.

Fields such as Gender, Marital Status, Race, Ethnicity, and Language are sourced directly from [HL7](https://www.hl7.org/implement/standards/index.cfm) value sets, ensuring data consistency across different systems.\
When the form is submitted, the gender value is stored as a [SNOMED CT](https://www.snomed.org/what-is-snomed-ct) concept rather than\
freeform text. As a result, data is captured using a stable identifier from the first entry into the system on submission, and remains stable on the way out. Every system now receives the\
same standardized concept, even if intake and downstreams systems display the value differently.

FHIR based workflows can use the data immediately without downstream transformation.\
From the patient’s perspective, this is just a simple intake form. Behind the scenes though,\
complexity is removed at the source and data is ready for internal and external exchange.

## The Workflow

<figure><img src="/files/5YfSx6wgOGCbSJiLmQIL" alt=""><figcaption></figcaption></figure>

1. **The patient** fills in a simple intake form
2. A **Select Component** configured with a URL data source captures input.
3. **TermHub** provides HL7/SNOMED coded values as options in the Select Component.
4. The **submission** contains standardized data.

## Implementation

To provide the form user with HL7/SNOMED component:

1. Within the Form Builder, drag a **Select Component** from the Basic Component palette to the canvas.
2. Open the Component Settings and select the **Data** tab.
3. In the **Data Source Type** menu, select **URL**.

<figure><img src="/files/WqAA7TurOigY09ML6y3e" alt="" width="375"><figcaption></figcaption></figure>

1. &#x20;Provide the URL for the TermHub FHIR R4 ValueSet `$expand` endpoint.
2. Configure the component to parse the FHIR response appropriately:
   1. **Data Path** - `expansion.contains`
   2. **ID Path** - `code`
   3. **Value Property** - `display`
   4. **Item Template** - `<span> {{ item.display }}</span>`
3. Verify the data using the live preview. Ensure the correct options are populating the selectable options.

<figure><img src="/files/QgAUBzTBNKfaFwDXtiVr" alt="" width="375"><figcaption></figcaption></figure>

## Available Value Sets

This pattern works with all available HL7 or SNOMED value sets that are available through TermHub's FHR endpoints. The following fields are a selection of commonly used in healthcare forms:

<table><thead><tr><th width="163.8984375">Field</th><th width="248.16796875">Standard</th><th>Example Codes</th></tr></thead><tbody><tr><td>Gender</td><td>HL7 Administrative Gender</td><td><em>male, female, other, unknown</em></td></tr><tr><td>Marital Status</td><td>HL7 Marital Status</td><td><em>M, S, D, W</em></td></tr><tr><td>Race</td><td>CDC Race &#x26; Ethnicity</td><td><em>2106-3, 2054-5, 2076-8</em></td></tr><tr><td>Ethnicity</td><td>CDC Race &#x26; Ethnicity</td><td><em>2135-2, 2186-5</em></td></tr><tr><td>Language</td><td>BCP-47 Language Tags</td><td><em>en-US, es-MX, fa</em></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.form.io/faq/tutorials-and-workflows/using-termhub-with-form.io.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
