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
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<EventName> | FhircastEventContext<EventName>[] | 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<void>
A Promise
that resolves once the request completes, or rejects if it fails.