Skip to content

[docs] Files for 3.1 - #126

Draft
rithviknishad wants to merge 11 commits into
mainfrom
claude/files-module-3-1-update-593fbc
Draft

rithviknishad wants to merge 11 commits into
mainfrom
claude/files-module-3-1-update-593fbc

Conversation

@rithviknishad

@rithviknishad rithviknishad commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

What this changes

Updates the Files documentation for Care 3.1 to match the 3.1 code, and adds three flows.

  • Concept concepts/clinical/files.mdx (Files): rewritten. Files can belong to patients, encounters, consents, diagnostic reports, service requests and referrals; the Files tab lists only patient and encounter files (questionnaire file answers are encounter files); upload, rename and archive (no delete, no unarchive); accepted types; a code-traced Permissions section; the Reports sub-tab is linked to the report-template pages.
  • Reference references/platform/file-upload.mdx (File Upload): adds the referral file type, an endpoint table, an authorization matrix per file type (including the closed-encounter rule), signed URLs, settings and defaults, the cleanup of incomplete uploads; fixes get_extension().
  • Eight flows in flows/clinical/files/, in this sidebar order:
    1. Find a file (new)
    2. Upload a file (updated)
    3. Take a photo and upload it (new)
    4. Record audio and upload it (new)
    5. View or preview a file (rewritten)
    6. Download a file (updated)
    7. Rename a file (updated)
    8. Archive a file (updated)
  • Media in static/media/clinical/files/: one narrated, subtitled video per flow and screenshots of its steps, with the relevant control outlined.

The old flow pages had several statements the 3.1 code contradicts. The main ones:

  • View is a row button, not an actions-menu item.
  • Archived files are listed by default, because Status starts on All.
  • Archived files cannot be opened or downloaded from the Files tab.
  • Record Audio needs the microphone button and ends with Done.
  • Combine Files To PDF appears for any two or more files.

Only 3.1: the 3.0 pages are left as they are.

What it was verified against

  • care @ ddfd840dbe314b4e53d2a719d2138324d970634b (develop, 2026-11-23)
  • care_fe @ 5e02f9aa4f690e08375da310511e14606985f788 (develop, 2026-11-26)

Every statement rests on a recorded fact: a cited line of the pinned code with its quote machine-checked (537 code facts), a runtime result, or a product decision. Two fresh-context reviewers checked each sentence against its fact (concept and flows; reference separately).

