Skip to content

Temporal annual distribution functionality and temporal FeatureExtraction capability enablement #2388

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

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

alex-odysseus
Copy link
Contributor

Addressing #2331 (temporal annual distribution requirement)

Cohort Characterization Controller has been extended with a new endpoint
GET /generation/{generationId}/temporalresult

Temporal annual distribution and temporal Cohort Characterization analysis execution results are selected from newly introduced tables in the result schema - cc_temporal_results and cc_temporal_annual_results

Each Feature Analysis has been extended with two attributes indicating their temporal and temporal annual distribution properties depending on their actual support by FeatureExtraction

@@ -26,4 +26,42 @@ CREATE TABLE @results_schema.cc_results
aggregate_id INTEGER,
aggregate_name VARCHAR(1000),
missing_means_zero INTEGER
);

IF OBJECT_ID('@results_schema.cc_temporal_results') IS NULL
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar notation as for the table above should be used

IF OBJECT_ID('@results_schema.table', 'U') IS NULL

'DemographicsPriorObservationTime',
'DemographicsPostObservationTime',
'DemographicsTimeInCohort',
'DemographicsIndexYearMonth'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the list final?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oleg-odysseus and others added 6 commits September 4, 2024 14:25
[ATL-10] Added an option to exclude creating comparative items for the covariates comparison feature
…ke it was done for the annual Feature Analysis flag
Fixed NullPointerException during saving of a cohort characterization with missing design
@anthonysena anthonysena self-assigned this Dec 17, 2024
@alex-odysseus
Copy link
Contributor Author

Chris, please pull the code @chrisknoll

@chrisknoll
Copy link
Collaborator

chrisknoll commented Mar 27, 2025

Error when generating:

2025-03-27 15:21:52.331 INFO taskExecutor-1 org.springframework.batch.core.job.SimpleStepHandler - [] - Executing step: [generateCohortCharacterization.generate]
2025-03-27 15:21:52.854 ERROR taskExecutor-1 org.ohdsi.webapi.common.generation.TransactionalTasklet - [] - JSONObject["sqlQueryFeatures"] not found.
org.json.JSONException: JSONObject["sqlQueryFeatures"] not found.
	at org.json.JSONObject.get(JSONObject.java:570) ~[json-20230227.jar:?]
	at org.json.JSONObject.getString(JSONObject.java:857) ~[json-20230227.jar:?]
	at org.ohdsi.cohortcharacterization.CCQueryBuilder.getQueriesForPresetAnalyses(CCQueryBuilder.java:251) ~[SkeletonCohortCharacterization-2.0.0.jar:?]

This came from a copy of an existing CC, where I switched on the new options in the design.

@alex-odysseus @oleg-odysseus

Attached is sample CC example: CC_TestCase.txt

Copy link
Collaborator

@chrisknoll chrisknoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will approve once errors are resolved.

@oleg-odysseus
Copy link
Contributor

oleg-odysseus commented Apr 1, 2025

Hi @chrisknoll , @anthonysena . I was able to reproduce the problem, a small fix on the SkeletonCohortCharacterization was enough for the test CC you've provided to get generated locally (Report opens, the temporal distributions are in place). I assume we`ll need to release the skeleton lib once again.. Fix PR: SkeletonCohortCharacterization PR 47 , Thank you.

@chrisknoll
Copy link
Collaborator

Yes, please release SkeletonCC, and as part of this release if we could add this failure as a test case for the package.

@oleg-odysseus
Copy link
Contributor

Hi @chrisknoll , @anthonysena , thank you for releasing SkeletonCohortCharacterization v2.0.1. Looks like the CI for this PR now succeeds and there are no merge conflicts so far. Please kindly merge if you have no other remarks. Thank you.

@chrisknoll
Copy link
Collaborator

While the functionality seems to work, my concern is on execution time. Here's a screen-shot of 2 executions, the 5 minute one is without the new options, the 13 hour one is with the options enabled. This was running on a large sample CDM on my local box:

image

So I'm concerned about releasing this feature and leading to 100-fold increase in execution time. Maybe we can spend some time at the meeting evaluating the queries and understanding if there's a performance optimization to be made.

@anthonysena @alex-odysseus

@chrisknoll
Copy link
Collaborator

@oleg-odysseus : per our conversation on WG call, you'll investigate the comparison flag that is leading to an empty STDDiff column in the UI.

For context: it seems that the new atlas branch shows the correct STDDiff values when the WebAPI branch is 'master'...only switching to the WebAPI temporal prevalence branch leads to the error in the UI where the StdDiff column is empty.

…s with temporal distributions for a scenario with 2 cohorts.
@oleg-odysseus
Copy link
Contributor

oleg-odysseus commented Apr 15, 2025

@chrisknoll , I've reproduced the problem locally and decided to roll back the change that I've introduced some time ago that led to this behavior (that change forced disabling the comparative results). Now as per my local checks, the reports behave as usual for the analysis with multiple cohorts. If the analysis was generated with temporal distribution then the links to observe those distributions would be visible for 1, 3 or more cohorts. For the comparative mode (2 cohorts) the link is not enabled, but if a user needs to observe temporal/annual distribution for the cohort then he/she could exit the comparative mode by selecting, for example, only that particular cohort and observing temporal distributions for it by clicking the link.

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