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:

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

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;
idsubjectconceptvalueunitssentence
13LVEF25090800452-55%%LEFT VENTRICLE: Left ventricular wall thickness, cavity size, and systolic function are normal, LVEF is 52-55%.
35Left ventricular ejection fraction25090800460%%Left ventricular ejection fraction of 60%.
84LVEF25090800455%%LEFT VENTRICLE: Normal LV wall thickness, cavity size, and systolic function (LVEF 55%).
85LVEF25090800455%%Left ventricular wall thickness, cavity size, and systolic function are normal, with a LVEF of 55%.
132LV ejection fraction25090800465%%LV ejection fraction is estimated at 65%.
134LV Ejection fraction25090800465%%LV Ejection fraction estimated at 65%.
201LVEF25090800420% 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.
222LVEF25090800420% 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.
285left ventricular ejection fraction25090800451%%Normal LV systolic function with left ventricular ejection fraction of 51%.
327LVEF25090800455%%Normal LV wall thickness, cavity size, and systolic function (LVEF 55%).

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

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;
idsubjectvalueunitssentence
13LVEF52-55%%LEFT VENTRICLE: Left ventricular wall thickness, cavity size, and systolic function are normal, LVEF is 52-55%.
35Left ventricular ejection fraction60%%Left ventricular ejection fraction of 60%.
84LVEF55%%LEFT VENTRICLE: Normal LV wall thickness, cavity size, and systolic function (LVEF 55%).
85LVEF55%%Left ventricular wall thickness, cavity size, and systolic function are normal, with a LVEF of 55%.
132LV ejection fraction65%%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 section.