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

# Intakes

> SDK reference for intake form (QuestionnaireResponse) operations.

# clinik.intakes

Intakes represent completed patient intake forms, stored as FHIR QuestionnaireResponse resources. Each intake contains structured question-answer pairs with full recursive nesting support.

## submit

```ts theme={null}
const { data, meta } = await clinik.intakes.submit(request: IntakeSubmitRequest): Promise<ApiResponse<QuestionnaireResponse>>
```

| Field           | Type           | Required | Description                                         |
| --------------- | -------------- | -------- | --------------------------------------------------- |
| `patientId`     | `string`       | Yes      | Patient reference                                   |
| `encounterId`   | `string`       | No       | Encounter reference                                 |
| `authorId`      | `string`       | No       | Who filled out the form                             |
| `sourceId`      | `string`       | No       | Who provided the answers                            |
| `questionnaire` | `string`       | No       | Reference to Questionnaire definition               |
| `status`        | `string`       | No       | in-progress, completed, amended, stopped            |
| `authored`      | `string`       | No       | When answers were gathered                          |
| `basedOn`       | `string[]`     | No       | CarePlan or ServiceRequest IDs this intake fulfills |
| `partOf`        | `string[]`     | No       | Observation or Procedure IDs this intake is part of |
| `items`         | `IntakeItem[]` | Yes      | Question-answer pairs (recursive)                   |

### Item Structure

Each item has a `linkId`, optional `definition`, `text`, `answer` values, and nested `items`:

```ts theme={null}
const { data } = await clinik.intakes.submit({
  patientId: 'pt_abc123',
  encounterId: 'enc_xyz789',
  questionnaire: 'https://forms.clinikapi.com/new-patient-intake',
  status: 'completed',
  basedOn: ['sr_referral123'],
  items: [
    {
      linkId: 'chief-complaint',
      text: 'What is your primary reason for visiting today?',
      answer: [{ valueString: 'Annual physical exam' }],
    },
    {
      linkId: 'allergies',
      text: 'Do you have any known allergies?',
      answer: [{ valueBoolean: true }],
    },
    {
      linkId: 'pain-level',
      text: 'Rate your current pain level (0-10)',
      answer: [{ valueInteger: 3 }],
    },
    {
      linkId: 'temperature',
      text: 'Body temperature',
      answer: [{ valueQuantity: { value: 98.6, unit: '°F' } }],
    },
    {
      linkId: 'smoking-status',
      text: 'Smoking status',
      answer: [{
        valueCoding: {
          system: 'http://snomed.info/sct',
          code: '266919005',
          display: 'Never smoker',
        },
      }],
    },
    {
      linkId: 'vitals-group',
      text: 'Vitals',
      items: [
        {
          linkId: 'weight',
          text: 'Weight',
          answer: [{ valueQuantity: { value: 165, unit: 'lbs' } }],
        },
        {
          linkId: 'height',
          text: 'Height',
          answer: [{ valueString: '5\'10"' }],
        },
      ],
    },
  ],
});
```

### Answer Types

| Field           | Type                          | Use Case                          |
| --------------- | ----------------------------- | --------------------------------- |
| `valueString`   | `string`                      | Free text answers                 |
| `valueBoolean`  | `boolean`                     | Yes/no questions                  |
| `valueInteger`  | `number`                      | Whole numbers                     |
| `valueDecimal`  | `number`                      | Decimal numbers                   |
| `valueDate`     | `string`                      | Date answers (YYYY-MM-DD)         |
| `valueDateTime` | `string`                      | Date-time answers (ISO 8601)      |
| `valueTime`     | `string`                      | Time answers (HH:mm:ss)           |
| `valueCoding`   | `{ system?, code, display? }` | Coded answers (SNOMED, ICD, etc.) |
| `valueQuantity` | `{ value, unit? }`            | Measurements                      |
| `valueUri`      | `string`                      | URI answers                       |

## read / update / delete / search

Same pattern as other resources. Search supports `patientId`, `status`, `dateFrom`, `dateTo` filters.
