Measure Evaluation Service
Overview
The Measure Eval service is a Java based application that is primarily responsible for evaluating bundles of acquired patient resources against the measures that Link Cloud tenants are configured to evaluate with. The service utilizes the CQF framework to perform the measure evaluations.
flowchart LR
nMeasureEvalService_67DBAC12["Service: Measure Evaluation Service"]
nMeasureEvalService_67DBAC12 -->|produces| nMeasureReportGenerated_38AFFB54["Event: MeasureReportGenerated"]
nresources_normalized_28215193["Event: resources-normalized"] -->|consumed by| nMeasureEvalService_67DBAC12
nMeasureEvalService_67DBAC12 -->|sends| nDataAcquisitionRequested_4BBEB8F8["Command: DataAcquisitionRequested"]
subgraph nCompliance_DBAE25D_domain["Domain: Compliance"]
nMeasureReportGenerated_38AFFB54
nresources_normalized_28215193
end
subgraph nDataAccess_2A523756_domain["Domain: Data Access"]
nDataAcquisitionRequested_4BBEB8F8
end
subgraph nReport_4D4FBBDA_domain["Domain: Report"]
nMeasureEvalService_67DBAC12
end
Common Configurations
Service Configurations
| Property Name | Description | Type/Value | Required | Secret? |
|---|---|---|---|---|
| link.reportability-predicate | Predicate to determine if a patient is reportable | "...IsInInitialPopulation" (default) |
No | No |
| /resource-cache/blob-storage/connection-string | Connection string to access the deployed Azure Blob Storage environment | Yes | Yes | |
| /resource-cache/blob-storage/blob-container-name | The Azure Blob Storage container name where cached resources will be stored | Yes | No | |
| /resource-cache/blob-storage/blob-root | Root Azure Blob Storage directory the cached resources will be located | Yes | No | |
| /spring/data/redis/host | Host Connection string to access the deployed Redis environment. | Yes | No | |
| /spring/data/redis/password | The access key to the deployed Redis environment. | Yes | Yes | |
| /spring/data/redis/port | The port of the deployed Redis environment | Yes | No |
Reportability Predicates
The link.reportability-predicate property is used to determine if a patient is reportable. The default value is "com.lantanagroup.link.measureeval.reportability.IsInInitialPopulation", whichi s a class that implements Predicate<MeasureReport>. Other predicate implementations may be built over time in the same package and should be listed here.
Package com.lantanagroup.link.measureeval.reportability:
IsInInitialPopulation: Determines if a patient is reportable if they are in the initial population (a count of 1 or more for the "InitialPopulation" population of the patient's MeasureReport).
Azure CosmosDB for MongoDB
The resource collection in the database needs to be created in the Azure portal and configured to shard based on the correlationId property
Features and Functionality
Measure Evaluation is a critical process in assessing clinical data against FHIR digital quality measures. It ensures that healthcare data is analyzed consistently and accurately using standardized logic and definitions.
Key Concepts
- FHIR Digital Quality Measures: Defined standards that outline how clinical data is measured for quality reporting and compliance.
- Measure Package: A comprehensive bundle (in FHIR JSON Bundle format) required for evaluation, including:
- Measure definitions.
- CQL logic in FHIR Library resources.
- Terminology, such as pre-expanded value sets and optimized code systems.
Evaluation Process
- Pre-preparation:
- Data is collected and normalized to align with FHIR standards.
- Measure packages are prepared, containing all artifacts necessary for evaluation.
- Execution: Measures are executed systematically against the acquired data for each patient, including multiple evaluations during progressive querying as described in Progressive Querying.
- Results: Each measure produces results indicating compliance or performance, which can be consumed by reporting or downstream systems. These results are in the form of a MeasureReport resource specific to the individual patient that the measure was executed against.
Role in Progressive Querying
Measure evaluation is performed multiple times for each patient during progressive querying to support an efficient and focused reporting pipeline:
- Determines whether the patient from the census meets the initial criteria for submission.
- Identifies what data should be submitted for the reporting scenario if the patient is relevant.
- Includes "FHIR Profile" assertion statements in the resulting data to support the validation service in determining which profiles to validate the data against.
Resource Caching
The CacheType value on consumed ResourcesNormalized events will inform the Measure Eval service whether patient FHIR resources are stored on Redis or Azure Blob Storage. The event contains a CacheKey that details which collection of FHIR resources are needed for measure evaluation.
Integration
Measure evaluation is often part of a broader workflow:
- Data Acquisition: Data is collected and normalized to a standard format.
- Measure Execution: Evaluations are run against pre-configured measures as data becomes available.
- Result Propagation: Evaluated results are consumed by the report service.
This approach ensures consistent, reliable evaluation of healthcare quality measures, supporting improved care outcomes and regulatory adherence.
Testing
The measure engine may be tested against arbitrary data using the $evaluate operation (which is custom-built for this purpose in the measure evaluation service) or using the measureeval-cli.jar that can be built separately from the service; see measureeval/README.md for more information.
Upload & Storage
- Bundles are uploaded via:
PUT /api/measureeval/measureDefinition - The uploaded bundle is a FHIR JSON Bundle and typically includes:
Measure,Library,StructureDefinition(Profile),ValueSet,CodeSystem - Bundles are stored as-is in the measureeval service's database.
Evaluation Execution
When a request is made to evaluate a measure:
- The service checks if a
MeasureEvaluatorinstance has already been compiled and cached. - If not, it:
- Retrieves the corresponding bundle from the database.
- Compiles a
MeasureEvaluatorinstance. - Stores the compiled instance in memory/cache for future use.
Terminology Handling:
- Currently, the bundle must include all required
ValueSetandCodeSystemresources for evaluation to succeed. - There are future plans to integrate a FHIR Terminology (TX) Service, which would offload terminology expansion (e.g.,
$expand) and eliminate the need for local terminology resources in the bundle. - Note: At this time, value sets and code systems must be pre-expanded, or enumerate all of the codes that should be included in a value set's intensional definition. A terminology service is being explored to address this.
Known Deficiencies
- No version tracking: Only a single bundle per
:idis retained. - Overwrites are destructive: Uploading a new bundle overwrites the existing one.
- No version selection: There is no support for evaluating a measure against a specific version of the bundle.
Database Schema
| Name | Type | Required? | Length |
|---|---|---|---|
| _id | string | Yes | |
| facilityId | string | Yes | |
| correlationId | string | Yes | |
| patientId | string | Yes | |
| resourceType | string | Yes | |
| resourceId | string | Yes | |
| resource | string | Yes | |
| createdDate | string | Yes |
| Name | Type | Required? | Length |
|---|---|---|---|
| _id | string | Yes | |
| facilityId | string | Yes | |
| patientId | string | Yes | |
| reports | array | Yes |
| Name | Type | Required? | Length |
|---|---|---|---|
| ContainerName | string | Yes | |
| BlobName | string | Yes | |
| Content | string | Yes |
OpenAPI Operations
Get all measure definitions
Route Parameters
None
Query Parameters
None
Put (create or update) a measure definition
Route Parameters
None
Query Parameters
None
Evaluate a measure against data in request body
Route Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
| id | string | Yes | The ID of the measure definition |
Query Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
| debug | boolean | No | Whether to log CQL debugging information during evaluation |
| parameters | Yes | The parameters to use in the evaluation |
Route Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
| facilityId | string | Yes | |
| reportId | string | Yes | |
| patientId | string | Yes |
Query Parameters
None
Get a measure definition
Route Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
| id | string | Yes |
Query Parameters
None
Get the CQL for a measure definition's library
Route Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
| id | string | Yes | The ID of the measure definition |
| library-id | string | Yes | The ID of the library in the measure definition |
Query Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
| range | string | No | The range of the CQL to return (e.g. 37:1-38:22) |
Route Parameters
None
Query Parameters
None
Relationships
flowchart LR
nMeasureEvalService_67DBAC12["Service: Measure Evaluation Service"]
nMeasureEvalService_67DBAC12 -->|produces| nMeasureReportGenerated_38AFFB54["Event: MeasureReportGenerated"]
nresources_normalized_28215193["Event: resources-normalized"] -->|consumed by| nMeasureEvalService_67DBAC12
nMeasureEvalService_67DBAC12 -->|sends| nDataAcquisitionRequested_4BBEB8F8["Command: DataAcquisitionRequested"]
subgraph nCompliance_DBAE25D_domain["Domain: Compliance"]
nMeasureReportGenerated_38AFFB54
nresources_normalized_28215193
end
subgraph nDataAccess_2A523756_domain["Domain: Data Access"]
nDataAcquisitionRequested_4BBEB8F8
end
subgraph nReport_4D4FBBDA_domain["Domain: Report"]
nMeasureEvalService_67DBAC12
end