Experiencer Relations
In this section, we describe what experiencer relations are and explain its database schema representation. We also provide sample queries to illustrate the key aspects of the data schema. At the end of the section, we provide utility queries to help you explore the annotated terms and surrounding text for experiencer relations.
After reading this section, you will know how to:
- Retrieve concepts or entity types, such as a specific disease concept or a category of concepts (e.g. procedure), that was experienced by the patient, or the patient’s relations (e.g. his mother).
- Search the concepts and entities that were mentioned in the context of the patient’s family history.
- Narrow down the concepts or entities as needed.
The content in this section builds on the concepts and data models explained in earlier sections (see Entity-level Tables, and Document-level Tables).
What are Experiencer Relations?
Experiencer relations relate an experiencer to an experienced term where the experiencer is the subject that is reported as having experienced a disorder, procedure or other applicable entity type (the experienced term). The experiencer is typically a `person`: the patient, or the patient’s relation (such as his sister). Moreover, the experiencer can also refer to the patient’s family history - either explicitly mentioned or implied by the section heading.
Moreover, when the experiencer is the patient, the NLP API distinguishes between explicit and implied references. Thus, the experiencer in a relation can be one of the following:
-
Implied - patient
In medical reports, most concepts are assumed to be about the patient, unless there is an explicit reference to the patient or someone else. For example, in the following sentences the assumed experiencer is the the patient.
Because the understood assumption in medical documents is that the document in a patient’s chart contains data primarily about that patient, the most numerous type of experiencer relations are those where the subject is the
implied patient.
-
Explicit - patient
Examples of sentences where there is an explicit mention of the patient are:
In the sentence “The patient notes a 3-week history of knee pain” the concept ‘knee pain’ would have a found experiencer of ‘patient’.
-
Implied - family history
Some medical reports have a “FAMILY HISTORY:” section, a list of diseases that do not identify the specific family member who had the diseases (example shown below). Concepts identified in these sections are assumed to belong to a patient’s family members due to the section of the report in which they are found.
-
Explicit - family history
A clinician may record the patient’s family history in narrative form. For example:
In this sentence, NLP API identifies the following: * The text “family history” as the experiencer and maps it to
snomedconcept ID57177007|Family history with explicit context (situation)|* the “clotting disorder” term as the experienced entity and maps it to64779008|Blood coagulation disorder (disorder)|
-
Explicit - family relation
There are sentences which explicitly refer to the members of the patient’s family. For example:
In the sentence “Her grandmother had gout and diabetes”, the concepts ‘gout’ and ‘diabetes’ would have a found experiencer of ‘grandmother’.
It should be mentioned that how the patient, persons related to the patient, and the notion of family history is handled in different ontologies varies. This has practical implications when constructing SQL queries. In general, however, SNOMED CT provides good support for concepts representing persons (the patient, and patient’s relations such as mother, sister, etc. ).
When using experiencer relations, use the SNOMED CT ontology.
Compound concepts such as family history of congestive heart failure exist in some ontologies; for example SNOMED has the concept Family history of congestive heart failure (situation)| 433305001. When the NLP API encounters such terms, it extracts an experiencer relation between the base form of the SNOMED concept, congestive heart failure, and family history of, but not the compound concept Family history of congestive heart failure. This is deliberate. By extracting the term congestive heart failure as Congestive heart failure (disorder) | 42343007 the NLP API allows users to retrieve all disorder mentions by querying for the disorder SNOMED semantic tag. By contrast the situation semantic tag covers a diverse range of concepts making it a less useful query parameter. Likewise, some ontologies contain compound concepts like no family history of drug abuse; however, the NLP API avoids using the negated compound concepts, and instead stores the negated temporal context as the polarity attribute of the experiencer relation.
JSON Data Model
We have established that experiencers can be implied or explicit. In this section we will consider how this is represented in the JSON output:
Explicit Experiencers
The Patient
First, consider the following sentence:
This sentence will produce the JSON output below, where the experienced and the experiencer arguments represent the related entities E1 and E0. Notice that the experiencer is an entity with label E0. The confidence score for the experiencer relation here is 1 since it is explicit.
The the next JSON excerpt shows the JSON output for the patient entity E0.
Notice that the patient entity E1 is mapped to several concepts and entity types depending on the ontologies selected for processing. For example, the concept label Csnomed0 refers to the SNOMED CT patient concept ID 116154003 with the fully-qualified description of patient (person).
The cardinality of the relation between entities, concepts and entity types is important to be aware of when querying the Output Database. Each entity has a many-to-many relation with concepts and entity types.
Implied Experiencers
The Patient
Consider the following phrase:
The patient is implied. The JSON output generated is different than that shown in the previous section. Notice that the implied patient reference is captured by the label reference Epatient. This special entity label identifies the implied patient in the JSON output. Notice that the confidence score here is null, since the experiencer relation is implied. In the database, the implied patient versus explicit patient is indicated in the entity table’s type_ column. This distinction is important for data retrieval. This will be discussed in detail in the next section (see Experiencer Relation Tables.)
The Patient’s Family History
For implied family history references, the JSON output for the experiencer relation, will contain a value of efamily for the ref key, instead of Epatient as shown below. For the phrase:
Experiencer Relation Tables
The following ER diagram shows the experiencerrelation table and how it relates to document and entity tables in the Output Database schema.

