core.setscheduleparameter | Medplum

setScheduleParameter() function

Immutably sets one scheduling parameter on a Schedule for a HealthcareService, so that calendar keeps it in place of the service-level parameter of the same name. Whatever the Schedule already holds at the sub-extension's url is replaced, and the SchedulingParameters extension is created if the Schedule has none for the service yet.

Untyped by design, taking any sub-extension of the shape the parameter calls for, for example { url: 'bufferBefore', valueDuration: { value: 10, unit: 'min' } }. A parameter whose value is a nested structure rather than a single value[x] is worth a typed wrapper over this; availability has one in @medplum/react-scheduling. Pairs with clearScheduleParameter and `getScheduleParameters.

Signature:

export declare function setScheduleParameter(schedule: Schedule, service: WithId<HealthcareService>, subextension: Extension): Schedule;

Parameters

Parameter Type Description
schedule Schedule Schedule to update
service WithId HealthcareService referenced by the parameters
subextension Extension SchedulingParameters sub-extension to set

Returns:

Schedule

A cloned Schedule containing the parameter