knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

CodelistGenerator

The goal of CodelistGenerator is to create a candidate set of codes for generating a phenotype for the OMOP CDM.

Installation

You can install the development version of CodelistGenerator like so:

devtools::install_github("edward-burn/CodelistGenerator")

Example

Note, Eunomia, used in the example below, does not include a full set of vocabularies. The full set can be downloaded from https://athena.ohdsi.org.

library(CodelistGenerator)
library(dplyr)
library(Eunomia)
library(stringr)
library(readr)
connection <- connect(getEunomiaConnectionDetails())
concepts<-querySql(connection, "SELECT * FROM concept;")
concept_ancestors<-querySql(connection, "SELECT * FROM concept_ancestor;")
concept_synonyms<-querySql(connection, "SELECT * FROM concept_synonym;")
disconnect(connection)
names(concepts)<-str_to_lower(names(concepts))
names(concept_ancestors)<-str_to_lower(names(concept_ancestors))
names(concept_synonyms)<-str_to_lower(names(concept_synonyms))
get_candidate_codes(keywords="asthma",
                 concept=concepts,
                    concept_ancestor = concept_ancestors,
                    concept_synonym = concept_synonyms)


edward-burn/CodelistGenerator documentation built on April 10, 2022, 11:02 a.m.