Skip to main content

Intakes

Intakes capture patient intake forms as FHIR QuestionnaireResponse resources — structured question-answer pairs that can be queried, versioned, and linked to encounters.

Submit an Intake Form

const { data: intake } = 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: 'Primary reason for visit',
      answer: [{ valueString: 'Persistent headaches for 2 weeks' }],
    },
    {
      linkId: 'allergies',
      text: 'Known allergies',
      answer: [
        { valueString: 'Penicillin' },
        { valueString: 'Sulfa drugs' },
      ],
    },
    {
      linkId: 'current-medications',
      text: 'Current medications',
      answer: [
        { valueString: 'Lisinopril 10mg daily' },
        { valueString: 'Metformin 500mg twice daily' },
      ],
    },
    {
      linkId: 'pain-level',
      text: 'Current pain level (0-10)',
      answer: [{ valueInteger: 6 }],
    },
    {
      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: '8517006',
          display: 'Former smoker',
        },
      }],
    },
  ],
});

Based On / Part Of

Link intakes to the requests or procedures they fulfill:
const { data } = await clinik.intakes.submit({
  patientId: 'pt_abc123',
  basedOn: ['sr_preop_assessment'],  // ServiceRequest this fulfills
  partOf: ['proc_surgery_001'],       // Procedure this is part of
  items: [
    { linkId: 'consent-confirmed', answer: [{ valueBoolean: true }] },
    { linkId: 'fasting-hours', answer: [{ valueInteger: 12 }] },
  ],
});

Answer Types

TypeFieldExample
TextvalueString"Persistent headaches"
Yes/NovalueBooleantrue
NumbervalueInteger6
DecimalvalueDecimal98.6
DatevalueDate"2024-06-15"
Date-TimevalueDateTime"2025-01-15T10:00:00Z"
TimevalueTime"14:30:00"
CodedvalueCoding{ code: "8517006", display: "Former smoker" }
MeasurementvalueQuantity{ value: 165, unit: "lbs" }
URIvalueUri"https://example.com/document"

Nested Questions

Group related questions using nested items — supports unlimited depth:
{
  linkId: 'family-history',
  text: 'Family Medical History',
  items: [
    {
      linkId: 'fh-diabetes',
      text: 'Family history of diabetes?',
      answer: [{ valueBoolean: true }],
    },
    {
      linkId: 'fh-heart-disease',
      text: 'Family history of heart disease?',
      answer: [{ valueBoolean: false }],
    },
    {
      linkId: 'fh-details',
      text: 'Details',
      items: [
        {
          linkId: 'fh-diabetes-who',
          text: 'Who has diabetes?',
          answer: [{ valueString: 'Mother, maternal grandmother' }],
        },
      ],
    },
  ],
}

Amend an Intake

await clinik.intakes.update('intake_abc123', {
  status: 'amended',
  items: [
    {
      linkId: 'allergies',
      text: 'Known allergies',
      answer: [
        { valueString: 'Penicillin' },
        { valueString: 'Sulfa drugs' },
        { valueString: 'Latex' }, // newly reported
      ],
    },
  ],
});

Search Intakes

const { data } = await clinik.intakes.search({
  patientId: 'pt_abc123',
  status: 'completed',
  sort: '-date',
});

Status Lifecycle

in-progresscompletedamended / stopped