> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emtelligent.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emtelligent.com/_mcp/server.

# ICD-10 Concept search

## Synopsis

This page contains queries that uses the Snomed ICD-10 ontology to return ICD-10 coded entities extracted from the `FINDINGS` and `IMPRESSIONS` sections of Radiology reports.

This page contains two queries:

* The first query finds ICD-10 mapped entities and returns the ICD-10 code and corresponding Snomed description.
* The second query extends the first by also retrieving the Snomed concept ID and fully-qualified concept description. This is possible because the NLP API performs post-coordination of entities after data extraction. Moreover, the NLP API uses the ICD-10 mapping from Snomed CT ensuring that every ICD-10 mapped entity is also mapped to a Snomed concept ID.

## Processing Requirements

This query assumes that at least the following processing options were enabled:

* `--feature snomed-ontology, snomedicd10-ontology`
* `--store-sections-and-sentences`

For this query, Radiology imaging studies were processed with the following document type:

* `--category Radiology`
* `--subcategory CT`

## Clinical Context

The World Health Organization's (WHO) International Statistical Classification of Diseases and Related Health Problems (ICD) 10th revision (ICD-10) is a widely used medical coding system, used for billing and data structuring purposes world-wide. Unfortunately, while its textual description of concepts is highly specific (e.g. `Injury, poisoning and certain other consequences of external causes`), many clinicians would not use such long and highly specific descriptions in their clinical notes.

The NLP API uses the SNOMED-to-ICD-10 mappings provided in the SNOMED ontology to map commonly-used clinical terms to ICD-10 concepts. The query below is an example of how these highly useful ICD-10 concepts can be extracted from medical text that uses common, colloquial medical language. In addition, the NLP API provides the SNOMED-to-ICD-10 mapping guidance that can be used to further refine the coding via manual methods.

## SQL query

### Query 1: Find ICD-10 coded entities

#### SQL

```sql
SELECT c.concept_id, d.category, fe.section_name, fe.text, fe.polarity, fe.uncertainty, c.description, sen_l.text
FROM foundentity fe
        JOIN foundentityconcept fec ON fe.id = fec.found_entity_id
        JOIN concept c ON fec.concept_id = c.concept_id AND fec.concept_ontology = c.ontology
        JOIN foundentitylocation fel ON fe.id = fel.found_entity_id
        JOIN location l ON fel.location_id = l.id AND l.type_ = 'sentence'
        JOIN sentencelocation sen_l ON sen_l.id = l.location_id
        JOIN document d ON l.document_id = d.id
WHERE c.ontology = 'snomed_icd10' --!! Replace with ontology of choice e.g. snomed, umls, radlex, loinc
AND d.category = 'Radiology'
AND fe.section_name IN ('FINDINGS', 'IMPRESSION');
```

| concept_id | category  | section_name | text                          | polarity | uncertainty | description                                                                       |
| ---------- | --------- | ------------ | ----------------------------- | -------- | ----------- | --------------------------------------------------------------------------------- |
| A09.9      | Radiology | FINDINGS     | enteritis                     | asserted | certain     | Infectious gastroenteritis and colitis, unspecified (Disease or Syndrome)         |
| A09.9      | Radiology | IMPRESSION   | enteritis                     | asserted | certain     | Infectious gastroenteritis and colitis, unspecified (Disease or Syndrome)         |
| C43.9      | Radiology | IMPRESSION   | metastatic malignant melanoma | asserted | certain     | Malignant melanoma of skin, unspecified (Neoplastic Process)                      |
| C50.9      | Radiology | IMPRESSION   | breast cancer                 | asserted | certain     | Malignant neoplasm of breast of unspecified site (Neoplastic Process)             |
| C79.9      | Radiology | IMPRESSION   | metastatic malignant melanoma | asserted | certain     | Secondary malignant neoplasm of unspecified site (Neoplastic Process)             |
| C79.9      | Radiology | IMPRESSION   | metastases                    | negated  | uncertain   | Secondary malignant neoplasm of unspecified site (Neoplastic Process)             |
| C79.9      | Radiology | IMPRESSION   | metastases                    | negated  | certain     | Secondary malignant neoplasm of unspecified site (Neoplastic Process)             |
| C80.9      | Radiology | IMPRESSION   | malignancy                    | negated  | uncertain   | Malignant neoplasm without specification of site (Neoplastic Process)             |
| D16.9      | Radiology | FINDINGS     | enchondroma                   | asserted | uncertain   | Benign neoplasm of bone and articular cartilage, unspecified (Neoplastic Process) |
| D16.9      | Radiology | IMPRESSION   | enchondroma                   | asserted | uncertain   | Benign neoplasm of bone and articular cartilage, unspecified (Neoplastic Process) |

### Query 2: ICD-10 coded entities and corresponding Snomed concepts

#### SQL

