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

# Left Ventricular Ejection Fraction

## Synopsis

This query finds mentions **left ventricular ejection fraction** (LVEF), and uses **measurement relations** to retrieve their values and units.

## Processing Requirements

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

* \--feature `measurement-relations, snomed-ontology`
* \--store-sections-and-sentences

## Clinical Context

Measurements are frequently used in clinical notes to provide information and context about patients. For example, a clinician may indicate that they feel that a patient's limited exercise tolerance is not related to cardiac issues by noting that:

```text
He can only walk 2 blocks without having to rest, but on a recent echo his LVEF was 55%.  
```

In this example, the NLP API identifies `LVEF` as matching the SNOMED concept `250908004 |Left ventricular ejection fraction (observable entity)|`, `55` as the measurement value, and `%` as the measurement unit. This information is captured as a measurement relation.

If a user wanted to extract all of the left ventricular ejection fraction measurements from a collection of clinical notes, the query below could be used. You can search for other measurement types of interest by altering the concept of interest in the query to another SNOMED concept such as `59328004 |Forced expired volume in 1 second (observable entity)|` will return all of the FEV1 measurements from patient charts.

## SQL query

### Variant 1: Find only LVEF mentions with measurement values

#### PostgreSQL

```sql
WITH measurementvalues AS (
    SELECT measurementrelation.id,
        string_agg( val_fe.text, ', ' ) AS values,
        string_agg(femu_val.text, ' x ') AS units
        FROM  measurementrelation
        -- 2. retrieve the entity attributes of the ** value ** of the measurement relation
        JOIN entity val_e
            ON measurementrelation.value_id = val_e.id AND val_e.type_ = 'found'
        JOIN foundentity val_fe
            ON val_e.entity_id = val_fe.id
        LEFT JOIN foundentitymeasurementunit femu_val -- retrieve units associated with a measurement value
            ON femu_val.found_entity_id = val_fe.id
    GROUP BY measurementrelation.id
)
SELECT  measurementrelation.id,
        -- if documentmetadata is populated
        -- dm.chartdate,
        -- dm.subject_id,
        REGEXP_REPLACE(sub_fe.text, '\n', ' ', 'g') AS subject,
        sub_c.concept_id                           AS concept,
        mv.values                                  AS value,
        mv.units                                   AS units,
        sl.text                                    AS sentence
FROM measurementrelation
        -- 1. retrieve the entity attributes of the ** subject ** of the measurement relation
        JOIN entity sub_e
            ON measurementrelation.subject_id = sub_e.id AND sub_e.type_ = 'found'
        JOIN foundentity sub_fe
            ON sub_e.entity_id = sub_fe.id
        JOIN foundentityconcept sub_fec
            ON sub_fec.found_entity_id = sub_fe.id
        JOIN concept sub_c
            ON sub_c.concept_id = sub_fec.concept_id AND sub_fec.concept_ontology = sub_c.ontology
        -- 2. get values and their units from CTE table
        JOIN measurementvalues mv ON mv.id = measurementrelation.id
        -- 3. retrieve sentence by joining with location and document tables on subject's foundentity id
        JOIN foundentitylocation sub_fel
            ON sub_fe.id = sub_fel.found_entity_id
        JOIN location l
            ON sub_fel.location_id = l.id
        JOIN document d
            ON l.document_id = d.id
        JOIN sentencelocation sl
            ON sl.id = l.location_id AND l.type_ = 'sentence'
        -- uncomment if documentmetadata is available
        -- JOIN documentmetadata dm 
        --    ON dm.document_id =  d.id
WHERE sub_c.ontology = 'snomed' -- Use SNOMED CT
      AND sub_c.concept_id = '250908004'; -- Snomed concept for Left Ventricular Ejection Fraction;
```

#### MS SQL Server

