Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add support for filters and transformation #129

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pieterlukasse
Copy link
Contributor

Link to JIRA ticket if there is one:
https://ctds-planx.atlassian.net/browse/VADC-1642,
https://ctds-planx.atlassian.net/browse/VADC-1585,
https://ctds-planx.atlassian.net/browse/VADC-1586

Combines #128 and #126 in a single PR to master.

New Features

  • add support for the new "filters" and "transformation" sections to various endpoints

Deployment changes

  • cohort-middleware might need an extra permission to create temp tables

Breaking changes

  • The endpoint /cohort-stats/by-source-id/:sourceid/by-cohort-definition-id/:cohortid/by-concept-id/:conceptid is now adjusted to /cohort-stats/by-source-id/:sourceid/by-cohort-definition-id/:cohortid and the concept to get stats on should be the last variable in the POST request body
  • The endpoint /histogram/by-source-id/:sourceid/by-cohort-definition-id/:cohortid/by-histogram-concept-id/:histogramid is now adjusted to /histogram/by-source-id/:sourceid/by-cohort-definition-id/:cohortid and the concept to get histogram on should be the last variable in the POST request body

feat: add new support for filters and transformation arguments in histogram endpoint

* fix: fix the naming for concept lists
...from ids to definitions (defs) and add some parsing for the new filter entries
in request body

* feat: working histogram endpoint POC for using tmp table for transformations

* feat: added first log transformation

* feat: added z-score transformation

* feat: add tempttablecache to include cleanup of oldest / least accessed item

* tmp: temporarily disable strict validation until frontend is fixed

* feat: add new ToSQL wrapper method

* feat: remove histogramConceptId from histogram endpoint
...and expect it as part of the variables instead

* fix: make sure only postgresql and sqlserver are accepted for now

* fix: naming improvements and extra unit tests

* fix: improve coverage of parsing.go

* feat: improve coverage of TempTableCache

* feat: improve coverage of TableExists
…endpoint (#126)

* feat: add filter and transformation support to breakdown / attrition endpoint

Also:
- feat: update RetrieveStatsForCohortIdAndConceptId and remove deprecated method
- feat: refactor RetrieveCohortOverlapStats and fix breakdown stats method
...and fix model tests
- feat: comment on a comment
...see also #5 (comment)
- feat: refactor RetrieveDataBySourceIdAndCohortIdAndVariables
... and deprecate model method in favor of the histogram one
that retrieves the same data but is already refactored.
- feat: remove deprecated breakdown stats method

* fix: restore variable type validation

* feat: remove QueryFilterByConceptIdsHelper deprecated method

* fix: fix breakdown query so it checks on the breakdown concept values

* fix: fix breakdown query

* fix: better naming and more tests covering filter/transformation
@pieterlukasse pieterlukasse marked this pull request as draft March 5, 2025 18:47
@pieterlukasse
Copy link
Contributor Author

pieterlukasse commented Mar 5, 2025

Converting to Draft PR since the code has not gone through all testing phases (it has been reviewed - see PRs #125, #126, #128 - but briefly tested in QA only).

Copy link

github-actions bot commented Mar 5, 2025

filepath $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{tests/test\_homepage.py}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$

Please find the detailed integration test report here

Please find the ci env pod logs here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant