Load ICD-10 terminology into Aidbox
In this post, you will learn how to load ICD-10 terminology into aidbox.
​
With a new version of Aidbox we provide you with a set of terminology packages like ICD-10 and LOINC and a special bulk operation to import these code sets.
You can read more about how terminology service is designed in a our CTO blog post - Two-phase terminology.
Aidbox team prepared terminology packages with popular code systems. These packages are essentially ndjson files with a set of concept resources and they are available by public url in our cloud.
Here are a few packages you can start with:
Rx-Norm, SNOMED-CT and basic FHIR CodeSystems/ValueSets packages are in progress. If you need something specific, ping us in a Aidbox Community Chat.
In this tutorial, we will load ICD-10 deceases codes into Aidbox and see how we can look up codes using Concept resource Search API.
To import these terminology packs, you can use terminology/$import operation. Let's load ICD-10 (Classification of Deceases): just copy-paste the following snippet into REST console in Aidbox UI:
request.yalm
1
POST /terminology/$import
2
​
3
url: 'https://storage.googleapis.com/aidbox-public/icd10/icd10cm.ndjson.gz'
Copied!
You will get a response with numbers of resources loaded:
response.yaml
1
status: 200 result: {CodeSystem: 1, ValueSet: 1, Concept: 44487}
Copied!
As you can see, a package consists of one CodeSystem, one ValueSet and about 40K concepts with decease codes.
Let's go to REST console and see what we have:
1
GET /CodeSystem
2
​
3
# response 200
4
​
5
resourceType: Bundle
6
type: searchset
7
entry:
8
- resource:
9
url: ICD-10
10
id: icd-10
11
name: ICD-10-CM
12
status: active
13
content: complete
14
version: '2019'
15
date: '2019'
16
resourceType: CodeSystem
17
description: International Classification of Diseases
Copied!
1
GET /ValueSet
2
​
3
# response 200
4
​
5
resourceType: Bundle
6
type: searchset
7
entry:
8
- resource:
9
url: icd-10
10
id: icd-10
11
name: ICD-10
12
status: active
13
compose:
14
include:
15
- {system: ICD-10}
16
version: 0.0.1
17
date: '2019-01-01'
18
resourceType: ValueSet
19
description: This value set includes all ICD-10 codes.
Copied!
Now we can search diagnoses with, for example, _ilike parameter:
1
GET /Concept?system=ICD-10&_ilike=flue
2
​
3
# response 200
4
resourceType: Bundle
5
type: searchset
6
entry:
7
- resource:
8
code: A08
9
system: ICD-10
10
display: Viral and other specified intestinal infections
11
property:
12
icd10:
13
excludes1: ['influenza with involvement of gastrointestinal tract (J09.X3, 10.2, J11.2)']
14
valueset: [icd-10]
15
id: ICD-10-A08
16
resourceType: Concept
17
- resource:
18
code: A41.3
19
system: ICD-10
20
display: Sepsis due to Hemophilus influenzae
21
valueset: [icd-10]
22
id: ICD-10-A41-3
23
resourceType: Concept
24
...
Copied!
Or inspect concepts in Aidbox Console UI:
Health Samurai Team is working on declarative search indexing in the future release. For now, let's create a trigram index to make _ilike search faster. Go to SQL Console and execute the following statement:
1
CREATE INDEX concept_trgm_idx on concept
2
USING gin (
3
(id || ' ' || resource::text) gin_trgm_ops
4
);
5
​
6
VACUUM ANALYZE concept;
Copied!
Try _ilike search again - is it faster?

Clean up

To clean up all terminology, you can truncate all related tables from db console:
1
truncate concept;
2
truncate codesystem;
3
truncate valueset;
Copied!
Last modified 6mo ago