Page tree
Skip to end of metadata
Go to start of metadata


This exercise is intended to teach you how to use Snowstorm to:

  • load a new instance with the SNOMED CT International Edition and another extension
  • load a newer version of the SNOMED CT International Edition and the other extension on top of existing data


Last Updated:  

On this page

Please visit the Pre-requisites page to see software that may be useful during the day. In summary, we recommend using:

  • Chromium based browser
  • A relevant SSH/terminal application

Accessing the server

You will be given an ip-address and you can download the training.pem private key to access the AWS instance to access. Go to the directory where you have saved the training.pem file and run:

chmod 700 training.pem
ssh -i training.pem ubuntu@<ip-address>

This should work without any problems on Linux and OSX.

For Windows, because of the difference in using SSH, please follow the instructions on the Windows set up page.

On the server you will find:

  • /opt/releases - containing the following:
    • SnomedCT_InternationalRF2_PRODUCTION_20200309T120000Z.zip (March 2020 International Edition)
    • SnomedCT_ManagedServiceDK_PRODUCTION_DK1000005_20200331T120000Z.zip (March 2020 Danish Extension)
    • SnomedCT_InternationalRF2_PRODUCTION_20200731T120000Z.zip (July 2020 International Edition)

    • SnomedCT_ManagedServiceDK_PRODUCTION_DK1000005_20200930T120000Z.zip (September 2020 Danish Extension)
    • SnomedCT_InternationalRF2_PRODUCTION_20210131T120000Z.zip (January 2021 International Edition)

  • /opt/snowstorm - contains a Snowstorm jar file

  • /opt/Frontend-Interaction-Demonstration - containing the following:
    • demo front end HTML for some exercises

Elasticsearch v7.9.2 has already been installed on the server. You can check that Elasticsearch is running with the following command:

curl localhost:9200

When normally installing Snowstorm, you will need to download the most recent release of Snowstorm from the GitHub repository releases page. However, we have put the Snowstorm executable jar file on the server already.

Starting Snowstorm

To start snowstorm you will need to run the following commands.
(Documentation available starting-snowstorm)

The simplest thing is to leave an SSH window open with this command running so you can easily access the log output. 

tmux
cd /opt/snowstorm
sudo java -Xms4g -Xmx4g -jar snowstorm*.jar | sudo tee -a snowstorm.log

We are using tmux so that if you have an internet connection issue and get disconnected Snowstorm will keep running. If this happens you can reconnect to the machine and type "tmux a" to continue where you left off.
We are using tee to see the output in the window and copy it to a snowstorm.log file in the same directory.

Loading the initial data

Next load the SNAPSHOT of the March 2020 International Edition
(Documentation available loading-snomed)

We will use the REST API to run the imports. Access the Snowstorm swagger interface using the AWS instance ip-address and port 8080, for example - http://<ip-address>:8080/

First we need to start the import process by creating a new import job. Look for the Import endpoints and then create a new import using the start-local-file-import endpoint with the following importRequest parameter

{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "filePath": "/opt/releases/SnomedCT_InternationalRF2_PRODUCTION_20200309T120000Z.zip",
  "type": "SNAPSHOT"
}

... and click on 'Try it now'.

The Response Headers will contain the location of the newly created job. Copy this URL into a new tab to monitor the status of the job.

You can watch the Snowstorm log to see how this is progressing or fetch the job status from the import job URL - http://<ip-address>:8080/imports/<import_id> .

This should take around 30 minutes.

Make sure that you wait for the import to complete before going any further forward. You can see it is completed by looking at the status of the import using the URL from the location header. When you refresh the page it should say COMPLETED when done.

If you want to check that you have imported successfully, you can do this by seeing how many SNOMED CT concepts there are on the MAIN branch with the following URL - http://<ip-address>:8080/MAIN/concepts?offset=0&limit=1  - which show that there are a total of 474,074 active and inactive concepts.

Code System Registry

