Patient data
When samples come from people, some facts about them belong in the record: a collection date, a phenotype, sometimes a date of birth. Harmoniomics calls them patient data, or PHI. It encrypts each one under a key of that person’s own, shows it only when someone asks with a reason, and can make it unreadable everywhere by destroying one key.
This page applies to nodes that hold data about people. A node whose subjects are sampling sites, lab animals, microorganisms or cell lines marks no field as patient data, runs no key service, and has no one to erase; everything else in this section still applies to it.
Declared, never guessed
Your facet schemas say which fields hold patient data. A field marked that way is patient data; nothing else is, and the node never guesses from a field’s name or content.
A field marked as patient data is never indexed, never a search criterion, never counted and never sent to the hub. The node can store it and show it to the right person, and that is all.
Names, identity numbers and contact details belong in your LIMS or health record system, not in the node. Patient data in the node is meant for values such as collection dates and phenotypes, read when someone needs them.
From writing to reading
1 Written
by your LIMS
The schema marks date_of_birth as patient data.
2 Stored
in the log and every backup
{"$phi": 1,
"subject": "01a1…",
"ct": "vault:v1:9Hq…"}Encrypted under subject 01a1…’s own key, which only the key service holds.
3 Read
by anyone, anywhere
Lists, Explore, the chat, GraphQL, the relay: always withheld.
4 Revealed
by a phi_reader, with a reason
The audit record is written first. If it cannot be, nothing is shown.
- One key per person. When a value is written, the node follows the lineage upstream to the one subject the record comes from, and encrypts the value under that subject’s key. A value on a pool, a family or an actor, which belongs to several people or none, is refused.
- The keys live in a key service apart from the database: OpenBao, beside the node. The node never holds a key; it asks OpenBao to encrypt or decrypt, and its permission there covers exactly that.
- The ciphertext is bound to its place. A value copied into another record does not decrypt there.
- If the key service is down, a write carrying patient data is refused and nothing is written. Every other write goes on.
- A node whose schemas mark nothing as patient data, such as the public node, needs no key service.
Asking to see it
Every ordinary read withholds patient data: lists, Explore, record pages, events, GraphQL, the MCP server, the relay and the chat. The web interface shows such a field as “withheld”. To see a value, a person holding phi_reader in that department asks for it, facet by facet, with a reason from a fixed list:
| Reason | Means | Reference |
|---|---|---|
care | The patient’s care | Optional (an episode) |
research | A study the ethics committee approved | Required: the protocol or CAAE number |
quality | Quality control of the sample’s own processing | Optional |
data_subject_request | The person’s own request (LGPD art. 18) | Required: the request number |
erasure | Preparing an erasure the institution accepted | Required: the request number |
legal | A legal or regulatory obligation, a court order | Required |
- There is no free text. Free text in an audit is where a name or a diagnosis ends up, so a reference is a number of at most 64 characters.
- The audit record comes first. If the node cannot write it, it answers with an error and shows nothing.
- One record per person, patient, reason and day. A screen that refreshes all day writes one record, not hundreds.
- A daily limit: at most 200 different patients in 24 hours per person, by default. Going past it is refused and recorded, and is the first thing an auditor looks for.
- No machine and no AI can ask. Machine tokens cannot hold
phi_reader, and the MCP server leaves the route out.
Who reads the audit
A person holding auditor, at the institution’s level. Administrators don’t hold it: they hand out the roles whose use is audited. An audit record holds the reader’s code, the department, the patient’s internal ID, the facets read, the reason and the reference. Never a value, an IP address or a name. It is kept as long as the log it concerns, and for at least five years. An erasure removes nothing from it: who read a person’s data before they were erased is your institution’s evidence.
A log that shows it was not changed
The node’s own database role can only add to the log and the audit. Whoever holds the database owner’s credentials could still change them, so both are hash chains: each event’s hash covers the one before. Every hour, or every 10,000 events, a checkpoint signs the chain’s head with the log key, which the database cannot reach. The relay delivers checkpoints to your own systems, outside the database.
Intact
- event #1041 3fa9…c2
- event #1042 b71e…09
- event #1043 0d4c…7a
- event #1044 e58b…31
- Checkpoint ✓ signed with the log key, delivered outside the database
Changed with the database’s own credentials
- event #1041 3fa9…c2
- event #1042 b71e…09 changed by hand
- event #1043 0d4c…7a
- event #1044 e58b…31
- Checkpoint ✓ no longer matches its hash
A change to anything older than the last checkpoint kept outside is found the next time anyone checks, even if the hashes were recomputed. A broken chain is an incident: the check reports it and never repairs it.
Erasing a person
The person asks your institution, never the node. Your institution checks who they are and finds their pseudonyms in its re-identification table. In the node:
In the node
1Inventory
Everything the node holds about the person: their own records, shared records, files, matches, recipients.
2Plan Person A
Every retraction and the key to destroy, under a hash. Nothing else is written.
3Review Person B
Reads the plan against the inventory.
4Apply Person B
By the plan’s hash, within 72 hours. Retractions written, then the key destroyed, last.
At your institution
5Re-identification table
Delete the pseudonym’s row in your LIMS or health record system.
6Files
Delete or unlink the person’s files; regenerate joint calls without them.
- What counts as theirs. From their subjects, the node walks downstream. A record is theirs when every person upstream of it is in the request: their specimens, extracts, libraries, per-sample files. A shared record, such as a pool, a multiplexed run or a joint-called VCF, stays; only the person’s links into it are retracted.
- Two people. One plans, another reviews and applies the plan by its hash. If anything changed in between, such as a new specimen recorded, the hash differs and the apply is refused.
- Afterwards their records are retracted: they stop counting and stop being served. Their patient data reads as “erased”, in every copy, backups included once the key service’s backups (kept at most 30 days) have rolled over. Their pseudonym cannot be created again, so a LIMS export that still has them is refused.
- Blocking is the same, keeping the key, for records the law requires your institution to keep. Their patient data can then be shown only with the reason
legal.
The node cannot finish an erasure alone. Until your institution deletes the person’s row in its re-identification table and their genomic files, what remains still points to a known person.