Generating Patient Summaries from Clinical Reports
Synopsis
This query searches for relevant medical concepts from medical reports for a patient. It returns entities coded to Snomed concepts and organizes them by the UMLS type associated with the Snomed concept. When multiple occurrences of the same concept is detected (e.g. in multiple reports), the query returns the most recent mention.
This example shows the value of populating the documentmetadata table after data processing. The Output Database Client supports merging of select metadata fields during the database insert step after structured data is returned by the NLP API. By using this data integration feature, your can use the Output Database to develop queries that return datasets which can be immediately used to generate insights for clinical or research questions where specific patients or cohorts need to be identified.
Processing Requirements
Because we need to uniquely identify the patient for this query, the patient identifier (MRN or other proxy for patient id), must be stored in the Output Database documentmetadata table after processing. Depending on your existing data infrastructure, there are several ways to populate the Output Database with patient identifiers so that they can be correlated with the extracted data. This information should be stored in the documentmetadata subject_id field in addition to other report specific information such as chart date. For more information about populating the documentmetadata table with patient identifiers and other report metadata see Storing Extended Report Metadata and Ingesting Input Documents from JSON Files in the Output Database Client documentation.
This query assumes that at least the following emtellipro-db-client processing options were enabled:
--feature experiencer-relation, snomed-ontology--store-sections-and-sentences
For this query, Clinical notes were processed with the following document type:
--category Clinical--subcategory generic
Clinical Context
The Unified Medical Language System (UMLS) from the National Library of Medicine (NLM) is a metathesaurus - it takes multiple medical ontologies, and combines and cross-references them. Another feature of the UMLS is that it uses its own semantic type labeling for its many medical ontologies, labeling concepts with semantic types such as Disease or Syndrome or Acquired Abnormality. The NLP API provides these UMLS semantic types for entities in the ‘entity_type’ field of the NLP API output and they can be used to identify groups of clinically-relevant concepts.
This query uses a combination of the experiencer CTE seen earlier in this cookbook with SQL CASE functionality to further combine multiple UMLS semantic types into broad groupings of patient history items. By combining multiple UMLS semantic types, it broadly groups patient history medical concepts into 6 categories of useful clinical history items:
- Abnormalities / Disorders
- Neoplasia / Cancer
- Injuries / Trauma
- Findings / Symptoms
- Mental / Behavioral Disorders
- Procedures / Care Activities
This kind of query could then be used to build a clinical helper applications that would show a snapshot of a patient’s medical history, highlighting and organizing information to help clinicians quickly read up on a patient’s history.

