MedicalTrace

How it works

The DEMO-BED-001 path from registration through hospital receipt.

One device has one passport. Organizations take turns writing to it. Each write keeps the name of the organization that made it. The seven steps below are the explanation order. A real device can join mid-life, when it already exists.

The fictional path for DEMO-BED-001:

  1. Demo Manufacturer registers the bed.
  2. Demo Manufacturer attaches model documentation.
  3. Custody moves to Demo Lab. Demo Lab signs a scoped inspection.
  4. Custody moves to Demo Supply Co.
  5. Demo Supply Co. hands the bed to Demo Hospital, and the hospital accepts.
  6. Demo Biomed Services records annual service while the hospital holds the bed.
  7. A reader checks findings one at a time.

Custody is who holds the device in the recorded chain. Accepting custody does not transfer legal title.

01 — Register identity

An approved organization submits category, model, and serial. The API creates the equipment row, an audit event, and a passport id together. On registration, that organization is both manufacturerId and custodianId.

Demo Manufacturer registers category hospital_bed, model DemoBed 100, serial SN-DEMO-001. The passport id in these docs is ppt_demo_bed_001. A local database issues its own ids.

A QR code only links to the passport. It does not prove the label is attached to the physical bed. Receiving inspection still matters.

02 — Attach evidence

Model sheets and supporting files are stored as document versions. Each version has its own digest. An upload is evidence a reviewer may inspect. Upload alone does not create a credential.

In the demo API, new documents are stored with access policy RESTRICTED. The public passport does not return the file.

03 — Sign an assertion

Only the current custodian can hand the device to the lab. Demo Manufacturer requests a transfer to Demo Lab. Demo Lab accepts with its own member token. Until that acceptance, Demo Lab cannot read the private equipment row.

Demo Lab may sign a claim only when both of these are true:

  • The member has credential:issue.
  • The organization holds an issuer grant for that claim type.

Declaring the capability “issuer” on the organization does not create the grant. In the sample seed, Demo Lab’s grant is electrical_safety_inspection. A safety inspection and a maintenance note are different assertion types.

The lab signs a specific document version and a validity window. Revoking or replacing that assertion adds a new status event. It does not rewrite the signed envelope.

04 — Record service

A service organization authorized for that asset submits an event type, the date the work is said to have occurred, a summary, and evidence references. Demo Biomed Services can record annual service on DEMO-BED-001. That event stays a lifecycle event. It is not displayed as a certificate, and it does not move custody.

05 — Confirm custody

Only the current custodian can request the next transfer. The named receiver accepts, rejects, or lets the request expire. Rejection, cancellation, and expiry leave custody where it was. Two acceptances of conflicting transfers cannot both succeed. The equipment row carries a custodyVersion so a stale request loses.

After Demo Lab finishes the inspection, it transfers to Demo Supply Co. The supplier later transfers to Demo Hospital. The hospital must accept with a hospital member token. The sample custody page shows that accept/reject call.

06 — Anchor a commitment

Selected records enqueue an integrity commitment. The demo stores that job on blockchain_outbox: a payload hash, a small payload, and later a transaction hash if a worker submits it. The PDF stays off the chain, in file storage.

A handover can be accepted in the application while the chain confirmation is still pending. The interface should say so. Anchoring does not make the lab’s claim true. Hospitals are not asked to run a blockchain node, hold a token, or pay an on-chain fee for an ordinary read.

07 — Read findings

The reader inspects issuer, authority, signature, document match, validity, credential status, and anchoring separately. Unknown stays unknown.

Who can still open the private row

There is one equipment row, not a copy in each organization.

After this stepPrivate equipment read
Manufacturer registers itDemo Manufacturer
Lab accepts custodyDemo Manufacturer and Demo Lab
Supplier accepts custodyDemo Manufacturer and Demo Supply Co.
Hospital accepts custodyDemo Manufacturer and Demo Hospital

manufacturerId stays on the registering organization, so Demo Manufacturer can still read the private row after every handover. custodianId moves. A previous holder that is no longer custodian receives 404 for that equipment id, the same response as a missing id. Anyone who has the passport id can still open the public passport, which omits restricted files and the custody party ids.

The API calls for this path are on Demo samples.

On this page