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

# Consultation Output: JSON data reference for EHR mapping

> Reference for the JSON object Squire returns after each consultation: metadata fields, report generation results, template IDs, and all section field types.

When a consultation ends, Squire returns a structured JSON object containing metadata about the session alongside the generated report data. The shape of the report data depends on the template used. Use this reference to map Squire's output fields to your EHR's data model.

## Metadata fields

Every response includes the following top-level metadata fields, regardless of which template was used.

<ResponseField name="id" type="string" required>
  Unique identifier for the consultation.
</ResponseField>

<ResponseField name="input_language" type="string" required>
  Language code of the input audio (e.g., `"nl"`, `"en"`).
</ResponseField>

<ResponseField name="output_language" type="string" required>
  Language code of the generated report.
</ResponseField>

<ResponseField name="start_datetime" type="string" required>
  ISO 8601 timestamp indicating when the consultation started.
</ResponseField>

<ResponseField name="end_datetime" type="string">
  ISO 8601 timestamp indicating when the consultation ended. `null` for in-progress dictations.
</ResponseField>

<ResponseField name="report_status" type="string" required>
  Status of the report: `"intermediate"` for consultations in progress, or `"final"` for finished consultations.
</ResponseField>

<ResponseField name="generation_result" type="string" required>
  Outcome of the report generation process. See [Report generation results](#report-generation-results) below for all possible values.
</ResponseField>

<ResponseField name="generation_result_message" type="string">
  User-friendly message with more detail about the generation outcome.
</ResponseField>

<Note>
  `generation_result_message` is translated into the report's output language and is intended to be displayed directly to end users in your EHR interface.
</Note>

## Report generation results

The `generation_result` field tells you whether Squire produced a usable report. When the result is not `success`, check `generation_result_message` for a user-ready explanation, or use the code to display your own localized message.

| Value                    | Report | Description                                                                |
| ------------------------ | ------ | -------------------------------------------------------------------------- |
| `success`                | ✓      | Report was generated successfully.                                         |
| `audio_quality_degraded` | ⚠      | A report was generated, but poor audio quality may have affected accuracy. |
| `transcript_too_short`   | ✗      | The transcription was too short to generate a meaningful report.           |
| `audio_too_short`        | ✗      | The audio duration was too short to generate a report.                     |
| `no_medical_context`     | ✗      | No medical context was detected in the consultation audio.                 |

When `generation_result` indicates a failure, the structured data fields may be empty or contain placeholder content.

## Templates

The `data` array in the response contains one or more consultation episodes. Each episode has a `template` identifier and a `sections` array. The available templates are:

| Template ID                        | Description                                                                        | Sections                                                                                           |
| ---------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `soap_new_complaint_api`           | SOAP note for general practitioners                                                | `subjective`, `objective`, `assessment`, `plan`                                                    |
| `soap_urgent_care_api`             | SOAP note for GP urgent care / out-of-hours consultations                          | `subjective`, `objective`, `assessment`, `plan`                                                    |
| `specialist_general_api`           | Contact note for specialist consultations (all sections include a `summary` field) | `reason_for_encounter`, `anamnesis`, `clinical_research`, `diagnosis`, `action_plan`, `conclusion` |
| `specialist_general_free_text_api` | Specialist contact note with all sections combined into a single free-text string  | `free_text`                                                                                        |
| `dictation_api`                    | Dictation session returning the raw transcription                                  | `transcription`                                                                                    |

To define your own output structure, see [Templates](/integration/templates).

## Fields per section

Each section in the response contains a `fields` object. The available fields depend on the template and section.

### Subjective

| Field ID         | Type     | Description                                                      |
| ---------------- | -------- | ---------------------------------------------------------------- |
| `summary`        | `object` | Narrative summary of the section.                                |
| `medical_coding` | `array`  | List of medical codes. Included only for `soap_urgent_care_api`. |

### Objective

| Field ID      | Type     | Description                       |
| ------------- | -------- | --------------------------------- |
| `summary`     | `object` | Narrative summary of the section. |
| `vital_signs` | `array`  | List of measured vital signs.     |

### Assessment

| Field ID         | Type     | Description                                                                 |
| ---------------- | -------- | --------------------------------------------------------------------------- |
| `summary`        | `object` | Narrative summary of the section. Included only for `soap_urgent_care_api`. |
| `medical_coding` | `array`  | List of medical codes.                                                      |

### Plan

| Field ID                | Type     | Description                       |
| ----------------------- | -------- | --------------------------------- |
| `summary`               | `object` | Narrative summary of the section. |
| `prescribed_medication` | `array`  | List of prescribed medications.   |
| `sick_note`             | `object` | Sick note date range.             |

### Transcription

The `transcription` section is used exclusively by the `dictation_api` template.

| Field ID  | Type     | Description                                                                                            |
| --------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `fixed`   | `object` | Finalized text. Contains a `text` string property.                                                     |
| `ongoing` | `object` | In-progress transcription that may still change as the user speaks. Contains a `text` string property. |

## Field reference

### `summary`

A text summary of the parent section.

| Property | Type     | Description                         |
| -------- | -------- | ----------------------------------- |
| `text`   | `string` | The textual summary of the section. |

### `vital_signs`

An array of vital sign measurements recorded during the consultation.

| Property        | Type     | Description                                                             |
| --------------- | -------- | ----------------------------------------------------------------------- |
| `vital_sign_id` | `string` | Identifier of the vital sign. See the table below for available values. |
| `unit`          | `string` | Unit of measurement.                                                    |
| `value`         | `number` | Measured value.                                                         |

**Available vital signs:**

| Vital sign ID              | Unit    | Description               |
| -------------------------- | ------- | ------------------------- |
| `weight`                   | `kg`    | Patient weight.           |
| `height`                   | `cm`    | Patient height.           |
| `bmi`                      | `null`  | Body Mass Index.          |
| `systolic_blood_pressure`  | `mmHg`  | Systolic blood pressure.  |
| `diastolic_blood_pressure` | `mmHg`  | Diastolic blood pressure. |
| `heart_rate`               | `bpm`   | Heart rate.               |
| `blood_glucose`            | `mg/dL` | Blood glucose level.      |
| `body_temperature`         | `°C`    | Body temperature.         |
| `peak_flow`                | `L/min` | Peak expiratory flow.     |
| `oxygen_saturation`        | `%`     | Oxygen saturation (SpO₂). |

### `medical_coding`

An array of diagnosis codes extracted from the consultation.

| Property      | Type     | Description                                  |
| ------------- | -------- | -------------------------------------------- |
| `icd_10`      | `string` | ICD-10 code.                                 |
| `icpc_2`      | `string` | ICPC-2 code.                                 |
| `ibui`        | `string` | IBUI code.                                   |
| `description` | `string` | Human-readable description of the diagnosis. |

### `prescribed_medication`

An array of medications prescribed during the consultation.

| Property              | Type     | Description                                |
| --------------------- | -------- | ------------------------------------------ |
| `active_ingredient`   | `string` | Active ingredient name.                    |
| `brand_name`          | `string` | Brand name of the medication.              |
| `pharmaceutical_form` | `string` | Pharmaceutical form (e.g., tablet, syrup). |
| `pack_size`           | `string` | Pack size.                                 |
| `atc_code`            | `string` | ATC code of the active ingredient.         |

### `sick_note`

Date range for a sick note issued during the consultation. Both dates are in `YYYY-MM-DD` format.

| Property    | Type     | Description                  |
| ----------- | -------- | ---------------------------- |
| `from_date` | `string` | Start date of the sick note. |
| `to_date`   | `string` | End date of the sick note.   |

## JSON examples

<AccordionGroup>
  <Accordion title="SOAP note (Dutch)">
    ```json theme={null}
    {
      "id": "yoEh163Y1cHih2S1",
      "input_language": "nl",
      "output_language": "nl",
      "start_datetime": "2025-01-01T12:00:00Z",
      "end_datetime": "2025-01-01T12:30:00Z",
      "report_status": "final",
      "generation_result": "success",
      "data": [
        {
          "episode": "Consultation",
          "template": "soap_new_complaint_api",
          "sections": [
            {
              "section_id": "subjective",
              "fields": {
                "summary": {}
              }
            },
            {
              "section_id": "objective",
              "fields": {
                "summary": {},
                "vital_signs": []
              }
            },
            {
              "section_id": "assessment",
              "fields": {
                "medical_coding": []
              }
            },
            {
              "section_id": "plan",
              "fields": {
                "summary": {},
                "prescribed_medication": [],
                "sick_note": {}
              }
            }
          ]
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Specialist note with free text (Dutch)">
    ```json theme={null}
    {
      "id": "qIe6WDaV1dN5f6y2",
      "input_language": "nl",
      "output_language": "nl",
      "start_datetime": "2025-10-02T08:59:13.128Z",
      "end_datetime": "2025-10-02T09:00:20.405Z",
      "report_status": "final",
      "generation_result": "success",
      "data": [
        {
          "episode": "Consultation",
          "template": "specialist_general_free_text_api",
          "sections": [
            {
              "section_id": "free_text",
              "fields": {
                "summary": {
                  "text": "Reden van het bezoek:\n---------------------\nDiarree sinds drie dagen.\n\nAnamnese:\n---------\nSinds drie dagen frequente, waterige en losse ontlasting. Gemiddeld zes tot zeven keer per dag naar het toilet. Klachten van pijn in de onderbuik. Diarree heeft invloed op dagelijkse activiteiten.\n\nKlinisch onderzoek:\n-------------------\n-\n\nDiagnose:\n---------\nAcute diarree, waarschijnlijk infectieus van aard.\n\nBehandelingsplan:\n-----------------\n-\n\nConclusie:\n----------\nAcute diarree met frequente, waterige ontlasting en onderbuikspijn sinds drie dagen."
                }
              }
            }
          ]
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Dictation">
    ```json theme={null}
    {
      "id": "j3hc7l6TgeKL15GQ",
      "input_language": "nl",
      "output_language": "en",
      "start_datetime": "2025-10-10T14:33:49.646709+00:00",
      "end_datetime": null,
      "report_status": "intermediate",
      "generation_result": "success",
      "data": [
        {
          "episode": "Dictation",
          "template": "dictation_api",
          "sections": [
            {
              "section_id": "transcription",
              "fields": {
                "fixed": {
                  "text": "Patient complains of a sore throat."
                },
                "ongoing": {
                  "text": "And a headache for the last two"
                }
              }
            }
          ]
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Split SOAP note with multiple episodes">
    ```json theme={null}
    {
      "id": "8lbv3SJ7ObqOWh11",
      "input_language": "nl",
      "output_language": "nl",
      "start_datetime": "2026-01-30T09:58:01.276040+00:00",
      "end_datetime": "2026-01-30T09:58:29.360123+00:00",
      "report_status": "final",
      "generation_result": "success",
      "generation_result_message": null,
      "data": [
        {
          "episode": "Episode 1",
          "template": "soap_new_complaint_api",
          "sections": [
            {
              "section_id": "subjective",
              "fields": {
                "summary": {
                  "text": "Koorts, 39°C. Ziektebriefje gevraagd."
                }
              }
            },
            {
              "section_id": "objective",
              "fields": {
                "summary": {
                  "text": "Lichaamstemperatuur 39°C."
                },
                "vital_signs": [
                  {
                    "vital_sign_id": "body_temperature",
                    "unit": "°C",
                    "value": 39
                  }
                ]
              }
            },
            {
              "section_id": "assessment",
              "fields": {
                "medical_coding": [
                  {
                    "icd_10": "R50",
                    "icpc_2": "A03",
                    "ibui": "10049426",
                    "description": "koorts van onbekende oorsprong"
                  }
                ]
              }
            },
            {
              "section_id": "plan",
              "fields": {
                "summary": {
                  "text": "Ibuprofen en paracetamol voorgeschreven. Ziektebriefje tot einde week."
                },
                "prescribed_medication": [
                  {
                    "active_ingredient": "Ibuprofen",
                    "brand_name": null,
                    "pharmaceutical_form": null,
                    "pack_size": null,
                    "atc_code": "M01AE01"
                  },
                  {
                    "active_ingredient": "Paracetamol",
                    "brand_name": null,
                    "pharmaceutical_form": null,
                    "pack_size": null,
                    "atc_code": "N02BE01"
                  }
                ],
                "sick_note": {
                  "from_date": "2026-01-30",
                  "to_date": "2026-01-31"
                }
              }
            }
          ]
        }
      ]
    }
    ```
  </Accordion>
</AccordionGroup>
