Skip to main content

Forms

Forms are the instructions Tiep gives the AI.

They answer this question:

What data should we extract from this medical visit?

If the form is clear, the AI knows what to look for. If the form is vague, the output will be vague.

The smallest useful form

{
"title": "Short visit",
"type": "object",
"properties": {
"reason": {
"title": "Reason for visit",
"type": "string",
"description": "Why the patient came today"
},
"plan": {
"title": "Plan",
"type": "string",
"description": "What the doctor decided to do next"
}
},
"required": ["reason"]
}

This says:

  • The form is called Short visit.
  • It has two fields.
  • reason is required.
  • The AI should extract a reason and a plan from the conversation.

Dynamic forms and catalogued forms

Tiep has two kinds of forms.

KindSimple meaningUse it when
Dynamic formA form sent for one API call or one session.Your HIS already knows the exact form for the visit.
Catalogued formA saved form in the facility library.Doctors should choose from reusable forms in Tiep.

Catalogued forms have definitions and versions

A catalogued form is split into two pieces:

PieceWhat it stores
Form definitionThe stable catalogue entry: name, specialty, icon.
Form versionThe actual schema for one version of that form.

Example:

Only one version is active at a time. Doctors use the active version. Older versions stay in history.

Form status

When a form is created, Tiep builds its internal tree in the background.

StatusMeaning
PENDINGTiep saved the raw schema and is building the blocks.
ACTIVEThe form is ready to use.
INACTIVEThe form is disabled or the build failed.

Blocks: the editor mental model

In the platform editor, think in blocks.

There are two backend ideas behind each block:

Backend ideaSimple meaning
PropertyThe reusable question itself, like "Weight" or "Diagnosis".
NodeWhere that question appears inside this form.

This lets Tiep reuse the same kind of question in different forms while still knowing where the answer came from.

Root rules

Every form must:

  • Be an object at the root.
  • Have at least one property.
  • Stay within the depth limit.
  • Use clear titles.
  • Use descriptions for fields the AI must extract.

Depth limit:

Root object -> nested object -> nested object -> nested object -> final field

That is five levels total.

Clear field descriptions

Bad:

{
"title": "Pain",
"type": "string"
}

Better:

{
"title": "Pain location",
"type": "string",
"description": "Where the patient says the pain is located"
}

Best when coded:

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

How the AI reads a form

The AI does not need the platform editor. It receives a JSON schema.

For large forms, Tiep splits the schema into chunks so it fits the model context. Then it merges the extracted answers.

Where to go next