Skip to content

[docs] Purchase Delivery flows for 3.1 - #122

Draft
billjohnc wants to merge 7 commits into
mainfrom
docs/supply-purchase-delivery-flows-8c26
Draft

billjohnc wants to merge 7 commits into
mainfrom
docs/supply-purchase-delivery-flows-8c26

Conversation

@billjohnc

Copy link
Copy Markdown
Contributor

What this changes (docs version 3.1 only)

The four Supply > Purchase Delivery flow pages, rewritten in place. Files, URLs, titles and sidebar entries are unchanged; #115 links to three of them.

  • create-purchase-delivery.mdx, Create a purchase delivery:
    • The real path is Services > the store's service > the store location > Inventory > External Supply > Purchase Deliveries > Create Delivery.
    • The form has Name, Vendor/Distributor, Note and Tags. There is no Destination field: Care uses the current location.
    • Includes the variant that starts from a Pending purchase order.
  • add-items-purchase-delivery.mdx, Add delivered items to a purchase delivery:
    • Steps are Add Item > Product Knowledge > batch (existing batch, or Create batch, linking to "Add a product") > Pack Qty > Save Changes.
    • Removed the old Condition step. That field is not in the add panel; condition is chosen when you receive.
    • Notes cover Load from order, Product or Device, editing or cancelling a saved item, and the 100-item limit.
  • receive-purchase-delivery.mdx, Receive and complete a purchase delivery:
    • Steps are Mark as Approved (Pending) > tick the items that arrived > Receive & Update Stock (Completed or Abandoned, Normal or Damaged) > Mark as Completed.
    • Stock rises at the receive step; completing the delivery adds none.
    • Removed the old medication-return / refund note: patient orders never appear in Purchase Deliveries.
  • view-purchase-delivery.mdx, View a purchase delivery:
    • Covers the Created and Completed tabs, the details card, the items table (cancelled items hidden behind Show cancelled items (N)), and Print, which opens the printable delivery order.
  • Media: a narrated video with subtitles for each page, plus step screenshots (static/media/supply/purchase-delivery/).

