Skip to main content

core.resourcemodifiedevent

Home > @medplum/core > ResourceModifiedEvent

ResourceModifiedEvent interface

Payload of the resourceModified event, emitted after this client instance successfully creates, updates, patches, or deletes a FHIR resource.

Emitted by createResource, createResourceIfNoneExist, updateResource, upsertResource, patchResource, deleteResource, and by notifyResourceModified. Conditional methods (createResourceIfNoneExist, upsertResource) emit even when the server made no change, except on HTTP 304 "Not Modified".

T - The type of the modified resource. Defaults to Resource; narrow it (e.g. via useResourceModified('Slot', ...)) to get a typed resource payload without extra guards.

Signature:

export interface ResourceModifiedEvent<T extends Resource = Resource>

Properties

Property

Modifiers

Type

Description

id?

string

(Optional) The resource id, when known.

operation

'create' | 'update' | 'patch' | 'delete'

How the resource was modified.

resource?

WithId<T>

(Optional) The server-returned resource, when available. Undefined for deletes.

resourceType

T['resourceType']

The type of the modified resource.