Low-level wrapper functions based on httr for interfacing with the operations built in the Snowstorm API
api_concept(
conceptId,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_concepts(
term = NULL,
conceptIds = NULL,
ecl = NULL,
eclStated = NULL,
activeFilter = NULL,
searchAfter = NULL,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
limit = snomedizer_options_get("limit"),
offset = 0,
catch404 = TRUE,
...
)
api_concept_descendants(
conceptId,
stated = FALSE,
limit = snomedizer_options_get("limit"),
offset = 0,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_concept_descriptions(
conceptId,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_all_branches(
endpoint = snomedizer_options_get("endpoint"),
catch404 = TRUE
)
api_branch(
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE,
...
)
api_branch_descendants(
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE,
...
)
api_descriptions(
conceptIds = NULL,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
offset = 0,
limit = snomedizer_options_get("limit"),
catch404 = TRUE,
...
)
api_version(endpoint = snomedizer_options_get("endpoint"), catch404 = TRUE)
api_browser_concepts(
conceptId,
descendantCountForm = c(NULL, "inferred", "stated", "additional"),
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_browser_concept_ancestors(
conceptId,
form = "inferred",
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_browser_concept_children(
conceptId,
form = "inferred",
includeDescendantCount = TRUE,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_browser_concept_parents(
conceptId,
form = "inferred",
includeDescendantCount = TRUE,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_browser_concept_descriptions(
term,
active = NULL,
module = NULL,
language = NULL,
type = NULL,
semanticTag = NULL,
semanticTags = NULL,
preferredIn = NULL,
acceptableIn = NULL,
preferredOrAcceptableIn = NULL,
conceptActive = NULL,
conceptRefset = NULL,
groupByConcept = FALSE,
searchMode = "STANDARD",
limit = snomedizer_options_get("limit"),
offset = 0,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_descriptions_semantic_tags(
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
catch404 = TRUE
)
api_relationships(
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
active = NULL,
source = NULL,
type = NULL,
destination = NULL,
characteristicType = NULL,
limit = snomedizer_options_get("limit"),
offset = 0,
catch404 = TRUE,
...
)
api_relationship(
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
relationshipId,
catch404 = TRUE,
...
)
api_all_code_systems(
endpoint = snomedizer_options_get("endpoint"),
forBranch = NULL,
catch404 = TRUE
)
api_code_system(
endpoint = snomedizer_options_get("endpoint"),
shortName,
catch404 = TRUE
)
api_code_system_all_versions(
endpoint = snomedizer_options_get("endpoint"),
shortName,
showFutureVersions = FALSE,
showInternalReleases = FALSE,
catch404 = TRUE
)
api_browser_refset_members(
referenceSet = NULL,
referenceSetModule = NULL,
referencedComponentId = NULL,
active = NULL,
offset = NULL,
searchAfter = NULL,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
limit = snomedizer_options_get("limit"),
catch404 = TRUE
)
api_refset_members(
referenceSet = NULL,
referenceSetModule = NULL,
referencedComponentId = NULL,
active = NULL,
offset = NULL,
searchAfter = NULL,
targetComponent = NULL,
mapTarget = NULL,
owlExpression.conceptId = NULL,
owlExpression.gci = NULL,
endpoint = snomedizer_options_get("endpoint"),
branch = snomedizer_options_get("branch"),
limit = snomedizer_options_get("limit"),
catch404 = TRUE
)
character string of a SNOMED CT concept identifier (for example:
"233604007"
)
URL of a SNOMED CT Terminology Server REST API endpoint.
See snomedizer_options
.
a string for the name of the API endpoint branch to use (most
commonly "MAIN"
). See snomedizer_options
.
whether to display a warning if the API operation returns a
'404 Not Found' status. Default is TRUE
.
character vector of terms to search
a character vector of SNOMED CT concept identifiers (for example:
c("233604007", "68566005")
)
a character expression constraint query (with full relationship inference). Consult the Expression Constraint Language guide for more detail.
a character expression constraint query (limited to stated relationships). Consult the Expression Constraint Language guide for more detail.
optional boolean:
TRUE
returns only active terminology
FALSE
returns only inactive terminology
NULL
(the default) returns both active and inactive terminology
integer for the number of results to skip. May be used for
for querying more that 10,000 records (current limit
on results returned)
a positive integer for the maximum number of results to return.
See snomedizer_options
. The maximum limit on public endpoints
is 10,000.
an integer indicating the number of results to skip
other REST API parameters
a boolean indicating whether to limit search to descendants
whose relationship is stated rather than inferred. Default is FALSE
.
a character string indicating whether to report
the count of descendant concepts based on stated or inferred relationships.
Must be one of "inferred"
, "stated"
, or "additional"
.
Default is NULL
for no descendant count reported.
a character string indicating which ancestors/parents or
descendants/children to extract based on stated or inferred relationships.
Must be one of "inferred"
(default), "stated"
, or "additional"
.
a boolean indicating whether a number of children/descendants counter should be included in the result
optional boolean:
TRUE
returns only active terminology
FALSE
returns only inactive terminology
NULL
(the default) returns both active and inactive terminology
character vector of SNOMED CT modules to include (example:
"900000000000207008"
)
vector of two-character language codes to include
(example: c("en", "de")
).
character vector of concept codes defining the type of description or the type of attribute/relationship to include, depending on the function:
see api_concept_descendants("900000000000446008")
for valid
description type concepts.
see api_concept_descendants("106237007")
for valid
attributes (relationship types) concepts.
character string of a description semantic tag
to include (example: "attribute"
). See
api_descriptions_semantic_tags()
for a list of valid
description semantic tags.
character vector of description semantic tags
to include (example: c("attribute", "finding")
). See
api_descriptions_semantic_tags()
for a list of valid
description semantic tags.
character vector of description language reference sets
(example: "900000000000509007"
).
The description must be preferred in at least one of these to match.
character vector of description language reference sets
(example: "900000000000509007"
).
The description must be acceptable in at least one of these to match.
character vector of description language reference sets
(example: "900000000000509007"
).
The description must be preferred OR acceptable in at least one of these to match.
optional boolean:
TRUE
returns only active concepts
FALSE
returns only inactive concepts
NULL
(the default) returns both active and inactive concepts
character vector of reference sets concept identifiers
to include (example: "900000000000497000"
for CTV3 terminology).
See api_concept_descendants("900000000000455006")
for valid reference set concepts.
a boolean indicating whether to group descriptions
by concept. Default is FALSE
.
a character string for the search mode. Must be either
"STANDARD"
(default) or "REGEX"
.
a character vector of concepts to be included as sources defined by the relationship
concept character string restricting the range of the relationships to be included in results
a character string indicating whether to include results for:
all relationships: NULL (the default)
only stated relationships: "STATED_RELATIONSHIP"
only inferred relationships: "INFERRED_RELATIONSHIP"
only additional relationships: ""ADDITIONAL_RELATIONSHIP" (for
instance, 123005000 | Part of (attribute) |
)
This parameter corresponds to
900000000000449001 | Characteristic type (core metadata concept)
string of a relationship concept
a character name of a single branch (eg "MAIN"
) for which
to fetch code systems results. The default (NULL
) will return all code systems.
character name of a code system (eg "SNOMEDCT"
,
"SNOMEDCT-UK"
)
a boolean indicating whether to include all code
systems (NULL
), only future code systems (TRUE
),
or no future code systems (FALSE
, the default)
a boolean indicating whether to include all
terminology releases (NULL
), only internal releases (TRUE
), or
only external releases (FALSE
, the default)
a string for a reference set identifier or ECL expression
can be used to limit the reference sets searched. Example: "<723564002"
a string identifier for a SNOMED CT module containing
the reference sets to include. An ECL expression can be used to limit
the modules searched, for example: "<900000000000445007"
a character vector of identifiers of SNOMED CT components to be included. For Map Reference Sets, this refers to the SNOMED CT concept that is mapped to the other terminology or code system
string identifier the target code (concept or description) in an Association Reference Set. Consult the Association Reference Set data structure for detail.
target code to which the SNOMED CT concept represented the
referencedComponentId
is mapped in the target code system, classification,
or terminology (eg ICD-10). This is only used for Map Reference Sets
a string for a concept identifier within an owlExpression. Consult the SNOMED CT OWL Guide for detail.
a boolean indicating whether to return axiom members
with a GCI owlExpression (TRUE
), without (FALSE
), or all members
(NULL
, the default). Consult the
SNOMED CT OWL Guide for detail.
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.
# look up the pneumonia concept
api_concept(conceptId = "233604007")
#> Response [https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/MAIN/concepts/233604007]
#> Date: 2022-07-08 08:44
#> Status: 200
#> Content-Type: application/json
#> Size: 370 B
#> {
#> "conceptId" : "233604007",
#> "active" : true,
#> "definitionStatus" : "FULLY_DEFINED",
#> "moduleId" : "900000000000207008",
#> "effectiveTime" : "20150131",
#> "fsn" : {
#> "term" : "Pneumonia (disorder)",
#> "lang" : "en"
#> },
#> ...
api_concepts(term = "pneumonia")
#> Response [https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/MAIN/concepts?term=pneumonia&limit=50&offset=0]
#> Date: 2022-07-08 08:44
#> Status: 200
#> Content-Type: application/json
#> Size: 22 kB
#> {
#> "items" : [ {
#> "conceptId" : "60363000",
#> "active" : false,
#> "definitionStatus" : "PRIMITIVE",
#> "moduleId" : "900000000000207008",
#> "effectiveTime" : "20020131",
#> "fsn" : {
#> "term" : "Pneumonia (disorder)",
#> "lang" : "en"
#> ...
api_concepts(conceptIds = c("233604007", "68566005"))
#> Response [https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/MAIN/concepts?conceptIds=233604007&conceptIds=68566005&limit=50&offset=0]
#> Date: 2022-07-08 08:44
#> Status: 200
#> Content-Type: application/json
#> Size: 1.02 kB
#> {
#> "items" : [ {
#> "conceptId" : "68566005",
#> "active" : true,
#> "definitionStatus" : "FULLY_DEFINED",
#> "moduleId" : "900000000000207008",
#> "effectiveTime" : "20020131",
#> "fsn" : {
#> "term" : "Urinary tract infectious disease (disorder)",
#> "lang" : "en"
#> ...
# get the content of the server request
pneumonia <- httr::content(api_concepts(term = "pneumonia"), limit = 1)
str(pneumonia$items[[1]])
#> List of 9
#> $ conceptId : chr "60363000"
#> $ active : logi FALSE
#> $ definitionStatus: chr "PRIMITIVE"
#> $ moduleId : chr "900000000000207008"
#> $ effectiveTime : chr "20020131"
#> $ fsn :List of 2
#> ..$ term: chr "Pneumonia (disorder)"
#> ..$ lang: chr "en"
#> $ pt :List of 2
#> ..$ term: chr "Pneumonia"
#> ..$ lang: chr "en"
#> $ id : chr "60363000"
#> $ idAndFsnTerm : chr "60363000 | Pneumonia (disorder) |"