Skip to content

Add Facility flow docs for 3.1 - #48

Open
aravindm4 wants to merge 2 commits into
mainfrom
docs/facility-flows
Open

Add Facility flow docs for 3.1#48
aravindm4 wants to merge 2 commits into
mainfrom
docs/facility-flows

Conversation

@aravindm4

Copy link
Copy Markdown
Member

What

Publishes the Facility / Facility documentation from care_docs into the docs site (version 3.1).

  • Adds four Facility flows under flows/facility/:
    1. Create a facility
    2. View a facility
    3. Update facility details
    4. Delete a facility
  • Replaces the 3.1 Facility concept with the authored version.
  • Adds a Facility category to the 3.1 flows sidebar, alongside Clinical.

Flows sit flat under flows/facility/ rather than flows/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-concepts work) had What it represents, Lifecycle, How it connects and 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 build passes for both en and ml locales.

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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploying coredocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 00b8895
Status: ✅  Deploy successful!
Preview URL: https://ba9cdb89.coredocs.pages.dev
Branch Preview URL: https://docs-facility-flows.coredocs.pages.dev

View logs

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

{/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Mirroring. Everything lands in version-3.1 only. The shared conventions keep version-3.0 and version-3.1 byte-identical. Missing: versioned_docs/version-3.0/flows/facility/* (four flows plus _category_.json), the 3.0 facility concept rewrite, and the Facility category in versioned_sidebars/version-3.0-sidebars.json.
  2. Soft delete stated as permanent. delete-facility.mdx says the action is permanent and the records disappear. perform_destroy in care/emr/api/viewsets/base.py sets deleted = True; the records are kept for history and audit. This one is worth fixing before merge.
  3. Permission tables that are not permissions. The concept table lists five facility-organization permissions that FacilityViewSet never checks — it authorizes only can_create_facility and can_update_facility_obj. The delete flow lists "Super Admin" (an is_superuser check, not a permission) and the view flow lists queryset scoping.

Layer and structure

  1. The concept is now ## Definition + ## Key Attributes — a field table, which is reference-layer content. The concept skill asks for ## What it represents with the FHIR resource, categorised bullets and one clarifying insight. The replaced version had that plus Lifecycle and How it connects; the PR description flags this, and I agree material was lost. The ## Related block also dropped its reference and concept links.
  2. ~58 lines of {/* ... */} commented-out content sit in the middle of the concept file. Restore or delete.
  3. All four flows use ## Overview / ## Pre-requisites / ## Permissions / ## Expected Outcome instead of the skill's :::info Prerequisite / ## Before you start / ## Steps / ## After ..., and | Components | What it captures | instead of | Field | Notes |.
  4. view-facility.mdx bundles 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_fe public/locale/en.json. I confirmed Delete Facility and the Delete <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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
*/}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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