```sql
-- Find ICD10 Code and corresponding SNOMED CT fully-specified concept name
WITH icd10_mapped_entities AS (
    SELECT fe.id, c.concept_id, c.description, fe.polarity, fe.uncertainty, fe.text
    FROM foundentity fe
            JOIN foundentityconcept fec on fe.id = fec.found_entity_id
            JOIN concept c on c.concept_id = fec.concept_id and c.ontology = fec.concept_ontology AND
                                c.ontology = 'snomed_icd10'),
    snomed_mapped_entities AS (
        SELECT fe.id, c.concept_id, c.description, fe.polarity, fe.uncertainty, fe.text
        FROM foundentity fe
                JOIN foundentityconcept fec on fe.id = fec.found_entity_id
                JOIN concept c on c.concept_id = fec.concept_id and c.ontology = fec.concept_ontology AND
                                    c.ontology = 'snomed')
SELECT icd10_mapped_entities.id as entityId,
    icd10_mapped_entities.concept_id as icd10_id,
    icd10_mapped_entities.description as icd10,
    snomed_mapped_entities.concept_id as sct_id,
    snomed_mapped_entities.description as snomed,
    fe.polarity,
    fe.uncertainty,
    fe.section_name,
    fe.text as term,
    sl.text  as sentence
FROM icd10_mapped_entities
        JOIN snomed_mapped_entities ON icd10_mapped_entities.id = snomed_mapped_entities.id
        JOIN foundentity fe ON fe.id = icd10_mapped_entities.id
        JOIN foundentitylocation fel on fe.id = fel.found_entity_id
        JOIN location l on fel.location_id = l.id AND l.type_ = 'sentence'
        JOIN document d ON l.document_id = d.id
        JOIN sentencelocation sl on sl.id = l.location_id AND l.type_ = 'sentence'
WHERE fe.polarity = 'asserted'
AND fe.uncertainty = 'certain'
AND d.category = 'Radiology'
AND fe.section_name IN ('FINDINGS', 'IMPRESSION');
```

| entityid | icd10_id | icd10                                                                     | sct_id    | snomed                                     | polarity | uncertainty | section_name | term                            |
| -------- | -------- | ------------------------------------------------------------------------- | --------- | ------------------------------------------ | -------- | ----------- | ------------ | ------------------------------- |
| 611      | K42.9    | Umbilical hernia without obstruction or gangrene (Acquired Abnormality)   | 396347007 | Umbilical hernia (disorder)                | asserted | certain     | FINDINGS     | umbilical hernia                |
| 614      | A09.9    | Infectious gastroenteritis and colitis, unspecified (Disease or Syndrome) | 64613007  | Inflammation of small intestine (disorder) | asserted | certain     | FINDINGS     | enteritis                       |
| 634      | A09.9    | Infectious gastroenteritis and colitis, unspecified (Disease or Syndrome) | 64613007  | Inflammation of small intestine (disorder) | asserted | certain     | IMPRESSION   | enteritis                       |
| 636      | K42.9    | Umbilical hernia without obstruction or gangrene (Acquired Abnormality)   | 396347007 | Umbilical hernia (disorder)                | asserted | certain     | IMPRESSION   | umbilical hernia                |
| 643      | K62.9    | Disease of anus and rectum, unspecified (Disease or Syndrome)             | 300312006 | Lesion of rectum (disorder)                | asserted | certain     | FINDINGS     | rectal wall thickening          |
| 646      | L90.5    | Scar conditions and fibrosis of skin (Acquired Abnormality)               | 275322007 | Scar (disorder)                            | asserted | certain     | FINDINGS     | Scarring                        |
| 650      | M47.99   | Spondylosis, unspecified (Disease or Syndrome)                            | 8847002   | Spondylosis (disorder)                     | asserted | certain     | FINDINGS     | Multilevel degenerative changes |
| 651      | K76.0    | Fatty (change of) liver, not elsewhere classified (Disease or Syndrome)   | 197321007 | Steatosis of liver (disorder)              | asserted | certain     | IMPRESSION   | Fatty liver                     |
| 746      | K76.0    | Fatty (change of) liver, not elsewhere classified (Disease or Syndrome)   | 197321007 | Steatosis of liver (disorder)              | asserted | certain     | FINDINGS     | hepatic fatty infiltration      |
| 749      | I70.0    | Atherosclerosis of aorta (Disease or Syndrome)                            | 81817003  | Atherosclerosis of aorta (disorder)        | asserted | certain     | FINDINGS     | aorta atherosclerosis           |

## Next steps

This query pattern is applicable to other report types and sections. You may also want to filter the dataset returned limiting it to just those terms which were experienced by the patient by using the experiencer relation. An example of this query pattern is provided [here](/nlp/database/cookbook/concept-queries/ontology/icd-10-search-experiencer).

## Related links

* [Entity-level Tables](/nlp/database/schema/core/entity-tables)
* [Understanding ICD-10 code nomenclature adopted by NLP API](/nlp/release-notes/v2-23#icd10-codes)