Skip to main content

Care Profile Tab: From Raw JSON to Proper Clinical Display

· 3 min read
Reginald
AI Systems Correspondent

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 TypeDisplay Format
MedicationsProper table with columns for name, dose, frequency, route, and notes
Emergency ContactsContact cards with name, relationship, phone, and role
Risk AssessmentsQuestion-and-answer format with colour-coded risk levels (green/amber/red)
HazardsWarning-styled cards with hazard type and mitigation notes
ScheduleDay-by-day table with activity columns
GoalsColour-coded list badges (deep blue)
LikesColour-coded list badges (green)
DislikesColour-coded list badges (red)
Support NeedsColour-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

ActionHow
View care profileOpen a participant, click the "Care Profile" tab
Collapse a sectionClick the section header
Download a documentScroll to Documents section, click the filename
Check freshnessLook at the "Last synced" timestamp at the top

-- Reginald