> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clinikapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Notes

> Create and manage clinical notes — progress notes, discharge summaries, and more.

# Notes

Notes (FHIR DocumentReference) represent clinical documentation — progress notes, discharge summaries, consultation notes, operative notes, and other narrative records.

## Create a Note

```ts theme={null}
const { data: note } = await clinik.notes.create({
  patientId: 'pt_abc123',
  authorId: 'prac_def456',
  encounterId: 'enc_xyz789',
  type: 'progress-note',
  title: 'Follow-up Visit - Hypertension Management',
  content: `## Subjective
Patient reports compliance with lisinopril 10mg daily. No dizziness, cough, or swelling.

## Objective
BP: 130/84 mmHg, HR: 72 bpm

## Assessment
Essential hypertension — improving but not at goal.

## Plan
- Increase lisinopril to 20mg daily
- Recheck BP in 4 weeks`,
  contentType: 'text/markdown',
  docStatus: 'final',
  category: 'cardiology',
  date: '2025-01-15',
  practiceSetting: 'cardiology',
  facilityType: 'outpatient-clinic',
});
```

## Document Relationships

Link notes to other documents they replace, append to, or sign:

```ts theme={null}
// Amend a note by creating a replacement
const { data: amended } = await clinik.notes.create({
  patientId: 'pt_abc123',
  authorId: 'prac_def456',
  type: 'progress-note',
  title: 'Follow-up Visit - Amended',
  content: '... corrected content ...',
  docStatus: 'amended',
  relatesTo: [{
    code: 'replaces',
    targetId: 'note_original_001',
  }],
});

// Append an addendum
const { data: addendum } = await clinik.notes.create({
  patientId: 'pt_abc123',
  authorId: 'prac_def456',
  type: 'progress-note',
  title: 'Addendum - Follow-up Visit',
  content: 'Patient called to report mild dizziness. Advised to take medication with food.',
  relatesTo: [{
    code: 'appends',
    targetId: 'note_original_001',
  }],
});
```

## Security Labels

Tag notes with security classifications:

```ts theme={null}
const { data } = await clinik.notes.create({
  patientId: 'pt_abc123',
  type: 'progress-note',
  title: 'Mental Health Assessment',
  content: '...',
  securityLabel: [
    { system: 'http://terminology.hl7.org/CodeSystem/v3-Confidentiality', code: 'R', display: 'Restricted' },
    { code: 'mental-health', display: 'Mental Health' },
  ],
  // ...
});
```

## Authentication and Custody

Track who authenticated and who maintains the document:

```ts theme={null}
const { data } = await clinik.notes.create({
  patientId: 'pt_abc123',
  authorId: 'prac_resident',
  authenticatorId: 'prac_attending',  // Attending physician who co-signed
  custodianId: 'org_hospital',        // Hospital maintaining the record
  type: 'discharge-summary',
  title: 'Discharge Summary',
  content: '...',
  // ...
});
```

## Service Context

Document the clinical context:

```ts theme={null}
const { data } = await clinik.notes.create({
  patientId: 'pt_abc123',
  type: 'consultation-note',
  title: 'Cardiology Consultation',
  content: '...',
  servicePeriod: {
    start: '2025-01-15T09:00:00Z',
    end: '2025-01-15T09:45:00Z',
  },
  facilityType: 'outpatient-clinic',
  practiceSetting: 'cardiology',
  // ...
});
```

## Note Types

| Type                   | Description                  |
| ---------------------- | ---------------------------- |
| `progress-note`        | Standard visit documentation |
| `discharge-summary`    | Hospital discharge summary   |
| `consultation-note`    | Specialist consultation      |
| `history-and-physical` | H\&P documentation           |
| `operative-note`       | Surgical procedure note      |
| `procedure-note`       | Non-surgical procedure note  |
| `referral-note`        | Referral documentation       |
| `transfer-summary`     | Patient transfer summary     |
| `other`                | Other note types             |

## Update a Note

```ts theme={null}
await clinik.notes.update('note_abc123', {
  docStatus: 'amended',
  content: '... updated content with addendum ...',
  relatesTo: [{
    code: 'appends',
    targetId: 'note_original_001',
  }],
});
```

## Search Notes

```ts theme={null}
const { data } = await clinik.notes.search({
  patientId: 'pt_abc123',
  type: 'progress-note',
  authorId: 'prac_def456',
  sort: '-date',
});
```
