IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
204 stars 80 forks source link

Updating the FHIR CodeSystem URI for the default Edition on the MAIN branch (UK Monolith) #548

Closed abelardy closed 11 months ago

abelardy commented 1 year ago

I've got a Snowstorm 8.1.0 instance running in Ubuntu and loaded with the UK Monolith.

By default, the CodeSystem on MAIN is assumed to be snomed.info/sct/900000000000207008 (ie the International Edition).

I have tried changing this to snomed.info/sct/83821000000107 (ie the UK Edition) by including the following in an applications.properties file located in the same folder from where the Snowstorm instance is started:

codesystem.config.SNOMEDCT=United Kingdom Edition|83821000000107|gb|NHS Digital Information Representation Services

...but this only works some of the time.

For reasons I have been unable to pin down, sometimes after restarting the Snowstorm instance using exactly the same invocation, if I send it:

http://snowstorm:8080/fhir/ValueSet/$expand?url=http://snomed.info/sct/83821000000107?fhir_vs=ecl/%3C%3C410607006&count=5000&offset=0

...then the restarted server will consistently deny all knowledge of any snomed.info/sct/83821000000107 CodeSystem ever existing. On other occasions, a different server instance started exactly the same way within exactly the same terminal instance on exactly the same Ubuntu VM will be perfectly happy to respond to the exact same question.

However, when in the state of denying that the CodeSystem even exists, if the question is changed instead to:

http://snowstorm:8080/fhir/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=ecl/%3C%3C410607006&count=5000&offset=0

..then the expected response is received and further states that it was in fact calculated against snomed.info/sct|http://snomed.info/sct/83821000000107.

So the CodeSystem does exist, but it doesn;'t...

kaicode commented 1 year ago

I have tried again with this issue and been able to reproduce it. The problem is that the UK edition is already configured, in the default configuration, as the Snowstorm CodeSystem "SNOMEDCT-UK". When new configuration is added to set the "SNOMEDCT" CodeSystem as the UK edition then there are two Snowstorm CodeSystems with that module. They then seemed to get picked randomly after each restart.

The simplest way to resolve this is to set the existing "SNOMEDCT-UK" CodeSystem to a different module, if you are loading the UK Edition into the MAIN branch which is always the "SNOMEDCT" CodeSystem. So a application.properties file like this:

# Set the UK Edition as the default "SNOMEDCT" code system on the MAIN branch.
codesystem.config.SNOMEDCT=United Kingdom Edition|83821000000107|gb|NHS Digital Information Representation Services

# Override the UK CodeSystem from Snowstorm's default configuration with a dummy module to avoid URI collision
codesystem.config.SNOMEDCT-UK=Not used|1000003|gb|Not used

With this configuration your lookups using http://snomed.info/sct/83821000000107 will always resolve.

abelardy commented 1 year ago

Thanks Kai.

kaicode commented 11 months ago

I'll close this ticket because I think the issue is resolved.