Verified against

  • care ddfd840 and care_fe 5e02f9a (develop; same pins as [docs] Product concept for 3.1 #114 and [docs] Product flows for 3.1: Add a product, Edit a product #115).
  • From code: 88 backend facts and 78 frontend facts, plus the receive-form facts verified for [docs] Product flows for 3.1: Add a product, Edit a product #115 at the same commits. Each fact has its file, lines and quote.
  • At runtime: all four flows were recorded on a local stack at those commits (production build of care_fe 5e02f9a), as a Facility Admin in Administration. No call returned 403. The results were read back through the API:
    • Create: the new delivery is Draft, and its destination is the current store.
    • Add items: one item of an existing batch was saved In Progress / Normal with quantity 100, and no new product was created.
    • Receive: both items are Completed / Normal, and the store's stock rose by the received quantities before Mark as Completed.
    • View: Print renders the delivery order.

Differences from the house style, on purpose

  • Language: STE rules for steps, prerequisites and tables; plain English for the Overview.
  • Versions: 3.1 only (verified against develop). 3.0 was not touched.
  • Permissions: each table lists the whole path to the action, not only the final permission:
    • Can Read Healthcare Service for the Services page.
    • Can List Facility Locations and Can Read Supply Delivery in the store's departments.
    • The action permission, where it must be held, and the default roles.
    • The default role named "Admin" is left out, because facility role pickers do not offer it.
  • Media markup: a <track> for subtitles and step screenshots, as in [docs] Definitions & Terminology for 3.1 #112 and [docs] Product flows for 3.1: Add a product, Edit a product #115.
  • Narration: the voice reads a short script per step: the step plus a sentence of context from the page. The subtitles show what it says. The voices are AI-generated with ElevenLabs (eleven_v4) from cloned voices: Bill reads Create and Receive, Gauri reads Add delivered items and View, alternating in sidebar order. Where a line runs longer than its step, the video holds a settled frame and the subtitles are timed to match.

Left out, or not settled

  • Purchase order with tags: when you start from a purchase order, the form also sends the order's tags, which belong to another resource type. The backend refuses tags of another type, so this probably fails; not run. The page no longer says that tags are filled in.
  • Opening a purchase order (for Create Delivery Order) and the requested-items read behind Load from order are not traced to a permission. Only the purchase order list is: Can Read Supply Request in the store's departments.
  • Can Read Charge Item Definition is not listed on "Add delivered items". The backend path mentions it, but neither this recording nor the new-batch recording for [docs] Product flows for 3.1: Add a product, Edit a product #115 made that call.
  • What Item Type Device changes in the backend.

Suspected product issues (recorded, not filed)

  • care_fe: the Actions menu offers Mark as Draft on a Completed delivery, but the backend refuses it ("Completed delivery order can only be cancelled").
  • care_fe + care: Edit Order lets you change Vendor/Distributor, but the update ignores the supplier, so the change is dropped while Care reports success.
  • care_fe: the batch list offers "Create batch: " even for an existing batch number. Choosing it creates a second product with the same lot number. The page now warns against it.
  • care_fe: View Stock Request on a delivery loaded from a purchase order links to the internal stock-request page.
  • care_fe: at the receiving store, the saved items table heads its columns "Dispatched Qty" / "Dispatched Date".
  • care_fe: the Medication Return list sends patient_isnull=false without patient_return=true, so it is likely always empty (outside these pages).
  • care (API only): an item can be created as Completed (adding stock with no receive step), condition and price stay editable after completion, and an empty order can be completed.

🤖 Generated with Claude Code

…nd complete, view

Verified against care ddfd840 and care_fe 5e02f9a and recorded on a local
stack at those commits. Narrated videos and step screenshots.

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: 780edd8
Status: ✅  Deploy successful!
Preview URL: https://a9cd24f1.coredocs.pages.dev
Branch Preview URL: https://docs-supply-purchase-deliver.coredocs.pages.dev

View logs

billjohnc and others added 6 commits November 29, 2026 00:34
…letion

Main's supply concepts and the supply delivery receive flow said stock
moves when the delivery is completed. In 3.1 the destination's stock rises
when each item is marked Completed with Receive & Update Stock, and for an
internal transfer the source's stock drops as soon as the item is added
(items are created In Progress). Completing the delivery changes no stock
and needs every item completed, abandoned or entered in error.

Evidence: care sync_inventory_item.py:38-71, supply_delivery.py:129-134,
162-165, delivery_order.py:182-196, cancel_delivery_order.py:19-58;
care_fe DeliveryOrderShow.tsx:319-341, 388-395, 771-788, 932-1048.
Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main said purchase orders and supply requests have no approve or complete
button and that the status is changed in the edit form. In 3.1 the edit
form has no Status field. Mark as Approved (shown below the items of a
Draft order, disabled until it has an item) sets the order to Pending, and
the requesting location's menu has Mark as Completed (Pending only), Mark
as Draft, Mark as Abandoned and Mark as entered in error. The status flows
now walk through these controls; the concepts say the same.

Evidence: care_fe requestOrder/AddItemsForm.tsx:87-88, 260-311;
RequestOrderShow.tsx:94-128, 192-293, 505-515; RequestOrderForm.tsx:250-296
(no status field); en.json mark_as_approved, mark_as_completed,
mark_as_draft, mark_as_abandoned, mark_as_entered_in_error, save_list,
order_updated_successfully. care request_order.py:135-140.
Pinned care ddfd840, care_fe 5e02f9a.

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

Once a request order is Abandoned or Entered in Error, the server refuses
any further status change ("Request order already abandoned or entered in
error"), although the requesting location's menu still shows for an
Abandoned order. Abandoning sets every requested item to Cancelled; entered
in error sets them to Entered in Error. Added to both status flows and to
the supply request reference, whose save-behaviour line said only the spec
enums enforce the lifecycle.

Evidence: care care/emr/api/viewsets/inventory/request_order.py:102-124;
care_fe RequestOrderShow.tsx:221-223, 482-497.
Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The delivery page shows Edit Order while the delivery is Draft, and 122
mentioned it only in notes. The new step 5 of Create a purchase delivery
covers it: the Edit Delivery page offers Name, Vendor/Distributor and Note
(no Tags), saves only the name and the note (the update spec has no
supplier), and shows Order updated successfully. Edit Order is disabled
while item rows are unsaved. The view page note now points to it.

Evidence: care_fe DeliveryOrderShow.tsx:506-519; DeliveryOrderForm.tsx:
129-139, 182-225; DeliveryOrderFormContent.tsx:90-196;
DeliveryOrderRoutingField.tsx:80-104; routes/...external.deliveries.$tab.
$id.edit.tsx; en.json edit_order, edit_delivery, order_updated.
care delivery_order.py (viewset) :71, :133-147; resources delivery_order.py
:44-51 (update spec: status, name, note).
Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The facility role picker never offers Admin: the role sync keeps one role
named Admin, for role organizations, and facility pickers list only roles
with the facility context. Removed it from the role columns of the five
supply concepts and from the role sentences of view-stock-levels,
update-purchase-order-status, update-supply-request-status and
receive-supply-delivery. No other role changed; each list matches its
permission definition without ADMIN_ROLE. Each concept now says why.

Evidence: care sync_permissions_roles.py:37-45, security/roles/role.py:57-67,
81-93, api/viewsets/roles.py:10-20; care_fe RoleSelect.tsx:125-140;
permissions/supply_delivery.py:17-43, supply_request.py:17-37,
inventory_item.py:17-31. Pinned care ddfd840, care_fe 5e02f9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The delivery order print adds the purchase delivery's filled extension
fields to the details block at the top, with their labels, after Deliver
To / Origin / Supplier and Date / Status; empty ones are left out (care_fe
PrintDeliveryOrder.tsx:89-101, orderPrintData.ts:48-53; added in care_fe
78e6c006f). Pinned care ddfd840, care_fe 5e02f9a.

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