Slightly confused about bitemporality modelling best practices in XTDB. In general, should the XTDB "valid time" be used for modelling "truth-in-the-world time" or "belief time"? My guess from the 'crime scene example' in the v1 docs is that it's probably the latter - but what if "belief time" lacks a central consensus? e.g.
- Suppose a GP treats a rash as "eczema", but a rheumatologist later changes the diagnosis to "paraneoplastic dermatomyositis" after discovering the patient has undiagnosed lung cancer. The diagnosis of "eczema" is "valid" until the rheumatologist "invalidates" it, but technically it's more like a "decision/belief state" since the fundamental facts/observations that led to the diagnoses (rash) are the same. So both obviously have different "belief time" dimensions (e.g. rheumatologist diagnoses dermatomyositis, sends letter to GP -> GP only updates belief after receiving letter), but the "truth-in-the-world dimension" is unified (i.e. after seeing the rheumatologist the patient now knows it was never just "eczema"). If I later go on to ask questions like "why wasn't this diagnosed properly earlier?", that would require storing multiple relational belief states.
- An 85-year-old woman with Alzheimer's has an unwitnessed fall in a nursing home (so you can't ask her when the fall happened). Should the XTDB valid time concern itself with the time the fall actually happened (truth-in-the-world), or the time when the treating clinicians labelled the fall (belief state)? The truth-in-the-world time might be rather imprecisely reported e.g. "yesterday evening", "between 8pm yesterday and 7 this morning", but we'd likely have a more precise log of belief-state changes e.g. "nurse noticed the patient on the ground at 7am" (in this case it might be the same as the xt/tx-time assuming they type it into the EMR without delay, but in reality, notes often get entered retrospectively so the belief-time might be "7am" while the transaction-time is "10:30am")
Further thoughts I've had on this since (if it helps anyone doing data modelling in the biomedical domain, and if anyone has any further input): - A diagnosis may be considered either a label assigned based on a judgement-call or synthesis on the part of a doctor (i.e. "I saw the patient and I think he was having a heart attack"), or a pathophysiological process given a label (e.g. "acute myocardial infarction" (AMI) means "the coronary arteries were blocked by a blood clot so part of the heart muscle died"). - If you think it's the former, the "valid time" should be the time of the consultation (i.e. "when did the doctor last review the patient?"). This view seems to be the paradigm used by codebooks (ICD, SNOMED, etc.) and most EMRs but is arguably clinically wrong, because the point of a diagnostic label is to be of utility in guiding treatment/management. - If you think it's the latter, the "valid time" should be the time of the incident symptom/finding onset (i.e. "when did the patient start having chest pain" for a heart attack), and the "belief time" (aka "decision time" in tritemporal databases) for "acute myocardial infarction" should be the time of the clinician review (so if the emergency physician reviewed the patient at 1100, but the patient complained of chest pain after eating breakfast at 0800, then the valid-time-start of "acute myocardial infarction" as a diagnosis is 0800 and the belief-time is 1100). - The underlying pathophysiology doesn't actually change just because you observed it or not (a blood clot still follows the coagulation cascade), but your ability to correctly deduce the underlying physiology does based on the information available to you at the time of review. - It's also possible that more facts will come to light later that change your opinion of what the underlying picture is - e.g. if the ED later performs a CT pulmonary angiogram, and it shows a clot in the pulmonary arteries, and there are no clear hallmarks of a heart attack (dynamic elevated troponin and/or ECG changes), the most-correct explanation for the patient's symptoms becomes "massive pulmonary embolism". So the "valid time" of the diagnosis remains unchanged, but the "belief time" of the diagnosis does (the symptoms the patient reported haven't changed, the explanation for it has). - Under the second conception "belief time" should always relate to whoever originated the belief for a specific thing.
My rule of thumb is: • system time is when we knew it • valid time is when it became true (which could be before or after the system time, or coincident) In your GP case, I would say the diagnoses valid times would either be the same or would be the examination date in each case (assuming the person saw their GP and later saw the rheumatologist). You would need some sort of "case ID" to track multiple diagnoses for a single series of examinations for a single patient -- and then you can query for all system time on that case ID and see there are multiple diagnoses... In the fall case, I'd expect the valid time to be whenever the staff determine she fell (a specific time they estimated), and the system time to be whenever it was inserted to XTDB. I'll be interested to hear what the XT folks say...