-
Notifications
You must be signed in to change notification settings - Fork 50
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
Separating individual functions in cohort diagnostics #1043
Comments
@azimov we talked about this idea back at the symposium and I have revisited it now. In a fork I have individualized some of these functions. I have tried to add unit tests to the proposed exposed functions. However I am encountering an issue in the testing environment with Take this code-block. In the testing environment it returns an error even though I know this file exists. Cannot find 'GetCalendarYearRange.sql' in the 'sql' or 'sql/sql_server' folder of the 'CohortDiagnostics' package. To avoid this issue in run tests, I unpacked the
but that would require editing a lot of code-blocks in CohortDiagnostics. Have you encountered this issue in tests? |
@mdlavallee92 Is this using An easy workaround on linux/mac is to create the symbolic link Doing this should also work with If you're using RCmd check in R studio (a setting you must adjust, it will try devtools by default I think) the tests should then normally find the SQL files. I was unaware of |
@mdlavallee92 - To the main point of this question. I do intend to expose the functions for use outside of the package, however I can't give a clear timeline. I would also vastly prefer to write unit tests for all the functions directly because the current test suite takes a long time to run and errors are often not especially meaningful. So the steps I would like to see are:
Until then It should be possible for you to call these functions with triple colon calls, |
Yeah that is what I am talking about the devtools::test. I tried to swap out |
Context Pipeline From the
In steps 5-12 there are other wrappers to functionalize the "worker" method on multiple cohort definitions, prep them for saving, provide logging information and export. There are a few exceptions such as Suggestion: Expose the singular diagnostic methods in the pipeline Some of these methods are already exposed (
Other steps in the pipeline are already functions from other packages....cohorts counts and inclusion stats from Cohort Generator and Cohort Characterization from FeatureExtraction What do you think @azimov? |
You could also try |
Here is the start of the idea I have, needs some further polishing (checkmates etc) but lot of the code stays the same. Just a matter of disentangling the dependencies, particularly with the concept set diagnostics. In the process of building the unit tests to make sure these work in isolation. Started testing in Eunomia on cohort 17492 from the cohorts to create tests you already have in there. Take a look and see what you think! No worries if this is in the wrong direction. |
@mdlavallee92 I completley agree with the principle of separating this out into distinct parts of a pipeline. Part of the reasoning behind RMM was to allow people to begin extending Ohdsi result sets in a consistent manner. I can imagine someone extending the pipeline of CohortDiagnostics pretty trivially by adding their own diagnostics functions that they maybe aren't ready (or willing) to share with the wider world but want to include in their results. Just adding a function and exporting the results according to their model specification and uploaded. With the changes to |
A use case I have for cohort diagnostics is running one of the low-level methods of cohort diagnostics such as
getIncidenceRate
orgetVisitContext
for a single cohort instead of executing the entireexecuteDiagnostics
or even for a set of cohorts. Is it within the development scope of Cohort Diagnostics to expose these individual functions?for example:
The text was updated successfully, but these errors were encountered: