Clinical research
Clinical events as anchors: aligning measurements around surgery and admission
How to record surgery, hospital stays and complications as research events and use them as day 0, so device and manual measurements line up across participants.
To compare recovery across participants, align their measurements to the clinical event that matters, not to the calendar. Record the surgery or the hospital admission as a research event, use it as day 0, and define every window and variable relative to it: "7 days before to 30 days after surgery", "length of stay", "hours from surgery until a threshold is first reached". Each participant then contributes the same relative period, however far apart their surgery dates are. This article shows how to set that up and which details keep the results trustworthy.
The calendar is the wrong axis
In a perioperative or admission-based study, participants enter at different times. One has surgery in March, another in June. Pulling "all heart rate data for April" mixes pre-operative days for one participant with post-operative weeks for another. What you want is a shared time axis: day −7 to day +30 around each participant's own event.
That requires two things: a reliable record of when the event happened, and tools that compute windows relative to it.
Step 1: record the clinical course as research data
In EnaResearch, clinical records belong to a participation (the same person's records in another study do not mix). In the participant panel you can record:
- Hospital stays with admission and discharge dates.
- Clinical events with type, start and end: surgery, procedures such as bronchoscopy, biopsy or a chest tube, an intensive care stay, ward transfers, outpatient visits and follow-up assessments.
- Complications such as pneumonia, air leak or wound infection, graded with the Clavien–Dindo classification and linked to the event they relate to.
- Manual measurements: pain and fatigue (NRS 0–10), the Borg scale (6–20), hemoglobin, CRP, leukocytes, creatinine and albumin.
Records can also be imported from a CSV file or a FHIR R4 Bundle. In FHIR, Encounter resources become hospital stays and Procedure resources become clinical events; the Patient resource is skipped and identity fields are not read. Every import starts with a dry run that lists invalid rows without saving anything.
These are research records. They do not replace the hospital information system or the electronic health record, where treatment and care records stay.
Step 2: keep corrections traceable
Event dates are exactly the kind of data that gets corrected. If day 0 moves, every window moves with it, so corrections must not silently rewrite history.
- Every correction keeps a full copy of the record and requires a reason; the panel shows who changed what, when and why.
- A record entered by mistake is not deleted; it is marked as entered in error with a reason and stays in the history. It is left out of analyses and exports.
- Exports and variables read records as they were at the data cut-off, so a correction made after the cut-off does not change a file regenerated with the earlier cut-off.
Step 3: define windows around the anchor
In a dataset definition, the window can be anchored to a hospital stay or to a clinical event type within the study's scope. Day 0 is the day of the anchor event; the window runs from a number of days before to a number of days after it. Device measurements, manual measurements and, if selected, clinical events (events.csv) all come out on the same relative axis, under each participant's pseudonym.
For a first look before any export, the study dashboard has a cohort view: for a chosen metric and anchor, it shows the group's daily median and quartiles before and after the event, over fixed windows (7 days before to 30 after, 14 before to 90 after, or 30 before to 180 after). The anchor is each participant's first admission or first completed event of that type, and entries in error do not count. To keep individual data from showing, a day is hidden when fewer than 5 participants have data for it, and only median and quartiles are shown, never minimum or maximum.
Step 4: turn the anchor into variables
Questions like "how long did patients stay?" or "how active were they in the first week?" become versioned variables, computed the same way for every participant:
- Length of stay: from admission to discharge of the first hospital stay.
- Event duration: for example the duration of surgery, from start to end.
- Time between two moments: for example from surgery end to discharge, or from the start of participation to admission.
- A metric in a window: the mean, median, minimum, maximum, sum or count of a metric in a window around an anchor, such as the mean heart rate over the 3 days before surgery. If too little of the window has data (by default, less than half), the value is left missing; samples flagged as suspicious are excluded by default.
- Time to a threshold: the time from an anchor until a metric, summarized per hour or per day, first reaches a threshold within a set limit.
A value that cannot be computed, for example because a participant has no recorded surgery, is never written as zero. It stays empty and missing.csv gives the reason. That matters in perioperative research, where "no data" and "zero" mean very different things.
Things to agree on before enrolment
- Which event is day 0. Admission, start of surgery or end of surgery each give a different axis. Write the choice into the protocol.
- Which clinical categories the study records. Only categories in the study's scope can be used as anchors.
- Who enters events, and how fast. A window can only be computed once its anchor exists, so agree on when the clinical course is entered or imported.
- How corrections are handled. Use reasons that a reviewer will understand later.
EnaResearch is a research data platform. It is not a medical device, a clinical decision-support system or a patient monitoring system, it raises no alarms, and its results are for research, not for clinical decisions. Device data collection through the participant apps is awaiting store release; clinical records, manual measurements, variables and event-anchored datasets are available today.
Read more on the clinical records and manual entry page and the perioperative recovery studies use case.