(HAPI) Terminology Server - UK SNOMED CT Import

_Instructions for setting up a HAPI server can be found at https://github.com/KevinMayfield/Jorvik/blob/master/Documentation/UK%20HAPI%20FHIR%20Server%20Instructions%201v01.docx_
This also includes early work on a regional set of UK FHIR ValueSets (based on NHS ITK Reference data for SNOMED, HL7 v2 and v3)

To import SNOMED CT (RF2) HAPI needs to be configured as a terminology server. This is done by adding a Terminology Provider to your JPAServer configuration e.g.

registerProvider(myAppCtx.getBean(TerminologyUploaderProviderDstu3.class));

(See line 146 in Jorvik/hapi-fhir-jpaserver/src/main/java/uk/co/mayfieldis/hapifhir/jpa/demo/JpaServerDemo.java at master · KevinMayfield/Jorvik · GitHub)
The upload is run by the hapi command line tools. Instructions for downloading can be found here http://hapifhir.io/doc_cli.html

In the UK(/England) the UK SNOMED CT Clinical Edition (RF2) can be found on TRUD
https://isd.hscic.gov.uk/trud3/user/guest/group/0/pack/1/subpack/102/releases
You may need to both register and subscribe to TRUD to get access to the download. Place the downloaded zip file in a suitable location. (The import was tested against SNOMEDCT2_21.0.0_20160401000001 dated 1st April 2016).
To run the import execute the following command at a command prompt

java -jar hapi-fhir-cli.jar upload-terminology -d c:\hapi-fhir\uk_sct2clfull_21.0.0_20160401000001.zip -f dstu3 -t http://localhost:8080/hapi-fhir-jpaserver/baseStu3 -u http://snomed.info/sct

-t parameter is the base url of your HAPI server
-d is the full path of your SNOMED CT RF2 zipfile

The import will take a while and will continue processing after the cli tool has finished. [The CLI tool finishes after it has loaded the data to the HAPI Server, the server then adds the data to the database]. On SQL Server the database load can be checked by running this query:

Select count(*) from dbo.TRM__CONCEPT

Syntax on other SQL systems should be similar.

Test the load has worked by executing the following query
http://127.0.0.1:8080/hapi-fhir-jpaserver/baseStu3/CodeSystem/$lookup?system=http://snomed.info/sct&code=209629006

This should return

{     

“resourceType”:“Parameters”,
“parameter”:[
{
“name”:“name”,
“valueString”:“Unknown”
},
{
“name”:“display”,
“valueString”:“Complete tear, knee, anterior cruciate ligament (disorder)”
},
{
“name”:“abstract”,
“valueBoolean”:false
}
]
}