Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

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 extnesion on top of existing data



Last Updated: 02 Jun  

On this page

Table of Contents
absoluteUrltrue


Tip

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 a private key of an AWS instance to access. Go to the directory where you have put the training.pem file and run:

Code Block
languagebash
themeConfluence
chmod 700 training.pem
ssh -i training.pem ubuntu@<ip-address>


Warning

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_20190731T120000Z.zip (July 2019 International Edition)

    • SnomedCT_ManagedServiceSEManagedServiceIE_PRODUCTION_SE1000052IE1000220_20191130T120000Z20191021T120000Z.zip (November October 2019 Swedish Irish Extension)

    • SnomedCT_InternationalRF2_PRODUCTION_20200131T120000Z.zip (January 2020 International Edition)

    • SnomedCT_InternationalRF2_PRODUCTION_20200309T120000Z.zip (March 2020 International Edition)

    • SnomedCT_ManagedServiceSEManagedServiceIE_PRODUCTION_SE1000052IE1000220_20200531T120000Z20200421T120000Z.zip (May April 2020 Swedish ExtensionIrishExtension)
  • /opt/snowstorm - currently empty

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

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

Code Block
languagebash
themeConfluence
curl localhost:9200

You will need to download the most recent release of Snowstorm (currently v4.10.2) into the /opt/snowstorm folder:

Code Block
languagebash
themeConfluence
cd /opt/snowstorm
sudo wget https://github.com/IHTSDO/snowstorm/releases/download/4.10.2/snowstorm-4.10.2.jar

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. Advanced linux users feel free to use tmux or similar instead to simulate multiple sessions.

Code Block
languagebash
themeConfluence
cd /opt/snowstorm
sudo java -Xms4g -Xmx4g -jar snowstorm*.jar | sudo tee -a snowstorm.log

We are using tee to see the output in the window and copy it to a snowstorm.log file in the same directory.

Note

Now start a second terminal window (a new SSH session) and ssh back in to the server so that you can run other commands without killing the running Snowstorm application.

Loading the initial data

Next load the SNAPSHOT of the July 2019 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 endpoint and then create a new import using

Code Block
languagexml
themeConfluence
{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "type": "SNAPSHOT"
}

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

The Response Headers will contain the location of the newly created job. Note the id of the import job as you will need it for the next step, this is a UUID it will look something like "d0b30d96-3714-443e-99a5-2f282b1f1b0".

We now need to upload the SNOMED CT release file. Normally, you would do this through the swagger interface but to reduce network load will use curl to upload the file from disk on the server directly.

Edit the command below replacing <import id> and then run on the server. We've also created a handy text file that you can use to easily edit the command - import.http - in a text editor.

Code Block
languagebash
themeConfluence
curl -i -X POST \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
-F file=@/opt/releases/SnomedCT_InternationalRF2_PRODUCTION_20190731T120000Z.zip \
'http://localhost:8080/imports/<import-id>/archive'

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 no more than 30 minutes.

Warning

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 - http://<ip-address>:8080/imports/<import id> - where it will say COMPLETED

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?activeFilter=true&offset=0&limit=1  - which show that there are a total of 350,830 active 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 (SE IE 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.

Code Block
languagexml
themeConfluence
{
  "branchPath": "MAIN/SNOMEDCT-SEIE",
  "shortName": "SNOMEDCT-SEIE",
  "countryCode": "seie",
  "defaultLanguageCode": "sven",
  "dependantVersionEffectiveTime": 20190731,
  "name": "SwedishIrish Extension"
}

click 'Try it now'.

You now need to import the local extension or edition. Like last time we start the import process by creating a new import job. Look for the Import endpoint and then create a new import using:

Code Block
languagexml
themeConfluence
{
  "branchPath": "MAIN/SNOMEDCT-SEIE",
  "createCodeSystemVersion": true,
  "type": "SNAPSHOT"
}

click 'Try it now'.

Copy the "location" from the Response Headers and open this in a new browser tab. The status will be WAITING_FOR_FILE.

We now upload the SE release file. Normally, you would do this through the swagger interface but to reduce network load will use curl to upload the file from disk on the server directly.

Edit the command below replacing <import id> with the UUID from the import location URL and then run on the server.

Code Block
languagebash
themeConfluence
curl -X POST \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
-F file=@/opt/releases/SnomedCT_ManagedServiceSEManagedServiceIE_PRODUCTION_SE1000052IE1000220_20191130T120000Z20191021T120000Z.zip \
'http://localhost:8080/imports/<import-id>/archive'

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.

Warning

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.

First, we need to create an import job using this configuration:

Code Block
languagexml
themeConfluence
{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "type": "DELTA"
}

click 'Try it now' and note the id of the import as before. Use the Response Header location to open a new browser tab. Refresh the page to monitor the import status.

Then give the server the file as before. Replace the <import id>.

Code Block
languagebash
themeConfluence
curl -X POST \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
-F file=@/opt/releases/SnomedCT_InternationalRF2_PRODUCTION_20200131T120000Z.zip \
'http://localhost:8080/imports/<import-id>/archive'


Warning

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


Note

Unusually, there was an interim release of the International Edition in March 2020 before the next Swedish release to respond to this year's COVID-19 pandemic. We need to import that too before the Swedish release.

Do the same as above with the same import job configuration

Code Block
languagexml
themeConfluence
{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "type": "DELTA"
}

And the following curl command (different file this time).

Code Block
languagebash
themeConfluence
curl -X POST \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
-F file=@/opt/releases/SnomedCT_InternationalRF2_PRODUCTION_20200309T120000Z.zip \
'http://localhost:8080/imports/<import-id>/archive'


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 SNOMEDCT-SE branch using the CodeSystem upgrade endpoint giving the shortname, SNOMEDCT-SE:

Code Block
languagexml
themeConfluence
{
  "newDependantVersion": 20200309
}

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. 

Info

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-SE/2020-05-31", not "MAIN/SNOMEDCT-SE". This will avoid your implementation being able to see inconsistent content during an upgrade.