Wrapper functions of api_concepts that fetch ancestors or descendants of one or several concept identifiers using full SNOMED CT inference.

Note: these functions can only fetch active concepts.

concept_ancestors(
  conceptIds,
  include_self = FALSE,
  encoding = "UTF-8",
  silent = FALSE,
  ...
)

concept_descendants(
  conceptIds,
  include_self = FALSE,
  encoding = "UTF-8",
  silent = FALSE,
  ...
)

Arguments

conceptIds

a character vector of concept identifiers

include_self

a logical vector indicating whether the conceptIds should be included in the results. The default is TRUE. If a single value is provided, it will be recycled.

encoding

HTTP charset parameter to use (default is "UTF-8")

silent

whether to hide progress bar. Default is FALSE

...

other valid arguments to function api_concepts, for instance endpoint, branch or limit.

Value

a named list of data frames

Disclaimer

In order to use SNOMED CT, a licence is required which depends both on the country you are based in, and the purpose of your work. See details on snomedizer.

See also

Examples

pneumonia_ancestors <- concept_ancestors(conceptIds = "233604007")
# This will trigger a warning using the default limit set by snomedizer_options_get("limit")
pneumonia_concepts <- concept_descendants(conceptIds = "233604007")
#> Warning: 
#> This server request returned just 50 of a total 225 results.
#> Please increase the server `limit` to fetch all results.
# Raising the limit
pneumonia_concepts <- concept_descendants(conceptIds = "233604007", limit = 300)
head(pneumonia_concepts$`233604007`)
#>            conceptId active definitionStatus           moduleId effectiveTime
#> 1 882784691000119100   TRUE    FULLY_DEFINED 900000000000207008      20200731
#> 2  10625751000119106   TRUE    FULLY_DEFINED 900000000000207008      20150731
#> 3  10625711000119105   TRUE    FULLY_DEFINED 900000000000207008      20150731
#> 4  10625671000119106   TRUE    FULLY_DEFINED 900000000000207008      20150731
#> 5  10625631000119108   TRUE    FULLY_DEFINED 900000000000207008      20150731
#> 6  10625591000119108   TRUE    FULLY_DEFINED 900000000000207008      20150731
#>                   id
#> 1 882784691000119100
#> 2  10625751000119106
#> 3  10625711000119105
#> 4  10625671000119106
#> 5  10625631000119108
#> 6  10625591000119108
#>                                                                                            idAndFsnTerm
#> 1 882784691000119100 | Pneumonia caused by severe acute respiratory syndrome coronavirus 2 (disorder) |
#> 2                                        10625751000119106 | Bronchopneumonia due to virus (disorder) |
#> 3                  10625711000119105 | Bronchopneumonia caused by Streptococcus pneumoniae (disorder) |
#> 4                             10625671000119106 | Bronchopneumonia caused by Streptococcus (disorder) |
#> 5                     10625631000119108 | Bronchopneumonia caused by Staphylococcus aureus (disorder) |
#> 6                            10625591000119108 | Bronchopneumonia caused by Staphylococcus (disorder) |
#>                                                                         fsn.term
#> 1 Pneumonia caused by severe acute respiratory syndrome coronavirus 2 (disorder)
#> 2                                       Bronchopneumonia due to virus (disorder)
#> 3                 Bronchopneumonia caused by Streptococcus pneumoniae (disorder)
#> 4                            Bronchopneumonia caused by Streptococcus (disorder)
#> 5                    Bronchopneumonia caused by Staphylococcus aureus (disorder)
#> 6                           Bronchopneumonia caused by Staphylococcus (disorder)
#>   fsn.lang                                          pt.term pt.lang total limit
#> 1       en                   Pneumonia caused by SARS-CoV-2      en   225   300
#> 2       en                    Bronchopneumonia due to virus      en   225   300
#> 3       en Bronchopneumonia due to Streptococcus pneumoniae      en   225   300
#> 4       en            Bronchopneumonia due to Streptococcus      en   225   300
#> 5       en    Bronchopneumonia due to Staphylococcus aureus      en   225   300
#> 6       en           Bronchopneumonia due to Staphylococcus      en   225   300
#>   offset  searchAfter searchAfterArray
#> 1      0 WzE4MTAwN10=           181007
#> 2      0 WzE4MTAwN10=           181007
#> 3      0 WzE4MTAwN10=           181007
#> 4      0 WzE4MTAwN10=           181007
#> 5      0 WzE4MTAwN10=           181007
#> 6      0 WzE4MTAwN10=           181007