Data Summarization (Lens)

Not only is clinical data messy, it is also often duplicated and not tailored to the questions a clinician needs to answer. Zus Lenses offer a summarized view of conditions and medications that are most relevant to a patient’s care team.

What is a Lens?

A Lens is a set of FHIR resources derived from a patient’s raw resources that have been structurally normalized, de-duplicated, summarized, and tagged. Alongside Zus Data Enrichment, a Lens helps you extract signal quickly from raw data with just one API call.

Deduplication: Both Medications and Conditions are aligned based on their Zus-enriched codings and a single resource is written per unique medication or condition based on the patient’s history.

Structural Normalization: Medication data comes from four different FHIR resources: MedicationStatement, MedicationRequest, MedicationDispense, and MedicationAdministration. Zus aligns these various resources together based on their Zus-enriched codings and writes a single MedicationStatement per unique medication based on the Patient’s history. Conditions are inherently from a single resource type and are therefore already normalized.

Summarization: Zus summarizes the history for each unique medication or condition in a single resource, so you have one source for answering questions such as: “what was the last activity for this medication?” or “what is the current status?” Additionally, you may just want to present what is currently applicable and active for the patient today. Lenses help with both of these scenarios and you can access them simply by specifying the related tag of the Lens you want (see below).

Lens resources are created after Zus enriches newly created resources and are rewritten every time a new relevant resource is created with no work or intervention needed by you.

How Are Lenses Represented?

Zus-Derived Lens Resources

Lens resources are aggregated, summarized versions of Builder-generated and third party resources in the Zus Aggregated Profile (ZAP). You can identify a Lens resource by the presence of a “Lens Tag,” which is a meta tag generated by Zus.

Lens Tag example:

"meta": {
    "tag": [
        {
            "system": "https://zusapi.com/lens",
            "code": "ActiveMedications"
        }
    ]
}

Lens Permissions

Builder users and app clients are NOT permitted to create, modify, or delete Lens resources. Any attempt to do so will result in a 403 error.

Medication Lenses

Summary Lens

The medication resources for a patient (i.e., MedicationStatement, MedicationRequest, MedicationDispense, and MedicationAdministration), are aligned and de-duplicated by common RxNorm (or their available CodeSystem if mapping to RxNorm was not possible). Zus then writes new Lens MedicationStatement resources with a specific tag for easy identification:

"meta": {
    "tag": [
        {
            "system": "https://zusapi.com/summary",  
  			"code": "Common"  
        }
    ]
}

You can query for a patient's Medication Summary Lens resources by filtering on the tag, as shown below:

{{fhir_url}}/MedicationStatement?_tag=https://zusapi.com/summary|Common&patient.identifier=https://zusapi.com/fhir/identifier/universal-id|{{universal_patient_id}}

Zus determines the value for each field in the summarized resource primarily based on the value on the raw resource with the latest real-world event date. This latest real-world event date is then used to populate the DateAsserted field of the summarized resource. The derivedFrom property on the Summary Lens resource references the resources the Summary Lens was compiled from. The status field is set to active for any Summary Lens that has activity within the last 180 days or 365 days into the future, and where the latest status among the raw resources is not one of: completed, entered-in-error, stopped, or not-taken.

Active Medication Lens

Active Medication Lenses are a subset of Summary Lenses that have a status of Active. The status is set to active for any Summary Lens that has activity within the last 180 days or 365 days into the future, and where the latest status among the raw resources is not completed, entered-in-error, stopped, or not-taken. This Lens helps answer the question: “What medications is this patient most likely on currently?”

Active Medication Lenses have the following tag:

"meta": {
    "tag": [
        {
            "system": "https://zusapi.com/lens",
            "code": "ActiveMedications"
        }
    ]
}

Because Active Medication Lens resources are a subset of Summary Lenses, they also contain the summary tag.

You can query for a patient's Active Medication Lens resources by filtering on the tag, as shown below:

{{fhir_url}}/MedicationStatement?_tag=https://zusapi.com/lens|ActiveMedications&patient.identifier=https://zusapi.com/fhir/identifier/universal-id|{{universal_patient_id}}

Condition Lenses

Summary Lens

The Condition resources of a patient are aligned and de-duplicated by common SNOMED CT (or the available CodeSystem if mapping to SNOMED CT is not available). Zus creates these new, de-duplicated Conditions Summary resources with the following tag:

