core.medplumclient.fhircastpublish | Medplum

MedplumClient.fhircastPublish() method

Publishes a new context to a given topic for a specified event type.

Signature:

fhircastPublish<EventName extends FhircastEventVersionOptional>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: never): Promise<Record<string, any>>;

Parameters

Parameter Type Description
topic string The topic to publish to. Usually a UUID.
event EventName The name of the event to publish an updated context for, ie. Patient-open.
context FhircastEventContext | FhircastEventContext [] The updated context containing resources relevant to this event.
versionId never (Optional) The versionId of the anchor context of the given event. Used for DiagnosticReport-update event.

Returns:

Promise<Record<string, any>>

A Promise that resolves once the request completes, or rejects if it fails.