PIES Studio 1.9 · Use case · Design note

Ward Assets: designing a hospital equipment and consumables system with door readers, smart bins and PIES Studio

A design study with a working prototype. This is the full technical companion to the video: how passive RFID behaves on a ward, how to set up a door reader and build a smart bin, how the hardware connects to a PIES application through two events, what the platform produced from a description, what still needed an engineer, and what we did not solve. It is a design, not a production system. PIES stands behind it: if you want it built for your hospital, or a system like it for your site, write to info@pies.io or use pies.io/contact.

The videoThe problemDoor readersSetting up a door readerSmart binsBuilding the binConnecting to PIES StudioWhat the platform builtThe prototype runningThe assistantWhere the AI runsWhat we did not solveSources

The video

The plain-language version, about eight minutes. Everything it says in a sentence is explained below with the numbers.

The problem is a sensing problem

A cardiac arrest on a ward, and the defibrillator is not on its hook: someone borrowed it, and nobody knows which room it went to. That is the extreme case of an everyday problem. A nurse hunting for equipment is a nurse who is not at a bedside, and published estimates put that hunting at somewhere between twenty minutes and an hour per shift (see sources; most of those figures come from vendors, so treat them as indicative). Consumables fail the other way: a dressing drawer is empty because somebody was supposed to count it and did not have time.

Any system that asks clinicians to scan, count or type a location fails, because the people it asks are the busiest people in the building. So the design rule is: ask as little as possible of the clinician, and sense where people already pass. That means two places: doorways for equipment and disposal bins for consumables.

Decision one: read at the doors, not in the rooms

A doorway with one antenna each side; the order in which the two antennas see the tag gives the direction
A door portal. Two antennas, one each side of the frame. Seen outside first, then inside, is "in"; the reverse is "out".

How the tag works. Equipment and packs carry passive UHF RFID tags (RAIN RFID, EPC Gen2, 860–960 MHz). A passive tag has no battery: it harvests energy from the reader's field and reflects its identity back. Read range is a few metres in open air and collapses near metal and water, which is exactly what a ward is made of: steel trolleys and pumps, saline bags, people. Equipment therefore gets an on-metal tag with a foam or ferrite spacer under the antenna; packs get an ordinary label tag.

Who applies the tags. The stores team, once, when an item is received and logged into the hospital. Equipment is registered against its tag identity at goods-in; so is each delivery of consumables. Supplier-applied tags are an optimisation for later, not the design.

Why doors. A room-wide reader tells you a pump is "somewhere on 7B", with constant noise. A door reader tells you it entered 7B at 06:48 and has not left. Zone-level truth beats bed-level guesses, and a doorway has fixed geometry you can tune once. Budget four to eight portals per floor; lifts and stairwells need their own.

The event. One pass produces dozens of reads. The reader, or the small gateway beside it, collapses them into a single record: tag, reader, direction, time. Current location is simply the latest event; the history is the audit trail.

Setting up a door reader: the installer's checklist

Schematic of a door reader installation with five numbered steps
Reader, two antennas, tuning, gateway, and a row in the application.
StepWhatDetail
1Fixed UHF readerTwo of its four antenna ports serve one doorway, so one reader covers two doors. Regional band: 865–868 MHz in Australia and Europe, 902–928 MHz in the United States. Check the band before ordering antennas.
2Two circularly polarised antennasOne each side of the frame, 1.5–2 m high, angled across the opening. Circular polarisation means tag orientation stops mattering.
3Tune on siteStart around 25 dBm and turn the power down until the corridor outside stops reading. Set an RSSI floor to drop weak reads. Use session 2 with the inventoried flag so a pump parked by the door is reported once, not all night. Allow about a day per ward for this; metal doors and lift shafts bend the field in ways no diagram predicts.
4GatewayA small box beside the reader (a Raspberry Pi class device is enough) speaks LLRP to the reader (TCP 5084 on common fixed readers), decides direction from which antenna saw the tag first, keeps one event per tag for 5–10 s, queues events if the network drops, and posts HTTPS to the application.
5Register the doorA row in the application's readers table: reader code, zone, which side is inside. The gateway only ever sends the reader code; the application resolves the zone.

Decision two: the smart bin is a disposal bin

A shielded bin with an antenna in the base posting one event per pack; stock equals delivered minus consumed
The one reliable moment to count a consumable is when it is used up, because the empty pack goes in the bin anyway.

Put the reader in the bin, not on the shelf. The bin is shielded so it only sees what falls into it, and each tagged pack is logged once. Stock position is then delivered minus consumed, per bin, per item, with reorder and critical thresholds on the position. Nobody counts a shelf. Reusable items can pass through the same bin on the way to sterilisation, which gives a last-seen for recalls. This pattern is documented in patents and sold commercially for theatre sponges and consumables (see sources).

Building the smart bin

