parents: Ancestors and descendants of SNOMED CT concepts

View source: R/hierarchy.R

parentsR Documentation

Ancestors and descendants of SNOMED CT concepts

Description

Returns concepts with 'Is a' or inverse 'Is a' relationship with a set of target concepts. Ancestors include parents and all higher relations. Descendants include children and all lower relations.

Usage

parents(
  conceptIds,
  include_self = FALSE,
  SNOMED = getSNOMED(),
  TRANSITIVE = NULL,
  ...
)

ancestors(
  conceptIds,
  include_self = FALSE,
  SNOMED = getSNOMED(),
  TRANSITIVE = NULL,
  ...
)

children(
  conceptIds,
  include_self = FALSE,
  SNOMED = getSNOMED(),
  TRANSITIVE = NULL,
  ...
)

descendants(
  conceptIds,
  include_self = FALSE,
  SNOMED = getSNOMED(),
  TRANSITIVE = NULL,
  ...
)

Arguments

conceptIds

character or integer64 vector of SNOMED concept IDs

include_self

whether to include the original concept(s) in the output, default = FALSE

SNOMED

environment containing a SNOMED dictionary

TRANSITIVE

transitive closure table for ancestors and descendants, containing is-a relationships. This table can be created by createTransitive to speed up the ancestor / descendant functions. If a TRANSITIVE table is provided, the SNOMED environment is not used and relatedConcepts is not called. TRANSITIVE should be a data.table with columns ancestorId and descendantId.

...

other arguments to pass to relatedConcepts

Value

a bit64 vector of SNOMED CT concepts

See Also

[createTransitive()] for creation of TRANSITIVE table, and [relatedConcepts()] for the underlying function to extract SNOMED CT relationships.

Examples

SNOMED <- sampleSNOMED()

parents('Heart failure')
children('Heart failure')
ancestors('Heart failure')
descendants('Heart failure')

anoopshah/Rdiagnosislist documentation built on Sept. 25, 2024, 12:20 p.m.