Skip to content

[docs] Tag configuration expiry and facility organization tree for 3.1 - #132

Draft
billjohnc wants to merge 7 commits into
mainfrom
docs/pr-fixer-leftovers-9a2a
Draft

billjohnc wants to merge 7 commits into
mainfrom
docs/pr-fixer-leftovers-9a2a

Conversation

@billjohnc

@billjohnc billjohnc commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes and media for existing 3.1 pages that no open PR covers. They were left over from the 28 Nov review of the open docs PRs from #102 up.

1. Tag configuration expiry

Since care_fe #17055 and care 3af5d2804, the tag form has an Expiry section. No page described it.

  • flows/platform/tagging/create-a-tag.mdx: field rows for Expire automatically, Expire after (days, hours, minutes; shown only when Expire automatically is on) and Allow changing expiry. Also the checks the form runs: the time must be above zero and at most 3650 days.
  • flows/platform/tagging/edit-a-tag.mdx: the same rows. A change applies only to tags applied after it; tags already on records keep their expiry. Turning off Expire automatically clears Expire after.
  • flows/platform/tagging/create-a-child-tag.mdx: an Expiry row. A child tag does not copy the expiry settings of its parent.
  • flows/platform/tagging/view-tags.mdx: the Expiry row on the tag detail page.
  • concepts/platform/tagging.mdx: a new Expiry section and a Key Attributes row. It covers what each setting does when staff apply the tag, and that Care removes the tag when it expires. Removal runs in a background check every hour; until then the tag shows as Expired. Setting expiry needs the same permission as creating or updating a tag.
  • references/platform/tag-config.mdx: expiry_metadata, TagConfigExpiryMetadata with its validator, ExpiryOffset, TagSetRequest.expiry_offset, the TagDeleteRequest model, and the server behaviour at apply time and at expiry.

Recording the flows also showed where the tag pages and the screens disagreed. The pages now match the screen:

  • The organization field of the form is labelled "Facility Organisation". The detail page calls it Managing Organization.
  • The form has an optional Color field (Assign Color, Shuffle Color).
  • The save buttons are "Create tag config" and "Update tag config".
  • The facility's tag list does not show instance-wide tags.
  • The detail page has a System generated row, and its Children row is labelled "Has children".

Applying an expiring tag to a patient or an encounter is covered by #113 and #129. Those pages are not touched here.

2. Facility organization tree

concepts/access-governance/facility-organization.mdx said departments "hang beneath" the facility's root, and that a permission granted high in the tree reaches every unit under it. In 3.1 nothing can be created under the root organization, Administration. Departments are top-level units beside it. The page now says:

  • A role in Administration never reaches a department through the tree.
  • Whether a role in Administration counts depends on the action. It counts for every encounter in the facility, and for managing departments and their members. It does not count for creating or changing a workspace that belongs to a department.

This also removes the contradiction with #108's workspace concept, which links this page. The permission table no longer lists "Admin", which the facility role picker does not offer.

3. The extensions field in two references

  • references/facility/facility.mdx and references/platform/resource-request.mdx now document extensions: deployment-specific data keyed by extension name, accepted on create and update, and checked against the extension's schema.
  • For resource requests, the field comes back exactly as stored. Both read specs skip the extension renderers, so an extension with no data gets no empty entry.
  • No 3.1 screen shows or edits the field. It is API only.

4. Videos and screenshots

  • Tag flows: each of the four pages (create a tag, create a child tag, view tags, edit a tag) has a narrated video under its Overview, with subtitles. Each also has step screenshots with descriptive alt text: 4 videos and 23 screenshots in static/media/platform/tagging/.
  • Concepts: the tag concept has a screenshot of the expiry step that staff see when they add a tag that allows changing expiry. The facility organization concept has a screenshot of the Departments/Teams page, with Administration at the same level as the other units (static/media/access-governance/facility-organization/).
  • Recording: recorded on a local Care stack at the pinned commits with invented data, as Rohan Kapoor (Facility Admin) and, for the expiry step, Anita George (Nurse). Never as a superuser.
  • Narration: each video has a voice that reads a short script per step: the step and one sentence of context taken from the page. The subtitles show the spoken words. The voices are AI-generated with ElevenLabs (model eleven_v4), from two voices cloned for the Care team: Gauri-eng and Bill-eng, taking turns flow by flow in sidebar order. Where a line is longer than its step on screen, the video holds a settled frame and the subtitles are timed to match.

How this was checked

Every statement was checked in the code at care ddfd840dbe314b4e53d2a719d2138324d970634b and care_fe 5e02f9aa4f690e08375da310511e14606985f788. The recordings confirmed the tag flows on screen. The commit messages cite the files and lines. The full build passes (en and ml).

Left out

  • On the four tag pages, the permission rows still list "Admin". In 3.1 the facility role picker does not offer that role. The rows also do not say that Can Create Tag Config on Facility must come from a role in Administration (care authorization/tag_config.py, root=True). Both existed before this PR and are not changed here.
  • The tag concept still describes instance-wide tags, which only a superuser can create. Not changed here.
  • On the facility organization page, the permission table uses permission slugs. Not changed here.
  • The tag Resource lists in the concept and the reference leave out Location (and the concept leaves out Activity Definition). Not changed here.
  • After [docs] Patient for 3.1 #113 merges, the concept's Expiry section can link its patient tag flow.

🤖 Generated with Claude Code

billjohnc and others added 2 commits November 29, 2026 00:38
The tag form in 3.1 has an Expiry section (Expire automatically, Expire
after, Allow changing expiry) that no page described. Add the field rows
and their validation to the create, edit and child-tag flows and the
detail row to view-tags; explain in the concept what happens when an
expiring tag is applied and when it expires (Care removes it; an hourly
check plus removal on display); document expiry_metadata,
TagConfigExpiryMetadata, ExpiryOffset and TagDeleteRequest in the
reference. Setting expiry needs the same permission as creating or
updating a tag.

