Skip to main content

Concept sets

Concept sets are reusable lists of coded choices.

Use them when the AI should pick from a controlled catalogue instead of inventing text.

Examples:

  • Diagnoses.
  • Medications.
  • Procedure codes.
  • Allergy lists.
  • Visit reasons.

Why use codes?

A label is what people read. A code is what systems store.

LabelCode
Rotator cuff tearM75.1
Bicipital tendinitisM75.2
Pain in jointM25.5

The doctor sees the label. The HIS receives the code.

Inline choices

Use inline choices for small lists.

"pain-location": {
"title": "Pain location",
"type": "string",
"description": "Pick the main pain location",
"oneOf": [
{ "const": "ANTERIOR", "title": "Front" },
{ "const": "POSTERIOR", "title": "Back" },
{ "const": "LATERAL", "title": "Side" }
]
}

The saved answer is ANTERIOR, POSTERIOR, or LATERAL.

Reusable concept set

Use a saved concept set when the list is shared or long.

"diagnosis": {
"title": "Diagnosis",
"type": "string",
"description": "Select the main diagnosis",
"x-concept-set-id": 12
}

Tiep loads concept set 12, checks it belongs to the facility, and hydrates the choices before the form is used.

Large concept sets

Small concept sets are shown as normal coded choices. Large concept sets become searchable.

This matters for lists like medications. You do not want a dropdown with thousands of items. You want search.

How the search index works

The AI reads the form schema before it fills it in. For a small set, the schema includes every choice and the AI picks one directly.

For a large set, the schema cannot carry the whole list — it would be too long. Instead, each large concept set has its own index in a search-as-a-service backend (currently Algolia). The form schema only mentions the set; the actual concepts live in the index.

When the AI extracts a value for a searchable field, it produces a human label like "Amoxicillin". Tiep then looks that label up in the set's index and replaces it with the canonical code stored on the concept.

When the index is created

You do not manage the index by hand.

  • When you create or revise a concept set, Tiep counts the concepts.
  • If the count is over 50, the set is flagged as searchable and the index is built automatically.
  • If the count is 50 or under, the choices stay inline and no index is built.

You can see whether a set is using a search index from the Indexed column on the concept sets list. A "Search index" badge means the AI is using the index for that set; an "Inline" badge means the choices live directly in the form schema.

Multiple coded answers

For many answers, put the concept set on items.

"diagnoses": {
"title": "Diagnoses",
"type": "array",
"description": "Select all diagnoses mentioned in the visit",
"items": {
"type": "string",
"x-concept-set-id": 12
}
}

Versions

Concept sets are versioned by name.

Example:

When you set a version as current, Tiep re-publishes each active form that pointed at an older version of the same set as a new form version pointing at the chosen one. Historical and draft form versions stay anchored to the version they were built with, so old records keep their original meaning.

Simple rule

Use:

ToolWhen
enumTiny list where label and value are the same.
oneOfSmall coded list written directly in the form.
x-concept-set-idReusable or large coded catalogue.