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

# Form Structure Reference

> Block types, question types, conditional logic, and patient data mapping.

Every form is organized into **blocks** and **questions**. A block is a section of your form (like "Personal Info" or "Medical History"), and inside each block you add the questions patients answer. This page is a reference for everything you can use when building a form.

<Tip>
  **Save time with automatic record updates:** When you use Demographics, Medical History, Measurements, or Payment Methods fields, the patient's answers automatically update their record in Decoda. For example, if a patient enters their address or weight on the form, it's saved to their chart — no manual data entry needed. See [Patient Data Mapping](#patient-data-mapping) below for the full list of fields that can auto-update.
</Tip>

## Block Types

A block is a named section within a form. Each block has a **type** that determines its behavior. When you click **Add Section** in the form editor, you can choose from four types:

| Block Type          | Menu Label      | Purpose                                                                                                                   | When to Use                                                                                                    |
| ------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Dynamic**         | Custom Section  | Standard section with custom questions you define.                                                                        | Most blocks — use this for any custom intake questions, consent acknowledgments, or assessment questionnaires. |
| **Demographics**    | Demographics    | Collects patient information (name, DOB, address, etc.) and saves it to the patient's record automatically.               | New patient intake — saves front desk staff from manually entering demographics.                               |
| **Medical History** | Medical History | Collects health information (allergies, medications, family history, etc.) and saves it to the patient's medical history. | Clinical intake — information flows into the patient's chart for provider review.                              |
| **Payment Methods** | Payment Methods | Collects credit card information securely within the form.                                                                | Collecting a card on file during intake so it's ready at checkout.                                             |

<Tip>
  Use **Demographics**, **Medical History**, and **Payment Methods** blocks when you want form answers to automatically update patient records. Use **Custom Section** (Dynamic) blocks for everything else — custom questions, consent language, screening tools, etc.
</Tip>

A Payment Methods block has one form-level setting: **Require a saved card before the form can be submitted**. Turn it on to block submission until the patient enters a card; leave it off to make the card optional. The patient sees card and bank transfer entry — Apple Pay is hidden on save-card flows since Apple Pay tokens can't be stored for later use.

### Reordering Blocks and Questions

Both blocks and questions within a block support drag-and-drop reordering. Grab the drag handle on a block or question and move it to a new position. This lets you arrange your form in the order that makes most sense for your patients.

## Question Types

Forms support these question types:

| Type                     | What the Patient Sees                                                                                                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Short Text**           | A single-line text field                                                                                                                                                                          |
| **Long Text**            | A larger, multi-line text field                                                                                                                                                                   |
| **Number**               | A field that only accepts numbers                                                                                                                                                                 |
| **Date**                 | A date picker (can be limited to a specific date range)                                                                                                                                           |
| **Single Select**        | A list where the patient picks one option                                                                                                                                                         |
| **Radial Single Select** | A set of choices where the patient picks one (shown as round buttons). *In the form editor, this appears as "Single Choice."*                                                                     |
| **Multi Select**         | A list where the patient can pick multiple options                                                                                                                                                |
| **Radial Multi Select**  | A set of choices where the patient can check multiple boxes. *In the form editor, this appears as "Multiple Choice."*                                                                             |
| **Yes/No**               | An on/off switch (e.g., "Do you have allergies? Yes/No")                                                                                                                                          |
| **Address**              | A full address form (street, city, state, ZIP, country)                                                                                                                                           |
| **Phone**                | A phone number field                                                                                                                                                                              |
| **Email**                | An email address field                                                                                                                                                                            |
| **Signature**            | A signature pad where the patient signs with their finger or mouse                                                                                                                                |
| **File**                 | A file upload area (e.g., for ID photos, insurance cards). You can set allowed file types, max file size, and how many files are allowed.                                                         |
| **Tag**                  | A field where the patient can type and add multiple items one by one (e.g., listing allergies). *Not available in the form editor palette — used on forms configured through the system.*         |
| **Disclaimer**           | Read-only legal or informational text the patient reads and acknowledges                                                                                                                          |
| **Statement**            | A list of points the patient reads (used for consent statements)                                                                                                                                  |
| **Document**             | An embedded PDF shown within the form (e.g., a policy document)                                                                                                                                   |
| **Height (Feet/Inches)** | A field for entering height                                                                                                                                                                       |
| **Weight (Pounds)**      | A field for entering weight                                                                                                                                                                       |
| **Calculated Score**     | An auto-calculated total based on the patient's other answers (used for clinical assessments like PHQ-9). *Added automatically by certain mapped fields — not directly available in the palette.* |
| **Medications**          | A field for listing current medications. *Added automatically by the Medical History block — not directly available in the palette.*                                                              |
| **Body Map**             | A body map image the patient annotates by drawing directly on it — used to mark pain locations or other areas of concern. You upload the background image when setting up the question.           |
| **Payment Method**       | A credit card entry field connected to the payment processor. *Added automatically by the Payment Methods block.*                                                                                 |
| **Pharmacy**             | A search field where the patient or staff selects a pharmacy by name or ZIP code. *Available when e-prescribing is enabled.*                                                                      |
| **Scribe Attachments**   | A field for attaching scribe-related documents. *Used internally by the notes system — not directly available in the palette.*                                                                    |

## The Field Palette

The form editor has a left sidebar called the **field palette** that organizes all available fields into categories. Click any field to add it to the currently selected section.

| Category               | What It Contains                                                                                                                                                                                                 |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Form Fields**        | All standard question types listed above (Short Text, Long Text, Number, Date, Yes/No, Single Choice, Multiple Choice, Address, Phone, Email, Signature, File Upload, Body Map, Disclaimer, Statement, Document) |
| **Demographics**       | Fields that save to the patient record: Date of Birth, Gender, Email, Address                                                                                                                                    |
| **Vitals**             | Patient measurements: Weight, Height                                                                                                                                                                             |
| **Measurements**       | Individual fields you've defined in [Settings > Measurements](/modules/settings/measurements). The patient's answer is recorded as a measurement entry on their chart.                                           |
| **Measurement Groups** | A measurement group from settings. Adds every field in the group at once.                                                                                                                                        |
| **Medical History**    | Health data fields: Allergies, Medications, Family History, Medical History, Prescriptions, Surgical History, Social History, Autoimmune Disorders, Skin Conditions, Neurological Conditions                     |
| **Marketing**          | Opt-in fields: SMS Marketing Opt-In, Email Marketing Opt-In                                                                                                                                                      |
| **E-Prescribing**      | Pharmacy fields for clinics that use e-prescribing.                                                                                                                                                              |

Fields in the Demographics, Vitals, Measurements, Measurement Groups, Medical History, and Marketing categories are linked to the patient record — when a patient submits the form, their answers update the matching area on the patient chart. Measurement questions show the linked measurement name as a read-only label; rename it in **Settings > Measurements**.

Measurement fields use the best matching question type. Numeric fields show number inputs, text fields show short text inputs, fields with options show a choice list, and multi-value fields show multiple choices or tags.

## Conditional Logic

You can set up questions that only appear when the patient gives a specific answer to another question. This keeps forms short and relevant — patients only see what applies to them.

**How to set it up:** Each condition has three parts:

* **Dependent Question** -- The earlier question whose answer controls visibility.
* **Operator** -- How to compare the answer. The form editor shows three operators:
  * **Equals** / **Not Equals** -- The answer matches (or doesn't match) a specific value.
  * **Contains** -- The answer includes a specific value. Useful when the patient can pick multiple options.
* **Value** -- The specific answer to compare against.

<Info>
  Additional operators (**Years Ago Minimum**, **Years Ago Maximum**, and **Sum**) may appear on forms set up by Decoda support or imported from another system. These are used for date-based age checks and calculated score thresholds.
</Info>

You can add multiple conditions to a single question to create more complex rules (all conditions must be true for the question to appear).

**Example:** You have a "Do you have any allergies?" yes/no switch. When the patient answers **Yes**, a follow-up "Please list your allergies" question appears. The condition would be: Dependent Question = "Do you have any allergies?", Operator = **Equals**, Value = **Yes**.

## Patient Data Mapping

When building a form, you can link questions to specific fields on the patient's record. When the patient submits the form, their answers automatically update those fields — no manual data entry required. This means a single intake form can fill in a patient's demographics, measurements, insurance, medical history, and payment method all at once.

Available fields that can auto-update:

**Demographics:**

* First name, last name, email, phone number, date of birth, gender
* Full address (street, city, state, ZIP, country)

**Measurements:**

* Weight, height
* Custom measurement fields added from **Measurements**
* Fields included through **Measurement Groups**

**Medical History:**

* Allergies, medications, family history, medical history, prescriptions
* Surgical history, social history, autoimmune disorders, skin conditions, neurological conditions

**Marketing:**

* SMS Marketing Opt-In, Email Marketing Opt-In

**Consent:**

* AI Scribe Consent — lets a patient opt in or out of [AI Scribe](/modules/notes/ai-scribe) recording

**Payment:**

* Credit card / payment method

**E-Prescribing:**

* Pharmacy — saved with the submitted form and sent to DoseSpot when the patient is synced to e-prescribing
