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

Before upgrading a SNOMED CT Extension to a new version of the International Edition on the Snow Owl terminology server it's necessary to find and update relationships pointing to concepts which are retired in the new release.

Prerequisites

  • The new International Release RF2 files
  • The SCTID(s) of the extension module
  • Snow-Owl running with the extension
  • Basic knowledge of using Snow-Owl exports
  • An OSX or Unix command line

Process Overview

  1. Export RF2 snapshot of Extension
  2. Grep for Extension RF2 relationships referencing retired International concepts
  3. Fix extension relationships

1. Export RF2 snapshot of Extension

Export a snapshot of the Extension from Snow-Owl by creating a snapshot export and specifying the SCTID or SCTIDs in the Extension.

https://dev-ms-authoring.ihtsdotools.org/snowowl/snomed-ct/v2/#!/exports/beginExport

Example export config for Sweden: 

{
"moduleIds": ["45991000052106"],
"branchPath": "MAIN/2016-01-31/SNOMEDCT-SV",
"type": "SNAPSHOT"
}

This will give you a url as a response e.g. :

"Location": "https://dev-ms-authoring.ihtsdotools.org/snowowl/snomed-ct/v2/exports/f2d28e97-6e3b-4c75-b665-8895532954bd"

So put into your web browser address bar:  "https://dev-ms-authoring.ihtsdotools.org/snowowl/snomed-ct/v2/exports/f2d28e97-6e3b-4c75-b665-8895532954bd/archive"

If on the local machine use the uuid with the url as below:

wget http://username:password@localhost:8080/snowowl/snomed-ct/v2/exports/f2d28e97-6e3b-4c75-b665-8895532954bd/archive -O export.zip

NOTE: At present the export does not start being generated until after the archive has been requested. As such not much may seem to be occurring for quite a while.

2. Grep for Extension RF2 relationships referencing retired International concepts

Unzip the International Edition RF2 files into a working directory.

Unzip the Extension RF2 snapshot (the export.zip above)  into a working directory.

Use the following shellscript and change the relevant directories:

upgrade-relationship-check.sh

Or...

Either use the script in the main termserver dir called checkconrels.sh or if it does not exist 

  1. nano checkconrels.sh
  2. open Bash Script to Check concept relationships: and copy the script
  3. edit the script to set the paths to the international release, the international delta filename and the extension.
  4. save
  5. sudo chmod 0774 checkconrels.sh 
  6. ./checkconrels.sh

Or:

Use the following command line statement to find retired concepts from the International concept delta and for each grep the Extension relationship files. (The last six fields are extracted so the final grep can filter for active relationships without picking up relationships in role group 1).

Update the paths for your use case. 

 

for retiredConcept in `grep -P '\t0\t' SnomedCT_RF2Release_INT_20160731/Delta/Terminology/sct2_Concept_Delta_INT_20160731.txt | cut -f1`; do \
grep $retiredConcept SE-Snapshot-Export/SnomedCT_Release_INT/RF2Release/Terminology/sct2_*Relationship_*.txt | cut -f1,2,3,4,5,6 | grep -P '\t1\t' \
&& echo "Relationship(s) above reference newly retired concept $retiredConcept"; \
done

 

Example output for upgrading the Swedish release to July 2016 of the International Edition:

SE-Snapshot-Export/SnomedCT_Release_INT/RF2Release/Terminology/sct2_Relationship_Snapshot_INT_20160921.txt:2047071000052125 20150531 1 45991000052106 51911000052104 69960004
SE-Snapshot-Export/SnomedCT_Release_INT/RF2Release/Terminology/sct2_StatedRelationship_Snapshot_INT_20160921.txt:49141000052128 20150531 1 45991000052106 51911000052104 69960004
Relationship(s) above reference newly retired concept 69960004

 

This shows that the inferred relationship 2047071000052125 and stated relationship 49141000052128 need to be fixed.

3. Fix extension relationships

Use the Snow-Owl relationship endpoint to update the offending relationships. Usually the destination of the relationship can be repointed to the parent of the retired concept but check that this concept has not also been retired.

Make a note of the relationships that have been fixed. After the upgrade process the MS customer should be informed so that they may make more appropriate relationship fixes now the new international content is available.

Limitations

This method only covers the upgrade between consecutive International Edition releases. If an Extension is jumping two releases, for example from July 2015 to July 2016, then the command in section 2 should be repeated for each International release in turn.

 

  • No labels

1 Comment

  1. See also the proposed design for automating this process as part of the Release Dashboard project - Managed Service - Extension Upgrade Automation