Named question about pod
My immunizations
Read from the view alone, as an app would, newest first by the date as written, so a year follows its months and days, with how many records each entry joins, each CVX code the entry states, a row for each, and each record it joins with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it, in order, separated by U+001F, its own parts by ", ". Times written with a zone are ordered by their wall time as written, not as instants: 23:00-05:00 sorts before 01:00Z the next day, though it is later.
The query
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX pav: <http://purl.org/pav/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?given ?vaccine ?code ?status (COUNT(?record) AS ?records) ?entry ?entryLabel ?sources
WHERE {
{ SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?sourceText, "\u001F"); separator=""), "\u001F$", "") AS ?sources)
WHERE {
{ SELECT ?entry ?sourceText
WHERE {
{ SELECT ?entry ?sourceRecord ?document ?retrievedOn
(REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
WHERE {
{ SELECT ?entry ?sourceRecord ?document ?retrievedOn ?hospital
WHERE {
?entry a cascade:Vaccination ; cascade:entryMember ?sourceRecord .
OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
?association prov:hadRole ?hospitalRole ; prov:agent ?agent
FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
OPTIONAL { ?agent rdfs:label ?agentLabel }
OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
}
ORDER BY ?entry ?sourceRecord ?document ?hospital }
}
GROUP BY ?entry ?sourceRecord ?document ?retrievedOn }
BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
}
ORDER BY ?entry ?sourceText }
}
GROUP BY ?entry }
?entry a cascade:Vaccination ; cascade:entryMember ?record .
OPTIONAL { ?entry cascade:vaccinationOccurrenceTime ?given }
OPTIONAL { ?entry cascade:vaccineName ?vaccine }
OPTIONAL { ?entry cascade:vaccineCode ?code }
OPTIONAL { ?entry cascade:workflowStatus ?status }
OPTIONAL { ?entry rdfs:label ?entryLabel }
}
GROUP BY ?entry ?given ?vaccine ?code ?status ?entryLabel ?sources
ORDER BY DESC(COALESCE(STR(?given), "")) ?vaccine ?entry ?code
Terms it reads
cascade:AuthorRole · cascade:CustodianRole · cascade:Vaccination · cascade:currentRevision · cascade:entryMember · cascade:vaccinationOccurrenceTime · cascade:vaccineCode · cascade:vaccineName · cascade:workflowStatus · pav:hasCurrentVersion · pav:retrievedOn · prov:agent · prov:hadRole · prov:wasGeneratedBy · rdfs:label
Rules and decision notes that name it
No rule or decision note writes its path.
Its rows on Alex Rivera's pod
1 row, as Alex Rivera's explorer shows them.
| given | vaccine | code | status | records | entry | sources |
|---|---|---|---|---|---|---|
| 2025-10-15 | Influenza, injectable, quadrivalent, preservative free | https:/ | completed | 3 | Immunization entry · Influenza, injectable, quadrivalent, preservative free · 2025-10-15 | urn:uuid:7d77d9e0-5457-86f2-8d9d-827c65c11b21 from ni:/ |