Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the Codesystem/$lookup endpoint #559

Closed
dwassing opened this issue May 18, 2020 · 3 comments
Closed

Using the Codesystem/$lookup endpoint #559

dwassing opened this issue May 18, 2020 · 3 comments
Assignees
Labels

Comments

@dwassing
Copy link

dwassing commented May 18, 2020

Hello b2i,

I am sitting with an instance of Snow Owl running on Ubuntu 18.04 LTS, and I am having troubles making sense of the lookup endpoint of the FHIR API, using the SNOMED CT terminology.

  • I have imported SNOMED CT RF2 files through the imports endpoint in the SNOMED CT API.
  • I am able to query concepts through the SNOMED CT API.
  • I set the parameter of createVersions to true when importing the RF2 files.

Try as I might, I have not been able to find an example use case where this endpoint is used. I have tried feeding it a URI as specified in the documents of IHTSDO in many ways. I have found an example of an instance of LOINC being used with this endpoint at HL7s FHIR documentation (see section 4.7.2.1), and additionally verified that the 'version' parameter should be YYYYMMDD (see section 4.3.1.0.3). The version that I am using is the international edition, interim released at 2020-03-09 (for the coronavirus updates). However, this does not seem to be recognized, no matter how I try. The response I get simply "Could not find code system for SNOMEDCT version '20200309'".

Is the interim version not supported? Do I need to try and get an older edition? My configuration is quite simple, as I'm trying to run a lightweight version of SNOW OWL. I have imported a Snapshot edition of SNOMED CT into the MAIN branch.

I would, if possible, love to see an example of a correct call to this endpoint, using SNOMED CT. My searching on the web has not yielded any results, and your documentation only suggests that it should work given the code/system/version, but is void of any examples.

Thank you for taking your time reading this. Regards, Daniel

@cmark cmark self-assigned this May 18, 2020
@cmark
Copy link
Member

cmark commented May 18, 2020

Hi @danwa223,

Thank you for reporting your issue.
Unfortunately, the RF2 Snapshot import does not support the createVersions parameter and basically ignores that setting. This is due to the fact that in a Snapshot only the latest version is available for each concept and a decision was made a long time ago not to create the versions in this case, since they are not going to be consistent.
The only possible solution would be to create a single version for the most recent effectiveTime but that is not supported at the moment (feel free to raise an enhancement ticket).

As a workaround, you have three options:

  1. Create the version by yourself using versions API. If you have imported the 20200309 International RF2 Snapshot Data, then perform the following REST API call:
POST /snowowl/admin/codesystems/SNOMEDCT/versions
{
  "description": "20200309",
  "effectiveDate": "20200309",
  "version": "20200309"
}
  1. Use the non-versioned SNOMED CT URI instead to get the latest version/data http://snomed.info/sct/900000000000207008
  2. Import the FULL RF2 release

I hope this helps, let me know if you have any further questions.

Cheers,
Mark

@dwassing
Copy link
Author

Hello @cmark,

Thank you for your swift response! Your first workaround using the Admin API worked flawlessly, and I am now able to query as first intended. I want to point out that I tried option 2 before opening this issue, and that did not seem to yield any results (though I do not remember what specific error output that gave me...). But now, both the following URIs will do the trick:
http://snomed.info/sct/900000000000207008/version/20200309
http://snomed.info/sct/900000000000207008
Just as you suggested.

I will be sure to reach out if I have more questions. Thanks again.
Regards, Daniel

@cmark
Copy link
Member

cmark commented May 18, 2020

Hi @danwa223,

Glad to hear that it worked.
I think Option 2 fails if there are no versions present in the system at all since http://snomed.info/sct/900000000000207008 defines the latest version implicitly, but Snow Owl is unable to find one. In this case, we could fall back to the current HEAD/development version.
I'll raise a bug report to track it and I'll also close this issue.

Regards,
Mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants