Care Profile Tab: From Raw JSON to Proper Clinical Display
The Care Profile tab on the Participant page has been completely rewritten. Previously it dumped raw JSON for most data types and had broken tables for medications and schedules. Now every category renders in a purpose-built format with collapsible sections, condition flags, and document downloads.
What Changed
The Care Profile tab pulls structured data from ROC (Record of Care) documents stored in Discord. The extraction pipeline was already working, but the frontend display was not doing it justice -- medications showed as JSON blobs, risk assessments were unreadable, and half the render types were not implemented at all.
All 9 render types now have dedicated renderers:
| Data Type | Display Format |
|---|---|
| Medications | Proper table with columns for name, dose, frequency, route, and notes |
| Emergency Contacts | Contact cards with name, relationship, phone, and role |
| Risk Assessments | Question-and-answer format with colour-coded risk levels (green/amber/red) |
| Hazards | Warning-styled cards with hazard type and mitigation notes |
| Schedule | Day-by-day table with activity columns |
| Goals | Colour-coded list badges (deep blue) |
| Likes | Colour-coded list badges (green) |
| Dislikes | Colour-coded list badges (red) |
| Support Needs | Colour-coded list badges (teal) |
Collapsible Sections
Each data category is now a collapsible section. Click the header to expand or collapse. This matters because a participant with a full ROC can have 15+ sections -- having them all open at once was overwhelming. Sections default to expanded on first load.
Condition Flags
Active medical conditions now display as coloured flags at the top of the profile, above all sections. These are immediately visible without scrolling -- important for support staff who need to see conditions at a glance.
Documents Section
ROC source documents (the actual PDFs and files from Discord) now appear at the bottom of the profile with download links. Previously these existed in the database but were never surfaced in the UI.
Last Synced Indicator
A timestamp at the top of the profile shows when the ROC data was last extracted. This tells staff whether they are looking at current information or something that needs a re-scan.
Discord Markdown Stripped
Raw Discord formatting (**bold**, __underline__, >>> quotes) is now cleaned from all text fields before display. The extraction pipeline pulls text from Discord messages, so this was appearing throughout the profile.
Backend Changes
The Care Profile API (/api/v1/participant-bios/:id) now returns documents, alert attachments, and the lastSynced timestamp. Static file mounts were added to Express for participant_profile_image and participant_roc_docs directories so documents can be downloaded directly.
Quick Reference
| Action | How |
|---|---|
| View care profile | Open a participant, click the "Care Profile" tab |
| Collapse a section | Click the section header |
| Download a document | Scroll to Documents section, click the filename |
| Check freshness | Look at the "Last synced" timestamp at the top |
-- Reginald