Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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


On this page

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

  • Google Chrome 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 that you have put 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/files - containing the following:
    • SnomedCT_InternationalRF2_PRODUCTION_20190131T120000Z.zip (January 2019 International Edition)

    • SnomedCT_InternationalRF2_PRODUCTION_20190731T120000Z.zip (July 2019 International Edition)

    • SnomedCT_NZExtensionRF2_BETA_20190601T000000Z.zip (June 2019 Beta NZ Edition)

  • /opt/snowstorm - containing the following:

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

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

curl "http://localhost:9200"

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

cd /opt/snowstorm
sudo wget https://github.com/IHTSDO/snowstorm/releases/download/4.4.0/snowstorm-4.4.0.jar

Starting Snowstorm

To start snowstorm you will need to run the following command (it is also document in the repository readme files - https://github.com/IHTSDO/snowstorm/blob/master/docs/getting-started.md). Alternatively, you can run the following command:

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

The pipe at the end of the command will log all the output to the snowstorm.log file in the same directory.

Make sure start a another, new 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 server



Loading the initial data

Now, you will need to load the SNAPSHOT of the January 2019 International Edition. Instructions on how to do that are in the Snowstorm readme - https://github.com/IHTSDO/snowstorm/blob/master/docs/loading-snomed.md - which uses the command line.

However, we are going to use the REST API to run the first import. Access the server 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

{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "type": "SNAPSHOT"
}

and then click on 'Try it now' and then note the id of the import as you will need it for the next step (it will look something like - d0b30d96-3714-443e-99a5-2f282b1f1b0)

We now need to give the server the file. Normally, you would do this through the swagger interface, but to reduce network issues, find the correct file and we will use curl to do this from the server directly

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

You can watch the log to see how this is progressing, or simply to the import endpoint - http://<ip address>:8080/imports/<import id> . 

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

Loading the local edition or extension

As this is the first time we will be importing the local edition or extension (NZ in this instance), we will need to create a CodeSystem on the server. On the swagger interface, and in the ‘Code Systems’ section of the swagger interface, look for the ‘Create a code system’ endpoint. Use the following in the request to create the CodeSystem.

{
  "branchPath": "MAIN/SNOMEDCT-NZ",
  "shortName": "SNOMEDCT-NZ"
}

and then click on 'Try it now'.

You now need to import the local extension or edition. 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

{
  "branchPath": "MAIN/SNOMEDCT-NZ",
  "createCodeSystemVersion": true,
  "type": "SNAPSHOT"
}

and then click on 'Try it now' and then note the id of the import as you will need it for the next step (it will look something like - d0b30d96-3714-443e-99a5-2f282b1f1b0)

We now need to give the server the file. Normally, you would do this through the swagger interface, but to reduce network issues, find the correct file and we will use curl to do this from the server directly

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

You can watch log to see how this is progressing, or simply to the import endpoint - http://<ip address>:8080/imports/<import id>

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

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. An upgrade is an import again, but for the International Edition, it is a DELTA import onto MAIN. 

First, we need to create an import job as above

{
  "branchPath": "MAIN",
  "createCodeSystemVersion": true,
  "type": "DELTA"
}

and then click on 'Try it now' and then note the id of the import as before.

We now need to give the server the fileas before

curl -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'

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

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

We now need to upgrade the local extension/edition branch. 

In our example, we will now merge the MAIN branch into the SNOMEDCT-NZ branch using the CodeSystem upgrade endpoint using the shortname, SNOMEDCT-NZ:

{
  "newDependantVersion": 20190731
}

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. 


  • No labels