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

Read configuration options from design spec json #282

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

chrisknoll
Copy link

@chrisknoll chrisknoll commented May 8, 2024

This PR introduces the approach to read configuration options (such as values in dropdowns and which options to enable) based on an embedded design json vs. reading for the existence of tables or querying large result tables.

Following elements are updated:

  • characterization-incidence

Notes

The original code remains in place if the design json isn't specified. To make it simpler, a new option was defined shinyApp.designSpec that can be used to contain the json-parsed design spec. See OhdsiShinyModules::getExampleAnalysisSpec() for an implementation, and note in app.R the following:

analysisSpec <- OhdsiShinyModules::getExampleAnalysisSpec();
options("shinyApp.designSpec" = analysisSpec)

With this change, you can run the example application where it will read the configuration from the JSON.

Which modules are impacted?

For some modules, there may be reference tables created that are suited to performing a lookup on in order to get the options for the given study and don't need to change for this PR. But some cases (such as characterization-incidence and possibly cohort diagnostics), you need to resort to querying the results to figure out what you selected in an analysis. This could lead to long load times and inefficient use of resources (such as seeking a billion records to find out there are two genders available).

Incidence Notes:

While I calculate the age group names from the analysis specification, I can't do the same for years and gender. It is not efficient to query a potential billion record table to find 10 distinct years or 2 distinct genders, so this PR hard codes the selections for those options to be 'Any, MALE, FEMALE' for gender and the sequence 2010 - 2024 for years. We can make this a global option to use across the shiny modules in the event we determine that we can live with a subset of choices instead of deriving them from results.

…on-Incidence module.

Added code to helers-example.R and including analysisSpecification.json for the built-in example.
@chrisknoll chrisknoll self-assigned this May 8, 2024
@chrisknoll chrisknoll changed the base branch from main to develop May 8, 2024 01:07
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.

None yet

1 participant