fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
43 lines (42 loc) • 1.6 kB
TypeScript
import { IElement } from 'fhirtypes/dist/r4';
import { Period } from '../../models';
import { IBuildable } from '../base/IBuildable';
import { UnderscoreKeys } from '../base/resource-type-map.interface';
import { ElementBuilder } from '../base/ElementBuilder';
type PrimitiveExtensionFields = keyof Pick<Period, UnderscoreKeys<Period>>;
interface IPeriodBuilder extends IBuildable<Period> {
setStart(value: string): this;
setEnd(value: string): this;
}
/**
* @description Class to build a Period instance with the builder pattern
*/
export declare class PeriodBuilder extends ElementBuilder implements IPeriodBuilder {
private readonly period;
constructor();
/**
* @description Adds a parameter extension to the period
* @param param - The parameter name ('start' or 'end')
* @param extension - The extension to add
* @returns The instance of PeriodBuilder for method chaining
*/
addPrimitiveExtension(param: PrimitiveExtensionFields, extension: IElement): this;
/**
* @description Sets the start date of the period
* @param value - The start date as a string
* @returns The instance of PeriodBuilder for method chaining
*/
setStart(value: string): this;
/**
* @description Sets the end date of the period
* @param value - The end date as a string
* @returns The instance of PeriodBuilder for method chaining
*/
setEnd(value: string): this;
/**
* @description Builds and returns the Period instance
* @returns The built Period instance
*/
build(): Period;
}
export {};