Metriport’s Realtime Patient Notifications are your way to receive realtime updates on a patient’s journey through a health system. You can trigger a workflow once a patient is admitted to a health system, check their diagnosis within moments of them being discharged, and so much more.
Each realtime notification we send via webhook has a payload that includes key information about the event, and a url field to JSON containing robust clinical data for the encounter.
If you want to access the clinical data, you need only download the json from the url. To work with the data, we recommend you understand The Encounter Model below.
The URL remains valid and available for download for 600
seconds (10 minutes).
For each patient you intend to receive realtime notifications for, Metriport maintains the real-time state of their journey through the health system.
Each of these patient journeys is represented via FHIR data - a FHIR Encounter.
But FHIR data relies on references to function. An Encounter might reference a subject, a practitioner, or a location - as the example above does (see the reference field in location.). Each root unit of data in FHIR is called a ‘Resource’ and each of type of resource has its own corresponding schema. It’s common for resources to include references to one another.
To provide comprehensive data about the Encounter, we serve a FHIR Bundle via the url in the patient notification.
Copy
{ "resourceType": "Bundle", "type": "message", "timestamp": "2020-05-08T13:10:15Z", "id": "message-uuid", "entry": [ { /* a FHIR Encounter */ }, // Other resources that are directly or transitively referenced via the FHIR encounter { /* Another resource */ }, { /* Another resource */ }, { /* Another resource */ }, ... ]}
The first item in every bundle for a Metriport’s Patient Notification is the root Encounter. Every item thereafter is a resource referenced by the Encounter. The bundle acts as a container for all resources, ensuring you have a standalone package of clinical data.
If you’re unfamiliar with FHIR, please read our FHIR Overview.
We may extend the patient notification types, so we recommend that you do a strict match when checking the handler type. If using a typed language like typescript, this also allows you to typecast the payload based on the appropriate event type.
See below.
Copy
import { PatientAdmitPayload, PatientDischargePayload,} from "@metriport/api-sdk";if (event.meta.type === "patient.admit") { const payload = event.payload as PatientAdmitPayload; // process admit message}if (event.meta.type === "patient.transfer") { const payload = event.payload as PatientTransferPayload; // process transfer message}if (event.meta.type === "patient.discharge") { const payload = event.payload as PatientDischargePayload; // process discharge message}
A Patient Admit event is emitted when a patient undergoes the admission process, assigning them a bed. It signals the official start of a patient’s stay in a healthcare facility. It includes short stay and “John Doe” (patient name unknown) admissions.
A Patient Transfer event indicates that a patient has been moved from one location to another within a healthcare system. This could represent a transfer between departments, units, or facilities.
A Patient Discharge event indicates the end of a patient’s stay in a healthcare facility. The patient now has the status “discharged” and an officially recorded discharge date.