% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/subsetOnRouteCategory.R
\name{subsetOnRouteCategory}
\alias{subsetOnRouteCategory}
\title{Subset a codelist to only those with a particular route category}
\usage{
subsetOnRouteCategory(x, cdm, routeCategory, negate = FALSE)
}
\arguments{
\item{x}{A codelist, codelist_with_details, or a concept_set. See \code{newCodelist()}, \code{newCodelistWithDetails()}, \code{newConceptSetExpression()} functions for more details.}

\item{cdm}{A cdm reference to an OMOP CDM dataset. If data is held within a
database, the vocabulary tables should be in the same schema as the clinical
tables (person, observation period, and so on).}

\item{routeCategory}{Only codes with the specified route will be
returned. If NULL, descendant codes will be returned regardless of route
category. Use 'availableRouteCategories()' to find the available route categories in
the database, and 'associatedRouteCategories()' to get drug routs associated with
a codelist.}

\item{negate}{If FALSE, only concepts with the routeCategory specified will
be returned. If TRUE, concepts with the routeCategory specified will be excluded.}
}
\value{
The codelist with only those concepts associated with the
specified route categories (if negate is FALSE) or the codelist without those
concepts associated with the specified route categories (if negate is TRUE).
}
\description{
Subset a codelist to only those with a particular route category
}
\examples{
\donttest{
library(CodelistGenerator)
library(omopgenerics)
cdm <- mockVocabRef()
codes <- subsetOnRouteCategory(
              x = newCodelist(list("codes" = c(20,21))),
              cdm = cdm,
              routeCategory = "topical")
codes
}
}
