OHDSI / Achilles

Automated Characterization of Health Information at Large-scale Longitudinal Evidence Systems (ACHILLES) - descriptive statistics about a OMOP CDM database
https://ohdsi.github.io/Achilles/
130 stars 121 forks source link

Unexpected result for analysis 110: not covering all months with observation period #751

Open MaximMoinat opened 8 months ago

MaximMoinat commented 8 months ago

Expected behavior

Given this mock observation period data, I expect analysis 110 gives a row for every month from 202201 to 202401. There is continuous observation for at least one person between those dates.

image

Observed behavior

Only three months are included in the result.

image

Investigation

It seems like only months in which an observation period is started are included in the result. While this might be expected for most data, this does create edge-cases where this is not handled correctly (e.g. if observation periods only start in first of the month, or the last month not being included as described in issue #20)

For replication, this is the mock data used:

INSERT INTO observation_period (observation_period_id, person_id, observation_period_start_date, observation_period_end_date)
              VALUES 
                (1, 1, '2022-01-01', '2023-01-01'),
                (2, 2, '2023-01-01', '2024-01-01'),
                (3, 3, '2023-06-01', '2024-01-01')
;