Skip to content
Alpha · We're looking for development partners. Build with us →
Menu

Entry

Lab result entry · Potassium [Moles/volume] in Serum or Plasma · 2025-03-27T12:00:00Z

https://pod.priya-natarajan.example/clinical/lab-results.ttl#385e5ffb09b34c8b29d19a3ff9f5675403e0e3e8a5f5f5e3ee145441d3c16751

An entry is what an app shows: one allergy, one condition, one vaccination. The build makes it in a view by joining the records judged to be the same thing, and takes each of its values from one of them. Follow a member to see where it came from.

Every section below is one question with only the rows about this entry. The first lists the files of the pod that say something about it or name it. A Turtle link beside a thing opens the file it arrived in; a thing only ever named, or written by the build, has none.

Which file states each thing

The store loads each file twice: into the default graph, which the other questions read, and into a graph named by its address, which GRAPH ?file reads. A file states a thing when it says something about it, or names it as the value of a statement: a patient profile has no file of its own, so the files that name it are where it is stated. Named marks a row for a file that names the thing, and rebuilt a view or the labels, which the build writes. Files the build did not write come first, and among them the file a thing arrived in, if it has one.

Only the rows whose ?thing is this one.

?file?named?rebuilt
clinical/lab-results.ttl pagefalsetrue
clinical/labels.ttlfalsetrue
clinical/reports.ttl pagetruetrue

3 rows

The query: queries/questions/pod/Which file states each thing.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX pim: <http://www.w3.org/ns/pim/space#>

SELECT DISTINCT ?thing ?file ?named ?rebuilt
WHERE {
  { { SELECT DISTINCT ?file ?thing
      WHERE {
        ?owner pim:storage ?root .
        GRAPH ?file { ?thing ?property ?value }
        FILTER (isIRI(?thing) && STRSTARTS(STR(?file), STR(?root)))
      } }
    BIND (false AS ?named)
    BIND (EXISTS { ?file a cascade:View } AS ?rebuilt) }
  UNION
  { { SELECT DISTINCT ?file ?thing
      WHERE {
        ?owner pim:storage ?root .
        GRAPH ?file { ?subject ?property ?thing }
        FILTER (isIRI(?thing) && STRSTARTS(STR(?file), STR(?root)))
      } }
    BIND (true AS ?named)
    BIND (EXISTS { ?file a cascade:View } AS ?rebuilt) }
}
ORDER BY ?thing ?rebuilt ?named ?file

The terms it uses: pim:storage, cascade:View.

Run it yourself, from the runtime's root:

npm run ask -- priya-natarajan "pod/Which file states each thing"

It prints the rows for every thing; this block keeps those whose ?thing is https://pod.priya-natarajan.example/clinical/lab-results.ttl#385e5ffb09b34c8b29d19a3ff9f5675403e0e3e8a5f5f5e3ee145441d3c16751.

Or in GraphDB, open the saved query pod/Which file states each thing in the repository priya-natarajan.

What it shows

What each entry shows: every value its view states of it and every value its members' current versions state of the fields the view shows, each with From, the member whose current version states it, and Lead, whether that member is the entry's lead (cascade:leadMember), whose values come first. An entry is what an app shows: one allergy, one condition, one vaccination; no merged record is stored, so the view holds each member's current values as a node of its own (cascade:memberCurrentValues) and this reads the view alone. The view takes the entry's name and codes from its lead, and its status and dates from the members the derivations chose for them (cascade:statusFrom, cascade:dateFrom and, for a medication, cascade:medicationUseStartDateFrom, cascade:prescriptionWrittenDateFrom and cascade:dosageFrom, and for an allergy cascade:allergyCategoryFrom and cascade:onsetDateFrom). A value no member states, such as the highest criticality among them, has no From. A padded time is shown as the time, and a reference range as its text, its bounds being nodes of the view of their own; the node saying a time was written short of the second is no value of its own.

Only the rows whose ?entry is this one.

