Skip to main content
The clinik.intakes namespace manages FHIR QuestionnaireResponse resources — completed patient intake forms. Each intake contains structured question-and-answer pairs with typed values, making form data both human-readable and machine-processable. Intakes support nine answer types, from free text and booleans to SNOMED-coded responses and measurement quantities.

submit

Submit a completed intake form. patientId and items are required. This method is equivalent to create but uses the domain-specific name to reflect the patient-facing workflow.
const { data, meta } = await clinik.intakes.submit(request: IntakeSubmitRequest): Promise<ApiResponse<QuestionnaireResponse>>
patientId
string
required
ID of the patient who completed the form.
items
Array
required
Array of question-answer pairs. Each item requires a linkId (unique question identifier) and an answer array. See answer types below.
encounterId
string
Encounter associated with this intake.
authorId
string
ID of the person who filled out the form (may differ from the patient).
sourceId
string
ID of the person who provided the answers.
questionnaire
string
URL or canonical reference to the Questionnaire definition this response answers.
status
string
Response status. Accepted values: in-progress, completed, amended, stopped.
authored
string
ISO 8601 datetime when the answers were gathered.

Example

const { data } = await clinik.intakes.submit({
  patientId: 'pt_abc123',
  encounterId: 'enc_xyz789',
  questionnaire: 'https://forms.clinikapi.com/new-patient-intake',
  status: 'completed',
  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: 'allergy-list',
      text: 'Please list your allergies',
      answer: [
        { valueString: 'Penicillin' },
        { valueString: 'Shellfish' },
      ],
    },
    {
      linkId: 'pain-level',
      text: 'Rate your current pain level (0-10)',
      answer: [{ valueInteger: 3 }],
    },
    {
      linkId: 'last-visit-date',
      text: 'When was your last doctor visit?',
      answer: [{ valueDate: '2024-06-15' }],
    },
    {
      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: [{ valueInteger: 165 }],
        },
        {
          linkId: 'height',
          text: 'Height',
          answer: [{ valueString: '5\'10"' }],
        },
      ],
    },
  ],
});
Nest items inside a parent item’s items array to represent grouped or section-based questions, such as a vitals panel.

Answer types

Each answer in an answer array uses exactly one typed value field:
FieldTypeUse case
valueStringstringFree-text answers
valueBooleanbooleanYes / no questions
valueIntegernumberWhole-number values
valueDecimalnumberDecimal-precision values
valueDatestringDate answers (YYYY-MM-DD)
valueDateTimestringDate-time answers (ISO 8601)
valueCoding{ system?: string; code: string; display?: string }Coded answers (SNOMED, ICD, etc.)
valueQuantity{ value: number; unit?: string }Measurements with units
valueUristringURI answers

read

Fetch a single intake by ID.
const { data, meta } = await clinik.intakes.read(id: string): Promise<ApiResponse<QuestionnaireResponse>>

update

Amend a submitted intake. Useful when new information comes to light after initial submission.
const { data, meta } = await clinik.intakes.update(id: string, request: IntakeUpdateRequest): Promise<ApiResponse<QuestionnaireResponse>>

Example: add a newly reported allergy

await clinik.intakes.update('intake_abc123', {
  status: 'amended',
  items: [
    {
      linkId: 'allergies',
      text: 'Do you have any known allergies?',
      answer: [{ valueBoolean: true }],
    },
    {
      linkId: 'allergy-list',
      text: 'Please list your allergies',
      answer: [
        { valueString: 'Penicillin' },
        { valueString: 'Shellfish' },
        { valueString: 'Latex' }, // newly reported
      ],
    },
  ],
});

delete

Permanently delete an intake record.
const { data, meta } = await clinik.intakes.delete(id: string): Promise<ApiResponse<void>>
Search intake responses with optional filters and cursor pagination.
const { data, meta } = await clinik.intakes.search(params?: ResourceSearchParams): Promise<ApiResponse<PaginatedResponse<QuestionnaireResponse>>>
patientId
string
Filter by patient.
status
string
Filter by response status.
dateFrom
string
Return intakes authored on or after this date.
dateTo
string
Return intakes authored on or before this date.
count
number
Results per page. Maximum is 100.
cursor
string
Pagination cursor from a previous response.