OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
41 stars 48 forks source link

Use external concept counts #1136

Open ablack3 opened 2 weeks ago

ablack3 commented 2 weeks ago

Moving this PR to the OHDSI organization so we can run all the tests in github actions.

ablack3 commented 2 weeks ago

A possible change if you want would be to make the CD concept counts table here identical to the fields needed in the achilles table - before I go and check @ablack3 @cebarboza, are they substantially different?

The achilles table we would like to use has "concept_id", "record_count", "descendant_record_count", and we would like to add "person_count" and "descendant_person_count" so we could use those column names.

https://github.com/OHDSI/Achilles/blob/247b86da872ceeb80b70d35901faa6795d3ab0d8/inst/sql/sql_server/analyses/create_result_concept_table.sql#L31

ablack3 commented 2 weeks ago

We are adding two parameters that depend on each other: conceptCountsTable (temp or not temp) and useExternalConceptCountsTable (T or F).

Let's list out the expected behavior:

T F
temp error? created as temp table. replace if it already exists.
permanent look for the table in the cohort schema. if it does not exist create it. ignore conceptCountsTable parameter. create temp table. replace if it already exists.

I'm wondering if we could do this with just one parameter, the cohortCountsTable. if it exists we use it and if not we recreate it.

azimov commented 4 days ago

@cebarboza @ablack3 I'm going to release 3.3.0 today for the HADES wide lock file so this will make its way in to a 3.4.0 release whenever it becomes ready