"meta": {
    "tag": [
        {
            "system": "https://zusapi.com/summary",  
  			"code": "Common"  
        }
    ]
}

You can query for a patient's Condition Summary Lens resources by filtering on the tag, as shown below:

{{fhir_url}}/Condition?_tag=https://zusapi.com/summary|Common&patient.identifier=https://zusapi.com/fhir/identifier/universal-id|{{universal_patient_id}}

Zus determines the value for each field in the Summary Lens resource primarily based on the value on the raw resource with the latest real-world event date.

Chronic Conditions Lens

Chronic Conditions are a subset of Conditions Summary Lenses that have an enriched Chronic Conditions Indicator (CCI) value of “Chronic”, “Both”, or null (i.e., if there is no mapping from the coding to CCI value). This Lens informs care team users about what chronic problems their patients are most likely currently dealing with. You can find the enriched CCI value in a Condition resource codeable concept in the following extension:

{  
  "extension": [  
    {  
      "url": "<https://zusapi.com/terminology/enrichment>",  
      "valueString": "CCI"  
    }  
  ],  
  "system": "<http://www.hcupus.ahrq.gov/toolssoftware/chronic_icd10/chronic_icd10.jsp>",  
  "code": "C",  
  "display": "Chronic",  
  "userSelected": false  
}

Chronic Conditions Lens resources have the following tag:

"meta": {
    "tag": [
        {
            "system": "https://zusapi.com/lens",
			"code": "ChronicConditions"
        }
    ]
}

Since Condition Lens resources are a subset of Summary Lenses, they also contain the summary tag

You can query for a patient's Chronic Conditions Lens resources by filtering on the tag, as shown below:

{{fhir_url}}/Condition?_tag=https://zusapi.com/lens|ChronicConditions&patient.identifier=https://zusapi.com/fhir/identifier/universal-id|{{universal_patient_id}}

Transition of Care Lens

The Transitions of Care Lens aggregates and summarizes Encounter FHIR resources for each patient into EpisodeOfCare FHIR resources. Inpatient, emergency, observation, and preadmit encounters that have matching visit IDs and/or any encounters that occur near each other temporally (within 36 hours) for a given patient will be grouped together and summarized into a Zus created and managed EpisodeOfCare resource.

Grouping Logic

First, Zus groups all encounters with the same visit ID together. Then we create temporal windows of these groups, collecting all encounters that occur within 36 hours of the previous encounter. These windows are then summarized into an EpisodeOfCare lens output resource.

Data Model

The output of the Transitions of Care Lens are EpisodeOfCare FHIR resources which Zus creates and manages.

FieldNote
resource.meta.tagAll transitions of care lens output resources will include this tag:
{ "system": "https://zusapi.com/summary", "code": "TransitionsOfCare" }
resource.extension with "url": "https://zusapi.com/lens/extension/aggregatedFrom"The Zus aggregated from extension lists the Encounter resources that were used to generate this output resource.
resource.extension with "url": "https://zusapi.com/lens/extension/dischargeDisposition"The Zus discharge disposition extension denotes the most recent discharge disposition for the episode.
resource.extension with "url": "https://zusapi.com/lens/extension/dischargeLocation"The Zus discharge location extension denotes the location of the most recent inpatient encounter in the episode.
resource.extension with "url": "https://zusapi.com/lens/extension/admittingLocation"The Zus admitting location extension denotes the location of the most recent emergency encounter in the episode.
resource.extension with "url": "https://zusapi.com/lens/extension/encounterClass"The Zus encounter class extension denotes the most recent “encounter class” in the episode. Expected codes are:EMER (emergency), IMP(inpatient), OBSENC (observation), and PRENC (preadmit).
resource.diagnosisThe diagnosis field includes all diagnoses from all encounters that are part of this episode.
Diagnoses from emergency encounters will have an admitting diagnosis extension on them.
Diagnoses from all other encounters will have a discharge diagnosis extension on them.
resource.periodThe period will begin at the start of the first occurring encounter that is part of this episode.
The period will end at the end of the last occurring encounter that is part of this episode. Null values are possible if the supporting encounters do not have a start or end period.
resource.patientThe patient will be the Zus Universal Patient.

Here is a mocked example of a single EpisodeOfCare for a single patient created by the Transitions of Care Lens in JSON format:

