IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
208 stars 83 forks source link

Adding custom translations to code systems #637

Open albert-t25 opened 3 days ago

albert-t25 commented 3 days ago

I have setup a Snowstorm instance and have loaded SNOMED CT International, SNOMED CT Austrian edition as well as LOINC. I'm able to read the data using FHIR API, but so far have been unable to make any kind of update. In my scenario, I would like to use the support for translations (https://build.fhir.org/languages.html#term) in order to add custom translations to both SNOMED and LOINC. However any kind of PUT/PATCH/POST request is returning a message similar to

Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[CodeSystem] with parameters [[]]

Looking at /metadata end-point, for code systems I get the following, so no create/update operations

                    "type": "CodeSystem",
                    "profile": "http://hl7.org/fhir/StructureDefinition/CodeSystem",
                    "interaction": [
                        {
                            "code": "read"
                        },
                        {
                            "code": "search-type"
                        },
                        {
                            "code": "delete"
                        }
                    ],

Are update operations on code systems supported in Snowstorm FHIR API? If so, is there some documentation for it?

Thank you

kaicode commented 3 days ago

This postman collection is the currently the best documentation for the Snowstorm FHIR API capabilities. Currently REST only supports read for the CodeSystem resource.

SNOMED CT CodeSystems must be created via SNOMED API. Other CodeSystems can be created via other package import types. It's not possible to add supplements at this time.

When a SNOMED CT edition is imported all preferred and acceptable terms are imported. These will be presented as designations when using CodeSystem/$lookup. If there are multiple dialects within the SNOMED edition one can be selected for display using the displayLanguage parameter. displayLanguage supports these formats:

albert-t25 commented 3 days ago

Thank you @kaicode. If I understood correctly, there's no way to update existing concepts in Snomed/Loinc code systems through FHIR API (or any other API for that matter), right?

kaicode commented 3 days ago

Correct. If you want to add terms to SNOMED CT that would have to happen via a SNOMED RF2 extension. I don't know how to add terms to a loinc package.

Some FHIR terminology servers allow adding terms to existing codes via a CodeSystem supplement, but Snowstorm does not support that yet.

albert-t25 commented 2 days ago

Is there any plan to support adding terms to existing codes in Snowstorm through FHIR API? If not, would you be willing to accept contributions toward that?

Thank you

kaicode commented 2 days ago

Adding terms to existing codes must be happen using a CodeSystem supplement. See slides 5-14 of this DevDays presentation Mastering FHIR Terminology (Dion McMurtrie, CSIRO)

There is no current plan to implement this functionality. We would accept contributions that implement adding terms using that method. Although the method outlined in the slides requires the FHIR R5 parameter useSupplement, and Snowstorm currently implements FHIR R4, I think supporting that parameter would be the right thing to do.

We would not accept PRs that allow modifying the imported CodeSystem directly because making changes like would break the terminology ecosystem.