```sql
--- FEV1 measurements
WITH measurementvalues AS (
    SELECT measurementrelation.id,
        STRING_AGG(val_fe.text, ', ')  AS val,
        STRING_AGG(femu_val.text, ' x ') AS units
        FROM  measurementrelation
        -- 2. retrieve the entity attributes of the ** value ** of the measurement relation
        JOIN entity val_e
            ON measurementrelation.value_id = val_e.id AND val_e.type_ = 'found'
        JOIN foundentity val_fe
            ON val_e.entity_id = val_fe.id
        LEFT JOIN foundentitymeasurementunit femu_val -- retrieve units associated with a measurement value
            ON femu_val.found_entity_id = val_fe.id
    GROUP BY measurementrelation.id
)
SELECT  measurementrelation.id,
        -- if documentmetadata is populated
        -- dm.chartdate,
        -- dm.subject_id,
        REPLACE(sub_fe.text, '\n', ' ')           AS subject,
        sub_c.concept_id                           AS concept,
        mv.val                                     AS value,
        mv.units                                   AS units,
        sl.text                                    AS sentence
FROM measurementrelation
        -- 1. retrieve the entity attributes of the ** subject ** of the measurement relation
        JOIN entity sub_e
            ON measurementrelation.subject_id = sub_e.id AND sub_e.type_ = 'found'
        JOIN foundentity sub_fe
            ON sub_e.entity_id = sub_fe.id
        JOIN foundentityconcept sub_fec
            ON sub_fec.found_entity_id = sub_fe.id
        JOIN concept sub_c
            ON sub_c.concept_id = sub_fec.concept_id AND sub_fec.concept_ontology = sub_c.ontology
        -- 2. get values and their units from CTE table
        JOIN measurementvalues mv ON mv.id = measurementrelation.id
        -- 3. retrieve sentence by joining with location and document tables on subject's foundentity id
        JOIN foundentitylocation sub_fel
            ON sub_fe.id = sub_fel.found_entity_id
        JOIN location l
            ON sub_fel.location_id = l.id
        JOIN document d
            ON l.document_id = d.id
        JOIN sentencelocation sl
            ON sl.id = l.location_id AND l.type_ = 'sentence'
        -- uncomment if documentmetadata is available
        -- JOIN documentmetadata dm 
        --    ON dm.document_id =  d.id
WHERE sub_c.ontology = 'snomed' -- Use SNOMED CT
      AND sub_c.concept_id = '250908004'; -- Snomed concept for Left Ventricular Ejection Fraction
```

#### Snowflake

```sql
--- FEV1 measurements
WITH measurementvalues AS (
    SELECT measurementrelation.id,
        listagg( val_fe.text, ', ' ) AS vals,
        listagg( femu_val.text, ' x ') AS units
        FROM  measurementrelation
        -- 2. retrieve the entity attributes of the ** value ** of the measurement relation
        JOIN entity val_e
            ON measurementrelation.value_id = val_e.id AND val_e.type_ = 'found'
        JOIN foundentity val_fe
            ON val_e.entity_id = val_fe.id
        LEFT JOIN foundentitymeasurementunit femu_val -- retrieve units associated with a measurement value
            ON femu_val.found_entity_id = val_fe.id
    GROUP BY measurementrelation.id
)
SELECT  measurementrelation.id,
        -- if documentmetadata is populated
        -- dm.chartdate,
        -- dm.subject_id,
        REGEXP_REPLACE(sub_fe.text, '\n', '') AS subject,
        sub_c.concept_id                           AS concept,
        mv.values                                  AS value,
        mv.units                                   AS units,
        sl.text                                    AS sentence
FROM measurementrelation
        -- 1. retrieve the entity attributes of the ** subject ** of the measurement relation
        JOIN entity sub_e
            ON measurementrelation.subject_id = sub_e.id AND sub_e.type_ = 'found'
        JOIN foundentity sub_fe
            ON sub_e.entity_id = sub_fe.id
        JOIN foundentityconcept sub_fec
            ON sub_fec.found_entity_id = sub_fe.id
        JOIN concept sub_c
            ON sub_c.concept_id = sub_fec.concept_id AND sub_fec.concept_ontology = sub_c.ontology
        -- 2. get values and their units from CTE table
        JOIN measurementvalues mv ON mv.id = measurementrelation.id
        -- 3. retrieve sentence by joining with location and document tables on subject's foundentity id
        JOIN foundentitylocation sub_fel
            ON sub_fe.id = sub_fel.found_entity_id
        JOIN location l
            ON sub_fel.location_id = l.id
        JOIN document d
            ON l.document_id = d.id
        JOIN sentencelocation sl
            ON sl.id = l.location_id AND l.type_ = 'sentence'
        -- uncomment if documentmetadata is available
        -- JOIN documentmetadata dm 
        --    ON dm.document_id =  d.id
WHERE sub_c.ontology = 'snomed' -- Use SNOMED CT
      AND sub_c.concept_id = '250908004'; -- Snomed concept for Left Ventricular Ejection Fraction
```

