Skip to content
Alpha: see what works today →
Menu

decisions/partial-dates-and-absent-reasons.md on GitHub, at the commit these pages were built from

Partial dates, and values absent for a stated reason

Status: ruled, 2026-10-22, from the research on #133 and the owner's rulings of that day; applied by #133, which writes the terms, shapes, queries and feature rules. Amends the date shapes at ontologies/health/v1/health.shapes.ttl:47-50, ontologies/clinical/v1/clinical.shapes.ttl:22-25 and ontologies/core/v1/core.shapes.ttl:13-15, and the matcher queries same-code-and-date.rq (removed 2026-11-18) and same-code-and-period-read-as-ranges.rq. Which revision is current is currency.md, which partial dates never meet (row 4). A result whose value is absent for a reason is row 7, never a value kind of quantities.md; row 5 follows that note's row "number". The adapters' side is cascade-bridge-adapter-fhir-r4#20 and cascade-bridge-adapter-ccda#35, which make each loss a finding.

Question

Every clinical source says two things the vocabulary has no place for, so both adapters drop them. A date stated to the year or the month, "diagnosed in 2019", fits no shape: each accepts only xsd:date and xsd:dateTime, and dateOfBirth only xsd:date. A value absent for a stated reason, "asked, but the patient did not know", "masked", has no term, so the C-CDA adapter writes it as absent. A pod has no server of record to ask what a missing value meant, merges records from several sources whose matcher must never treat "2019" as "2019-06-01", and is read open-world: a triple that is not there says nothing.

What others do

