Learn R Programming

CodelistGenerator (version 4.1.0)

summariseOrphanCodes: Find orphan codes related to a codelist using achilles counts and, if available, PHOEBE concept recommendations

Description

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")
)

Value

A summarised result containing the frequency of codes related to (but not in) the codelist.

Arguments

x

A codelist, codelist_with_details, or a concept_set. See newCodelist(), newCodelistWithDetails(), newConceptSetExpression() functions for more details.

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).

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.

Examples

Run this code
# \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)
# }

Run the code above in your browser using DataLab