My daughter is going into junior kindergarten this year, and thus I have been confronted with the City of Toronto's school age vaccination requirements. Specifically, all of her vaccinations must be entered into Toronto's ICON system.
This process is laborious:
- 1.
I must request a paper copy of my daughter's vaccination records from her paediatrician.
- 2.
I must sign up for an ICON account, which is implicitly tied to her provincial health insurance identifier.
- 3.
I must enter in these vaccines one at a time into ICON's UI. This requires me to decipher what my paediatrician calls the vaccine into what ICON calls the vaccine. I did this by cross referencing the vaccine's lot number with Canada's National Vaccine Catalogue (which only works for vaccines administered in Canada, and even then, my paediatrician misspelled some).
- 4.
After all this, I upload a copy of the paper vaccination record to the ICON system for review by the public health authorities.
- 5.
Finally, I wait an unspecified period of time to know if my daughter's vaccination record has been accepted. So far I have waited over a month.
Perhaps because I have software brain, I can't help but think of this as a database problem: If I could grant Toronto Health access to my child's vaccination record, and that vaccination record was in some standard format, and it was signed by a trusted party (e.g., my child's paediatrician), then this would be a few clicks instead of a multi-hour copy-and-paste-a-thon.
But vaccination records (like many health, financial, and other personal records) face a fundamental issue: while my daughter owns the information contained in her records, she does not own the record itself.1 This should sound familiar to anyone who has tried to move their account from one social media company to another: you generally have ownership of whatever you post, but the social media company owns their database.2
In the social media space, this has led to several groups to define communication protocols where the user explicitly owns the data they create. Up to now, these protocols fundamentally open and did not support private data. One of these protocols–ATProto–recently announced a first draft of "permissioned data," and this led me to wonder, what would it look like to put vaccination records (and potentially other medical records) into this shape.3
A Vaccine Record Shape
In the spirit of 's permissioned data shape series, we can put together a proposal of what a vaccine record might look like and see where the proposed permissioned data implementation would break down for vaccination records.
Shape Attempt #1
A shape is identified by three values, an authority DID, a space type NSID, and a space key. A medical record is ultimately a fact about the patient and thus the authority should be the patient. The spec allows a personal DID to be an authority. Moreover, a patient really only has one vaccination record and so we would expect this to be a canonical record of a type, which we'll specify as example.lexicon.health.vaccination.collection. That leads to a space id of
at://did:plc:XXX/space/example.lexicon.health.vaccination.collection/selfand a single vaccination would have a record of
at://did:plc:XXX space authority (me)
/space literal
/example.lexicon.health.vaccination.collection space type
/self skey
/did:plc:YYY author (a provider)
/example.lexicon.health.vaccination.record element
/a1b2c3d4e5f6g rkeyHere we note that a vaccination collection is owned by me (using my DID as the space authority) but the record is written by a provider to their own PDS.
This leads to a problem: In social media settings, the record and the information contained therein are owned by the user who posts the data. This is not true of medical records. One way to conceptualize this is that writes should be irrevocable,4 or at least irrevocable without the patient's or a court's consent.5
An Aside on Writes
The permissioned data spec takes an interesting approach to permissioned reading and writing: A member of a space can always read and sync the whole space. For vaccination records, this sets up a potentially problematic dynamic. It's common to get vaccines at pop up clinics, pharmacies, and other "itinerant" medical providers. These are providers whom a patient may not trust with their entire medical history, but require the provider to attest they received a vaccine by writing to their medical history.
This paradigm is explicitly disavowed by the ATProto spec in that there are no "append only" roles available in the auth. Indeed, the general goal is that write permissions are not directly enforced by the protocol. Instead, from the protocol's perspective, anyone can purport to write to a space, and applications are responsible for filtering the writes to the ones that are valid.
This leads to another problem: How do we provide temporary, append only access to a user's PDS? Here we can take a page out of 's Notification shape. Specifically, we never make itinerant providers members of our space. Instead, we grant them a create-only permission.
Unlike the Notifications shape, we potentially do want other readers than just self: Our primary care physician is likely both a reader of and a writer to this space. Our child's school (or the public health authority) is also likely a reader. This leads us to the following.
Shape Attempt #2
What might that look like as a shape? Our space id would remain the same:
at://did:plc:XXX/space/example.lexicon.health.vaccination.collection/selfBut our record id would potentially change at the author slot:
at://did:plc:XXX space authority (me)
/space literal
/example.lexicon.health.vaccination.collection space type
/self skey
/did:plc:YYY author (me or a provider)
/example.lexicon.health.vaccination.record element
/a1b2c3d4e5f6g rkeyDefining the Type
Spaces are just just lexicons with type "space", so we can define one thus:
{
"lexicon": 1,
"id": "example.lexicon.health.vaccination.collection",
"defs": {
"main": {
"type": "space",
"description": "A patient's vaccination record",
"key": "any",
"name": "Vaccination Record",
"collections": [
"example.lexicon.health.vaccination.record"
]
}
}
}Here we have set the "key": "any" to reference which space keys can hold these records. Here we've chosen "key": "any" to represent that other types of vaccination records (e.g., pets) might be useful, but it is possible that "literal:self", which would indicate that this is always an individual's vaccination record, is correct.
Now we also need a vaccination record type, which for illustrative purposes might look something like:
{
"lexicon": 1,
"id": "example.lexicon.health.vaccination.record",
"defs": {
"main": {
"type": "record",
"description": "A particular vaccination",
"key": "tid",
"record": {
"type": "object",
"required": ["provider", "signatory", "vaccineName"],
"properties": {
"provider": { "type": "string" },
"signatory": { "type": "string" },
"lotNumber": { "type": "string" },
"vaccineName": { "type": "string" },
"signature": { "type": "string"}
}
}
}
}
}Here we note that a provider may not be the same person who is entering data in the system. For instance, if a patient is administered a vaccine in the United States, but they want that reflected on their Ontario health record, the signatory may be the patient's Thunder Bay-based paediatrician, but the provider would be their American pharmacist.
Also, due to the need to support itinerant providers, the protocol itself cannot guarantee that a particular record was written by a particular signatory. Instead, we add an explicit "signature" field which can be cross referenced to a signatory's public key.
This points to another fundamental difference between the permissioned data spec and what is likely required for a vaccination record: the permissioned data spec calls for all commits to permissioned spaces to be deniable, which is to say, while they can be validated as authentic at write time, at a future time (e.g., if they are leaked) the author should be able to deny they wrote them. This is likely the correct setup for many-to-many communication (I don't want to be held liable for whatever random messages I sent to my college friends thirty years on). It also is likely the correct setup for general medical records: If a hospital has a breach, I want to be able to claim that I didn't actually have a particular procedure.
However, vaccination records serve two purposes: A medical record and a proof of some legal status (vaccination) which the state wants to enforce to receive certain benefits (schooling). In the latter case, the commit cannot be deniable.6 Thus, to use the permissioned data spec for vaccination records, you must get around this provision by requiring providers to provide non-deniable proof they created the record.
Permission Surface
Ultimately, the discussion above leads to a few different OAuth scopes:
# For itinerant providers (just create)
space:example.lexicon.health.vaccination.collection?action=create
# For regular providers (create + read, no update or delete)
space:example.lexicon.health.vaccination.collection?action=create+read
# For public health authorities (just read)
space:example.lexicon.health.vaccination.collection?action=read
# For the patient (full authority)
space:example.lexicon.health.vaccination.collectionAn Aside on Confidentiality
The permissioned data spec explicitly disavows any sort of built in end-to-end encryption, which would allow whoever is hosting my PDS to read my entire vaccination record. Notably, this isn't necessarily bad in and of itself: Today public health authorities such as Toronto's ICON hold vaccination records in trust. Moreover, vaccination records are the kind of data that people do not access on a regular basis, and as such, are unlikely to keep up with whatever key material would be necessary to unlock an end-to-end encrypted data set. Or, to put it another way, they're going to need to "reset their password" every time they access this data and so someone will need to hold a master key to allow for this.
As such, this arrangement represents no net new privacy degradation, and it's not clear e2ee is the right paradigm for this sort of record.
Some Reflections
This was a fun exercise attempting to think through the difference between a truly open (or even private-ish) social media space and something more critical like a vaccination record. It revealed a few key missing components vis-a-vis the permissioned data spec:
A lack of an "append only" primitive, forcing providers to "write through" a patient's credentials to their PDS
The permissioned data spec is structured around deniable commits, which may not be the correct solution for "legally binding" documents.
Lack of end-to-end encryption isn't necessarily that bad in that it is generally no worse than what exists today. Moreover, it seems unlikely that people will maintain key material for low-frequency access, so a middleman holding the key material in trust might be required anyway
I generally like the idea from ATProto that something between the fully federated setup of ActivityPub and the full decentralization of blockchains makes a lot of sense for medical records. In general, for medical records I want a centralized copy of all my records somewhere that I can view (and share) and which I can easily take with me if I lose trust in my host. The semi-centralization of ATProto is nice for this.
These requirements are potentially different for other medical records since vaccination records are also legal documents.