A few key points should be noted:
-
The type_ and relation_id columns in the relation table give the type of relation and the reference to a relation-specific table respectively. For experiencer relations, the type_ column must have a value of
experiencer, and the relation_id is the reference to the primary key of the experiencerrelation table. -
Each row in the experiencerrelation table represents an experiencer relation instance, and contains the following information for this relation type, namely the:
- polarity attributed
- experiencer entity id
- experienced entity id
-
The relation table document_id column is a foreign key reference to the document table. An inner join on this key can be performed to locate the documents where relations are found.
-
The experiencer_id and experienced_id columns are foreign key references to the entity table. The entity table is an entry point from which to gather stored in other entity-related tables such as the foundentity, concept, foundentitytype tables. For more information, see Entity-level Tables.
Key Attributes
Notice that experiencer relations have polarity. For example, in the statement The patient has no family history of breast cancer, the absence of breast cancer in the patient’s family history is captured in the polarity attribute of the experiencer relation. It is important to consider the polarity attribute when querying experiencer relations about the patient’s family history.
Found vs. Assumed Entities
The distinction between found and assumed entities applies only to references to patients as follows:
foundentities are extracted from explicit mentions of the patient, and map to concepts and entity types in the concept and foundentitytype tables respectively.assumedentities are extracted from implicit references to the patient, and do not have concept or entity type representation in the database, but are represented as rows in the assumedentity table.
This distinction between found and assumed is important when querying experiencer relations. To retrieve the complete set of all patient relations, you must take this into account.
To determine if an entity is found or assumed, you can look up the value stored in the type_ column of the entity table:
- When the value of the type_ column of the entity table is
found, the entity_id column refers to the primary key of the foundentity table. - When the value of type_ is
assumed, the value of entity_id refers to the primary key of the assumedentity table.
Sample Queries
Because relations have multiple entities and attributes, querying involves multiple join operations with specific join conditions. A good approach is to start by exploring the data with simple queries that can be used, in subqueries or common table expressions (CTE), to build more elaborate queries.
We begin by querying the experiencer entities as follows:
- Query: Count of found vs. assumed experiencers
- Query: Count of found experiencers by concept
- Query: List relation where experiencers are patients (implied and explicit)
- Query: List relations where experiencers are relatives of patients
- Query: List relations where experiencers refer to patient family history
Next, we show examples of querying the experienced entities as follows:
- Query: List concepts for experienced entities
- Query: Distribution of experienced concepts by semantic type
Finally, we combine elements of previous queries to retrieve data for experiencer and experienced entities:
Query: Count of found vs. assumed experiencers
This query reinforces a key point which is that experiencer entities can be implied (assumed) or explicit (found). Let’s find the relative distribution of experiencer relations by found vs. assumed experiencers.
This query involves an inner join between the experiencerrelation table and the entity table as shown below. By grouping on the entity.type_ we get the count of relation instances of found vs. assumed experiencers. As expected the number of assumed experiencer relations far outnumber the found experiencer relations.
Query: Count of found experiencers by concept
Next, we want to know how many experiencer relations were extracted, and who the experiencers were. As mentioned above, an experiencer can be a patient, a person other than the patient, or reference to the patient’s family history. The query below performs an inner join between the entity, foundentity, foundentityconcept and concept tables to look up the SNOMED CT concepts for each experiencer entity, and then aggregates the results by the concepts found. For more information about these tables see Entity-level Tables.
Query: List relation where experiencers are patients (implied and explicit)
The query below finds the relation ids for relations where the experiencer entity is a patient, either found or assumed. The result is a union of two CTEs as follows:
- The first CTE finds explicit patient references by querying for entities associated with the SNOMED CT concept ID for
Patient (person). Concept IDs are stored in the concept table. - The second CTE finds implicit patient references by querying for entities of type
assumedin the entity table’s type_ column, and a value ofpatientin the assumedentity table.
This query returns the subset of relation IDs.
Query: List relations where experiencers are relatives of patients
The following query searches for relations where the experiencer entity maps to the SNOMED CT concept for Mother (person), Father (person), Parent (person), and returns a set of relation IDs from the experiencerrelation table.
Query: List relations where experiencers refer to patient family history
This query finds implicit and explicit references to the patient’s family history, by querying for entities of type assumed, and whose value in the assumedentity table is family to extract implied references and querying for entities of type found that are mapped to the SNOMED CT concept ID 57177007|Family history with explicit context (situation)|.
Query: List concepts for experienced entities
Previous query examples explored the experiencer entities. Here, we want to survey the experienced entities in the dataset, based on the concepts that they map to in the SNOMED CT ontology.
Query: Distribution of experienced concepts by semantic type
The NLP API allows you to analyze occurrences of entities at multiple levels of granularity. This SQL query shows how to find the frequencies of different types of concepts. Here we use semantic types defined in the SNOMED CT ontology. Semantic type information is stored in the foundentitytype table.
To access the semantic types for an entity, we will join the entity, foundentity and foundentitytype tables as shown below. For more information about these tables see Entity-level Tables.
Query: Count of relations where patients have diabetes or CAD
Finally, we combine the queries presented previously to count the number of references to diabetes or coronary artery disease (CAD) experienced by the patient. This query involves a number of steps:
- First, get the subset of relation ids that pertain to the patient.
- Then join with foundentity, foundentityconcept and concept tables to assemble the required columns.
- Filter the results for the SNOMED CT concepts for diabetes (
73211009) or CAD (53741008) and ensure that the polarity of the relation isassertedin the WHERE clause. - Finally, summarize the results with a count and GROUP BY.
This query can be easily modified to analyze the experienced entities for other experiencer subjects. For example, replace the explicitpatients_ers and implicitpatient CTEs above with a query that returns relation IDs for the patient’s family history. See Query: List relations where experiencers refer to patient family history.
Utility Queries
It is sometimes useful to be able to survey the extracted terms and review the context in which they occur, and the concepts they may to. The SQL queries provided here show how to retrieve this information for experiencer relations by querying the entity-level and document level tables. See Entity-level Tables, and Document-level Tables for a detailed explanation of these tables.

