Skip to content

[docs] Referral for 3.1 - #111

Draft
rithviknishad wants to merge 9 commits into
mainfrom
docs/referral-1da5
Draft

rithviknishad wants to merge 9 commits into
mainfrom
docs/referral-1da5

Conversation

@rithviknishad

@rithviknishad rithviknishad commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds user documentation for Care's Referral module to docs version 3.1: one concept page and twelve flow pages, each flow with a narrated, subtitled video and step screenshots.

All pages are new; no existing page is replaced. Referral exists only on develop (Care 3.1). It is absent from the 3.0 branches of care and care_fe, so nothing is written to version-3.0.

Pages

Concept: versioned_docs/version-3.1/concepts/clinical/referral.mdx

Flows, in versioned_docs/version-3.1/flows/clinical/referral/, listed in the sidebar under Flows › Clinical › Referral (after Notes):

  1. Set up referral availability
  2. Change or remove referral availability
  3. Send a referral
  4. Share records with a referral
  5. Find a referral
  6. Start a referral and assign the team
  7. Book the referred patient's visit
  8. Respond to a referral
  9. Change a referral's status
  10. Edit a referral's title or note
  11. Discuss a referral
  12. Mark a referral form as entered in error

Media for these pages is in static/media/clinical/referral/: 12 videos with posters and captions, and step screenshots.

Verified against

  • care at ddfd840dbe314b4e53d2a719d2138324d970634b (develop, 23 Nov 2026)
  • care_fe at 5e02f9aa4f690e08375da310511e14606985f788 (develop, 26 Nov 2026)

How the pages were verified

  • From code. Every statement in the pages rests on a recorded fact: 175 backend and 363 frontend facts, each with the file, the lines and a quote. A script checked every quote against its lines. A separate audit then checked every permission, role and label claim against the code that uses it.
  • At runtime. Each flow was recorded against a native Care stack started for this session from the two commits above. The stack used a new database and fictional data only. 54 facts come from what the screen showed, each tied to the screenshot that shows it.
  • Permissions, checked by running them. The permission tables trace the whole path to each action, not only the final permission. Two rules were also checked by calling the API as the users concerned:
    • Staff who hold a role only in a department are refused the facility-wide referral list until they choose their department.
    • A Facility Admin who holds a role only at the facility level is refused a top-level department's referrals and its referral availability settings.
  • Review. Each page was reviewed by a reader who had not written it, against the facts, the templates and .github/references/review-checklist.md. The pages were reviewed again after the media went in.

Where the pages differ from the house style on purpose

  • Language. Simplified Technical English rules apply to steps, prerequisites and tables. Explanations use plain, consistent English instead.
  • Versions. The pages are in 3.1 only, because the module does not exist in 3.0. The conventions file says the versions are kept identical; that cannot hold here.
  • Permissions. Each table lists every permission on the path to the action, with where it must be held and which default roles hold it.
  • Flow titles. Titles use sentence case without "How to", as every existing 3.1 flow and the flow skill's naming rule do. The flow template still says "How to".
  • Concept page. The concept keeps a Permissions section, which care-concept-doc requires and the template lacks.
  • Media markup. Each video has a captions <track>, and screenshots sit after their steps. The build passes for every language with this markup.

Narration

  • What the voice says. Each video is narrated: one line per step, saying the step and a sentence or two of context taken from that page. The subtitles show the words spoken.
  • How it was made. The speech is AI-generated with ElevenLabs (model eleven_v4).
  • Whose voices. Two cloned voices take turns flow by flow, in sidebar order:
    • Bill-eng, cloned from Bill's voice, reads flows 1, 3, 5, 7, 9 and 11.
    • Gauri-eng, cloned from Gauri's voice, reads flows 2, 4, 6, 8, 10 and 12.
  • Timing. Where a line is longer than its step on screen, the video holds a settled frame until the voice finishes. The subtitles are timed to match.

Left out, and open questions

  • Patients. The pages cover staff only. The referral pages accept a patient sign-in, but nothing in the patient portal links to them.
  • Superuser-only. "External" referral destinations are left out, because only a superuser can work with them.
  • Upload file, not recorded. The Upload file steps in "Share records with a referral" are verified from code but not recorded. The session stack had no file storage.
  • Details the code did not settle, left out of the pages:
    • The default roles of "Can Read Questionnaires" and "Can list bookings on Object", and of the read permissions behind each kind of shared record.
  • Answered since, now in the pages:
    • Removing a member from the default care team: "Change or remove referral availability" has the step. The change applies only to referrals sent after it; referrals already sent keep their assignees.
    • An Inactive referral availability: referrals already sent keep their status and stay in the lists, and the sending end can still work on them. At the receiving end, the referral page shows its buttons only to people who also hold Can Manage Referral Availabilities there. The concept and "Change or remove referral availability" say so.
  • Open: status changes. Anyone who can update a referral, at either end, can move it from any status to any other, and closed referrals still accept records, messages and responses. The pages describe this as Care does it today. The product team has not said whether it is intended.
  • Open: closed encounters. The encounter's Referrals tab offers New Referral on a completed or discontinued encounter, and the backend accepts it. The New Referral quick action appears only on an active encounter. The pages describe both as they behave; the intent is open.