| id  | subject                            | concept   | value                  | units | sentence                                                                                                                                                                                          |
| --- | ---------------------------------- | --------- | ---------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 13  | LVEF                               | 250908004 | 52-55%                 | %     | LEFT VENTRICLE: Left ventricular wall thickness, cavity size, and systolic function are normal, LVEF is 52-55%.                                                                                   |
| 35  | Left ventricular ejection fraction | 250908004 | 60%                    | %     | Left ventricular ejection fraction of 60%.                                                                                                                                                        |
| 84  | LVEF                               | 250908004 | 55%                    | %     | LEFT VENTRICLE: Normal LV wall thickness, cavity size, and systolic function (LVEF 55%).                                                                                                          |
| 85  | LVEF                               | 250908004 | 55%                    | %     | Left ventricular wall thickness, cavity size, and systolic function are normal, with a LVEF of 55%.                                                                                               |
| 132 | LV ejection fraction               | 250908004 | 65%                    | %     | LV ejection fraction is estimated at 65%.                                                                                                                                                         |
| 134 | LV Ejection fraction               | 250908004 | 65%                    | %     | LV Ejection fraction estimated at 65%.                                                                                                                                                            |
| 201 | LVEF                               | 250908004 | 20% to 25%, 20% to 25% | % x % | An echocardiogram performed at the bedside demonstrated a LVEF of 20% to 25% in the setting of tachycardia and a hyperdynamic right ventricle; suggesting elevated right-sided filling pressures. |
| 222 | LVEF                               | 250908004 | 20% to 25%, 20% to 25% | % x % | An echocardiogram performed at the bedside demonstrated a LVEF of 20% to 25% in the setting of tachycardia and a hyperdynamic right ventricle; suggesting elevated right-sided filling pressures. |
| 285 | left ventricular ejection fraction | 250908004 | 51%                    | %     | Normal LV systolic function with left ventricular ejection fraction of 51%.                                                                                                                       |
| 327 | LVEF                               | 250908004 | 55%                    | %     | Normal LV wall thickness, cavity size, and systolic function (LVEF 55%).                                                                                                                          |

### Variant 2: Find all LVEF mentions showing measurement values when available

#### PostgreSQL

```sql
WITH lvef_mentions AS (
    -- retrieve lvef mentions
    SELECT fe.id as subject_feid, e.id as subject_eid, fe.text as subject_term FROM foundentity fe
        JOIN entity e on e.entity_id = fe.id AND e.type_ = 'found'
        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
    WHERE
        c.ontology = 'snomed' AND c.concept_id = '250908004' -- LVEF 250908004
),
lvef_values AS (
-- retrieve values and units when present
SELECT mr.id as mrel_id,
        mr.subject_id as subject_eid,
        val_fe.id as value_feid,
        val_fe.text as value_term,
        string_agg( val_femu.text, ', ') as units
FROM measurementrelation mr
    JOIN lvef_mentions fm ON mr.subject_id = fm.subject_eid
    JOIN entity val_e on mr.value_id = val_e.id AND val_e.type_='found'
    JOIN foundentity val_fe ON val_e.entity_id = val_fe.id
    -- retrieve unit(s) for value term if present (using LEFT JOIN)
    LEFT JOIN foundentitymeasurementunit val_femu ON val_fe.id = val_femu.found_entity_id
GROUP BY mrel_id, mr.subject_id, value_feid, value_term
)
SELECT
    fv.mrel_id as id,
    fm.subject_term as subject,
    fv.value_term as value,
    fv.units as units,
    s.text as sentence
FROM lvef_mentions fm
    -- retrieve value terms if available (LEFT JOIN is required)
    LEFT JOIN lvef_values fv ON fm.subject_eid = fv.subject_eid
    -- retrieve sentence using the subject entity
    JOIN foundentitylocation fel on fm.subject_feid = fel.found_entity_id
    JOIN location l on fel.location_id = l.id AND l.type_='sentence'
    JOIN sentencelocation s on l.location_id = s.id;
```

#### MS SQL Server

