## MedplumClient.fhircastPublish() method  
Publishes a new context to a given topic for a specified event type.

**Signature:**

```typescript
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](/content/docs/sdk/core.fhircasteventcontext) <EventName> \| [FhircastEventContext](/content/docs/sdk/core.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<Record<string, any>>

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

- [MedplumClient.fhircastPublish() method](/content/docs/sdk/core.medplumclient.fhircastpublish#medplumclientfhircastpublish-method/index.html)
- [Parameters](/content/docs/sdk/core.medplumclient.fhircastpublish#parameters/index.html)
