> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telepatia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Field Recipes

> Translate each EMR form field into Smart Template JSON, then build a template field by field

You already know your EMR screen as a set of **form fields** — a text box, a number, a dropdown, a checkbox. A Smart Template is the same screen expressed as JSON: each field becomes a property in a section's [`OutputSchema`](/scribe-api/smart-templates-output-schema). This page gives you the JSON for every field type, then walks you through assembling a full template.

<Tip>
  Every field needs `instructions` — that's the prompt the model uses to fill the slot. Write it as if briefing a scribe: *"the patient's main complaint, in their own words"*.
</Tip>

## Field cookbook

### Text

A free-text input or textarea.

```html theme={null}
<input type="text" name="chiefComplaint" />
```

```jsonc theme={null}
{
  "type": "string",
  "instructions": "Chief complaint in the patient's own words",
  "maxLength": 500
}
```

### Number

A numeric input. Use `integer` for whole numbers, `number` for decimals; bound with `minimum` / `maximum`.

```html theme={null}
<input type="number" name="weightKg" min="0" max="500" />
```

```jsonc theme={null}
{
  "type": "number",
  "instructions": "Body weight in kilograms",
  "minimum": 0,
  "maximum": 500
}
```

### Single choice (dropdown / radio)

A `<select>` or a group of radio buttons — pick exactly one option. Use `{ label, value }` so you store a stable code and can rename or translate the label freely. Generation returns the **`value`**.

```html theme={null}
<select name="visitType">
  <option value="FIRST_VISIT">First visit</option>
  <option value="FOLLOW_UP">Follow-up</option>
</select>
```

```jsonc theme={null}
{
  "type": "string",
  "instructions": "Type of visit",
  "enum": [
    { "label": "First visit", "value": "FIRST_VISIT" },
    { "label": "Follow-up",   "value": "FOLLOW_UP" }
  ]
}
```

### Multi-select (checkbox group)

A group of checkboxes where several options can be selected at once — an `array` whose `items` carry the `enum`.

```html theme={null}
<input type="checkbox" name="symptoms" value="FEVER" /> Fever
<input type="checkbox" name="symptoms" value="COUGH" /> Cough
```

```jsonc theme={null}
{
  "type": "array",
  "instructions": "All symptoms the patient reports",
  "items": {
    "type": "string",
    "enum": [
      { "label": "Fever", "value": "FEVER" },
      { "label": "Cough", "value": "COUGH" }
    ]
  }
}
```

### Yes / No (checkbox)

A single checkbox is a `boolean`.

```html theme={null}
<input type="checkbox" name="followUpNeeded" /> Follow-up needed
```

```jsonc theme={null}
{
  "type": "boolean",
  "instructions": "Whether a follow-up appointment is needed"
}
```

### Date and time

A date or time input — a `string` with a `format`. The value is returned as ISO 8601.

```html theme={null}
<input type="date" name="visitDate" />
```

```jsonc theme={null}
{
  "type": "string",
  "instructions": "Date of the visit",
  "format": "date"
}
```

### Optional field

By default every field is `required: true` (the model always produces a value). Set `required: false` to let it return `null` when the encounter doesn't mention it.

```jsonc theme={null}
{
  "type": "string",
  "instructions": "Secondary diagnosis, if any",
  "required": false
}
```

### Default value

Pair `required: false` with `default` to guarantee a fallback. For an `enum`, the `default` must be one of the `value`s.

```jsonc theme={null}
{
  "type": "string",
  "instructions": "Triage priority",
  "enum": [
    { "label": "Routine", "value": "ROUTINE" },
    { "label": "Urgent",  "value": "URGENT" }
  ],
  "required": false,
  "default": "ROUTINE"
}
```

## Not supported

There is **no conditional logic** in a Smart Template — no "show field B only if field A is X". Keywords like `anyOf`, `if/then/else`, `pattern`, and `minItems` are silently dropped. Model optionality with `required: false` + `default`; put branching in the RPA layer. Full list: [OutputSchema → Not supported](/scribe-api/smart-templates-output-schema#not-supported).

## Build a template, field by field

<Steps>
  <Step title="List the fields on your screen">
    Write down each form field and its kind (text, number, choice, checkbox, date).
  </Step>

  <Step title="Pick the JSON for each">
    Use the [cookbook](#field-cookbook) above to turn each field into an `OutputSchema`.
  </Step>

  <Step title="Group them into a section">
    A section is an `object` whose `properties` are your fields — one section per part of the record.

    ```jsonc theme={null}
    {
      "type": "object",
      "instructions": "Consultation summary",
      "properties": {
        "chiefComplaint": { "type": "string", "instructions": "Main complaint" },
        "followUpNeeded": { "type": "boolean", "instructions": "Follow-up needed" }
      }
    }
    ```
  </Step>

  <Step title="Attach a prompt strategy">
    Give the section a curated `telepatiaPromptId`, or your own `systemPrompt`. See [Sections](/scribe-api/smart-templates-nodes).
  </Step>

  <Step title="Create it, then reference it">
    `POST /v1/medical-record-configurations` (idempotent — identical content returns the same `id`), then pass `medicalRecordConfigurationId` on [`set-consultation-context`](/scribe-api/consultations).
  </Step>
</Steps>

## Full recipe: a prescription template

A complete template covering every field type — text, number, single choice, multi-select, boolean, and an optional date with a default:

```bash theme={null}
curl -X POST https://scribe-api.telepatia.ai/v1/medical-record-configurations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Prescription",
    "configuration": {
      "prescription": {
        "systemPrompt": "Extract the prescription details from the consultation.",
        "schema": {
          "type": "object",
          "instructions": "Prescription issued during the visit",
          "properties": {
            "patientName": {
              "type": "string",
              "instructions": "Full name of the patient",
              "maxLength": 200
            },
            "itemCount": {
              "type": "integer",
              "instructions": "Number of medications prescribed",
              "minimum": 0,
              "maximum": 50
            },
            "visitType": {
              "type": "string",
              "instructions": "Type of visit",
              "enum": [
                { "label": "First visit", "value": "FIRST_VISIT" },
                { "label": "Follow-up",   "value": "FOLLOW_UP" }
              ]
            },
            "medications": {
              "type": "array",
              "instructions": "Medications prescribed, with dose",
              "items": {
                "type": "object",
                "instructions": "One medication entry",
                "properties": {
                  "name": { "type": "string", "instructions": "Generic or brand name" },
                  "dose": { "type": "string", "instructions": "Dose with unit, e.g. 500 mg" }
                }
              }
            },
            "followUpNeeded": {
              "type": "boolean",
              "instructions": "Whether a follow-up is needed"
            },
            "visitDate": {
              "type": "string",
              "instructions": "Date of the visit",
              "format": "date",
              "required": false,
              "default": "1970-01-01"
            }
          }
        }
      }
    }
  }'
```

## Next steps

<CardGroup cols={2}>
  <Card title="OutputSchema reference" icon="brackets-curly" href="/scribe-api/smart-templates-output-schema">
    Every supported field, type by type.
  </Card>

  <Card title="Sections" icon="diagram-project" href="/scribe-api/smart-templates-nodes">
    How prompts resolve per section.
  </Card>
</CardGroup>