```sql
WITH lvef_mentions AS (
    -- retrieve lvef mentions
    SELECT fe.id as subject_feid, e.id as subject_eid, fe.text as subject_term FROM foundentity fe
        JOIN entity e on e.entity_id = fe.id AND e.type_ = 'found'
        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
    WHERE
        c.ontology = 'snomed' AND c.concept_id = '250908004' -- LVEF 250908004
),
lvef_values AS (
-- retrieve values and units when present
SELECT mr.id as mrel_id,
        mr.subject_id as subject_eid,
        val_fe.id as value_feid,
        val_fe.text as value_term,
        STRING_AGG( val_femu.text, ', ') as units
FROM measurementrelation mr
    JOIN lvef_mentions fm ON mr.subject_id = fm.subject_eid
    JOIN entity val_e on mr.value_id = val_e.id AND val_e.type_='found'
    JOIN foundentity val_fe ON val_e.entity_id = val_fe.id
    -- retrieve unit(s) for value term if present (using LEFT JOIN)
    LEFT JOIN foundentitymeasurementunit val_femu ON val_fe.id = val_femu.found_entity_id
GROUP BY mrel_id, mr.subject_id, value_feid, value_term
)
SELECT
    fv.mrel_id as id,
    fm.subject_term as subject,
    fv.value_term as value,
    fv.units as units,
    s.text as sentence
FROM lvef_mentions fm
    -- retrieve value terms if available (LEFT JOIN is required)
    LEFT JOIN lvef_values fv ON fm.subject_eid = fv.subject_eid
    -- retrieve sentence using the subject entity
    JOIN foundentitylocation fel on fm.subject_feid = fel.found_entity_id
    JOIN location l on fel.location_id = l.id AND l.type_='sentence'
    JOIN sentencelocation s on l.location_id = s.id;
```

#### Snowflake

```sql
lvef_mentions AS (
    -- retrieve lvef mentions
    SELECT fe.id as subject_feid, e.id as subject_eid, fe.text as subject_term FROM foundentity fe
        JOIN entity e on e.entity_id = fe.id AND e.type_ = 'found'
        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
    WHERE
        c.ontology = 'snomed' AND c.concept_id = '250908004' -- LVEF 250908004
),
lvef_values AS (
-- retrieve values and units when present
SELECT mr.id as mrel_id,
        mr.subject_id as subject_eid,
        val_fe.id as value_feid,
        val_fe.text as value_term,
        list_agg( val_femu.text, ', ') as units
FROM measurementrelation mr
    JOIN lvef_mentions fm ON mr.subject_id = fm.subject_eid
    JOIN entity val_e on mr.value_id = val_e.id AND val_e.type_='found'
    JOIN foundentity val_fe ON val_e.entity_id = val_fe.id
    -- retrieve unit(s) for value term if present (using LEFT JOIN)
    LEFT JOIN foundentitymeasurementunit val_femu ON val_fe.id = val_femu.found_entity_id
GROUP BY mrel_id, mr.subject_id, value_feid, value_term
)
SELECT
    fv.mrel_id as id,
    fm.subject_term as subject,
    fv.value_term as value,
    fv.units as units,
    s.text as sentence
FROM lvef_mentions fm
    -- retrieve value terms if available (LEFT JOIN is required)
    LEFT JOIN lvef_values fv ON fm.subject_eid = fv.subject_eid
    -- retrieve sentence using the subject entity
    JOIN foundentitylocation fel on fm.subject_feid = fel.found_entity_id
    JOIN location l on fel.location_id = l.id AND l.type_='sentence'
    JOIN sentencelocation s on l.location_id = s.id;
```

| id  | subject                            | value  | units | sentence                                                                                                        |
| --- | ---------------------------------- | ------ | ----- | --------------------------------------------------------------------------------------------------------------- |
| 13  | LVEF                               | 52-55% | %     | LEFT VENTRICLE: Left ventricular wall thickness, cavity size, and systolic function are normal, LVEF is 52-55%. |
| 35  | Left ventricular ejection fraction | 60%    | %     | Left ventricular ejection fraction of 60%.                                                                      |
| 84  | LVEF                               | 55%    | %     | LEFT VENTRICLE: Normal LV wall thickness, cavity size, and systolic function (LVEF 55%).                        |
| 85  | LVEF                               | 55%    | %     | Left ventricular wall thickness, cavity size, and systolic function are normal, with a LVEF of 55%.             |
| 132 | LV ejection fraction               | 65%    | %     | LV ejection fraction is estimated at 65%.                                                                       |

## Next steps

Expand the search by searching for all child concepts of cardiac ejection fractions `70822001`. This concept includes both right and left ventricular ejection fractions. Examples of using Snomed CT concept hierarchies in SQL queries are provided in the [Concept Hierarchy Queries](/nlp/database/cookbook/concept-queries/concept-hierarchy/overview) section.

## Related links

* [Entity-level Tables](/nlp/database/schema/core/entity-tables)
* [Measurement Relations](/nlp/database/schema/relations/measurement)