aphp / eds-scikit

eds-scikit is a Python library providing tools to process and analyse OMOP data
https://aphp.github.io/eds-scikit
BSD 3-Clause "New" or "Revised" License
35 stars 5 forks source link

[WIP] plot_age_pyramid: add the possibility to have one datetime_ref that differs for each patient #18

Closed strayMat closed 1 year ago

strayMat commented 1 year ago

The previous plot_age_pyramid function only allow for one fixed datetime reference for all persons.

In some case studies , we would like to have a different datetime of reference for each person. Eg. the date of their inclusion in the study. The objective is to draw the pyramid of ages of patient at inclusion. (Very useful and more pertinent when we have cohorts over a long time period).

Description

Add to plot_age_pyramid the possibility to give the datetime_ref argument as a column name.

Checklist

Vincent-Maladiere commented 1 year ago

Looks good! We need to merge #20 before we merge this PR as well.

codecov-commenter commented 1 year ago

Codecov Report

Base: 95.08% // Head: 94.94% // Decreases project coverage by -0.13% :warning:

Coverage data is based on head (1b4f6a7) compared to base (2ad6ec3). Patch coverage: 87.17% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #18 +/- ## ========================================== - Coverage 95.08% 94.94% -0.14% ========================================== Files 65 65 Lines 2034 2057 +23 ========================================== + Hits 1934 1953 +19 - Misses 100 104 +4 ``` | [Impacted Files](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp) | Coverage Δ | | |---|---|---| | [eds\_scikit/utils/custom\_implem/custom\_implem.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC91dGlscy9jdXN0b21faW1wbGVtL2N1c3RvbV9pbXBsZW0ucHk=) | `75.00% <44.44%> (-12.50%)` | :arrow_down: | | [eds\_scikit/plot/data\_quality.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC9wbG90L2RhdGFfcXVhbGl0eS5weQ==) | `100.00% <100.00%> (ø)` | | | [eds\_scikit/utils/custom\_implem/cut.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC91dGlscy9jdXN0b21faW1wbGVtL2N1dC5weQ==) | `100.00% <100.00%> (ø)` | | | [eds\_scikit/icu/icu\_care\_site.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC9pY3UvaWN1X2NhcmVfc2l0ZS5weQ==) | `100.00% <0.00%> (ø)` | | | [eds\_scikit/structures/description.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC9zdHJ1Y3R1cmVzL2Rlc2NyaXB0aW9uLnB5) | `100.00% <0.00%> (ø)` | | | [eds\_scikit/emergency/emergency\_visit.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC9lbWVyZ2VuY3kvZW1lcmdlbmN5X3Zpc2l0LnB5) | `100.00% <0.00%> (ø)` | | | [eds\_scikit/emergency/emergency\_care\_site.py](https://codecov.io/gh/aphp/eds-scikit/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp#diff-ZWRzX3NjaWtpdC9lbWVyZ2VuY3kvZW1lcmdlbmN5X2NhcmVfc2l0ZS5weQ==) | `90.32% <0.00%> (+0.32%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aphp)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

strayMat commented 1 year ago

Where are we for this PR ? I am not sure to see what is missing before merging ?

Vincent-Maladiere commented 1 year ago

Close in favor of #43 to avoid nested merging conflicts.