oxford-pharmacoepi / MegaStudy

4 stars 2 forks source link

VISIT_DETAIL_ID under DRUG_EXPOSURE #12

Closed yichienlee2 closed 8 months ago

yichienlee2 commented 8 months ago

We have OMOP databases from various data providers. Some of them do not have all tables/columns in the CDM. Can I confirm it's a deal breaker (i.e. we cannot run the study) if we do not have VISIT_DETAIL_ID or VERBATIM_END_DATE under DRUG_EXPOSURE?

We have another database that does not provide CONCEPT table, I believe that's a deal breaker too?

Thank you for your help!

Below is the error messages around lack of VERBATIM_END_DATE:

source("E:/doc/internal/OMOP/Megastudy_feasibility/MegaStudy/Feasibility Code/RunFeasibility.R") population after earliestStartDate smaller than sample, ignoring date for sampling Error in dplyr::collect(): ! Failed to collect lazy table. Caused by error: ! nanodbc/nanodbc.cpp:1526: 42000: SQL compilation error: error line 7 at position 18 invalid identifier '"verbatim_end_date"' Run rlang::last_trace() to see where the error occurred.

rlang::last_trace() <error/rlang_error> Error in dplyr::collect(): ! Failed to collect lazy table. Caused by error: ! nanodbc/nanodbc.cpp:1526: 42000: SQL compilation error: error line 7 at position 18 invalid identifier '"verbatim_end_date"'

Backtrace: ▆

  1. ├─base::source("E:/doc/internal/OMOP/Megastudy_feasibility/MegaStudy/Feasibility Code/RunFeasibility.R")
  2. │ ├─base::withVisible(eval(ei, envir))
  3. │ └─base::eval(ei, envir)
  4. │ └─base::eval(ei, envir)
  5. ├─DrugExposureDiagnostics::executeChecks(...) at MegaStudy/Feasibility Code/RunFeasibility.R:66:0
  6. │ └─DrugExposureDiagnostics:::executeChecksSingleIngredient(...) at DrugExposureDiagnostics/R/executeChecks.R:74:4
  7. │ ├─... %>% dplyr::collect() at DrugExposureDiagnostics/R/executeChecks.R:227:4
  8. │ └─DrugExposureDiagnostics:::getDrugMissings(...) at dplyr/R/compute-collect.R:51:2
  9. │ └─... %>% ... at DrugExposureDiagnostics/R/drugRecordChecks.R:48:2
  10. ├─dplyr::collect(.)
  11. ├─tidyr::pivot_longer(...)
  12. ├─dplyr::collect(.)
  13. └─dbplyr:::collect.tbl_sql(.) at dplyr/R/compute-collect.R:51:2 Run rlang::last_trace(drop = FALSE) to see 6 hidden frames.
tiozab commented 8 months ago

@yichienlee2 sorry, yes the missing will look for those concepts, I forgot about that. Please remove in line 96 from the RunFeasibilty the check "missing" and try again.

yichienlee2 commented 8 months ago

@tiozab thank you, it works now! I do not have further questions.

The only remaining database we have do not even provide CONCEPT table and I believe there is no workaround we can do,

tiozab commented 8 months ago

Well, the concept table is needed to get the descendant (more granular) drug concepts from the ingredient level in this feasibility step.

yichienlee2 commented 8 months ago

Completely understood, we already reached out to our data provider to discuss including concepts tables moving forward. Thank you for your help and guidance along the way.