Skip to main content

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

const { data, meta } = await clinik.intakes.submit(request: IntakeSubmitRequest): Promise<ApiResponse<QuestionnaireResponse>>
FieldTypeRequiredDescription
patientIdstringYesPatient reference
encounterIdstringNoEncounter reference
authorIdstringNoWho filled out the form
sourceIdstringNoWho provided the answers
questionnairestringNoReference to Questionnaire definition
statusstringNoin-progress, completed, amended, stopped
authoredstringNoWhen answers were gathered
basedOnstring[]NoCarePlan or ServiceRequest IDs this intake fulfills
partOfstring[]NoObservation or Procedure IDs this intake is part of
itemsIntakeItem[]YesQuestion-answer pairs (recursive)

Item Structure

Each item has a linkId, optional definition, text, answer values, and nested items:
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

FieldTypeUse Case
valueStringstringFree text answers
valueBooleanbooleanYes/no questions
valueIntegernumberWhole numbers
valueDecimalnumberDecimal numbers
valueDatestringDate answers (YYYY-MM-DD)
valueDateTimestringDate-time answers (ISO 8601)
valueTimestringTime answers (HH:mm:ss)
valueCoding{ system?, code, display? }Coded answers (SNOMED, ICD, etc.)
valueQuantity{ value, unit? }Measurements
valueUristringURI answers
Same pattern as other resources. Search supports patientId, status, dateFrom, dateTo filters.