?view?field?value?from?lead
clinical/lab-results.ttl pagerdf:typelaboratory test result cascade:LaboratoryTestResult
clinical/lab-results.ttl pageentry member cascade:entryMemberLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtle
clinical/lab-results.ttl pageentry member cascade:entryMemberLab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtle
clinical/lab-results.ttl pagelead member cascade:leadMember termLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtle
clinical/lab-results.ttl pagenarrative text cascade:narrativeTextPotassium 4.1 mmol/l 3.5-5.1 mmol/l March 27, 2025 12:00 UTCLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pagereference range text cascade:referenceRangeText3.5-5.1 mmol/lLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pagereference range text cascade:referenceRangeText3.5-5.1 mmol/LLab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtlefalse
clinical/lab-results.ttl pageresult clinically relevant time cascade:resultClinicallyRelevantTime2025-03-27 12:00 UTCLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pageresult clinically relevant time cascade:resultClinicallyRelevantTime2025-03-27 12:00 UTCLab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtlefalse
clinical/lab-results.ttl pageresult interpretation code cascade:resultInterpretationCodeHL7 v3 ObservationInterpretation NLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pageresult interpretation code cascade:resultInterpretationCodeHL7 v3 ObservationInterpretation NLab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtlefalse
clinical/lab-results.ttl pageresult unit text cascade:resultUnitTextmmol/l
clinical/lab-results.ttl pageresult value text cascade:resultValueText4.1
clinical/lab-results.ttl pagestatus from cascade:statusFrom termLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtle
clinical/lab-results.ttl pagetest code cascade:testCodeLOINC 2823-3Lab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pagetest code cascade:testCodeLOINC 2823-3Lab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtlefalse
clinical/lab-results.ttl pagetest name cascade:testNamePotassium [Moles/volume] in Serum or PlasmaLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pagetest name cascade:testNamePotassiumLab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtlefalse
clinical/lab-results.ttl pageworkflow status cascade:workflowStatusfinalLab result · Potassium [Moles/volume] in Serum or Plasma · Kestrel Harbor Hospital · received 2025-04-03 Turtletrue
clinical/lab-results.ttl pageworkflow status cascade:workflowStatusfinalLab result · Potassium · Kestrel Harbor Hospital · obs-potassium-20250327 Turtlefalse

20 rows

The query: queries/questions/entry/What it shows.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?entry ?entryLabel ?view ?field ?value ?valueLabel ?from ?fromLabel ?lead
WHERE {
  { GRAPH ?view { ?entry cascade:entryMember [] ; cascade:leadMember ?leader ; cascade:memberCurrentValues ?values .
                  ?values cascade:valuesOfMember ?from ; ?field ?value .
                  FILTER (?field NOT IN (cascade:valuesOfMember, cascade:paddedDateTime, cascade:referenceRangeLow, cascade:referenceRangeHigh)) }
    BIND (?from = ?leader AS ?lead)
    OPTIONAL { ?from rdfs:label ?fromLabel }
    OPTIONAL { ?entry rdfs:label ?entryLabel }
    OPTIONAL { ?value rdfs:label ?valueLabel } }
  UNION
  { GRAPH ?view { ?entry cascade:entryMember [] ; ?field ?value
                  FILTER (?field NOT IN (cascade:memberCurrentValues, cascade:paddedDateTime, cascade:referenceRangeLow, cascade:referenceRangeHigh))
                  FILTER NOT EXISTS { ?entry cascade:memberCurrentValues ?held . ?held ?field ?value } }
    OPTIONAL { ?entry rdfs:label ?entryLabel }
    OPTIONAL { ?value rdfs:label ?valueLabel } }
}
ORDER BY ?entryLabel ?entry ?field DESC(?lead) STR(?value) ?from

The terms it uses: cascade:entryMember, cascade:leadMember, cascade:memberCurrentValues, cascade:valuesOfMember, cascade:paddedDateTime, cascade:referenceRangeLow, cascade:referenceRangeHigh, rdfs:label.

Run it yourself, from the runtime's root:

npm run ask -- priya-natarajan "entry/What it shows"

It prints the rows for every entry; this block keeps those whose ?entry is https://pod.priya-natarajan.example/clinical/lab-results.ttl#385e5ffb09b34c8b29d19a3ff9f5675403e0e3e8a5f5f5e3ee145441d3c16751.

Or in GraphDB, open the saved query entry/What it shows in the repository priya-natarajan.

What needs review: none. The question

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.

Only the rows whose ?entry is this one.

2 rows

The query: queries/questions/entry/Where it came from.rq on GitHub
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

The terms it uses: cascade:entryMember, cascade:currentRevision, prov:generatedAtTime, rdfs:label, prov:wasGeneratedBy, prov:wasDerivedFrom, pav:retrievedOn, prov:wasAttributedTo, pav:hasCurrentVersion.

Run it yourself, from the runtime's root:

npm run ask -- priya-natarajan "entry/Where it came from"

It prints the rows for every entry; this block keeps those whose ?entry is https://pod.priya-natarajan.example/clinical/lab-results.ttl#385e5ffb09b34c8b29d19a3ff9f5675403e0e3e8a5f5f5e3ee145441d3c16751.

Or in GraphDB, open the saved query entry/Where it came from in the repository priya-natarajan.