Sources: care_fe TagConfigForm.tsx:126-166,288-303,554-626,
TagExpiryOffsetInput.tsx, tagExpiry.ts:15-58, TagExpiryStep.tsx,
TagConfigView.tsx:131-143; care config_spec.py:90-124,
tagging/base.py:92-198,263-289, tasks/__init__.py:27-31,
models/tag_config.py:53,101-125. Pinned care ddfd840, care_fe 5e02f9a.

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

The page said departments hang beneath the facility's root and that a
permission granted high in the tree reaches every unit under it. In 3.1
no unit can be created under the root organization, Administration
(facility_organization.py:76-79), so departments are top-level units
beside it. A role in Administration therefore never reaches a department
through the tree; some checks add Administration on their own (every
encounter's organization list, encounter.py:41-56; managing departments
and their members, facilityorganization.py:64-99,144-179) and others do
not (department workspaces, workspace.py:29-44). Pinned care ddfd840,
care_fe 5e02f9a.

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: 2645812
Status: ✅  Deploy successful!
Preview URL: https://c1f2c1f3.coredocs.pages.dev
Branch Preview URL: https://docs-pr-fixer-leftovers-9a2a.coredocs.pages.dev

View logs

The facility model and specs carry an extensions JSON field that the
reference left out. The model stores it (care facility/models/facility.py:203);
FacilityBareMinimumSpec binds it to ExtensionResource.facility
(facility/spec.py:40); FacilityCreateSpec takes it on create and update
through ExtensionValidator (spec.py:131; viewsets/facility.py:81, no update
spec), FacilityReadSpec and FacilityRetrieveSpec return it through the list
and retrieve renderers (spec.py:176, 199-200), and FacilityMinimalReadSpec
does not (spec.py:301). Validation, the core env schema and the per-key
rendering follow emr/extensions/validator.py:6-70 and extensions/base.py:62-123;
de_serialize dumps with exclude_defaults (resources/base.py:92), so an update
without extensions keeps the stored value. test_facility_api.py:128-137
round-trips {"core": {...}}. The 3.1 frontend has no facility extension
screen: ExtensionEntityType has no facility (care_fe
types/extensions/extensions.ts:14-22) and no facility screen reads or sends
extensions. Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billjohnc and others added 4 commits November 29, 2026 11:12
The resource request model and specs carry an extensions JSON field that
the reference left out. The model stores it (care
emr/models/resource_request.py:55); ResourceRequestBaseSpec binds it to
ExtensionResource.resource_request (resource_request/spec.py:45);
ResourceRequestCreateSpec takes it on create and update through
ExtensionValidator (spec.py:65; viewsets/resource_request.py:40, no update
spec). Validation and the core env schema follow
emr/extensions/validator.py:6-34 and extensions/base.py:62-123, and
de_serialize dumps with exclude_defaults (resources/base.py:92), so an
update without extensions keeps the stored value.

Unlike the facility, the list and retrieve specs override
perform_extra_serialization without calling super() (spec.py:116-126,
139-160), so ExtensionListRenderer and ExtensionRetrieveRenderer never run
and serialize returns the stored dict as is (resources/base.py:51-59). The
3.1 frontend has no resource request extension screen: ExtensionEntityType
has no resource_request (care_fe types/extensions/extensions.ts:14-22) and
no resource request file reads or sends extensions. Pinned care ddfd840,
care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The facility role picker offers Pharmacist, Volunteer, Facility Admin,
Administrator, Nurse, Staff and Doctor; the role named Admin is for
role organizations only (GET /api/v1/role/?context=FACILITY on the
care ddfd840 stack).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recording the tag flows showed four places where the pages and the 3.1
screens disagree:

- In facility settings the organization field of the tag form is labelled
  "Facility Organisation" (placeholder "Select Department"), not Managing
  Organization; the detail page calls it Managing Organization (care_fe
  TagConfigForm.tsx:629-655, TagConfigView.tsx:268). The note about the
  Admin area is dropped: that screen is for superusers only.
- The form has an optional Color field: Assign Color picks a color,
  Shuffle Color another, with a badge preview; the color tints the tag's
  badge on records (TagConfigForm.tsx:492-552, 296; tagColor.ts:8-26).
- The save buttons are "Create tag config" and "Update tag config"
  (TagConfigForm.tsx:724-725).
- The facility tag list asks for facility_only=true, so instance-wide
  tags are not listed (TagConfigList.tsx:52; care
  viewsets/tag_config.py:97-102). The detail page has a System generated
  row and labels Children "Has children", shown for root tags only
  (TagConfigView.tsx:242-256).

Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each of the four tag flows (create a tag, create a child tag, view tags,
edit a tag) gets a narrated video under its Overview, with subtitles, and
step screenshots with descriptive alt text: 4 videos, 23 screenshots. The
tag concept gets a screenshot of the expiry step staff see when they add a
tag that allows changing expiry, and the facility organization concept a
screenshot of the Departments/Teams page with Administration at the same
level as the other units.

Recorded on a local Care stack at care ddfd840 / care_fe 5e02f9a with
invented data, as Rohan Kapoor (Facility Admin) and, for the expiry step,
Anita George (Nurse); never as a superuser. The narration is AI-generated
with ElevenLabs (eleven_v4), voices Gauri-eng and Bill-eng (cloned for the
Care team) taking turns in sidebar order; where a line is longer than its
step, the video holds a settled frame and the subtitles are timed to
match.

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.

1 participant