> 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.

# Identifying Terms of Interest in Radiology Reports

## Synopsis

This query finds all terms labelled as **disease**, **findings**, and **morphologic abnormality** SNOMED entity types in the IMPRESSION section of Radiology reports. Entity type searches are less specific than concept search but are useful for finding entities for further analysis and filtering.

## Processing Requirements

This query assumes that at least the following `emtellipro-db-client` processing options were enabled:

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

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

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

## Clinical Context

Medical ontologies like SNOMED classify their concepts into semantic types such as `disorder`, `morphologic abnormality`, `findings`, `substance`, `procedure`, etc. The NLP API reports this information separately from the concept itself as the `entity_type` field in its output, which allows users to filter for concepts based on this information retrospectively.

A common data science or clinical application scenario is one where a clinician wants to know, very generically, what medical problems a patient has had in their past. One simple way is to just search an Output Database for any concepts that are asserted, which have a SNOMED semantic type of `disorder`, `morphologic abnormality`, or `finding`. While this is a somewhat broad definition of medical problems (as many findings may be benign), it can be used with high-recall to identify almost any medical issue of concern that NLP API has coded with SNOMED CT. The results return can be reduced by searching for `disorder` only, or `disorder` and `morphologic abnormality` if higher precision is required.

## SQL query

#### SQL

```sql
-------------------------------------------------------------------------------------------------------------
-- Retrieve disease/findings/morphologic abnormality in IMPRESSION section of Radiology reports
-- that are 'asserted' and 'certain'
-------------------------------------------------------------------------------------------------------------
SELECT d.category AS document_category,
    c.concept_id,
    c.description,
    fe.section_name AS section,
    fe.text AS annotated_term,
    fe.polarity,
    fe.uncertainty,
    sl.text AS sentence
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 foundentitytype fet on fe.id = fet.found_entity_id AND fet.ontology = 'snomed'
        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 sl ON sl.id = l.location_id
        JOIN document d ON l.document_id = d.id
WHERE c.ontology = 'snomed'
AND fet.type_name IN ('disorder', 'finding', 'morphologic abnormality') -- Snomed CT entity types
AND d.category = 'Radiology'
AND fe.section_name = 'IMPRESSION'                                      -- REPLACE: with section of interest e.g. FINDINGS, INDICATIONS
AND fe.polarity = 'asserted'
AND fe.uncertainty = 'certain';
-- LIMIT 1000; -- RECOMMENDED: for very large data sets
```

#### Microsoft SQL Server

```sql
-------------------------------------------------------------------------------------------------------------
-- Retrieve disease/findings/morphologic abnormality in IMPRESSION section of Radiology reports
-- that are 'asserted' and 'certain'
-------------------------------------------------------------------------------------------------------------
SELECT TOP 1000 -- RECOMMENDED: for very large data sets
    d.category AS document_category,
    c.concept_id,
    c.description,
    fe.section_name AS section,
    fe.text AS annotated_term,
    fe.polarity,
    fe.uncertainty,
    sl.text AS sentence
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 foundentitytype fet on fe.id = fet.found_entity_id AND fet.ontology = 'snomed'
        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 sl ON sl.id = l.location_id
        JOIN document d ON l.document_id = d.id
WHERE c.ontology = 'snomed'
AND fet.type_name IN ('disorder', 'finding', 'morphologic abnormality') -- Snomed CT entity types
AND d.category = 'Radiology'
AND fe.section_name = 'IMPRESSION'                                      -- REPLACE: with section of interest e.g. FINDINGS, INDICATIONS
AND fe.polarity = 'asserted'
AND fe.uncertainty = 'certain';
-- LIMIT 1000; -- RECOMMENDED: for very large data sets
```

#### Snowflake

