Metriport’s Real-time Patient Notifications are your way to receive real-time 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 real-time notification we send via webhook has a payload that includes key information about the event, and a url field to a Patient Encounter Bundle containing robust clinical data for the encounter.
If you want to access the clinical data, you need only download the Patient Encounter Bundle 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 real-time 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 Patient Encounter Bundle (a FHIR Bundle) via the url in the patient notification.
Copy
Ask AI
{ "resourceType": "Bundle", "type": "message", "timestamp": "2020-05-08T13:10:15Z", "id": "message-uuid", "entry": [ { /* the FHIR Patient */ }, { /* a FHIR Encounter */ }, // Other resources that are directly or transitively referenced via the FHIR encounter { /* Another resource */ }, { /* Another resource */ }, { /* Another resource */ }, ... ]}
The first two items in every bundle for a Metriport’s Patient Notification are the applicable patient & root Encounter. Every item thereafter is a resource referenced by the Encounter.If you’re unfamiliar with FHIR, 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
Ask AI
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.
The Encounter is the core resource in a Patient Encounter Bundle. Below is an example of a FHIR Encounter resource - one piece of the data you’ll receive when downloading from the URL you receive in the notification.