Skip to main content
The clinik.consents namespace manages FHIR Consent resources — patient agreements to privacy policies, treatment plans, research participation, and advance directives. Each consent records the scope of agreement, the policy it references, optional verification details, and provision rules that specify what is permitted or denied.

sign

Record a new consent. patientId, scope, and category are required. This method is equivalent to create but uses the domain-specific name to reflect the consent-gathering workflow.
const { data, meta } = await clinik.consents.sign(request: ConsentSignRequest): Promise<ApiResponse<Consent>>
patientId
string
required
ID of the patient granting or denying consent.
scope
string
required
Scope of the consent. Accepted values: patient-privacy, research, treatment, adr (advance directive).
category
string | string[]
required
Consent category code, for example hipaa-notice, treatment-consent, research-participation. Accepts a single string or an array.
status
string
Consent status. Accepted values: draft, proposed, active, rejected, inactive. Defaults to active.
dateTime
string
ISO 8601 datetime when consent was given or denied.
performerId
string
ID of the practitioner or patient who is agreeing.
organizationId
string
ID of the custodian organization.
policyUri
string
URI of the policy the consent references.
verification
object
Verification details: verified (boolean), verifiedWith (patient or practitioner ID), and verificationDate (ISO 8601).
provision
object
Provision rules that qualify the consent. Includes type (permit or deny), optional period, and purpose codes.

Examples

const { data: hipaa } = await clinik.consents.sign({
  patientId: 'pt_abc123',
  status: 'active',
  scope: 'patient-privacy',
  category: 'hipaa-notice',
  policyUri: 'https://clinic.com/hipaa-notice',
  verification: {
    verified: true,
    verifiedWith: 'pt_abc123',
    verificationDate: '2025-01-15T10:00:00Z',
  },
});
ScopeDescription
patient-privacyPrivacy and data-sharing policies (HIPAA notices)
researchResearch study participation
treatmentAuthorization for treatment or procedures
adrAdvance directive (living will, DNR, etc.)

read

Fetch a single consent by ID.
const { data, meta } = await clinik.consents.read(id: string): Promise<ApiResponse<Consent>>

update

Partially update a consent. Commonly used to revoke active consents or update verification records.
const { data, meta } = await clinik.consents.update(id: string, request: ConsentUpdateRequest): Promise<ApiResponse<Consent>>

Examples

await clinik.consents.update('consent_abc123', {
  status: 'inactive',
});

delete

Permanently delete a consent record.
const { data, meta } = await clinik.consents.delete(id: string): Promise<ApiResponse<void>>
Search consents with optional filters and cursor pagination.
const { data, meta } = await clinik.consents.search(params?: ResourceSearchParams): Promise<ApiResponse<PaginatedResponse<Consent>>>
patientId
string
Filter by patient.
status
string
Filter by consent status.
dateFrom
string
Return consents dated on or after this date.
dateTo
string
Return consents dated on or before this date.
count
number
Results per page. Maximum is 100.
cursor
string
Pagination cursor from a previous response.