OHDSI Home | Forums | Wiki | Github

CohortDiagnostics package questions

(Vojtech Huser) #1

The CohortDiagnostics package (at https://github.com/OHDSI/CohortDiagnostics ) is very useful.

There are instructions, how to use it at a site that also has Atlas/webAPI installed.

Those who use it in R, it would be good to have a vignette (or other guide) how to use it at a site without Atlas/webAPI installed.

This code here https://github.com/ABMI/Covid19Characterization/blob/master/Covid19TestCharacterization/extras/CodeToRun.R#L46 seems to demostrate that a site does not need Atlas.

It seem like I just need to emulate this call using R code (and not webapi)

Is that right? The assumption is that I have .SQL definitions of the cohorts in my local hard drive. (like 2018 and 2019 network studies tended to do)
E.g. https://github.com/vojtechhuser/SkeletonDescriptiveStudy/blob/master/R/CreateCohorts.R#L37

Requiring a site to have webAPI fully working is a significant burden (block for some sites).

(Martijn Schuemie) #2

Yes, there are two approaches to running CohortDiagnostics: The cohort diagnostics can be embedded in an OHDSI study package, where all the cohort definitions are stored as part of that study package, or the cohort diagnostics can be used as a stand-alone solution, relying on a WebAPI instance to provide the cohort definitions.

For the first option, you can use the example package included in the CohortDiagnostics repo as a starting point. See the README for details how to modify it to your needs.

(Martijn Schuemie) #3

(Added an issue to create a vignette about this)

(Chris Knoll) #4

Is it also true that you could use your own custom cohort table for execution in cohort diagnostics? Ie: let’s say you made your drug_era table your cohort table, where the drug_concept_id in the drug_era table would serve as your cohort_definition_id, and your drug_era_start/end dates would serve as your cohort_start/end dates…in this way you could get a diagnostic report without any cohort construction at all? I think you’d still have to work out building a cohrotSetReference .csv file (but you can easily construct this by querying for the drug_concept name from the vocabulary). I think there’s a way to skip cohort construction as a paramater in the R package…where it assumes you already have a cohort table constructed.


(Martijn Schuemie) #5

Yes, the main runCohortDiagnostics function assumes the cohorts have already been constructed, but… it still needs the JSON and SQL, for example to figure out the labels for the inclusion rules, or the SQL for instantiating the concept sets.

As a consequence, even though you might trick CohortDiagnostics in executing on cohorts that were created with custom SQL code, several of the diagnostics would fail because the JSON and SQL are not there, or not as expected.