Suspected product issues (not filed)

  1. Status changes. No status rules: either end can set any status from any status (see above).
  2. Closed referrals. Completed, cancelled and rejected referrals still accept records, messages, responses and assignee changes.
  3. Respond on closed referrals. Respond and Add response appear on closed referrals from the referral page, but not from the appointment or encounter panels.
  4. Department-only staff. On the facility Referrals page, department-only staff first see "You do not have access to these referrals". The message points them to the administrator, not to the department filter.
  5. Assignees. Any active user can be made an assignee, and then sees the patient's name, the title and the note in the assigned list without referral permissions. The tests treat this as intended. No screen calls that list.
  6. Manage assignees. The dialog opens on the user's first facility, not the referral's.
  7. Lookups that fail. The referral page requests the receiving facility and its department even for a sender who cannot read them, so two calls return 404 on every view. The page still renders.
  8. A misleading screen-reader name. The button that removes an assignee has a screen-reader name that mentions the "default care team".

Neighbouring pages that look stale

  • concepts/access-governance/facility-organization.mdx. It says departments hang beneath the facility's root and that a permission high in the tree reaches every unit below. At the pinned code, Care refuses to create anything under the root, and departments have no parent. For referrals, a role only in the Administration department does not reach a department.
  • flows/definitions/questionnaire/create-questionnaire.mdx. It covers only the admin area and the Patient and Encounter subject types. Referral forms need subject type Referral, so the Referral pages link the questionnaire concept instead.

What the skill learned (separate commit)

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 3 commits November 27, 2026 17:48
Concept page and twelve flow pages for Care's Referral module, with step
screenshots and video posters, verified against care ddfd840 and
care_fe 5e02f9a. Adds the Referral flows to the 3.1 sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Twelve videos with spoken narration (ElevenLabs eleven_v4; voices
Bill-eng and Gauri-eng, cloned from Bill and Gauri) and subtitles of
the spoken words.

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

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

Copy link
Copy Markdown

Deploying coredocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 52ca8e9
Status: ✅  Deploy successful!
Preview URL: https://abbc88cd.coredocs.pages.dev
Branch Preview URL: https://docs-referral-1da5.coredocs.pages.dev

View logs

billjohnc added a commit that referenced this pull request Nov 28, 2026
Position 13 is also taken by the Referral concept in #111, and 14 by
the Immunization concept in #123. The concepts sidebar is
autogenerated, so pages with the same position have no set order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billjohnc and others added 4 commits November 29, 2026 00:32
The facility role pickers never offer Admin: the role sync keeps one role
named Admin, and it is the role-organization one (care
sync_permissions_roles.py:37-45, role.py:57-67). The pickers ask only for
facility roles (care_fe LinkFacilityUserSheet.tsx:207,
EditFacilityUserRoleSheet.tsx:177, LinkUserToDepartmentSheet.tsx:131,
PatientUsers.tsx:164; care roles.py:15). The referral permissions are also
held by the role-organization Admin, Manager and Member roles
(care/security/permissions/referral.py), so those rows now name them as
roles of a role organization. Can Create encounter, Can update bookings on
Object and Can view clinical data about patients drop Admin
(encounter.py:24-29, schedule.py:47-58, patient.py:58-63).

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start Consultation only opens the encounter form and then goes to the new
encounter with the referral in the address; nothing is stored on the
referral (care_fe ReferralAppointments.tsx:295-323; the comment in
useReferralReceivingEncounter.ts:24-26 says direct encounter context does
not establish a stored link; referralResource.ts:14-26 has no encounter
type). Start Consultation and Book appointment hide only when an
appointment that is not cancelled is attached, or when the page is opened
from an appointment or encounter (ReferralAppointments.tsx:207-279), so
both stay on the referral after a walk-in while it is Pending or In
progress. The concept's Appointment and visit section and the flow's
expected outcome now say so.

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR left open whether a member can be removed. Each member under
Default care team has an X button, "Remove {{name}} from the default care
team" (care_fe ReferralDefaultCareTeam.tsx:124-138, en.json
referral_remove_member). When the team changed, the form sends the whole
new list (ReferralAvailabilityForm.tsx:73-82, 112-114) and the backend
replaces it (care resources/referral/availability.py:203-205). A referral
gets a copy of the team when it is sent (viewsets/referral.py:563), and
nothing else writes referral assignees except Manage assignees
(set_assignees, :571-579), so referrals already sent keep their team.

Pinned care ddfd840, care_fe 5e02f9a.

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

The PR left this open. The backend checks the availability status only
for the Referral unit list, for opening the availability and for new
referrals (care security/authorization/referral.py:83, 94, 139). Reading
and updating a referral ignore it (:122-136), and the referral lists do
not filter on it (viewsets/referral.py:366-402, 481-510), so sent
referrals keep their status and stay listed.

The referral page, though, learns the receiving end from the
availability (care_fe useReferralPermissions.ts:66-197). For an
availability that is not Active, that request is refused unless the user
can manage the availability (authorization/referral.py:78-91,
viewsets/referral.py:263-267), so receiving-end write access drops to
false and the page hides Start referral, Respond, Add record, Manage
assignees, Start Consultation and Book appointment for everyone else
there (ReferralDetailsPage.tsx:80-403, ReferralAppointments.tsx:202-212).
The sending end is unaffected. The concept and the change flow now say
this.

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billjohnc added a commit that referenced this pull request Nov 30, 2026
… PRs.

The cleanup check found four lessons the open PRs named that this update had
not kept: record anyway when the tool refuses the terminology-server check
(#121), a database-renamed user's profile returns 404 (#111), a role held only
in the facility's root organization does not reach department checks (#116),
and REACT_CARE_URL_MAP must be valid JSON (#108). The code facts go in the
dated list of seeding traps.

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>
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>

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