ramses-antibiotics / snomedizer Goto Github PK
View Code? Open in Web Editor NEWAn R Interface to the SNOMED CT API <https://github.com/IHTSDO/snowstorm>
Home Page: https://snomedizer.web.app
License: Other
An R Interface to the SNOMED CT API <https://github.com/IHTSDO/snowstorm>
Home Page: https://snomedizer.web.app
License: Other
Following HISO10033 the NZ Ministry of Health is providing SNOMED CT resources, including a snowstorm endpoint https://snomednz.digital.health.nz/
Note: This endpoint will fail httr::http_error()
, possibly because HEAD()
leads to error due to redirection to https://snomednz.digital.health.nz/swagger-ui.html. In any case this requires adaptation of
snomed_public_endpoint_suggest()
snomedizer_options_set()
git hash: 159c6d51
Important: All failing checks above must be addressed prior to proceeding
Package License: MIT + file LICENSE
git hash: d55a0283
Important: All failing checks above must be addressed prior to proceeding
Package License: MIT + file LICENSE
Hi,
I try connect but the function send this error:
Warning message:
Status 500 INTERNAL_SERVER_ERROR
Index [branch] not found.; nested exception is [branch] ElasticsearchStatusException[Elasticsearch exception [type=index_not_found_exception, reason=no such index [branch]]]
I´m looking for your URL https://snowstorm.test-nictiz.nl but is down.
¿is it possible change the URL into the configuration function?
Thankds
set batches of 300 conceptIds
infection_concepts <- concepts_descendants(
conceptIds = "40733004",
direct_descendants = FALSE,
activeFilter = TRUE,
endpoint = local_endpoint,
branch = local_branch,
limit = 10000
)[[1]]
infection_descriptions <- concepts_descriptions(
conceptIds = infection_concepts$conceptId,
endpoint = local_endpoint,
branch = local_branch,
limit = 10000)
> No encoding supplied: defaulting to UTF-8.
> Warning message:
> Status 414
Solution: change user agent and identify snomedizer library and version in the REST request.
I tried running the first example in the README but it gives an error:
> api_concepts(term = "pneumonia", activeFilter = TRUE)
Response [https://snowstorm.test-nictiz.nl/MAIN/concepts?term=pneumonia&limit=50&offset=0&activeFilter=TRUE]
Date: 2023-09-25 22:24
Status: 500
Content-Type: application/json
Size: 230 B
{
"error" : "INTERNAL_SERVER_ERROR",
"message" : "Index [branch] not found.; nested exception is [branch] ElasticsearchStatusException[Elasticsearch exception [type=index_not_foun...
Warning message:
Status 500 INTERNAL_SERVER_ERROR
Index [branch] not found.; nested exception is [branch] ElasticsearchStatusException[Elasticsearch exception [type=index_not_found_exception, reason=no such index [branch]]]
refactor validations in snomedizer_options_set
apply this validations in api_operations
may need to also separate lower-level REST operations from checks - at the moment wrapper functions that use purrr map() would carry out validations at every step.
Pneumonia example too long
httr::content(api_concepts(term = "pneumonia"))
https://temp-snomedizer.netlify.app/reference/api_operations.html
This won't be tested because public endpoints are currently not using the internalRelease flag.
The internalRelease flag is currently optional in snowstorm
concept_is does not allow the narrowing down of an ECL query.
Current behaviour:
# check that bacterial pneumoniae (53084003) are excluded from the whole set of pneumoniae
# 10625071000119104 | Bronchopneumonia caused by bacteria (disorder) |
> concept_is("10625071000119104", target_ecl = "<<233604007 MINUS <<53084003")
[1] TRUE
Expected behaviour:
> concept_is("10625071000119104", target_ecl = "<<233604007 MINUS <<53084003")
[1] FALSE
This is caused by original flaw in #12 #21.
The revised function should no longer use the "<<" operator and expect the user to instead specify it in their query.
Implementation of the most important API operations from https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/swagger-ui.html
searchAfter
parameter in all relevant 'api_*()' operations (not a breaking change, just an opportunity to document this parameter)git hash: 5e047d4d
Important: All failing checks above must be addressed prior to proceeding
Package License: MIT + file LICENSE
httr::content(api_concepts(term = "blurgh", branch="*(*£"))
prints some html stuff, not json!
Several requests have come through for the following features which depend on Snowstorm/Elastic:
Thanks to @nels for the use case!
The main vignette should contain a fifth example for
This will require implementing the snowstorm RefSet members endpoints.
Note: At the moment this seems to be yet to be implemented into ECL, but considered for ECL 1.7 according to SLPG meeting 23/09/2021. This may involve a new operator to query the mapTarget field in RF2 refsets.
^ 447562003 |ICD-10 complex map refset| {{ M mapTarget = "L56.2" }}
^ [referencedComponentId] 447562003 |ICD-10 complex map refset| {{ M mapTarget = "L56.2" }}
^ [referencedComponentId] 447562003 |ICD-10 complex map refset| {{ M mapGroup = #1, mapPriority = #1, mapTarget = "L56.2" }}
Update infection_concepts to RF2 June 2020
As a dplyr user, I want to create a column indicating whether a concept stored in a row is a descendant of another concept, so that I don't have to waste time using the concept_descendants()
wrapper
data.frame %>%
mutate(desc_123038009_Specimen = concept_descendant_indicator(
conceptIds = .$concept_code,
parent = "123038009",
... )
api_concepts()
)see release notes
see effectiveTime
@AnikaC-git would you mind sense-checking the below before I implementing the proposed change in wrapper functions that use .split_into_chunks?
concept_find()
is designed to retrieve concepts by chunks of 99 conceptIds (see CHUNK_SIZE=100 in wrapper.R) from GET /{branch}/concepts
. This is due to the URL character limit constraint of GET (:arrow_right: error 414 Request-URI Too Large)
But often the limit
on the number of results sent back by snowstorm will be lower than this -- the default is 50, and a user cannot set limit
above a hard threshold of 10,000.
# Get 221 concept IDs
concepts <- concept_find(ecl = "<233604007", limit = 300)
# Retrieve those
concepts_batch <- concept_find(
conceptIds = concepts$conceptId,
limit = 50
)
Warning messages:
1:
This server request returned just 50 of a total 99 results.
Please increase the server `limit` to fetch all results.
2:
This server request returned just 50 of a total 100 results.
Please increase the server `limit` to fetch all results.
Currently, the function will display a warning with every chunk.
Say you are asking the function to retried 153 concepts, that means you have 2 chunks, so 2 warnings.
Neither elegant nor self-explanatory!
Users will not understand why this happens.
Note: The same thing will apply to:
/validation-maintenance/semantic-tags
(not a breaking change)A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.