Add Facility flow docs for 3.1 - #48
Conversation
Publish the Facility concept and four flows from the care_docs sources: create, view, update and delete a facility. Flows sit flat under flows/facility since the domain has a single module. Adds a Facility category to the 3.1 flows sidebar.
Deploying coredocs with
|
| Latest commit: |
00b8895
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ba9cdb89.coredocs.pages.dev |
| Branch Preview URL: | https://docs-facility-flows.coredocs.pages.dev |
There was a problem hiding this comment.
Generated by Docs Reviewer for #48 · opus50 · 108.5 AIC · ⌖ 2.4 AIC · ⊞ 10.5K
| - **Billing** — discounts, taxes, and invoice numbering are set per facility (see [Facility config](../../references/facility/facility-config.mdx)) | ||
| ## Definition | ||
|
|
||
| A **facility** in Care is a hospital, clinic, health center, or other place that provides care to patients. . The facility is the top-level unit that holds departments, users, patients, and encounters. |
There was a problem hiding this comment.
Two issues on this line. There is a stray double period: to patients. . The facility. Also, per the concept skill the page opens with the H1 followed directly by a 1–2 sentence definition and then ## What it represents — a ## Definition heading is not part of the structure. Suggested: delete the ## Definition heading and fix to ...that provides care to patients. The facility is the top-level unit....
| | Make this facility public | Whether the facility appears in the public facility directory. This is optional. | | ||
| | Cover Photo | An image that Care shows on the page of the facility. This is optional. | | ||
|
|
||
| {/* |
There was a problem hiding this comment.
This large {/* ... */} block (lines 28–86) is commented-out content shipped into the published page. Per the conventions, pages carry no leftover placeholders or template comments. Either restore Facility Type / Features / Geo Organization as real sections, or delete the block.
| | Latitude | The map coordinate of the facility from north to south. This is optional. | | ||
| | Longitude | The map coordinate of the facility from west to east. This is optional. | | ||
| | Make this facility public | Whether the facility appears in the public facility directory. This is optional. | | ||
| | Cover Photo | An image that Care shows on the page of the facility. This is optional. | |
There was a problem hiding this comment.
## Key Attributes is a field table — that is reference-layer content (references/facility/facility.mdx), not a concept. The concept skill asks for ## What it represents with categorised bullets plus one clarifying insight, not a field-by-field required/optional table. Suggest replacing this table with prose and linking the reference for the field detail.
| | Can Manage Facility Organizations | Rename or edit the departments or teams of a facility. | | ||
| | Can Delete Facility Organizations | Delete the departments or teams of a facility. | | ||
| | Can List Users in a Facility Organizations | See the users in a department of a facility. | | ||
| | Can Manage Users in a Facility Organization | Add a user to a department of a facility, remove a user from it, or change the role of a user in it. | |
There was a problem hiding this comment.
Five of these seven rows are facility-organization permissions, not facility permissions. care/security/permissions/facility.py defines only can_create_facility, can_read_facility and can_update_facility. The org rows belong in the Facility organization concept; Can Read on Facility is missing here. The table also drops the System Roles column the concept skill requires.
| - Flow: [Create a facility](../../flows/facility/create-facility.mdx) | ||
| - Flow: [View a facility](../../flows/facility/view-facility.mdx) | ||
| - Flow: [Update facility details](../../flows/facility/update-facility-details.mdx) | ||
| - Flow: [Delete a facility](../../flows/facility/delete-facility.mdx) |
There was a problem hiding this comment.
The Related block lost every link the previous version carried: the technical reference (../../references/facility/facility.mdx), Facility config, and the Organization concept. The concept skill requires the matching reference link plus 2–4 related concepts; flows alone are not enough.
| Note: Only a system administrator can delete a facility. Deletion does not use one of the permissions above. | ||
|
|
||
| Permissions cascade down the organization tree: a role held at a parent organization applies to the facilities and sub-organizations beneath it. | ||
| Note: When you create a facility, Care creates a default Administration department for it. Care also adds you to that department as its Facility Admin. |
There was a problem hiding this comment.
The Lifecycle and How it connects sections were removed with no replacement, so the page no longer explains that a facility is the outer container versus locations and facility organizations, or that deletion is a soft delete. EMRModelViewSet.perform_destroy in ohcnetwork/care sets deleted = True, so line 100 plus "The action is permanent" in the delete flow both overstate what happens. Please restore a short lifecycle/connections section and say deletion hides the facility rather than erasing it.
# Conflicts: # versioned_sidebars/version-3.1-sidebars.json
There was a problem hiding this comment.
Care docs review — Facility flows (3.1)
Four new facility flows and a rewritten facility concept. The flows are readable, the steps track the real UI, and the sidebar entry is correct — versioned_sidebars/version-3.1-sidebars.json lists all four doc ids under a Facility category, which is the thing most easily missed. Relative links all resolve to files that exist after this PR, no MDX hazards ({#...}, bare braces) and no agent-leakage corruption.
The substantive concerns are below.
Blocking-ish
- Mirroring. Everything lands in
version-3.1only. The shared conventions keepversion-3.0andversion-3.1byte-identical. Missing:versioned_docs/version-3.0/flows/facility/*(four flows plus_category_.json), the 3.0 facility concept rewrite, and theFacilitycategory inversioned_sidebars/version-3.0-sidebars.json. - Soft delete stated as permanent.
delete-facility.mdxsays the action is permanent and the records disappear.perform_destroyincare/emr/api/viewsets/base.pysetsdeleted = True; the records are kept for history and audit. This one is worth fixing before merge. - Permission tables that are not permissions. The concept table lists five facility-organization permissions that
FacilityViewSetnever checks — it authorizes onlycan_create_facilityandcan_update_facility_obj. The delete flow lists "Super Admin" (anis_superusercheck, not a permission) and the view flow lists queryset scoping.
Layer and structure
- The concept is now
## Definition+## Key Attributes— a field table, which is reference-layer content. The concept skill asks for## What it representswith the FHIR resource, categorised bullets and one clarifying insight. The replaced version had that plusLifecycleandHow it connects; the PR description flags this, and I agree material was lost. The## Relatedblock also dropped its reference and concept links. - ~58 lines of
{/* ... */}commented-out content sit in the middle of the concept file. Restore or delete. - All four flows use
## Overview/## Pre-requisites/## Permissions/## Expected Outcomeinstead of the skill's:::info Prerequisite/## Before you start/## Steps/## After ..., and| Components | What it captures |instead of| Field | Notes |. view-facility.mdxbundles two journeys (public directory, signed-in view) into one numbered sequence.
Could not verify
- Whether Add Facility, Add New Facility, Create Facility, Edit Facility Details, Update Facility, Edit Cover Photo and Danger Zone exactly match
care_fepublic/locale/en.json. I confirmed Delete Facility and theDelete <name>confirmation string. Please spot-check the rest against the locale file. - Whether the Facility Type and Features lists in the commented block are current; if that block is restored, trace them to the backend enum.
Non-blocking overall — the shape is good and the flows are genuinely useful. The delete claim and the 3.0 mirror are the two I would fix first.> Generated by Docs Reviewer for #48 · opus50 · 147.6 AIC · ⌖ 4.89 AIC · ⊞ 10.5K
| - **Billing** — discounts, taxes, and invoice numbering are set per facility (see [Facility config](../../references/facility/facility-config.mdx)) | ||
| ## Definition | ||
|
|
||
| A **facility** in Care is a hospital, clinic, health center, or other place that provides care to patients. . The facility is the top-level unit that holds departments, users, patients, and encounters. |
There was a problem hiding this comment.
Two problems on this line. There is a stray double period: provides care to patients. . The facility. Also, the concept skill's structure is # <Title> followed directly by the 1–2 sentence definition, then ## What it represents — a ## Definition heading is not part of it. Suggested: delete the ## Definition heading and write A **facility** in Care is a hospital, clinic, health center, or other place that provides care to patients.
|
|
||
| ## Key Attributes | ||
|
|
||
| | Components | What it captures | |
There was a problem hiding this comment.
A ## Key Attributes field table is reference-layer content. The concept skill says a concept is "not a technical reference: do not dump fields, types, or API schemas (that is the reference layer's job)", and the required section here is ## What it represents — FHIR resource, categorised bullets, and one clarifying insight. Please move the field table to references/facility/facility.mdx and restore the conceptual sections.
| ### Make this facility public | ||
|
|
||
| Select **Make this facility public** to show the facility in the public facility directory. Anyone can browse the public facility directory without a sign-in. | ||
| */} |
There was a problem hiding this comment.
This whole block is commented out with {/* ... */} — a large block of dead content in a merged doc is a leftover, not a deliberate section. Either restore it as real content (as ## Types / ## Features conceptual sections) or delete it. Leaving ~58 commented lines in the file is a hard finding.
| | Can Manage Facility Organizations | Rename or edit the departments or teams of a facility. | | ||
| | Can Delete Facility Organizations | Delete the departments or teams of a facility. | | ||
| | Can List Users in a Facility Organizations | See the users in a department of a facility. | | ||
| | Can Manage Users in a Facility Organization | Add a user to a department of a facility, remove a user from it, or change the role of a user in it. | |
There was a problem hiding this comment.
This table lists five facility-organization permissions that FacilityViewSet never checks. Per the concept skill, document what the viewset actually authorizes: care/emr/api/viewsets/facility.py checks only can_create_facility (create) and can_update_facility_obj (update, cover image, monetary config, invoice expression). The organization permissions belong on the facility-organization concept. The dropped System Roles column should also come back — the skill requires | Permission | Description | System Roles |.
| - Flow: [Create a facility](../../flows/facility/create-facility.mdx) | ||
| - Flow: [View a facility](../../flows/facility/view-facility.mdx) | ||
| - Flow: [Update facility details](../../flows/facility/update-facility-details.mdx) | ||
| - Flow: [Delete a facility](../../flows/facility/delete-facility.mdx) |
There was a problem hiding this comment.
The ## Related block now links only flows. The concept skill requires the technical reference plus 2–4 closely-related concepts; the removed links to ../../references/facility/facility.mdx, ../../references/facility/facility-config.mdx and ../access-governance/organization.mdx should be restored alongside the new flow links.
|
|
||
| ### 3. Confirm the facility name | ||
|
|
||
| Care asks you to type the facility name to confirm. Type the word Delete, then a space, then the facility name. Type the text exactly. Confirm the action. |
There was a problem hiding this comment.
Describe the confirmation with the real string rather than in the abstract. src/components/Facility/FacilityDeleteDialog.tsx sets confirmationText = \Delete ${facility.name}`. Suggested: "Type Delete ` exactly, then select Delete Facility."
|
|
||
| | Permission | Access | | ||
| | --- | --- | | ||
| | Super Admin | Super admin access to the instance. | |
There was a problem hiding this comment.
"Super Admin" is not a permission — authorize_destroy in care/emr/api/viewsets/facility.py checks request.user.is_superuser directly, bypassing the permission system. A permission table with no permission in it is misleading. Suggested: drop the table and state in ## Before you start: "Only a super administrator of the instance can delete a facility. No role permission grants this."
| | Permission | Access | | ||
| | --- | --- | | ||
| | Facility membership | You can see a facility when you belong to that facility. | | ||
| | Shared Geo Organization | You can see a facility when you share its Geo Organization. | |
There was a problem hiding this comment.
These two rows are queryset scoping, not permissions. FacilityViewSet.get_queryset returns facilities you reach through a FacilityOrganizationUser membership or an overlapping geo_organization_cache; there is no read permission. Suggested: replace the table with one sentence in ## Before you start — "You see a facility when you belong to it, or when you belong to its geographic organization."
| ## Steps | ||
|
|
||
| Note: Steps 1 and 2 describe the public directory. Steps 3 to 5 describe the | ||
| signed-in view. |
There was a problem hiding this comment.
One flow is one task. This page mixes two different journeys — the public directory (no sign-in) and the signed-in organization view — and needs a note telling the reader which steps apply. Consider splitting into two flows, or restructuring the steps under two clear sub-tasks so no reader follows steps 1–5 in order.
| | Description | A short description of the facility. | | ||
| | Features | The services that the facility gives. | | ||
| | Phone Number | The contact number of the facility. | | ||
| | PIN Code | The postal code of the facility. | |
There was a problem hiding this comment.
Step 5 sends the reader back to a page they are already on and the wording is vague. Suggested, as a single instruction per sentence: "Go to Settings, then General. Select Edit Cover Photo. Upload the new image." Also, the flow skill uses | Field | Notes | for form-field tables; | Components | What it captures | is used across all four new flows and should be aligned.
What
Publishes the Facility / Facility documentation from
care_docsinto the docs site (version 3.1).flows/facility/:Facilitycategory to the 3.1 flows sidebar, alongsideClinical.Flows sit flat under
flows/facility/rather thanflows/facility/facility/, since the domain has a single module of the same name.Note for reviewers
The Facility concept page is replaced, not extended. The previous version (from the
care-3-conceptswork) hadWhat it represents,Lifecycle,How it connectsand a Related block linking to Facility config, Location, Device, Healthcare service and Organization. The authored version covers Definition, Key Attributes, Facility Type, Features, Geo Organization, Latitude and Longitude, visibility, Permissions and Related. Worth a look to confirm nothing needed is lost.Verification
npm run buildpasses for bothenandmllocales.