Skip to content

Export Selected Notes

1. What does this feature do? (High-Level Overview)

Section titled “1. What does this feature do? (High-Level Overview)”

This feature allows users to bulk export selected notes from Notes List into a single PDF file. It is designed to support operational and clinical workflows that require sharing, auditing, or archiving multiple notes in one downloadable artifact.

  • Users with manage_notes (or SUPERADMIN role): can select and unselect notes in the table, including select-all on visible rows.
  • Users with export_notes: can execute the export action.
  • Users without manage_notes: cannot use selection controls.
  • Users without export_notes: cannot use export action even if notes are selected.

Required permissions used by this feature path:

  • manage_notes: enables note row checkboxes and selection logic.
  • export_notes: enables the Export selected action.
  • Rule 1: Selection controls are rendered only when user can manage notes.
  • Rule 2: Export button is rendered only when user can export notes.
  • Rule 3: Export button is disabled when selected count is 0.
  • Rule 4: Export button is disabled while export request is in progress.
  • Rule 5: Selection is tracked by unique key composed of note_type and id, preventing collisions across note types.
  • Rule 6: Select-all applies only to currently visible rows (current page dataset).
  • Rule 7: When filters change, previous selection is cleared to avoid exporting stale/out-of-scope notes.
  • Rule 8: Export request payload format is an array of objects: { id, type }.
  • Rule 9: Successful export response is handled as binary PDF and downloaded as notes-export-.pdf.
  • Rule 10: On export failure, an error modal is shown with backend message fallback.
  • Rule 11: If export is requested with zero selected notes, an informational modal prompts user to select at least one note.
  • Feature location: Notes List table header area, above the records table.
  • Selection controls area includes:
  1. Selection summary text (No notes selected / N notes selected)
  2. Export selected button
  • Row-level selection checkbox is displayed at the beginning of each note row.
  • Header-level checkbox allows select-all for visible notes.

Scenario A: Export a small set of specific notes

Section titled “Scenario A: Export a small set of specific notes”
  1. Open Notes List.
  2. Mark individual note checkboxes you want to export.
  3. Confirm summary count updates.
  4. Click Export selected.
  5. Wait for PDF download to complete.

Scenario B: Export all notes on current visible page

Section titled “Scenario B: Export all notes on current visible page”
  1. Open Notes List with desired filters.
  2. Click header checkbox to select all visible notes.
  3. Click Export selected.
  4. Download combined PDF file.
  1. Click Export selected.
  2. If error modal appears, review message.
  3. Keep or adjust selection.
  4. Retry export.
  • Q: What happens if user has manage_notes but not export_notes?

  • A: User can select notes, but export action is not available.

  • Q: What happens if user has export_notes but not manage_notes?

  • A: User cannot select rows, so effective export flow cannot be used.

  • Q: What happens if no note is selected?

  • A: Export action is blocked and an info modal asks to select at least one note.

  • Q: What happens if user clicks export multiple times quickly?

  • A: isExporting state disables the button during request, preventing duplicate submits.

  • Q: What happens when pagination changes?

  • A: Selected map persists across page navigation unless filters are changed.

  • Q: What happens when filters change?

  • A: Selection is cleared before applying the new filter.