Skip to main content

core.createfhircastmessagepayload

Home > @medplum/core > createFhircastMessagePayload

createFhircastMessagePayload() function

Creates a serializable JSON payload for the FHIRcast protocol

Signature:

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

Parameters

ParameterTypeDescription
topicstringThe topic that this message will be published on. Usually a UUID.
eventEventNameThe event name, ie. "Patient-open" or "Patient-close".
contextFhircastValidContextForEvent<EventName> | FhircastValidContextForEvent<EventName>[]The updated context, containing new versions of resources related to this event.
versionIdnever(Optional) The current versionId of the anchor context. For example, in DiagnosticReport-update, it's the versionId of the DiagnosticReport.

Returns:

FhircastMessagePayload<EventName>

A serializable FhircastMessagePayload.