Schematic of the smart bin build with five numbered steps
Metal liner, reader module under the base, count-once rule, posting with a key, tagging at goods-in.
StepWhatDetail
1Shielded binA normal clinical bin with a metal liner, or a steel bin. The shield is the design: the antenna must see inside the bin and nothing on the shelf beside it.
2Reader moduleA small UHF reader module with a near-field antenna under the base plate, at 10–15 dBm for a 20–30 cm read zone. Module and antenna cost tens of dollars, not thousands.
3Count onceA new tag identity (EPC) is one event. The same EPC seen again within the hour is ignored. An empty-bin reset happens when the bag is collected.
4PostBin code and pack tag go to the application over Wi-Fi, using the same gateway code as the doors and an API key issued for the bin. Hold events locally if the network drops.
5Tag at goods-inA label tag per pack when the delivery is logged, linked to the consumable code and the bin. Not a ward job.
A disposal bin counts packs, not partial use. If half-used packs matter for an item, that item needs a different sensor or a manual count.

Connecting the hardware to PIES Studio

Schematic of the integration: tables, two functions as endpoints, an API key per gateway, a test message, and the application doing the rest
The whole integration surface is two events.
  1. Everything is data. Readers, zones, assets, bins, consumables and the two event tables (movement_events, consumption_events) are tables in the application. Adding a door is adding a row.
  2. Two functions are the integration. record_movement(asset_tag, reader_code) looks up the reader's zone, writes the movement row and updates the asset's current zone. record_consumption(bin_code, pack_tag) decrements the position and sets its status. Every function in a PIES application is also an HTTP endpoint: POST /api/record_movement and POST /api/record_consumption, JSON in, JSON out.
  3. One API key per gateway. Keys are issued from the application's Admin page, sent in the X-API-Key header and scoped to a role, so a gateway can post events and nothing else. The deployed application publishes its own OpenAPI document for the installer.
  4. Test before mounting an antenna.
curl -X POST https://<your-app>/api/record_movement \ -H "X-API-Key: <gateway key>" -H "Content-Type: application/json" \ -d '{"asset_tag":"IP-0231","reader_code":"RD-ED1"}' curl -X POST https://<your-app>/api/record_consumption \ -H "X-API-Key: <bin key>" -H "Content-Type: application/json" \ -d '{"bin_code":"BIN-W7-DRE","pack_tag":"PK-DRE-0412"}'

From there the application does the rest: zone resolution, thresholds, exceptions, the agents and the assistant. The hardware only ever sends two kinds of event.

What the platform built from a description

The description being typed into PIES AI
The build started from one paragraph describing the hospital: zones, door readers, equipment with tags, smart bins with a reader in the base.

The build ran on a frontier model and produced the data model (sixteen tables, references by code), the screens, the dashboard and the two endpoints. Where a function needed correcting, the correction was one more sentence in the same chat. To be precise about the limits: the threshold logic and the timestamp handling in the functions took an engineer's attention; everything that reads and displays data came straight out of the description. The defects we hit on the way were filed against the platform and are being fixed.

The prototype running

For this study the prototype is deployed on a server PIES operates. A hospital would deploy the same build on its own infrastructure; nothing in the design depends on where it runs.
Ward Assets dashboard: assets present by zone and recent movements
The dashboard after four pumps pass the Emergency door reader: the Emergency bar grows, the movements table shows the reads.
Find equipment: pump IP-0231 with its current zone and last seen time
Find: pump IP-0231, its current zone and when it was last seen.
Asset detail with the movement timeline
Asset detail: the movement timeline is the audit.
Smart bins: delivered, consumed, on hand, position status
Bins after six used dressing packs are dropped in: the position falls and the status changes.
Reorders raised by the bins
Reorders: raised by the bins, approved by people or by policy.

The shortest path is not a screen

The in-app assistant answering: pump IP-0231 is right now in W7B
Every PIES application ships with an assistant that knows the application's own data. A nurse asks where the pump is and gets the zone.

The assistant's questions follow the same policy as the agents, so they go to PIES Private AI. In the prototype the answer arrived in about thirty seconds and still carried some of the model's working; both are logged as defects against the assistant, not the design.

Where the AI runs is a design decision too

The governance policy for the application
One policy for this application: builds go to the frontier model; the running application, its agents and its assistant go to PIES Private AI.
The call log showing both routes
The call log shows both routes side by side. The boundary is a policy anyone can read, not a promise.
The replenishment agent asking for approval before updating a reorder request
The replenishment agent reads low positions, lead times and a week of consumption, and asks before it acts on the application. Supervised first, autonomous when trusted. Every call is audited with the route it took.

What we did not solve

Sources and further reading

Written for engineers, biomedical teams and operations managers who have to decide whether to build this. The prototype, agents and policy are real; the hospital, its data and its readers are not. PIES stands behind the design: info@pies.io · pies.io/contact.