Skip to content

Commit

Permalink
issue #442
Browse files Browse the repository at this point in the history
  • Loading branch information
nmercadeb committed Feb 8, 2025
1 parent 95212a9 commit 5361064
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 60 deletions.
46 changes: 1 addition & 45 deletions R/benchmark.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ benchmarkCohortConstructor <- function(cdm,
omopgenerics::assertLogical(dropCohorts)
tictoc::tic.clearlog()

# Read JSONs of cohorts to create ----
jsons <- CDMConnector::readCohortSet(here::here("extras", "JSONCohorts")) |>
dplyr::filter(.data$cohort_name != "first_depression")

# prefix for cohorts created - to drop later
pref <- paste0("bench", paste0(sample.int(9,3), collapse = ""))

# Instantiate or read Atlas ----
Expand All @@ -58,11 +55,6 @@ benchmarkCohortConstructor <- function(cdm,
}
}

# Get codelist ----
if (runCohortConstructorDefinition | runCohortConstructorDomain) {
codes <- getCodes(cdm)
}

# CohortConstructor by definition ----
if (runCohortConstructorDefinition) {
cli::cli_inform(c(""))
Expand Down Expand Up @@ -778,42 +770,6 @@ getTimes <- function(log, cdm) {
)
}

getCodes <- function(cdm) {
concept_sets <- c(
"inpatient_visit", "beta_blockers", "symptoms_for_transverse_myelitis",
"asthma_therapy", "fluoroquinolone_systemic",
"congenital_or_genetic_neutropenia_leukopenia_or_agranulocytosis",
"endometriosis", "chronic_obstructive_lung_disease", "essential_hypertension",
"asthma", "neutropenia_agranulocytosis_or_unspecified_leukopenia",
"dementia", "schizophrenia_not_including_paraphenia", "psychotic_disorder",
"bipolar_disorder", "major_depressive_disorder", "transverse_myelitis",
"schizoaffective_disorder", "endometriosis_related_laproscopic_procedures",
"long_acting_muscarinic_antagonists_lamas", "neutrophilia", "covid_19",
"sars_cov_2_test", "neutrophil_absolute_count",
"mncs_abdominal_aortic_aneurysm_repair", "mncs_above_knee_amputation",
"mncs_adrenalectomy", "mncs_appendectomy", "mncs_below_knee_amputation",
"mncs_breast_reconstruction", "mncs_celiac_artery_revascularization",
"mncs_cerebrovascular_surgery", "mncs_cholecystectomy",
"mncs_complex_visceral_resection_liver", "mncs_complex_visceral_resection_oesophagus",
"mncs_complex_visceral_resection_pancreas_biliary", "mncs_craniotomy",
"mncs_head_neck_resection", "mncs_hysterectomy_opherectomy",
"mncs_iliac_femoral_bypass", "mncs_internal_fixation_femur", "mncs_knee_arthroplasty",
"mncs_lobectomy", "mncs_lymph_node_dissection", "mncs_major_hip_pelvic_surgery",
"mncs_mytoreductive_surgery", "mncs_peripheral_vascular_lower_limb_arterial_bypass",
"mncs_pneumonectomy", "mncs_radical_hysterectomy", "mncs_radical_prostatectomy",
"mncs_renal_artery_revascularization", "mncs_sb_colon_rectal", "mncs_splenectomy",
"mncs_stomach_surgery", "mncs_thoracic_resection", "mncs_thoracic_vascular_surgery",
"mncs_transurethral_prostatectomy", "mncs_ureteric_kidney_bladder_surgery"
)
codes_cdm <- CodelistGenerator::codesFromCohort(here::here("extras", "JSONCohorts"), cdm)
codes <- as.list(rep(100001L, length(concept_sets))) # mock concept as place-holder
names(codes) <- concept_sets
for (nm in names(codes_cdm)) {
codes[nm] <- codes_cdm[nm]
}
return(codes)
}

runWithoutIndex <- function(cdm, codes) {

}
Binary file modified R/sysdata.rda
Binary file not shown.
Binary file removed data-raw/data/Results_AurumCDM_202403_20240920.zip
Binary file not shown.
Binary file removed data-raw/data/Results_CORIVA-Estonia_20240913.zip
Binary file not shown.
Binary file removed data-raw/data/Results_CPRD Gold 100k_20240909.zip
Binary file not shown.
Binary file removed data-raw/data/Results_OHDSI SQL server_20240924.zip
Binary file not shown.
Binary file removed data-raw/data/Results_OHDSI postgres_20241007.zip
Binary file not shown.
Binary file removed data-raw/data/Results_OHDSI redshift_20241008.zip
Binary file not shown.
Binary file removed data-raw/data/Results_OHDSI snowflake_20241009.zip
Binary file not shown.
12 changes: 0 additions & 12 deletions data-raw/domainsData.R

This file was deleted.

2 changes: 1 addition & 1 deletion data-raw/getBenchmarkResults.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ niceNum <- function(x, dec = 0) {

# get data ----
resultPatterns <- c("time", "comparison", "details", "omop", "index_counts", "sql_indexes")
benchmarkDataPre <- readData(here::here("data-raw", "data")) |>
benchmarkDataPre <- readData(here::here("data-raw", "benchmarkResults")) |>
mergeData(resultPatterns) |>
updateCDMname(old = "AurumCDM_202403", new = "CPRD Aurum") |>
updateResultType(old = "cohort_overlap", new = "summarise_cohort_overlap")
Expand Down
19 changes: 17 additions & 2 deletions data-raw/internalData.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
source(here::here("data-raw", "domainsData.R"))
usethis::use_data(domainsData, internal = TRUE, overwrite = TRUE)
domainsData <- dplyr::tribble(
~"domain_id", ~"table", ~"concept", ~"source", ~"start", ~"end",
"drug", "drug_exposure", "drug_concept_id", "drug_source_concept_id", "drug_exposure_start_date", "drug_exposure_end_date",
"condition", "condition_occurrence", "condition_concept_id", "condition_source_concept_id", "condition_start_date", "condition_end_date",
"procedure", "procedure_occurrence", "procedure_concept_id", "procedure_source_concept_id", "procedure_date", "procedure_date",
"observation", "observation", "observation_concept_id", "observation_source_concept_id", "observation_date", "observation_date",
"measurement", "measurement", "measurement_concept_id", "measurement_source_concept_id", "measurement_date", "measurement_date",
"visit", "visit_occurrence", "visit_concept_id", "visit_source_concept_id", "visit_start_date", "visit_end_date",
"device", "device_exposure", "device_concept_id", "device_source_concept_id", "device_exposure_start_date", "device_exposure_end_date"
)

jsons <- CDMConnector::readCohortSet(here::here("extras", "JSONCohorts")) |>
dplyr::filter(.data$cohort_name != "first_depression")

load(here::here("extras", "benchmarkCodelists.RData"))

usethis::use_data(domainsData, jsons, codes, internal = TRUE, overwrite = TRUE)

Binary file added extras/benchmarkCodelists.RData
Binary file not shown.

0 comments on commit 5361064

Please sign in to comment.