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

Error in Cohort Characterization tab #94

Open
bdemeulder opened this issue Oct 19, 2021 · 10 comments · Fixed by #95
Open

Error in Cohort Characterization tab #94

bdemeulder opened this issue Oct 19, 2021 · 10 comments · Fixed by #95
Assignees

Comments

@bdemeulder
Copy link
Collaborator

In the shiny app cohort characterisation, there seems to be an error in parsing the results.
image

Further, when looking only at the demographics domain, it seems the rows are replicated many times in the table (e.g. more than 170 occurences of gender=male)

image

Compare cohorts characteristics seems fine.

@MaximMoinat
Copy link
Collaborator

MaximMoinat commented Oct 25, 2021

That indeed looks like a join/merge gone wrong, but I can't reproduce this with the data on my side. What premerge.R data file are you using? @bdemeulder

@bdemeulder
Copy link
Collaborator Author

@MaximMoinat I'm using the one I've just uploaded to teams (task #5/Processed results files/results)

@MaximMoinat
Copy link
Collaborator

I found the issue, the function getCovariateDataSubset returns data for all cohorts while it should filter for the selected cohort. So the duplication that we are seeing are the covariates for all cohorts. We are not seeing this in the cohort comparison tab as this filters in a different way.

getCovariateDataSubset <- function(cohortId, databaseList, comparatorCohortId = NULL) {
if (usingDbStorage()) {
return(getCovariateValue(connPool, cohortId = cohortId, databaseList = databaseList, comparatorCohortId = comparatorCohortId))
} else {
return(covariateValue[covariateValue$cohortId %in% c(cohortId, comparatorCohortId) & covariateValue$databaseId %in% databaseList, ])
}
}

Debugging further to find a solution.

@MaximMoinat
Copy link
Collaborator

MaximMoinat commented Oct 27, 2021

PR #95 fixes an issue on the shiny side. However, there is another issue with duplicate covariateIds. See following screenshot, where e.g. id 462874664123 is in there twice, with a different name. They should have different windowId's and therefore a different last digit.

It seems like databases have conflicting sets of covariateIds. Could it be one or more have run a different version of the study package?

image

@bdemeulder
Copy link
Collaborator Author

Checked in the different datasets, there are indeed two sets of results with different covariate IDs.
When generating a new premerge.Rdata with only CPRD, MarketScan, OPTUM (the three from Bayer) + MAITT and TMC, there are no issues anymore.

image

Those seem to agree on the covariate table.

image

So indeed, some datasets might have run different version of the package.

@bdemeulder
Copy link
Collaborator Author

@MaximMoinat, @keesvanbochove: how can we check what the proper covariate table should be in the current version, so we can pinpoint which datasets have run the correct version and which should run it again?

bdemeulder added a commit that referenced this issue Oct 27, 2021
Fixes #94 by replacing function getCovariateDataSubset
This fix works when combined with a newly generated preMerge data from datasets that have the same covariate table
@bdemeulder bdemeulder reopened this Oct 27, 2021
@ablack3
Copy link

ablack3 commented Oct 28, 2021

The version of the results viewer on https://data.ohdsi.org/PioneerWatchfulWaiting/ still has this issue. The download button on the characterization tab fails as well.

image

@keesvanbochove
Copy link
Collaborator

The version of the results viewer on https://data.ohdsi.org/PioneerWatchfulWaiting/ still has this issue. The download button on the characterization tab fails as well.

@bdemeulder could you upload the new merged set to the OHDSI server so this could be fixed online as well?

@bdemeulder
Copy link
Collaborator Author

bdemeulder commented Nov 9, 2021

@keesvanbochove , I've updated the merged set and created pull request #134 on shiny deploy to trigger the update. Could you approve it?

@ahijazy ahijazy reopened this May 25, 2023
@ahijazy
Copy link
Collaborator

ahijazy commented May 25, 2023

Facing the same issue, could you please clarify how was the error finally solved?

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 a pull request may close this issue.

5 participants