When a trigger's logic condition results in {"alert": true, ...}, a webhook event is generated and sent to your configured endpoint.
Webhook Payload with Custom value and message (New):
If the trigger logic uses the new structure with alert, value, and message fields, these fields will be present at the root of the webhook event payload.
Consider the "Urine Output Per Kilogram Per Hour" (86632-9) trigger:
{
"code": "86632-9",
"display": "Urine Output Per Kilogram Per Hour",
"valueKey": "valueQuantity.value",
// ... other properties
"logic": {
"if": [
{ "<": [{ "var": "valueQuantity.value" }, 0.5] },
{
"alert": true,
"value": "Oliguria",
"message": "Urine output < 0.5 mL/kg/hour (Oliguria)"
},
// ... other conditions
{
"alert": false,
"value": "Normal/Adequate",
"message": "Urine output >= 0.5 mL/kg/hour (Normal/Adequate)"
}
]
}
}
If an observation comes in with valueQuantity.value = 0.21 (which is less than 0.5), the following webhook event will be sent:
{
"_id": "681f3704fb23ad7ed1e6db63",
"reason": "trigger",
"patient": "681ca7ac5d27f607d2e81f26",
"observation": "681f36fffb23ad7ed1e6db5b", // ID of the triggering observation
"component": {
// Full FHIR Observation resource that triggered the alert
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "86632-9"
// Additional coding details can go here
}
]
// Additional code details can go here
},
"valueQuantity": {
"value": 0.21,
"unit": "mL/kg/hour"
}
// Additional component fields can go here
},
"trigger": {
// The full definition of the trigger that fired
"code": "86632-9",
"display": "Urine Output Per Kilogram Per Hour",
"valueKey": "valueQuantity.value",
"logic": {}
// Additional trigger fields can go here
},
"value": "Oliguria", // Custom value from the trigger logic's result
"message": "Urine output < 0.5 mL/kg/hour (Oliguria)", // Custom message from the logic
"createdAt": "2025-05-10T11:22:44.240Z",
"updatedAt": "2025-05-10T11:22:44.240Z"
}
As you can see, the value ("Oliguria") and message ("Urine output < 0.5 mL/kg/hour (Oliguria)") from the trigger's logic are directly included in the event payload, making it easier to process the alert's specific context.
Webhook Payload for Basic Triggers (Legacy Behavior):
If your trigger logic is simpler and only evaluates to true or false (e.g., { ">" : [ { "var" : "value" },100 ] }) without the explicit {"alert": ..., "value": ..., "message": ...} structure, an alert is still sent when the condition is met.
However, the webhook event for such basic triggers will not contain the custom value and message fields directly at its root. The payload would look more like this:
{
"_id": "6847de5a31d663610fa585e7", // MongoDB ObjectId as a string
"reason": "trigger", // Indicates this record was created by a trigger
"patient": "683ea69de500201a32eb6fec", // Reference to the patient
"observation": "6847de5a31d663610fa585e1", // Reference to the triggering observation
"component": {
"patient": "683ea69de500201a32eb6fec", // Reference to the patient in the FHIR component
"refId": "706e3245-7452-448f-8e64-742d42253390", // Internal reference ID
"status": "registered", // Status of the observation
"code": {
"coding": [
{
"code": "29463-7", // LOINC code for Body Weight
"display": "Body Weight"
}
],
"text": "Body Weight" // Human-readable text
},
"valueQuantity": {
"value": 45.45, // Measured body weight
"unit": "kg"
},
"note": [
// Optional notes, currently empty
],
"component": [
// Optional component details, currently empty
],
"observedAt": "2025-06-10T07:27:21.938Z", // ISO timestamp of observation
"createdAt": "2025-06-10T07:27:22.136Z",
"updatedAt": "2025-06-10T07:27:22.136Z",
"id": "6847de5a31d663610fa585e1" // Observation ID
},
"trigger": {
"code": "29463-7", // LOINC code for Body Weight
"display": "", // Display name, currently empty
"valueKey": "value", // Key path to extract value for trigger evaluation
"notes": "value>=80 & value<=100", // Human-readable logic summary
"logic": {
"!": [
{
"and": [
{
">=": [
{ "var": "valueQuantity.value" },
80
]
},
{
"<=": [
{ "var": "valueQuantity.value" },
100
]
}
]
}
]
}
},
"value": true, // Result of the trigger logic evaluation
"message": "true", // String representation of the result
"createdAt": "2025-06-10T07:27:22.165Z",
"updatedAt": "2025-06-10T07:27:22.165Z",
}
In this case, you would still have the full observation and trigger details to understand the context, but the specific categorized value and message (like "Oliguria") wouldn't be pre-processed and added to the root of the event.
The example you provided for a message with reason: "note":
{
"_id": "681f36fffb23ad7ed1e6db60", // MongoDB ObjectId as a string
"reason": "note", // Indicates this is a note rather than a trigger
"patient": "681ca7ac5d27f607d2e81f26", // Reference to the patient
"observation": "681f36fffb23ad7ed1e6db5b", // Reference to the observation
"createdAt": "2025-05-10T11:22:39.523Z", // ISO timestamp as string
"updatedAt": "2025-05-10T11:22:39.523Z" // ISO timestamp as string
}
This type of event is typically generated when global settings like alertIfNote: true are active and an observation contains a note, rather than from a standard trigger logic evaluation. Standard logic-based triggers will have reason: "trigger".
Note: Internally (in the code and database), notifications are for historical reasons defined as "alerts." However, this definition does not imply an urgent situation. These notifications are solely intended to inform the user.