```sql
-------------------------------------------------------------------------------------------------------------
-- Retrieve disease/findings/morphologic abnormality in IMPRESSION section of Radiology reports
-- that are 'asserted' and 'certain'
-------------------------------------------------------------------------------------------------------------
WITH distinct_concepts AS (SELECT DISTINCT * FROM concept)
SELECT d.category AS document_category,
    c.concept_id,
    c.description,
    fe.section_name AS section,
    fe.text AS annotated_term,
    fe.polarity,
    fe.uncertainty,
    sl.text AS sentence
FROM foundentity fe
        JOIN foundentityconcept fec ON fe.id = fec.found_entity_id
        JOIN distinct_concepts c ON fec.concept_id = c.concept_id AND fec.concept_ontology = c.ontology
        JOIN foundentitytype fet on fe.id = fet.found_entity_id AND fet.ontology = 'snomed'
        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 sl ON sl.id = l.location_id
        JOIN document d ON l.document_id = d.id
WHERE c.ontology = 'snomed'
AND fet.type_name IN ('disorder', 'finding', 'morphologic abnormality') -- Snomed CT entity types
AND d.category = 'Radiology'
AND fe.section_name = 'IMPRESSION'                                      -- REPLACE: with section of interest e.g. FINDINGS, INDICATIONS
AND fe.polarity = 'asserted'
AND fe.uncertainty = 'certain';
-- LIMIT 1000; -- RECOMMENDED: for very large data sets
```

| document_category | concept_id | description                                | section    | annotated_term         | polarity | uncertainty | sentence                                                                                                                                                |
| ----------------- | ---------- | ------------------------------------------ | ---------- | ---------------------- | -------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Radiology         | 40199007   | Supine body position (finding)             | IMPRESSION | supine                 | asserted | certain     | No obvious pneumoperitoneum or bowel obstruction, but evaluation is limited on these supine views.                                                      |
| Radiology         | 64613007   | Inflammation of small intestine (disorder) | IMPRESSION | enteritis              | asserted | certain     | Several fluid-filled loops of jejunum are present compatible with mild enteritis.                                                                       |
| Radiology         | 396347007  | Umbilical hernia (disorder)                | IMPRESSION | umbilical hernia       | asserted | certain     | Fat containing umbilical hernia.                                                                                                                        |
| Radiology         | 197321007  | Steatosis of liver (disorder)              | IMPRESSION | Fatty liver            | asserted | certain     | Fatty liver.                                                                                                                                            |
| Radiology         | 89977008   | Increased thickness (finding)              | IMPRESSION | thickening             | asserted | certain     | Subtle area of thickening of the lower rectal wall.                                                                                                     |
| Radiology         | 300312006  | Lesion of rectum (disorder)                | IMPRESSION | rectal wall thickening | asserted | certain     | Subtle area of thickening of the lower rectal wall.                                                                                                     |
| Radiology         | 76197007   | Hyperplasia (morphologic abnormality)      | IMPRESSION | hyperplasia            | asserted | certain     | Multiple visualized nodes of the bilateral deep lateral cervical nodal chain, within normal size and morphology, most compatible with mild hyperplasia. |
| Radiology         | 4147007    | Mass (morphologic abnormality)             | IMPRESSION | mass lesion            | asserted | certain     | Large, well demarcated mass lesion of the deep lobe of the left parotid gland, with probable involvement of the left facial nerve.                      |
| Radiology         | 53461003   | Normal size (finding)                      | IMPRESSION | normal size            | asserted | certain     | Multiple visualized nodes of the bilateral deep lateral cervical nodal chain, within normal size and morphology, most compatible with mild hyperplasia. |
| Radiology         | 312894000  | Osteopenia (disorder)                      | IMPRESSION | osteopenia             | asserted | certain     | Severe osteopenia.                                                                                                                                      |

## Next steps

To refine the query, one practical strategy that may be explored is to limit the search to specific report sections only. The section of the report where a diseased is mentioned typically provides important context that alters the interpretation and significance of the disease mention.

The NLP API normalizes a large set of recognized section headings into standardized section names. To see a list of normalized section names present in your data, you can use the provided [here](/nlp/database/schema/core/document-tables#query-list-sections-by-report-category). Select one or more section names to use as a query constraint.

To search for these entity types in a specific section, simply relace the `fe.section_name` WHERE clause with appropriate section name.

## Related links

* [Entity-level Tables](/nlp/database/schema/core/entity-tables)
* [List sections by report category](/nlp/database/schema/core/document-tables#query-list-sections-by-report-category).