This endpoint requires authentication. Include your API key in the request headers as X-API-Key.
This endpoint creates a new metric in the system.
Request Body
Description of what the metric measures
Unit of measurement for the metric
Array of strings representing the formula used to calculate the metric
ID of the variable used to filter patients for this metric
The threshold below which quality is considered low
The threshold above which quality is considered high
Whether higher values indicate better quality
Example Request
{
"name": "Blood Pressure Control",
"description": "Percentage of patients with controlled blood pressure",
"unit": "%",
"calculation_formula": [
"count(patients where bp < 140/90) / count(patients) * 100"
],
"filter_variable_id": 1,
"low_quality_threshold": 50.0,
"high_quality_threshold": 85.0,
"is_ascending": true
}
Response Fields
Unique identifier of the created metric
Description of what the metric measures
Unit of measurement for the metric
Array of strings representing the formula used to calculate the metric
ID of the variable used to filter patients for this metric
The threshold below which quality is considered low
The threshold above which quality is considered high
Whether higher values indicate better quality
Example Response
{
"id": 1,
"name": "Blood Pressure Control",
"description": "Percentage of patients with controlled blood pressure",
"unit": "%",
"calculation_formula": [
"count(patients where bp < 140/90) / count(patients) * 100"
],
"filter_variable_id": 1,
"low_quality_threshold": 50.0,
"high_quality_threshold": 85.0,
"is_ascending": true
}
Error Responses
Invalid request data. Check the request body format and required fields.
Authentication failed. Invalid or missing API key.
Array of strings representing the formula used to calculate the metric
Description of what the metric measures
Unit of measurement for the metric
ID of the variable used to filter patients for this metric
The threshold below which quality is considered low
The threshold above which quality is considered high
Whether higher values indicate better quality
Metric created successfully
Unique identifier of the metric
Array of strings representing the formula used to calculate the metric
Number of patients with values for this metric
Description of what the metric measures
Unit of measurement for the metric
ID of the variable used to filter patients for this metric
The threshold below which quality is considered low
The threshold above which quality is considered high
Whether higher values indicate better quality