Contribute with concept sets
OmopConcepts is an open-source library and it is open to external contributions. In this vignette we explain how to contribute with new concept sets (and codelists) to the library.
First of all clone repo locally and open the R project. Export the concept set of interest in the folder ‘resources/concept_sets/’. Please make sure the concept set has a name not used before. OmopConcepts is an incremental library and in general we do not change existing concept sets.
library(dplyr)
cs <- list(
infection_present = tibble(
concept_id = 40664135L,
excluded = FALSE,
descendants = TRUE,
mapped = FALSE
)
) |>
newConceptSetExpression()
cs
exportConceptSetExpression(
x = cs,
path = "resources/concept_sets",
type = "csv"
)Once added the concept set document it in the metadata:
library(readr)
# read current metadata
mt <- read_csv(
file = "resources/metadata.csv",
col_types = c(
concept_set_id = "i",
concept_set_name = "c",
description = "c",
author = "c",
reference = "c",
tag = "c"
)
)
# new line in metadata
new_mt <- tibble(
concept_set_id = max(mt$concept_set_id) + 1L,
concept_set_name = "infection_present", # edit with name of your concept set
description = "Short description how this concept set was created and used.",
author = "@your_github_username;second author;...", # GitHub user name or your name, separate names with ;
reference = "https://doi.org/10.1016/S2213-2600(23)00414-9", # separate doi links with ;
tag = "table1;charlson_index" #tags separated by ;
)
# join together
mt <- union_all(mt, new_mt)
# write metadata
write_csv(x = mt, file = "resources/metadata.csv")Now you can open a Pull Request and wait for a review.
Contribute with a codelist
You can also export codelists as concept sets:
codelist <- newCodelist(x = list(infection_present = 40664135L))
codelist
exportConceptSetExpression(
x = codelist,
path = "resources/concept_sets",
type = "csv"
)