core.createfhircastmessagepayload | Medplum

createFhircastMessagePayload() function

Creates a serializable JSON payload for the FHIRcast protocol

Signature:

export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionOptional | FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: string): FhircastMessagePayload<EventName>;

Parameters

Parameter Type Description
topic string The topic that this message will be published on. Usually a UUID.
event EventName The event name, ie. "Patient-open" or "Patient-close".
context FhircastEventContext | FhircastEventContext [] The updated context, containing new versions of resources related to this event.
versionId string (Optional) The current versionId of the anchor context. For example, in DiagnosticReport-update, it's the versionId of the DiagnosticReport.

Returns:

FhircastMessagePayload

A serializable FhircastMessagePayload.