diff --git a/DESCRIPTION b/DESCRIPTION index 1f99ba8..866453d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: CodelistGenerator Title: Identify Relevant Clinical Codes and Evaluate Their Use -Version: 3.1.0.900 +Version: 3.2.0 Authors@R: c( person("Edward", "Burn", email = "edward.burn@ndorms.ox.ac.uk", role = c("aut", "cre"), @@ -8,9 +8,11 @@ Authors@R: c( person("Marti", "Catala", email = "marti.catalasabate@ndorms.ox.ac.uk", role = c("ctb"), comment = c(ORCID = "0000-0003-3308-9905")), - person("Xihang", " Chen", email = "xihang.chen@ndorms.ox.ac.uk", - role = c("ctb"), + person("Xihang", "Chen", email = "xihang.chen@ndorms.ox.ac.uk", + role = c("aut"), comment = c(ORCID = "0009-0001-8112-8959")), + person("Nuria", "Mercade-Besora", email = "nuria.mercadebesora@ndorms.ox.ac.uk", + role = c("aut"), comment = c(ORCID = "0009-0006-7948-3747")), person("Mike", "Du", email = "mike.du@ndorms.ox.ac.uk", role = c("ctb"), comment = c(ORCID = "0000-0002-9517-8834")), diff --git a/NAMESPACE b/NAMESPACE index dbd8bb1..7e09ac7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,9 @@ # Generated by roxygen2: do not edit by hand export("%>%") +export(availableATC) +export(availableICD10) +export(availableIngredients) export(codesFromCohort) export(codesFromConceptSet) export(codesInUse) diff --git a/R/summariseAchillesCodeUse.R b/R/summariseAchillesCodeUse.R index 944968b..c0f1691 100644 --- a/R/summariseAchillesCodeUse.R +++ b/R/summariseAchillesCodeUse.R @@ -189,6 +189,6 @@ fetchAchillesCounts <- function(cdm, analysisId, conceptId = NULL){ # the same code might appear in multiple tables so we will sum them analyses %>% dplyr::group_by(.data$concept_id) |> - dplyr::summarise(n = sum(n, na.rm = TRUE)) |> + dplyr::summarise(n = sum(.data$n, na.rm = TRUE)) |> dplyr::mutate(n = as.integer(.data$n)) } diff --git a/R/vocabUtilities.R b/R/vocabUtilities.R index b0f1638..9f30d63 100644 --- a/R/vocabUtilities.R +++ b/R/vocabUtilities.R @@ -518,10 +518,10 @@ filterOnDoseForm <- function(concepts, conceptDoseForms, doseForm){ } addIngredientCount <- function(cdm, concepts) { - ingredient_ancestor <- cdm$concept_ancestor %>% dplyr::inner_join(cdm$concept %>% - dplyr::filter(.data$concept_class_id == "Ingredient") %>% + dplyr::filter(.data$concept_class_id == "Ingredient", + .data$standard_concept == "S") %>% dplyr::select("concept_id"), by = c("ancestor_concept_id" = "concept_id")) diff --git a/_pkgdown.yml b/_pkgdown.yml index 3c11502..6fd99d7 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -28,7 +28,7 @@ reference: - matches("codesInUse|compareCodelists|subsetToCodesInUse|restrictToCodesInUse|subsetOnRouteCategory|stratifyByRouteCategory|stratifyByDoseUnit|stratifyByConcept|subsetOnDoseUnit") - subtitle: Vocabulary utility functions - contents: - - matches("getVocabVersion|getVocabularies|getConceptClassId|getDomains|getDescendants|getDoseForm|doseFormToRoute|getRouteCategories|getRoutes|getDoseUnit|getRelationshipId|getMappings|sourceCodesInUse") + - matches("getVocabVersion|getVocabularies|getConceptClassId|getDomains|getDescendants|getDoseForm|doseFormToRoute|getRouteCategories|getRoutes|getDoseUnit|getRelationshipId|getMappings|sourceCodesInUse|availableATC|availableICD10|availableIngredients") - subtitle: Create a mock dataset that contains vocabulary tables - contents: - matches("mockVocabRef") diff --git a/cran-comments.md b/cran-comments.md index e7ab6ec..2b48fd0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,3 @@ ## R CMD check results -This is a new release. +This release addresses a breaking change in a dependency. diff --git a/man/CodelistGenerator-package.Rd b/man/CodelistGenerator-package.Rd index b635b74..8ed0c6f 100644 --- a/man/CodelistGenerator-package.Rd +++ b/man/CodelistGenerator-package.Rd @@ -20,10 +20,15 @@ Useful links: \author{ \strong{Maintainer}: Edward Burn \email{edward.burn@ndorms.ox.ac.uk} (\href{https://orcid.org/0000-0002-9286-1128}{ORCID}) +Authors: +\itemize{ + \item Xihang Chen \email{xihang.chen@ndorms.ox.ac.uk} (\href{https://orcid.org/0009-0001-8112-8959}{ORCID}) + \item Nuria Mercade-Besora \email{nuria.mercadebesora@ndorms.ox.ac.uk} (\href{https://orcid.org/0009-0006-7948-3747}{ORCID}) +} + Other contributors: \itemize{ \item Marti Catala \email{marti.catalasabate@ndorms.ox.ac.uk} (\href{https://orcid.org/0000-0003-3308-9905}{ORCID}) [contributor] - \item Xihang Chen \email{xihang.chen@ndorms.ox.ac.uk} (\href{https://orcid.org/0009-0001-8112-8959}{ORCID}) [contributor] \item Mike Du \email{mike.du@ndorms.ox.ac.uk} (\href{https://orcid.org/0000-0002-9517-8834}{ORCID}) [contributor] \item Danielle Newby \email{danielle.newby@ndorms.ox.ac.uk} (\href{https://orcid.org/0000-0002-3001-1478}{ORCID}) [contributor] } diff --git a/man/availableATC.Rd b/man/availableATC.Rd new file mode 100644 index 0000000..85b2c97 --- /dev/null +++ b/man/availableATC.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helperFunctions.R +\name{availableATC} +\alias{availableATC} +\title{Get all ATC codes from the cdm} +\usage{ +availableATC(cdm, level = c("ATC 1st")) +} +\arguments{ +\item{cdm}{cdm_reference via CDMConnector} + +\item{level}{ATC level. Can be one or more of "ATC 1st", "ATC 2nd", +"ATC 3rd", "ATC 4th", and "ATC 5th"} +} +\value{ +A vector list of all ATC codes for the chosen level(s) found in the +concept table of cdm. +} +\description{ +Get all ATC codes from the cdm +} +\examples{ +\dontrun{ +cdm <- mockVocabRef() +availableATC(cdm) +} + +} diff --git a/man/availableICD10.Rd b/man/availableICD10.Rd new file mode 100644 index 0000000..2945a1f --- /dev/null +++ b/man/availableICD10.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helperFunctions.R +\name{availableICD10} +\alias{availableICD10} +\title{Get all ICD codes from the cdm} +\usage{ +availableICD10(cdm, level = c("ICD10 Chapter", "ICD10 SubChapter")) +} +\arguments{ +\item{cdm}{cdm_reference via CDMConnector} + +\item{level}{Can be either "ICD10 Chapter" or "ICD10 SubChapter"} +} +\value{ +A vector list of all ICD10 codes for the chosen level(s) found in the +concept table of cdm. +} +\description{ +Get all ICD codes from the cdm +} +\examples{ +\dontrun{ +cdm <- mockVocabRef() +availableICD10(cdm) +} +} diff --git a/man/availableIngredients.Rd b/man/availableIngredients.Rd new file mode 100644 index 0000000..46ebd6a --- /dev/null +++ b/man/availableIngredients.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helperFunctions.R +\name{availableIngredients} +\alias{availableIngredients} +\title{Get all ingredients codes from the cdm} +\usage{ +availableIngredients(cdm) +} +\arguments{ +\item{cdm}{cdm_reference via CDMConnector} +} +\value{ +A vector list of all ingredient level codes found in the concept +table of cdm. +} +\description{ +Get all ingredients codes from the cdm +} +\examples{ +\dontrun{ +cdm <- mockVocabRef() +availableIngredients(cdm) +} +}