Skip to main content

IntakeForm

A dynamic intake form that submits responses as FHIR QuestionnaireResponse resources. Supports all FHIR answer types including text, boolean, integer, decimal, date, time, coded values, quantities, and URIs.

Usage

import { IntakeForm } from '@clinikapi/react';

<IntakeForm
  proxyUrl="/api/clinik"
  patientId="pt_abc123"
  theme="light"
/>

Props

PropTypeRequiredDescription
proxyUrlstringYesBackend proxy URL
patientIdstringYesPatient ID
theme'light' | 'dark'NoColor theme

Supported Answer Types

The intake form maps to FHIR QuestionnaireResponse answer types:
TypeFieldExample
TextvalueStringFree-text answers
Yes/NovalueBooleantrue / false
IntegervalueIntegerWhole numbers
DecimalvalueDecimalDecimal numbers
DatevalueDate"2024-06-15"
Date-TimevalueDateTime"2025-01-15T10:00:00Z"
TimevalueTime"14:30:00"
CodedvalueCodingSNOMED, ICD codes
MeasurementvalueQuantity{ value: 165, unit: "lbs" }
URIvalueUriExternal references

Features

  • Dynamic question rendering
  • Nested question groups (unlimited depth)
  • Multiple answer types per question
  • Auto-save as in-progress, submit as completed
  • Support for basedOn (ServiceRequest/CarePlan references)
  • Support for partOf (Observation/Procedure references)

Proxy Action

The widget sends intakes.submit with:
{
  "action": "intakes.submit",
  "data": {
    "patientId": "pt_abc123",
    "status": "completed",
    "items": [
      {
        "linkId": "chief-complaint",
        "text": "Primary reason for visit",
        "answer": [{ "valueString": "Annual physical exam" }]
      },
      {
        "linkId": "pain-level",
        "text": "Current pain level (0-10)",
        "answer": [{ "valueInteger": 3 }]
      }
    ]
  }
}