BIP Export PDF
1. What does this feature do? (High-Level Overview)
Section titled “1. What does this feature do? (High-Level Overview)”This feature generates a report-style PDF from the active BIP, using selected sections and current report context so teams can share a standardized clinical document for review, supervision, and external reporting. It combines narrative sections, charts, comments, consent/signature data, and insurer-specific fixed texts when available.
2. Who is this for? (Roles & Permissions)
Section titled “2. Who is this for? (Roles & Permissions)”- Superadmin/Admin/Owner/Manager (or any role granted export_bip and manage_bips): Can launch PDF export from BIP tabbed header actions.
- Users with manage_bips but without export_bip: Can edit BIP but cannot use Export PDF action.
- RBT/Analyst in read-only flow: This tabbed export action is tied to tabbed workflow header and permission check; availability depends on route/permissions.
Required permissions used by this feature path:
- export_bip: Required for Export PDF button visibility.
- manage_bips: Required for editable tabbed workflow entry in standard navigation.
- view_bips: Used for read-only BIP access routes.
3. Business Rules & Enforcements
Section titled “3. Business Rules & Enforcements”- Rule 1: Export action is shown only when user passes export_bip permission check.
- Rule 2: Export button is disabled until PDF generation prerequisites are ready (bip + client loaded, bip exists, and initial UI delay completed).
- Rule 3: Export flow starts with section selector modal; at least one section must be selected.
- Rule 4: Section list is filtered by feature flags; insurance-statement sections appear only when insurance-statements-fields is enabled.
- Rule 5: School-services PDF sections are additionally filtered by bip.apply_schedule_of_services.
- Rule 6: On confirmation, system closes selector modal, clears artifacts, and opens progress modal state.
- Rule 7: Charts are captured before final PDF generation.
- Rule 8: PDF generation requires persisted BIP ID; if missing, flow fails with error.
- Rule 9: Consent data/signatures are refreshed from backend before generating document.
- Rule 10: Report Date and Month Range are used to fetch weekly reports/chart comments for the PDF context.
- Rule 11: If insurer fixed texts are available for client insurer_id, they are injected into generation payload.
- Rule 12: On success, progress UI is closed and cleanup runs; on failure, user sees explicit error alert.
4. UI Placement
Section titled “4. UI Placement”- Medical > clients list > client actions > BIP View / Update.
- Inside BIP tabbed header actions: Export PDF button.
- Modal flow:
- Select sections modal (Save PDF)
- Progress/loading state during chart capture and document build
- Error modal path when selection validation fails
- Route family used for tabbed BIP: /bip/tabbed/:patient_id and /:id route variant under BIP module.
5. How-To Guide (Step-by-Step)
Section titled “5. How-To Guide (Step-by-Step)”Scenario A: Standard export
Section titled “Scenario A: Standard export”- Open BIP View / Update (tabbed workflow).
- Ensure Report Date and Month Range are set as desired.
- Click Export PDF.
- Select sections to include.
- Click Save PDF.
- Wait for chart capture and generation progress.
- Verify file download and contents.
Scenario B: Export with selective sections
Section titled “Scenario B: Export with selective sections”- Open Export PDF.
- Use Select All / Deselect All.
- Re-enable only required sections.
- Save PDF and verify output contains only selected sections.
Scenario C: Feature-flag or school-service dependent sections
Section titled “Scenario C: Feature-flag or school-service dependent sections”- Open Export PDF selector.
- Verify insurance-statement sections appear only when feature flag is enabled.
- Verify school-related sections appear only when Apply School Services is enabled.
- Export and confirm resulting document scope.
6. What happens if…? (Edge Cases / FAQ)
Section titled “6. What happens if…? (Edge Cases / FAQ)”-
Q: What if user selects no sections?
-
A: Export is blocked and selector emits validation error requiring at least one section.
-
Q: What if BIP ID is missing when generating?
-
A: Generation fails because persisted BIP ID is required.
-
Q: What if chart capture fails?
-
A: Flow stops and user receives failed-to-capture/generate error message.
-
Q: What if insurer fixed texts are unavailable?
-
A: PDF generation continues without insurer text injection.
-
Q: Why can Export PDF button appear disabled?
-
A: Typical causes are missing loaded bip/client data, bip not existing yet, or initial readiness delay not completed.