Skip to content

Commit

Permalink
Merge branch 'main' into find_orphan_codes
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-burn authored Jan 22, 2024
2 parents 44cf1db + 14994c9 commit e82f595
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 42 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: CodelistGenerator
Title: Generate Code Lists for the OMOP Common Data Model
Version: 2.1.1
Version: 2.1.2
Authors@R: c(
person("Edward", "Burn", email = "[email protected]",
role = c("aut", "cre"),
Expand Down Expand Up @@ -50,3 +50,4 @@ Config/testthat/parallel: true
VignetteBuilder: knitr
URL: https://darwin-eu.github.io/CodelistGenerator/
Language: en-US
Config/testthat/parallel: true
1 change: 0 additions & 1 deletion R/mockVocabRef.R
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,4 @@ mockVocabRef <- function(backend = "database") {
}

cdm

}
72 changes: 33 additions & 39 deletions extras/precomputeVignetteData.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ devtools::load_all()

# example with postgres database connection details
db <- dbConnect(RPostgres::Postgres(),
dbname = "cdm_iqvia_pharmetrics_plus_202203",
dbname = "cdm_gold_202301",
port = Sys.getenv("DB_PORT") ,
host = "163.1.65.51",
user = Sys.getenv("DB_USER"),
Expand Down Expand Up @@ -46,9 +46,9 @@ rm(cdm)
# intro vignette ----
vocabVersion <- getVocabVersion(cdm = cdm_arrow)

saveRDS(
save(
vocabVersion,
here("vignettes", "introVocab.RData")
file = here("vignettes", "introVocab.RData")
)


Expand All @@ -70,12 +70,12 @@ saveRDS(
dementiaCodes1 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "dementia",
domains = "Condition",
searchViaSynonyms = FALSE,
fuzzyMatch = FALSE,
#searchViaSynonyms = FALSE,
#fuzzyMatch = FALSE,
exclude = NULL,
includeDescendants = TRUE,
includeAncestor = FALSE,
verbose=TRUE
#verbose=TRUE
)
saveRDS(
dementiaCodes1,
Expand Down Expand Up @@ -112,15 +112,15 @@ saveRDS(
oaCodes1 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = "Condition",
searchViaSynonyms = FALSE,
fuzzyMatch = FALSE,
#searchViaSynonyms = FALSE,
#fuzzyMatch = FALSE,
exclude = c(
"post-infection",
"post-traumatic"
),
includeDescendants = FALSE,
includeAncestor = FALSE,
verbose = TRUE
#verbose = TRUE
)
saveRDS(
oaCodes1,
Expand All @@ -131,8 +131,8 @@ saveRDS(
oaCodes2 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = "Condition",
searchViaSynonyms = FALSE,
fuzzyMatch = FALSE,
#searchViaSynonyms = FALSE,
#fuzzyMatch = FALSE,
exclude = c(
"post-infection",
"post-traumatic"
Expand All @@ -149,9 +149,9 @@ saveRDS(
oaCodes3 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = c("Condition", "Observation"),
searchViaSynonyms = FALSE,
fuzzyMatch = FALSE,
maxDistanceCost = 0.1,
#searchViaSynonyms = FALSE,
#fuzzyMatch = FALSE,
#maxDistanceCost = 0.1,
exclude = c(
"post-infection",
"post-traumatic"
Expand All @@ -169,9 +169,9 @@ oaCodes4 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = "Condition",
searchInSynonyms = TRUE,
searchViaSynonyms = TRUE,
fuzzyMatch = FALSE,
maxDistanceCost = 0.1,
#searchViaSynonyms = TRUE,
#fuzzyMatch = FALSE,
#maxDistanceCost = 0.1,
exclude = c(
"post-infection",
"post-traumatic"
Expand Down Expand Up @@ -201,15 +201,13 @@ saveRDS(
here("vignettes", "optionsData04.RData")
)



# fuzzy search
oaCodes6 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = "Condition",
searchViaSynonyms = FALSE,
fuzzyMatch = TRUE,
maxDistanceCost = 0.1,
#searchViaSynonyms = FALSE,
#fuzzyMatch = TRUE,
#maxDistanceCost = 0.1,
exclude = c(
"post-infection",
"post-traumatic"
Expand All @@ -226,9 +224,9 @@ saveRDS(
oaCodes7 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = "Condition",
searchViaSynonyms = FALSE,
fuzzyMatch = TRUE,
maxDistanceCost = 0.2,
#searchViaSynonyms = FALSE,
#fuzzyMatch = TRUE,
#maxDistanceCost = 0.2,
exclude = c(
"post-infection",
"post-traumatic"
Expand All @@ -245,9 +243,9 @@ saveRDS(
oaCodes8 <- getCandidateCodes(cdm = cdm_arrow,
keywords = "osteoarthritis",
domains = "Condition",
searchViaSynonyms = FALSE,
fuzzyMatch = FALSE,
maxDistanceCost = 0.2,
#searchViaSynonyms = FALSE,
#fuzzyMatch = FALSE,
#maxDistanceCost = 0.2,
exclude = c(
"post-infection",
"post-traumatic"
Expand All @@ -265,8 +263,7 @@ ac_codes_1 <- getCandidateCodes(cdm = cdm_arrow,
keywords="acetaminophen",
domains="drug",
standardConcept="standard",
includeDescendants = TRUE,
verbose = TRUE)
includeDescendants = TRUE)
saveRDS(
ac_codes_1,
here("vignettes", "medData01.RData")
Expand All @@ -277,8 +274,7 @@ ac_codes_2a <- getCandidateCodes(cdm = cdm_arrow,
"acetaminophen intravenous"),
domains="drug",
standardConcept="standard",
includeDescendants = TRUE,
verbose = TRUE)
includeDescendants = TRUE)
saveRDS(
ac_codes_2a,
here("vignettes", "medData02a.RData")
Expand All @@ -287,10 +283,9 @@ saveRDS(
ac_codes_2b <- getCandidateCodes(cdm = cdm_arrow,
keywords="acetaminophen",
domains="drug",
doseForm = c("injection", "intravenous"),
#doseForm = c("injection", "intravenous"),
standardConcept="standard",
includeDescendants = TRUE,
verbose = TRUE )
includeDescendants = TRUE)
saveRDS(
ac_codes_2b,
here("vignettes", "medData02b.RData")
Expand All @@ -305,11 +300,10 @@ c <- compareCodelists(ac_codes_2, ac_codes_2a)
ac_codes_3 <- getCandidateCodes(cdm = cdm_arrow,
keywords="acetaminophen",
domains="drug",
conceptClassId = c("Quant Clinical Drug"),
doseForm = c("injection", "intravenous"),
#conceptClassId = c("Quant Clinical Drug"),
#doseForm = c("injection", "intravenous"),
standardConcept="standard",
includeDescendants = TRUE,
verbose = TRUE)
includeDescendants = TRUE)
saveRDS(
ac_codes_3,
here("vignettes", "medData03.RData")
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files

library(testthat)
library(CodelistGenerator)

Expand Down
2 changes: 1 addition & 1 deletion vignettes/a01_Introduction_to_CodelistGenerator.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ getVocabVersion(cdm = cdm)
```

```{r, message=FALSE, warning=FALSE,echo=FALSE}
vocabVersion <- readRDS(here("vignettes", "introVocab.RData"))
vocabVersion <- load(here("vignettes", "introVocab.RData"))
vocabVersion
```

Expand Down
Binary file modified vignettes/introData01.RData
Binary file not shown.
Binary file modified vignettes/introData02.RData
Binary file not shown.
Binary file modified vignettes/introData03.RData
Binary file not shown.
Binary file modified vignettes/introData04.RData
Binary file not shown.
Binary file modified vignettes/introData05.RData
Binary file not shown.
Binary file modified vignettes/introVocab.RData
Binary file not shown.
Binary file modified vignettes/medData01.RData
Binary file not shown.
Binary file modified vignettes/medData02a.RData
Binary file not shown.
Binary file modified vignettes/medData02b.RData
Binary file not shown.
Binary file modified vignettes/medData03.RData
Binary file not shown.
Binary file modified vignettes/medDataConceptClass.RData
Binary file not shown.
Binary file modified vignettes/medDataDoseForms.RData
Binary file not shown.
Binary file modified vignettes/optionsData01.RData
Binary file not shown.
Binary file modified vignettes/optionsData02.RData
Binary file not shown.
Binary file modified vignettes/optionsData03.RData
Binary file not shown.
Binary file modified vignettes/optionsData04.RData
Binary file not shown.
Binary file modified vignettes/optionsData05.RData
Binary file not shown.
Binary file modified vignettes/optionsData06.RData
Binary file not shown.
Binary file modified vignettes/optionsData07.RData
Binary file not shown.

0 comments on commit e82f595

Please sign in to comment.