Sources: FHIR R4 datatypes (https://hl7.org/fhir/R4/datatypes.html), resource Meta (https://hl7.org/fhir/R4/resource.html), RDF (https://hl7.org/fhir/R4/rdf.html, https://build.fhir.org/rdf.html), search (https://hl7.org/fhir/R4/search.html), Observation (https://hl7.org/fhir/R4/observation-definitions.html), the extension (http://hl7.org/fhir/StructureDefinition/data-absent-reason) and its CodeSystem (http://terminology.hl7.org/CodeSystem/data-absent-reason); v3 NullFlavor (http://terminology.hl7.org/CodeSystem/v3-NullFlavor); HL7 v3 Data Types abstract (https://www.oasis-open.org/committees/ubl/lcsc/doc/qateam/Comment%20work%20from%20HL7/datatypes.html); C-CDA on FHIR mapping guidance (https://hl7.org/fhir/us/ccda/en/mappingGuidance.html); C-CDA general guidance (http://hl7.org/cda/us/ccda/generalguidance.html); HL7 v2.5.1 (https://www.hl7.eu/HL7v2x/v251/std251/ch02a.html, https://www.hl7.eu/HL7v2x/v251/std251/ch02.html); EDTF (https://www.loc.gov/standards/datetime/); XSD 1.1 Part 2 (https://www.w3.org/TR/xmlschema11-2/); SPARQL 1.1 (https://www.w3.org/TR/sparql11-query/); DCAT 3 (https://www.w3.org/TR/vocab-dcat-3/) and the GLD thread (https://lists.w3.org/Archives/Public/public-gld-wg/2012Jan/0037.html); W3CDTF (https://www.w3.org/TR/NOTE-datetime); SPHN (https://www.biomedit.ch/docroot/sphn/latest/sphn_ontology.html); OMOP CDM 5.4 (https://ohdsi.github.io/CommonDataModel/cdm54.html); USCDI Date of Onset (https://isp.healthit.gov/uscdi-data/date-onset?page=1); OWL 2 Primer (https://www.w3.org/TR/owl2-primer/). The research on #133, with the Oxigraph and rdflib code it read (https://github.com/the-cascade-protocol/cascade-vocabulary/issues/133#issuecomment-6345860418).

Choice

Every row is ruled, 2026-10-22. Rows 1 to 5 are partial dates, 6 to 8 absent reasons.

thing prior art what we do borrowed or diverged Rules that cite it
1. datatype FHIR RDF's union; DCAT 3; openEHR's reduced-accuracy string; against: HL7 v2's retired precision component, CDISC's flags, SPHN's and OMOP's parts one property per date, typed xsd:gYear, xsd:gYearMonth, xsd:date or xsd:dateTime by the precision the source wrote, through sh:or; nothing padded; dateOfBirth takes the same four; rule M23 borrowed from FHIR RDF, union and all
2. comparison and order XSD's disjoint value spaces; SPARQL 1.1; Oxigraph 0.5.11; rdflib 7.6.0 "2019" never equals "2019-06-01", by term or by value, which is the matcher's requirement met by the datatype alone; a query that sorts mixed precisions orders by the written form, STR() of the date, so a year sorts before its months and its days on every engine; rule M23 borrowed from XSD; the sort rule is ours, since SPARQL defines none
3. matching partial to full FHIR search's implied range, eq contains, ap overlaps; v3's TS to IVL_TS same-code-and-date.rq:11-12 (removed 2026-11-18) stayed term-equal, so a year never joins a day, and in the rule list R2 and R4 join only a day or a time written to the second, since two shots dated to one year or one padded hour may be two; same-code-and-period-read-as-ranges.rq reads each bound as the range its type implies, where the query it replaced compared the first ten characters as a string; rule M23 borrowed from FHIR search's ranges for periods; term equality for dates is ours
4. the currency ladder FHIR meta.lastUpdated, an instant; CDA document effectiveTime, at least the day partial dates never reach currency.md's ladder: no source change time and no rec:asOf is a clinical date (runtime/currency.feature, C1) borrowed; nothing to decide past saying so
5. hour precision from CDA C-CDA on FHIR's precision rule; FHIR and XSD dateTime, which need seconds; quantities.md row "number" kept, the pattern of quantities.md's decimal: an xsd:dateTime padded with zeros to the second (2023-05-31T14:00:00), with no timezone where the source gave none, which sorts, compares and falls in a range; and timeAsWritten, a plain string of the characters the source sent (2023053114), only where the typed form was padded, below the day; no finding, since nothing is dropped; a padded time is never read as exact, and a query needing the precision reads the string; the string sits on a node of the version naming its property, cascade:PaddedDateTime, and the lab rules R6, R16 and R17 read no padded time as an instant and R15 counts it as a day alone; rule M23 borrowed from C-CDA on FHIR's precision rule and from quantities.md row "number"
6. the reason's code FHIR data-absent-reason, 15 codes; v3 NullFlavor, 17 in a hierarchy; the draft map, 9 of 15 one term, cascade:absentReasonCode, whose value is exactly the code IRI the source gave, FHIR's (cascade:DataAbsentReason) or NullFlavor's (cascade:NullFlavor), with no crosswalk at write time; a view that needs one list applies HL7's cm-data-absent-reason-v3 at read, where it maps, and the source's own term where it does not (NI, and the six FHIR codes it leaves out); the map is a versioned table like the matcher's code tables, cited as used, replaceable when HL7 finishes it; no view needs one list yet, so the table waits for the first that does (Still open) (ontologies/cascade.ttl, ontologies/cascade.shapes.ttl) borrowed from both systems, and from HL7's map, applied at read No rule cites this row.
7. where it sits FHIR obs-6 and the extension; CDA @nullFlavor anywhere; openEHR ELEMENT; HL7 v2 "" on the record's version, naming the property it stands for, and only where that property is absent: cascade:ValueAbsentForReason, a node of the version named <version>#absent- and the property's local name; a result's absent value is this row, naming cascade:resultValueKind, and no value kind of quantities.md; v2's "" is a delete and is never read as a reason (ontologies/cascade.shapes.ttl) borrowed from obs-6, widened to any property as the extension is No rule cites this row.
8. negation C-CDA negationInd; US Core out of scope: "no known allergies" is a statement, not an absent value, and is #152's "no known X" borrowed from C-CDA's split No rule cites this row.

Why

Why the union. (row "1. datatype") Every health standard carries precision in the form as written and none pads: FHIR, CDA and HL7 v2 drop digits from the right, openEHR keeps a reduced-accuracy string, and C-CDA on FHIR says "not 2023-05-31T00:00:00+00:00" (verified). FHIR RDF already writes the union and DCAT 3 does the same, so the vocabulary adds two types to an sh:or that already mixes two incomparable ones, xsd:date and xsd:dateTime. XSD defines each type as an interval, so the range FHIR search wants is the literal itself, with no second triple to keep in step.

Why disjointness is the requirement, not the cost. (rows "2. comparison and order", "1. datatype") #133 asks that the matcher never treat "2019" as "2019-06-01". Under the union it cannot: XSD makes the values incomparable and Oxigraph 0.5.11 returns false for = (verified), so a term-equal join is safe by construction. The cost is order: SPARQL defines none across types, Oxigraph falls back to the written form and rdflib to the datatype IRI (verified), so two engines sort one list two ways. A query that sorts dates says it sorts by the written form, which puts "2019" before "2019-03" before "2019-03-14"; that is start order with the coarser value first, which a timeline can show as a span.

Why the period query changes. (row "3. matching partial to full") The earlier query took SUBSTR(STR(?onset), 1, 10) as a string and admits an abatement only if it is xsd:date or xsd:dateTime. With a year onset "2019" the rules as written give an active condition the period "2019" to "9999-12-31", which overlaps a 2019-06-01 onset, while an inactive one does not match, since "2019-06-01" <= "2019" is false, and a gYear abatement counts as none (inferred, not run). The same pair matching or not by status is a bug the union exposes; reading a year as 1 January to 31 December, as FHIR search and v3's IVL_TS do (verified), fixes it.

Why the ladder never meets them. (row "4. the currency ladder") currency.md ranks by source change time, then rec:asOf. FHIR's change time is Meta.lastUpdated, an instant; a C-CDA document's effectiveTime "SHALL be precise to at least the day"; and rec:asOf is an exporter's stamp or a device clock (verified). A partial date is a clinical date and is on a version, never a clock (inferred). The ladder has its own mix, a day-precision C-CDA effectiveTime beside a FHIR instant, which Oxigraph cannot order with <; that is currency.md's to note, not this note's.

Why pad the hour, and keep what was sent. (row "5. hour precision from CDA") A CDA time to the hour has no FHIR or XSD form short of padding the minutes and seconds (inferred), so it follows quantities.md row "number": a typed literal that does the typed jobs and a plain string that keeps the source's characters. Padded to the second, 2023-05-31T14:00:00 sorts, compares and falls in a range as every other xsd:dateTime does, where keeping only the day, as the C-CDA adapter does today (in/sparql/result.rq:319-322), dropped the hour. XSD allows a dateTime with no timezone, and a source that gave none gets none, since inventing one would be a lie. The padding is the risk the standards guard against, so the padded literal is never read as "at 14:00:00 exactly": timeAsWritten holds 2023053114, the precision is recoverable from it, and a query that needs the precision reads it. It is written only where the adapter padded, which the adapter knows; a year, a month or a day carries its precision in its own type (row 1), so this is the separate written property that lost for row 1, used only where no typed form holds the precision. Nothing is dropped, so no finding is written. How often a source sends hours is not counted (unverified).

Why the source's own code, and HL7's map at read. (row "6. the reason's code") The draft map covers 9 of FHIR's 15 codes, and NI, CDA's default and the most general code, has no FHIR counterpart (verified). Mapping at write time would invent a counterpart for NI or drop it, and the adapter would then be stating HL7's draft as fact, so the version stores exactly the IRI the source gave. A view that needs one list, as the review page does, applies cm-data-absent-reason-v3 at read where it maps and shows the source's own term where it does not. The map is a table like the code tables the matcher reads, versioned and cited as used, so a view says which map it applied; when HL7 finishes it, the table is replaced and every view improves without touching a record. Nothing is lost and nothing invented.

Why on the version, beside the property. (row "7. where it sits") Open-world RDF makes a missing triple say nothing (verified), so only a written term can say "absent because", and no PROV or W3C term does (none found). FHIR's obs-6 already gives the shape: a reason only where the value is absent. Putting it on the version keeps the vocabulary's rule that content is on a version, and naming the property says which absence it explains, as CDA's attribute does by sitting on the element. HL7 v2's "" means "the old value should be changed to null" (verified), so an adapter reading it as a reason would turn a delete into a statement.

Alternatives that lost

Settled while applying it

By #133, 2026-10-24, under the owner's delegation (the-cascade-protocol/cascade-vocabulary#204):

Still open

Each with the lean and the one fact that decides it:

What would change our mind

A measurement, none of which exists (unverified): partial dates rare enough in real FHIR and C-CDA data that a finding is cheaper than a union every client must handle would favour Cyganiak's case; absent reasons rare enough would favour a finding only. A health standard or FHIR RDF moving to a precision term would reopen row 1. HL7 publishing the crosswalk as final, with NI mapped, would favour mapping at write time. An engine the runtime adopts that orders across date types would let the sort rule follow it. A query or view found reading a padded time as exact would reopen row 5.