Skip to content
Alpha: see what works today →
Menu

Named question about entry

Where it came from

For each member of an entry: when its current revision arrived, the import that brought it, and the document it was derived from, with each hospital that wrote or keeps that document and when it was retrieved. A record the person entered has no document.

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 DISTINCT ?entry ?entryLabel ?record ?recordLabel ?arrived ?import ?importLabel ?document ?documentLabel ?hospital ?retrieved
WHERE {
  ?record ^cascade:entryMember ?entry ; cascade:currentRevision ?revision .
  ?revision prov:generatedAtTime ?arrived .
  OPTIONAL { ?entry rdfs:label ?entryLabel }
  OPTIONAL { ?record rdfs:label ?recordLabel }
  OPTIONAL { ?revision prov:wasGeneratedBy ?import .
             OPTIONAL { ?import rdfs:label ?importLabel } }
  OPTIONAL { ?revision prov:wasDerivedFrom ?document .
             OPTIONAL { ?document rdfs:label ?documentLabel }
             OPTIONAL { ?document pav:retrievedOn ?retrieved }
             OPTIONAL { ?document prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital } }
}
ORDER BY ?entryLabel ?entry ?arrived ?recordLabel ?record ?document ?hospital ?retrieved

Terms it reads

cascade:currentRevision · cascade:entryMember · pav:hasCurrentVersion · pav:retrievedOn · prov:generatedAtTime · prov:wasAttributedTo · prov:wasDerivedFrom · 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

The first 10 of 21 rows, as Alex Rivera's explorer shows them. Every row of every question is in answers.json.

entryrecordarrivedimportdocumenthospitalretrieved
Allergy entry · LatexAllergy · Latex · Meridian Health System · alg-latex-12026-11-20T09:00:04ZApple Health exportDocument · Meridian Health System · AllergyIntolerance/alg-latex-1 · retrieved 2026-11-20Meridian Health System2026-11-20T09:00:00Z
Allergy entry · PeanutsAllergy · Peanuts · own entry2026-09-01T18:30:00Zentered by Alex in the Cascade app
Allergy entry · PenicillinAllergy · Penicillin G · Meridian Health System · alg-pcn-12026-09-01T10:00:04ZApple Health exportDocument · Meridian Health System · AllergyIntolerance/alg-pcn-1 · retrieved 2026-09-01Meridian Health System2026-09-01T10:00:00Z
Allergy entry · PenicillinAllergy · Penicillin · Larkspur Valley Health · al-82374612026-10-14T15:42:00ZApple Health exportDocument · Larkspur Valley Health · AllergyIntolerance/al-8237461 · retrieved 2026-10-14Larkspur Valley Health2026-10-14T15:40:00Z
Allergy entry · PenicillinAllergy · Penicillin · Larkspur Valley Health · lv-alg-1012027-03-18T12:00:04ZApple Health exportDocument · Larkspur Valley Health · AllergyIntolerance/lv-alg-101 · retrieved 2027-03-18Larkspur Valley Health2027-03-18T12:00:00Z
Allergy entry · SulfamethoxazoleAllergy · Sulfamethoxazole · Larkspur Valley Health · al-82374622026-10-14T15:42:00ZApple Health exportDocument · Larkspur Valley Health · AllergyIntolerance/al-8237462 · retrieved 2026-10-14Larkspur Valley Health2026-10-14T15:40:00Z
Allergy entry · SulfamethoxazoleAllergy · Sulfamethoxazole · Meridian Health System · alg-sulfa-12026-11-20T09:00:04ZApple Health exportDocument · Meridian Health System · AllergyIntolerance/alg-sulfa-1 · retrieved 2026-11-20Meridian Health System2026-11-20T09:00:00Z
Allergy entry · SulfamethoxazoleAllergy · Sulfamethoxazole · Larkspur Valley Health · lv-alg-1022027-03-18T12:00:04ZApple Health exportDocument · Larkspur Valley Health · AllergyIntolerance/lv-alg-102 · retrieved 2027-03-18Larkspur Valley Health2027-03-18T12:00:00Z
Condition entry · Acute bronchitis · 2026-08-12Condition · Acute bronchitis · Meridian Health System · cond-bronch-12026-11-20T09:00:04ZApple Health exportDocument · Meridian Health System · Condition/cond-bronch-1 · retrieved 2026-11-20Meridian Health System2026-11-20T09:00:00Z
Condition entry · Asthma · 2008-09-01Condition · Asthma · Larkspur Valley Health · pr-300182026-10-14T15:42:00ZApple Health exportDocument · Larkspur Valley Health · Condition/pr-30018 · retrieved 2026-10-14Larkspur Valley Health2026-10-14T15:40:00Z

queries/questions/entry/Where it came from.rq on GitHub ↗