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.
2. Who is this for? (Roles & Permissions)
Section titled “2. Who is this for? (Roles & Permissions)”- 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.
3. Business Rules & Enforcements
Section titled “3. Business Rules & Enforcements”- 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.
4. UI Placement
Section titled “4. UI Placement”- Feature location: Notes List table header area, above the records table.
- Selection controls area includes:
- Selection summary text (No notes selected / N notes selected)
- 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.
5. How-To Guide (Step-by-Step)
Section titled “5. How-To Guide (Step-by-Step)”Scenario A: Export a small set of specific notes
Section titled “Scenario A: Export a small set of specific notes”- Open Notes List.
- Mark individual note checkboxes you want to export.
- Confirm summary count updates.
- Click Export selected.
- 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”- Open Notes List with desired filters.
- Click header checkbox to select all visible notes.
- Click Export selected.
- Download combined PDF file.
Scenario C: Retry after an export failure
Section titled “Scenario C: Retry after an export failure”- Click Export selected.
- If error modal appears, review message.
- Keep or adjust selection.
- Retry export.
6. What happens if…? (Edge Cases / FAQ)
Section titled “6. What happens if…? (Edge Cases / FAQ)”-
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.