% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/summariseOrphanCodes.R
\name{summariseOrphanCodes}
\alias{summariseOrphanCodes}
\title{Find orphan codes related to a codelist using achilles counts and, if
available, PHOEBE concept recommendations}
\usage{
summariseOrphanCodes(
  x,
  cdm,
  domain = c("condition", "device", "drug", "measurement", "observation", "procedure",
    "visit")
)
}
\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{domain}{Character vector with one or more of the OMOP CDM domains.
The results will be restricted to the given domains. Check the available
domains in the database by running 'availableDomains()', or 'associatedDomains()'
to explore the domains associated with a codelist. If NULL, all supported domains
are included: Condition, Drug, Procedure, Device, Observation, and Measurement.}
}
\value{
A summarised result containing the frequency of codes related
to (but not in) the codelist.
}
\description{
Find orphan codes related to a codelist using achilles counts and, if
available, PHOEBE concept recommendations
}
\examples{
\donttest{
library(CodelistGenerator)

cdm <- mockVocabRef("database")
codes <- getCandidateCodes(cdm = cdm,
                          keywords = "Musculoskeletal disorder",
                          domains = "Condition",
                          includeDescendants = FALSE)
codelist <- omopgenerics::newCodelist(list("msk" = codes$concept_id))
orphan_codes <- summariseOrphanCodes(x = codelist,
                                      cdm = cdm)

orphan_codes
CDMConnector::cdmDisconnect(cdm)
}
}
