observation.derived

When Signals sends observation.derived, its payload and how to handle it in Node.js, Python and Java.

A rule computed a value from readings, such as a score, and stored it as a reading.

Payload

Every delivery is the envelope type, timestamp, sequence and data; the delivery's id is the webhook-id header. See Verify webhooks.

{
  "type": "observation.derived",
  "timestamp": "2026-10-25T08:00:02.000Z",
  "sequence": 1052,
  "data": {
    "patient": "6f1c2a8e-3b7d-4c55-9a0e-2d4b8f6e1a90",
    "patientRefId": "resident-001",
    "observation": {
      "id": "3c1d9f20-7a64-4b8e-8d52-5e0a1b2c3d4e",
      "patient": "6f1c2a8e-3b7d-4c55-9a0e-2d4b8f6e1a90",
      "status": "final",
      "code": {
        "coding": [
          {
            "code": "readiness-score"
          }
        ]
      },
      "valueQuantity": {
        "value": 82
      },
      "component": [],
      "observedAt": "2026-10-25T08:00:00.000Z",
      "createdAt": "2026-10-25T08:00:02.000Z",
      "updatedAt": "2026-10-25T08:00:02.000Z"
    }
  }
}

The same alert that fires on this code carries the reading in derivedObservation.

FieldMeaning
patient, patientRefIdThe patient, by Signals id and by your own refId.
observationThe derived reading, in the shape of observation.created.

Handle the event

Verify the delivery first (Verify webhooks), then act on the verified event as in Handle an event.

observation-derived.js
export async function handle(webhookId, event) {
  if (!(await firstTime(webhookId))) return;
  const { data } = event;
  switch (event.type) {
    case 'observation.derived':
      await storeScore(data.patientRefId, data.observation);
      break;
    default:
      break;
  }
}

Last updated on

On this page