OHDSI / Atlas

ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data
http://atlas-demo.ohdsi.org/
Apache License 2.0
273 stars 137 forks source link

Patient Profile Start Days Offset #2121

Open anthonysena opened 4 years ago

anthonysena commented 4 years ago

Expected behavior

When using the patient profile without a cohort definition (for defining the index), I expect that the "Start Days" is based on the start of the observation period.

Actual behavior

There appears to be some behavior where this is not offset. We observed that for a particular person, a diagnosis that was 1 day after observation was labeled as "8 days" instead.

Steps to reproduce behavior

Navigate to /atlas/#/profiles/<database>/<person_id> and observe the issue. This issue does not seem to happen when viewing that same person when they are part of a cohort: /atlas/#/profiles/<database>/<person_id>/<cohort_definition_id>

anthonysena commented 4 years ago

A few notes on how to reproduce this:

wivern commented 4 years ago

@anthonysena I've examined how WebAPI prepares profile and found when using profile without cohort definition then index date is a first event date. And when using cohort then index date is a cohort start date. That's the reason why the same event offset differs in different modes. One case when offsets are exactly the same is when cohort includes a first patient's event. Could you clarify is this behavior correct?

If yes, then I'd like to ask is it possible the issue impacted by patient's data? I mean, probably by some reason, one event is out of observation period.

anthonysena commented 4 years ago

@wivern - can you point me to the code where this is happening? I'm a bit torn on this: a patient can have events that fall outside of the observation_period and we'd still like to see them on the patient profile. That said, I'm not sure how we'd orient the time axis to reflect this. Seeing the code might give me an idea here. Thank you!

wivern commented 4 years ago

Sure, this magic doing inside the PersonService from 135 to 143 lines.

anthonysena commented 4 years ago

Let's move this out of this release and consider it either for after 2.8 or 3.0