Runtime: a disposable local stack built from exactly those commits (new empty database plus Care's fixtures, MinIO for file storage, invented names: City General Hospital, Dr. Lakshmi Menon, patients Ravi Kumar and Thomas Varghese). All eight flows were recorded as a Doctor with a role in the encounter's department, never as a superuser; every API call in the recordings returned 2xx. Runtime checks changed three pages:

  • Status starts on All.
  • Chromium adds the extension to a row download, although Care names the download without one.
  • In Chromium on macOS, .rtf and .avi uploads are refused, because the browser reports a type Care does not allow.

Deliberate differences from the house style

  • Language: Simplified Technical English rules for steps, prerequisites and outcomes; plain consistent English for explanations.
  • Versions: written only for 3.1, the version whose code was verified.
  • Permissions: each Permissions table covers the whole path to the action. That includes the permission lists the frontend checks before it shows the tab or the buttons, where each permission must be held, and the closed-encounter rule. "A role on the patient" is explained once, in the concept, and the flows link to it.
  • Concept sections: the concept keeps ## Permissions. The concept template has no such section, but the concept skill asks for it and the Patient concept has one.
  • Flow H1s: the plain task title, not the template's "How to …", matching the site's existing flow pages.
  • Concept and reference slugs differ (concepts/clinical/files and references/platform/file-upload), as before; moving either would change a published URL.
  • Narration: each video has a voice reading a short script, one line per step: the step itself, then a sentence or two of context taken from that page. The captions track shows what the voice says. It is AI-generated with ElevenLabs (model eleven_v4) in two cloned voices: Bill-eng (Bill's voice) and Gauri-eng (Gauri's voice), one voice per video, taking turns flow by flow in sidebar order. Where a line is longer than its step, the video holds a settled frame and the subtitles are timed to match, so the videos run 35–81 s. Following the skill, the videos are plain: no zoom or speed-up.
  • Media markup: videos carry a WebVTT captions track, and steps have inline screenshots; both pass the build for en and ml.

Left out

  • Superuser-only behaviour.
  • The Reports sub-tab: it holds template reports, not uploads, and is linked to the existing report-template flows.
  • Behaviour only a runtime check could show and none did, for example what other browsers name a downloaded file.

Product findings (recorded, not filed)

The product team asked for these to be reported here only.

Certain

  • care_fe: the Files upload picker offers .tiff, but the backend refuses it.
  • care_fe: audio recordings are named .mp3 and sent as audio/mpeg, but contain WebM or MP4 audio. In the Play Audio dialog they open at their end, and play only on the second press.
  • care_fe: .ogg files show as Video.
  • care: refused uploads, renames and archives all say "Cannot View File".
  • care (patient access, not Files): Patient.rebuild_organization_cache adds the PatientOrganization link-row id instead of its organization id (care/emr/models/patient.py:89-96).
  • care_fe: on the Files list, pressing → opens a preview when none is open.

Likely, or needs intent

  • The encounter tab shows the edit actions on "Update Encounter non clinical", but the backend checks "Update Encounter related clinical data" (same default roles).
  • The frontend shows the patient Files tab and loads encounter files with "Can Read encounter", but the backend never accepts it alone.
  • By default, Administrator can write patient files but cannot read them, so the tab is hidden from them.
  • .rtf and .avi fail in Chromium on macOS because of their browser MIME types. .docx and .pptx are not accepted anywhere.
  • The 100 MB limit is checked only in the browser; the signed-URL path has no server-side size check.
  • The API allows renaming and re-archiving an archived file, which overwrites the reason, time and user.
  • Consent attachments include archived files and incomplete uploads.
  • The FILE_UPLOAD_KEY, FILE_UPLOAD_SECRET and FILE_UPLOAD_REGION settings are never read.
  • The upload dialog may hang if mark-upload-completed fails.
  • Archive Proceed stays enabled while archiving.
  • Retaking a photo clears every file already picked.
  • Failed uploads lose the names the user typed.
  • The "Previous file" label is not translated.
  • At 1440 px, the patient header wraps the name one syllable per line when the patient has fewer than two tags (the recordings give the patients two tags).

What the skill learned

Moved to the consolidated Ezhuthachan skill update, #141. This PR no longer changes .claude/skills/.

🤖 Generated with Claude Code

Open Healthcare Network and others added 2 commits November 28, 2026 17:51
Rewrite the Files concept and File Upload reference against care ddfd840
and care_fe 5e02f9a, update five flows, and add Find a file, Take a photo
and upload it, and Record audio and upload it. Each flow has a narrated,
subtitled video and step screenshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- File storage for a stack without Docker: MinIO, bucket settings, and an
  end-to-end upload check before recording.
- Keep load_fixtures output, which prints the fixture password, out of
  session files.
- Give every cast patient two tags before recording patient pages; the 3.1
  header wraps the name otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Deploying coredocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: c8f415b
Status: ✅  Deploy successful!
Preview URL: https://a360cc39.coredocs.pages.dev
Branch Preview URL: https://claude-files-module-3-1-upda.coredocs.pages.dev

View logs

billjohnc and others added 7 commits November 29, 2026 00:36
The facility role pickers never offer a role named Admin. Care defines two
roles with that name; the role sync looks roles up by name, so the database
keeps one Admin role, for role organizations (care
sync_permissions_roles.py:37-45, roles/role.py:57-67,81-93), and the facility
screens list roles with context FACILITY (care_fe RoleSelect.tsx:140,
LinkFacilityUserSheet.tsx:207, LinkUserToDepartmentSheet.tsx:131; care
security/api/viewsets/roles.py:10-15). The referral rows keep the Admin,
Manager and Member roles of a role organization, which care
security/permissions/referral.py gives Can Read Referrals and Can Update
Referrals, and drop only the bare facility Admin. The concept and the
reference now say why Admin is left out. Every other role in the lists
matches care security/permissions/patient.py, encounter.py,
diagnostic_report.py, service_request.py and referral.py.

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The concept implied that consent files can be renamed or archived while
their encounter is open. The consent details page gives each file only
View and Download (care_fe pages/Encounters/ConsentDetail.tsx:197-235); it
never calls the file manager's rename or archive, and the Files tab lists
only patient and encounter files (components/Files/FilesTab.tsx:23). The
backend does allow both, with the encounter's write rule (care
emr/api/viewsets/file_upload.py:69-75,127-131; security/authorization/
file_upload.py:37-48). The concept now says only the API can.

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The concept said Can Update Referrals lets you upload, rename and archive
the files of a referral. Referral files show only in the referral's Shared
records, where each file has View and a menu with Remove, which takes the
file off the referral and keeps the file (care_fe components/Referral/
ReferralSharedRecords.tsx:159-243,416-420; en.json
referral_remove_record_description). The rename and archive screens are
used only for patient, encounter and diagnostic report files. The backend
allows both with can_write_referral, so only the API can. Uploads go
through Upload file with the referral file type (ReferralUploadDialog.tsx:
75).

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Can Write Service Request on Facility row said the permission lets you
upload, rename and archive the files of a service request. No screen does:
care_fe uses the service_request file type only in the referral record picker
(ReferralResourcePicker.tsx:146,325), and no useFileUpload call or file list
is mounted for service requests. Only an API call can. Pinned care ddfd840,
care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each narrated video now plays from the Open Healthcare Network YouTube
channel (playlist "Care 3.1 documentation"), with its subtitles on
YouTube. The .mp4, .vtt and poster files are removed from this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ect step 4

The old screenshots of the camera showed Chromium's built-in fake camera
(a green test pattern), and the photo was named "Wound photo". The new ones
show a camera filming an invented referral letter for Maya Raman, named
"Referral letter", recorded as Dr. Meera Iyer on the local 3.1 stack.

Step 4 said that Care starts with the back camera. That holds on a small
screen only. On a screen at least 1024 px wide, Care starts with the camera
last used in this browser, or the first camera in the list
(CameraCaptureDialog.tsx: lastUsedCameraDeviceIdAtom, atomWithStorage).

The narrated video is re-recorded too; its new YouTube id replaces
KvifzjsJ2rA in a following commit, once it is uploaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The camera view is a photo, which compresses badly as a PNG: 4.7 MB each.
Saved at 1440 by 900 with a 256-colour palette they are 0.7 MB, in line
with the other images on the site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billjohnc and others added 2 commits November 30, 2026 21:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new video (bJENiiVSLbQ) shows a camera filming an invented referral letter,
the Select Camera menu for step 4, and a voice line for every step. It
replaces KvifzjsJ2rA, which showed Chromium's green fake camera.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants