System Design Atlas

Laboratory samples with a complete chain of custody

04 / 10Worked example

Interfaces

The recipient belongs to the repeat contract. What conditions ensure the result?

A receipt can be confirmed even though the scanner does not see a response.

Starting point Test average load and scanning peaks separately.

Assumptions for the example case

Fictitious training laboratory with an aqueous control sample. The draft documents custody changes and results; diagnostic interpretation and clinical decisions are outside the case. All quantities, thresholds and operational objectives of this design are illustrative assumptions.

Receipt contract

Receipt contract

New keyVersion 2
identicalResult
Different recipientConflict

Check expectedVersion before applying an effect; an identical retry returns the receipt.

Three outputs for new keys, identical replay, changed receiver; version comparison before effect.

Proposed domain contracts

  1. POST/proben/P-40/empfang

    Confirm takeover.

    Input
    transferKey, previousCustodian, receiver, collectedAt, receivedAt, sealIntact, expectedVersion
    Result
    Receipt confirmed with new custodian version or domain rejection.
    Retry behaviour
    Identical transferKey and content return the stored receipt; changed recipient details under the same key cause a conflict.
  2. POST/ergebnisse/E-40/freigaben

    Release reviewed results.

    Input
    commandKey, specimen=P-40, procedureVersion, rawHash, expectedVersion, reviewer
    Result
    Released unchangeable state or conflict.
    Retry behaviour
    A retry references the same revision; changes require a new result revision.

The recipient is part of the retry contract.

The recipient is part of the retry contract.

The key and input hash identify the same receipt.

A receipt can be confirmed even though the scanner does not see a response.

The original receipt result is returned, without a new handover. Conflict; the confirmed custodian is preserved and a new domain handover is required.

Alternative considered
Replay with new receiver would hide a second handover.
Trade-off
Real corrections need their own process.
Reassess
Offline scanners require additional device safeguards.

Try it yourself

Formulate expected responses for identical receipt and modified receiver under the same transferKey.

A hint for your attempt

A receipt can be confirmed even though the scanner does not see a response.

Compare with a possible solution
Identical scan
The original receipt result is returned, without a new handover.
Altered recipient
Conflict; the confirmed custodian is preserved and a new domain handover is required.

Apply to your project

What is the equivalent of "The recipient belongs to the repeat contract." in your own project?

Step 5: Custody changes and results remain traceable. What conditions ensure the result?