The Snowstorm Code System Registry should now have a single code system listed here: http://<ip-address>:8080/codesystems
And a single SNOMEDCT version listed here: http://<ip-address>:8080/codesystems/SNOMEDCT/versions

Check the registry throughout this exercise to see your changes reflected.

Loading the local edition or extension

As this is the first time we will be importing the local edition or extension (DK in this instance), we will need to create a CodeSystem on the server.
On the swagger interface in the ‘Code Systems’ section look for the ‘Create a code system’ endpoint. 
Use the following in the request to create the CodeSystem. Note the dependantVersionEffectiveTime allows you to create a CodeSystem dependent on a specific International Edition version.

{
  "name": "Danish Extension",
  "shortName": "SNOMEDCT-DK",
  "countryCode": "dk",
  "branchPath": "MAIN/SNOMEDCT-DK",
  "dependantVersionEffectiveTime": 20200309,
  "defaultLanguageCode": "da",
  "defaultLanguageReferenceSets": [
        "554461000005103"
  ]
}

click 'Try it now'.

You now need to import the local extension or edition. Like last time, we need to start the import process by creating a new import job. Look for the Import endpoints and then create a new import using the start-local-file-import endpoint with the following importRequest parameter

{
  "branchPath": "MAIN/SNOMEDCT-DK",
  "createCodeSystemVersion": true,
  "filePath": "/opt/releases/SnomedCT_ManagedServiceDK_PRODUCTION_DK1000005_20200331T120000Z.zip",
  "type": "SNAPSHOT"
}

click 'Try it now'.

Copy the "location" from the Response Headers and open this in a new browser tab.

Refresh the import job in your browser to see the status change from WAITING_FOR_FILE to RUNNING and then COMPLETED. You can also see how this is progressing in the Snowstorm log.

This should take no more than a few minutes.

Make sure that you wait for the import status to change to COMPLETED before going any further forward.

Upgrading MAIN to a new International Edition

Every 6 months there is a new International Edition and it is important to keep your terminology server up to date. The International Edition can be upgraded by importing a DELTA of the new changes onto the MAIN branch.

We now need to create an import job using this configuration:

{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "filePath": "/opt/releases/SnomedCT_InternationalRF2_PRODUCTION_20200731T120000Z.zip",
  "type": "DELTA"
}

click 'Try it now'. As before use the URL in the location Response Header to open a new browser tab. Refresh the page to monitor the import status.

Make sure that you wait for import status COMPLETED before going any further forward.

Upgrading the extension/edition branch to the new International Edition (merging the branch)

We now need to upgrade the local extension/edition branch to use the newly imported International Edition release content.

In our example, we will now rebase the MAIN/SNOMEDCT-DK branch using the CodeSystem upgrade endpoint giving the shortname SNOMEDCT-DK:

{
  "contentAutomations": false,
  "newDependantVersion": 20200731
}

You can check this has been successful by checking the status of the branch and seeing if it is FORWARD.

Upgrading to a new extension or edition

Using what you have already done, see if you can do this making note the type and the branch that you will import into. 

Do this by creating an import job as before, using this configuration:

{
  "branchPath": "MAIN/SNOMEDCT-DK",
  "createCodeSystemVersion": true,
  "filePath": "/opt/releases/SnomedCT_ManagedServiceDK_PRODUCTION_DK1000005_20200930T120000Z.zip",
  "type": "DELTA"
}

click 'Try it now' and use the location Response Header to open a new browser tab. Refresh the page to monitor the import status.


Code System Registry Advice

When updating Snowstorm, entries only appear in the registry when each process is complete.

When accessing content a version branch from the registry should be used e.g. "MAIN/SNOMECT-DK/2020-03-31", not "MAIN/SNOMEDCT-DK". This will avoid your implementation being able to see inconsistent content during an upgrade.

  • No labels

1 Comment

  1. To restart and cleanup Snowstorm after a failed load use: sudo java -Xms4g -Xmx4g -jar snowstorm*.jar --delete-indices