Skip to main content

Data Explorer

The Data Explorer is available when modifying layouts on the Subject Viewer. This tool is helpful as a way to navigate FHIR JSON data in order to extract values for display.

The power behind the Data Explorer is JMESPath (JSON Matching Expression paths). JMESPath is a query language for searching JSON documents. It allows you to declaratively extract elements from a JSON document.

Example: Configure Birth Place

Prerequisites

  • A user who has ABAC policy named layoutAdmin.
  • A project with subjects (patients) who have birthPlace stored.
    • In this example:
      • Project: Clinical T2D LifeExtend
      • Subject: Ms. Lavelle Vandervort

1. "Not Available" for Birth Place

A layout is configured to display Birth Place in the header, however the value is showing as Not Available.

Not Available could mean this subject is missing data, however in this example the header configuration for Patient JMESPath Query is incorrectly using a query expression of extensions.

Data Explorer Header Missing Birthplace

2. Open Data Explorer

Open the Data Explorer using the icon next to Birth Place:

Data Explorer Open

3. Modify the JMESPath Query Expression

Data Explorer Modify JMESPath Query Expression

Using the Input data as a guide, navigate the JSON structure to locate birthPlace inside of extension.

After reviewing the JSON structure for the birthPlace element, craft a JMESPath query to extract the city, state, country of birthPlace.

Example
extension[?url == 'http://hl7.org/fhir/StructureDefinition/birthPlace'].valueAddress
| values([0])
| join(', ', @)

The example above, annotated below, shows off how helpful JMESPath query expressions can be:

// Find extension data element, if available, related to `birthPlace` FHIR patient extension.
// See: <http://hl7.org/fhir/extension-patient-birthplace.html>
extension[?url == 'http://hl7.org/fhir/StructureDefinition/birthPlace'].valueAddress
// The extension calls for the keys of: city, state, country for birthPlace.
// Extract the object key values from the birthPlace object into an array.
// See: <http://jmespath.org/specification.html#values>
| values([0])
// Join the array of key values with a comma
// See: <http://jmespath.org/specification.html#join>
| join(', ', @)

4. Apply change

Apply the change and immediately the value for birthPlace will populate if this data exists for this subject.

Data Explorer Query Modified

Save the layout to share this change with all users of this project.

5. Output Format Types and Data Display

Previously the above steps have shown off JMESPath's power and ability to extract and render data using the default Default Raw JMESPath Result output format type.

However the web console offers Output Format Type display utilities of:

We can simplify our JMESPath expression and use the Address output format type:

extension[?url == 'http://hl7.org/fhir/StructureDefinition/birthPlace'].valueAddress

Data Explorer Output Format Types

When the queried data renders correctly, modify the Result Type in the layout configuration to use Address as the output format type.

Save the layout to share this change with all users of this project.