Skip to main content

Consents

Consents track patient agreements to privacy policies, treatment plans, research participation, and advance directives.
// HIPAA privacy notice
const { data: hipaa } = await clinik.consents.sign({
  patientId: 'pt_abc123',
  status: 'active',
  scope: 'patient-privacy',
  category: 'hipaa-notice',
  policyUri: 'https://clinic.com/hipaa-notice',
  policyRule: 'HIPAA-Auth',
  verification: [{
    verified: true,
    verifiedWith: 'pt_abc123',
    verificationDate: '2025-01-15T10:00:00Z',
  }],
});

// Treatment consent with provisions and attestation
const { data: treatment } = await clinik.consents.sign({
  patientId: 'pt_abc123',
  status: 'active',
  scope: 'treatment',
  category: ['treatment-consent', 'surgical-consent'],
  performerId: 'prac_def456',
  organizationId: 'org_ghi789',
  policies: [
    { authority: 'https://clinic.com', uri: 'https://clinic.com/treatment-policy' },
    { authority: 'https://clinic.com', uri: 'https://clinic.com/surgical-policy' },
  ],
  provision: {
    type: 'permit',
    period: {
      start: '2025-01-15',
      end: '2025-07-15',
    },
    purpose: [
      { system: 'http://terminology.hl7.org/CodeSystem/v3-ActReason', code: 'TREAT', display: 'Treatment' },
    ],
    action: [
      { code: 'access', display: 'Access' },
      { code: 'use', display: 'Use' },
    ],
  },
});

Source Documents

Link a consent to its source document:
// From an attachment
const { data } = await clinik.consents.sign({
  patientId: 'pt_abc123',
  scope: 'treatment',
  category: 'surgical-consent',
  sourceAttachment: {
    contentType: 'application/pdf',
    url: 'https://storage.clinic.com/consents/signed-form.pdf',
    title: 'Signed Surgical Consent Form',
  },
  // ...
});

// From a reference (e.g. a QuestionnaireResponse)
const { data: fromForm } = await clinik.consents.sign({
  patientId: 'pt_abc123',
  scope: 'research',
  category: 'research-participation',
  sourceReferenceId: 'QuestionnaireResponse/intake_consent_form',
  // ...
});

Multiple Verifications

Track multiple verification events:
const { data } = await clinik.consents.sign({
  patientId: 'pt_abc123',
  scope: 'treatment',
  category: 'surgical-consent',
  verification: [
    {
      verified: true,
      verifiedWith: 'pt_abc123',
      verificationDate: '2025-01-15T09:00:00Z',
    },
    {
      verified: true,
      verifiedWith: 'related_person_spouse',
      verificationDate: '2025-01-15T09:30:00Z',
    },
  ],
  // ...
});

Provisions with Data Control

Control access to specific data:
provision: {
  type: 'permit',
  period: { start: '2025-01-01', end: '2025-12-31' },
  purpose: [
    { code: 'TREAT', display: 'Treatment' },
    { code: 'HPAYMT', display: 'Healthcare Payment' },
  ],
  action: [
    { code: 'access', display: 'Access' },
    { code: 'use', display: 'Use' },
  ],
  securityLabel: [
    { system: 'http://terminology.hl7.org/CodeSystem/v3-Confidentiality', code: 'R', display: 'Restricted' },
  ],
  data: [
    { meaning: 'instance', reference: 'DiagnosticReport/lab_hiv_001' },
    { meaning: 'related', reference: 'Condition/cond_mental_health' },
  ],
  dataPeriod: { start: '2024-01-01', end: '2025-12-31' },
  // Nested exception: deny research use
  provision: [{
    type: 'deny',
    purpose: [{ code: 'HRESCH', display: 'Healthcare Research' }],
  }],
}
ScopeDescriptionExamples
patient-privacyPrivacy and data sharingHIPAA notice, data sharing agreement
treatmentTreatment authorizationSurgical consent, procedure consent
researchResearch participationClinical trial enrollment
adrAdvance directiveLiving will, DNR

Status Lifecycle

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

Search Consents

const { data } = await clinik.consents.search({
  patientId: 'pt_abc123',
  status: 'active',
});