Skip to main content

core.medplumclient.fhircastpublish

Home > @medplum/core > MedplumClient > fhircastPublish

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<void>;

Parameters

ParameterTypeDescription
topicstringThe topic to publish to. Usually a UUID.
eventEventNameThe name of the event to publish an updated context for, ie. Patient-open.
contextFhircastEventContext<EventName> | FhircastEventContext<EventName>[]The updated context containing resources relevant to this event.
versionIdnever(Optional) The versionId of the anchor context of the given event. Used for DiagnosticReport-update event.

Returns:

Promise<void>

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