Comments (7)
Hi @psiotwo,
Yes, this is a limitation of the current commits API, unfortunately.
Usually what we do to show the history of a single concept is fetch everything in one go:
GET /snomed-ct/v3/commits?affectedComponentId=61462000&expand=details()
The details()
expand will actually use the affectedComponentId
filter to limit the details object to the requested component ID and all its related component changes (description/relationship/member related commits will be returned when you request the history of the concept, you don't have to make explicit requests for them).
So basically that is the only request you need to make to get the entire history of the concept.
Additionally to make life easier and support individual commits, where the details()
expansion is defined, I'll improve the API with the following two changes:
Filter by id
option will be added to GET /commits
API:
`GET /snomed-ct/v3/commits?id=7ca1c4da-a045-4f7c-a6e0-f632d5243b06&affectedComponentId=61462000&expand=details()`
Also, affectedComponentId details filter will be added to details()
expand:
`GET /snomed-ct/v3/commits/7ca1c4da-a045-4f7c-a6e0-f632d5243b06?expand=details(affectedComponentId:61462000)`
These changes will be available soon on the 7.x
branch and will be released in 7.4.0
end of February.
I hope these changes make sense to you if you have any feedback or comment, let us know.
Cheers,
Mark
from snow-owl.
Hi @cmark ,
yes, thanks - sounds perfect!
Petr
from snow-owl.
Hi @cmark,
thanks, just tested.
Maybe I misinterpreted your intent. When I issue the first request
GET /snomed-ct/v3/commits?id=7ca1c4da-a045-4f7c-a6e0-f632d5243b06&affectedComponentId=61462000&expand=details()
I still get the whole commit in the result. What I would need is to filter only those items in the commit which refer to the concept (or related descriptions/relationships), e.g. by filtering on items/detail/object:61462000. Maybe I just don't know how to correctly construct the expand
parameter (similarly to the affectedComponentId:61462000 mentioned below).
Also after issuing
GET /snomed-ct/v3/commits/7ca1c4da-a045-4f7c-a6e0-f632d5243b06?expand=details(affectedComponentId:61462000)
I get:
{
"status": 400,
"code": 0,
"message": "Expected type 'String' is not valid for the value '61462000(Integer)' returned for the key 'affectedComponentId'",
"errorCode": 0,
"statusCode": 400
}
Petr
from snow-owl.
Hi @psiotwo,
No, you did not, you did everything perfectly, the example I gave you was incorrect.
Inside a nested object expansion, like in details()
, we treat everything as JSON and parse it accordingly. So to be able to parse the affectedComponentId
as a String value, you need to wrap it in "61462000"
, so the correct example would look like this:
GET /snomed-ct/v3/commits/7ca1c4da-a045-4f7c-a6e0-f632d5243b06?expand=details(affectedComponentId:"61462000")
Let me know if this works for you.
Cheers,
Mark
from snow-owl.
Hi @cmark ,
thanks for hint. First it seemed to me it worked :-). But, then tried for a commit which corresponds to the 2002-07-31 release import of Snomed CT Intl. and got:
{
"id": "9a463a2e-e718-4f6d-890a-34a20889401f",
"branch": "MAIN",
"author": "System",
"comment": "Imported components from 2002-07-31",
"timestamp": 1580314281451,
"details": {
...
"limit": 119031,
"total": 119031
}
}
no matter whether I specify affectedComponentId or not, i.e. both of the following calls return a result set with the same "total".
/snomed-ct/v3/commits/9a463a2e-e718-4f6d-890a-34a20889401f?expand=details()
and
/snomed-ct/v3/commits/9a463a2e-e718-4f6d-890a-34a20889401f?expand=details(affectedComponentId:"61462000")
Petr
from snow-owl.
Hi @cmark ,
I was testing stuff on wrong deployment and can confirm that everything works with me exectly as you described.
I tried even a more "bold query" to get all the details across all the commits in one run:
/snomed-ct/v3/commits?expand=details(affectedComponentId:"239783001")
It is working fine, but it returns also commits which don't reference this component at all, e.g.
{
"id": "0578874b-c45e-4565-ac02-76aa73ee5495",
"branch": "MAIN",
"author": "System",
"comment": "Imported components from 2002-01-31",
"timestamp": 1574253114834,
"details": {
"items": [],
"limit": 0,
"total": 0
}
},
Does it make sense to filter out these commits from the response?
Cheers,
Petr
from snow-owl.
Hi @cmark ,
thanks for hint. First it seemed to me it worked :-). But, then tried for a commit which corresponds to the 2002-07-31 release import of Snomed CT Intl. and got:
{ "id": "9a463a2e-e718-4f6d-890a-34a20889401f", "branch": "MAIN", "author": "System", "comment": "Imported components from 2002-07-31", "timestamp": 1580314281451, "details": { ... "limit": 119031, "total": 119031 } }
no matter whether I specify affectedComponentId or not, i.e. both of the following calls return a result set with the same "total".
/snomed-ct/v3/commits/9a463a2e-e718-4f6d-890a-34a20889401f?expand=details()
and
/snomed-ct/v3/commits/9a463a2e-e718-4f6d-890a-34a20889401f?expand=details(affectedComponentId:"61462000")
Petr
Hi @psiotwo,
The filtering bug has been fixed and the details()
expand with an affectedComponentId
filter will now produce the correct numbers.
Regarding the other issue you have reported, you only restrict the details()
expansion to the given affectedComponentId
, but you still need all commits because you did not filter them by any means.
From an API perspective, this works as expected and how it should.
If you would like to restrict the commits to a given component then please use the affectedComponentId
filter.
Cheers,
Mark
from snow-owl.
Related Issues (20)
- Missing results in GET `/snomed-ct/v3/{path}/members` HOT 9
- SnowOwl & AWS ElasticSearch
- ArrayIndexOutOfBoundsException on Import HOT 3
- Can we control how the searching works on the search APIs? HOT 5
- Error launching snow owl HOT 7
- SNOMED CT International Edition import not working HOT 2
- hapi-fhir-cli for upload of custom terminology HOT 1
- Opensearch integration HOT 2
- Target Platform is not able to Resolve HOT 3
- snowowl and ES / Opensearch on AWS HOT 2
- Snow Owl doesn't start from source in Eclipse HOT 3
- Publishing PreRelease content (to OntoServer) HOT 1
- Publication of Live and Pre-Release content to OntoServer Terminology Server HOT 4
- Concept Search API semanticTag filter issue HOT 3
- Contribution by code smell removal HOT 1
- UNABLE TO IMPORT SNOMED AFTER INSTALL HOT 7
- Support the "url" search parameter for both CodeSystem and ValueSet resources HOT 4
- SNOMED CT Import not working HOT 9
- Import of FHIR ValueSet HOT 2
- Log4j vulnerability HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snow-owl.