Skip to main content

clinik.patients

create

const { data, meta } = await clinik.patients.create(request: PatientCreateRequest): Promise<ApiResponse<Patient>>
FieldTypeRequiredDescription
firstNamestringYesPatient’s first name
lastNamestringYesPatient’s last name
emailstringNoEmail address
phonestringNoPhone number
gender'male' | 'female' | 'other' | 'unknown'NoAdministrative gender
birthDatestringNoDate of birth (YYYY-MM-DD)
addressobjectNoAddress with line, city, state, postalCode, country
maritalStatusstringNoMarital status (married, single, divorced, widowed)
photoobjectNoPhoto with url, data (base64), contentType
contactArrayNoEmergency contacts (relationship, name, phone, email)
languagesArray<{ language, preferred? }>NoLanguages the patient speaks
generalPractitionerIdstringNoReference to the patient’s GP (Practitioner ID)

read

const { data, meta } = await clinik.patients.read(id: string, options?: ReadOptions): Promise<ApiResponse<PatientReadResponse>>
The include option fetches related resources in a single call:
const { data } = await clinik.patients.read('pt_abc123', {
  include: ['Encounter', 'Observation', 'MedicationRequest'],
});

data.patient;       // Patient
data.encounters;    // Encounter[]
data.observations;  // Observation[]
data.prescriptions; // MedicationRequest[]

update

const { data, meta } = await clinik.patients.update(id: string, request: PatientUpdateRequest): Promise<ApiResponse<Patient>>
Only send the fields you want to change. Uses JSON Patch internally.

delete

const { data, meta } = await clinik.patients.delete(id: string): Promise<ApiResponse<void>>
const { data, meta } = await clinik.patients.search(params?: PatientSearchParams): Promise<ApiResponse<PaginatedResponse<Patient>>>
ParameterTypeDescription
namestringSearch by name (partial match)
emailstringExact email match
phonestringExact phone match
birthDatestringDate of birth
genderstringGender filter
activebooleanActive status
countnumberResults per page (max: 100)
cursorstringPagination cursor