clinik.patients namespace provides methods to manage FHIR Patient resources. Patients are the central resource in ClinikAPI — most other resources such as encounters, observations, and prescriptions reference a patient by ID. The read method supports an include option that lets you fetch related resources in a single round-trip.
create
Create a newPatient resource. Only firstName and lastName are required; all other fields are optional.
Patient’s first (given) name.
Patient’s family name.
Email address.
Phone number.
Administrative gender.
Date of birth in
YYYY-MM-DD format.Address object with
line, city, state, postalCode, and country fields.Example
read
Fetch a singlePatient by ID. Use the include option to retrieve related FHIR resources in the same call.
The patient ID (e.g.
pt_abc123).An array of related resource types to include in the response. Supported values:
Encounter, Observation, MedicationRequest, and other FHIR resource types linked to the patient.Fetching related resources
When you passinclude, the response’s data object contains the patient alongside arrays of the requested related resources.
update
Partially update an existing patient. Send only the fields you want to change — the SDK applies a JSON Patch internally, so unspecified fields remain unchanged.The patient ID to update.
Example
delete
Permanently delete a patient record.search
Search for patients with optional filters and cursor-based pagination. Omitparams entirely to return the first page of all patients.
Partial name match across first and last name.
Exact email address match.
Exact phone number match.
Filter by date of birth (
YYYY-MM-DD).Filter by administrative gender.
Filter by active status.
Number of results per page. Maximum is
100.Opaque pagination cursor from the previous response. Pass
data.nextCursor to fetch the next page.