fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
89 lines (88 loc) • 3.32 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PractitionerRoleAvailableTimeBuilder = void 0;
const models_1 = require("../../models");
const base_1 = require("../base");
/**
* @version R4 (v4.0.1)
* @summary FHIR® Specification by HL7®
* @description Class for building a PractitionerRoleAvailableTime
* @class PractitionerRoleAvailableTimeBuilder
* @extends {BackboneBuilder}
* @implements {IPractitionerRoleAvailableTimeBuilder}
* @author Roberto Araneda Espinoza
*/
class PractitionerRoleAvailableTimeBuilder extends base_1.BackboneBuilder {
practitionerRoleAvailableTime;
constructor() {
super();
this.practitionerRoleAvailableTime = new models_1.PractitionerRoleAvailableTime();
}
/**
* @description Adds a primitive extension to the element
* @param param - the field to add the extension to
* @param extension - the extension to add
* @returns {this}
* @example addPrimitiveExtension('_value', { value: 'test' })
*/
addPrimitiveExtension(param, extension) {
const arrayParam = ['_daysOfWeek'];
if (arrayParam.includes(param)) {
this.practitionerRoleAvailableTime[param] = this.practitionerRoleAvailableTime[param] || [];
this.practitionerRoleAvailableTime[param].push(extension);
return this;
}
const localParam = param;
this.practitionerRoleAvailableTime[localParam] = extension;
return this;
}
/**
* @description Builds the model
* @returns {PractitionerRoleAvailableTime}
*/
build() {
return Object.assign(this.practitionerRoleAvailableTime, super.build());
}
/**
* @description Adds a value to the daysOfWeek array
* @description Indicates which days of the week are available between the start and end Times.
* @param value - the value to add
* @returns {this}
*/
addDaysOfWeek(value) {
this.practitionerRoleAvailableTime.daysOfWeek = this.practitionerRoleAvailableTime.daysOfWeek || [];
this.practitionerRoleAvailableTime.daysOfWeek.push(value);
return this;
}
/**
* @description Sets the allDay value
* @description Is this always available? (hence times are irrelevant) e.g. 24 hour service.
* @param value - the value to set
* @returns {this}
*/
setAllDay(value) {
this.practitionerRoleAvailableTime.allDay = value;
return this;
}
/**
* @description Sets the availableStartTime value
* @description The opening time of day. Note: If the AllDay flag is set, then this time is ignored.
* @param value - the value to set
* @returns {this}
*/
setAvailableStartTime(value) {
this.practitionerRoleAvailableTime.availableStartTime = value;
return this;
}
/**
* @description Sets the availableEndTime value
* @description The closing time of day. Note: If the AllDay flag is set, then this time is ignored.
* @param value - the value to set
* @returns {this}
*/
setAvailableEndTime(value) {
this.practitionerRoleAvailableTime.availableEndTime = value;
return this;
}
}
exports.PractitionerRoleAvailableTimeBuilder = PractitionerRoleAvailableTimeBuilder;