{
            "fullUrl": "https://api.zusapi.com/fhir/EpisodeOfCare/3ca3ddf4-5808-4c37-a70d-340a9bb288a7",
            "resource": {
                "resourceType": "EpisodeOfCare",
                "id": "3ca3ddf4-5808-4c37-a70d-340a9bb288a7",
                "meta": {
                    "extension": [
                        {
                            "url": "https://zusapi.com/stream",
                            "valueString": "zus"
                        },
                        {
                            "url": "https://zusapi.com/created-at",
                            "valueInstant": "2023-12-04T18:42:23.176+00:00"
                        }
                    ],
                    "versionId": "3",
                    "lastUpdated": "2023-12-06T14:30:09.309+00:00",
                    "source": "#oPJqrr6aRcqDT6zN",
                    "tag": [
                        {
                            "system": "https://zusapi.com/accesscontrol/owner",
                            "code": "builder/5e0f86eb-bb0b-4543-8489-262fcbf661da",
                            "display": "zus-health-lens"
                        },
                        {
                            "system": "https://zusapi.com/summary",
                            "code": "TransitionsOfCare"
                        }
                    ]
                },
                "extension": [
                    {
                        "url": "https://zusapi.com/lens/extension/aggregatedFrom",
                        "extension": [
                            {
                                "url": "https://zusapi.com/lens/extension/aggregatedFrom",
                                "valueReference": {
                                    "reference": "Encounter/9ff3e597-dea9-4030-a0bb-faed510c62ae",
                                    "type": "Encounter"
                                }
                            },
                            {
                                "url": "https://zusapi.com/lens/extension/aggregatedFrom",
                                "valueReference": {
                                    "reference": "Encounter/b04dddba-2c9a-4a40-8059-582fb3ea1fdb",
                                    "type": "Encounter"
                                }
                            }
                        ]
                    },
                    {
                        "url": "https://zusapi.com/lens/extension/dischargeDisposition",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "display": "Discharged to home health"
                                }
                            ],
                            "text": "Discharged to home health"
                        }
                    },
                    {
                        "url": "https://zusapi.com/lens/extension/dischargeLocation",
                        "valueReference": {
                            "reference": "Location/4e193be5-fc7e-4ead-99c7-5d45e6342196",
                            "type": "Location",
                            "display": "Mock Healthcare Facility"
                        }
                    },
                    {
                        "url": "https://zusapi.com/lens/extension/admittingLocation",
                        "valueReference": {
                            "reference": "Location/62d66292-17c3-4e06-9fec-97352ef8cb41",
                            "type": "Location",
                            "display": "Mock Healthcare Facility 2"
                        }
                    },
                    {
                        "url": "https://zusapi.com/lens/id",
                        "valueString": "6f29897a-db0e-41af-b666-3f7c2eb0417a"
                    },
                    {
                        "url": "https://zusapi.com/fhir/identifier/universal-id",
                        "valueString": "17029ef4-c018-4f24-a627-b3b68f094114"
                    },
                    {
                        "url": "https://zusapi.com/lens/extension/encounterClass",
                        "valueCoding": {
                            "system": "https://terminology.hl7.org/2.1.0/ValueSet-v3-ActEncounterCode.html",
                            "code": "IMP",
                            "display": "inpatient",
                            "userSelected": false
                        }
                    }
                ],
                "identifier": [
                    {
                        "type": {
                            "coding": [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "VN",
                                    "display": "visit number"
                                }
                            ],
                            "text": "visit number"
                        },
                        "value": "000001"
                    }
                ],
                "status": "finished",
                "diagnosis": [
                    {
                        "condition": {
                            "reference": "Condition/cbd9e03d-29cc-4aaa-93ea-8e04c33c1b6a"
                        },
                        "role": {
                            "coding": [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
                                    "code": "AD",
                                    "display": "Admitting diagnosis"
                                }
                            ]
                        }
                    },
                    {
                        "condition": {
                            "reference": "Condition/6434ced9-bc03-4477-8a31-9c4801213fc3"
                        },
                        "role": {
                            "coding": [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
                                    "code": "DD",
                                    "display": "Discharge diagnosis"
                                }
                            ]
                        }
                    }
                ],
                "patient": {
                    "reference": "Patient/95fd00c0-ca37-47e5-a570-f10f588e8a99",
                    "type": "Patient"
                },
                "period": {
                    "start": "2023-09-02T18:07:00.000000+00:00",
                    "end": "2023-09-05T19:51:00.000000+00:00"
                }
            },
            "search": {
                "mode": "match"
            }
        }