fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
92 lines (91 loc) • 3.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppointmentParticipantBuilder = 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 AppointmentParticipant
* @class AppointmentParticipantBuilder
* @extends {BackboneBuilder}
* @implements {IAppointmentParticipantBuilder}
* @author Roberto Araneda Espinoza
*/
class AppointmentParticipantBuilder extends base_1.BackboneBuilder {
appointmentParticipant;
constructor() {
super();
this.appointmentParticipant = new models_1.AppointmentParticipant();
}
/**
* @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) {
this.appointmentParticipant[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {AppointmentParticipant}
*/
build() {
return Object.assign(this.appointmentParticipant, super.build());
}
/**
* @description Adds a value to the type array
* @description Role of participant in the appointment.
* @param value - the value to add
* @returns {this}
*/
addType(value) {
this.appointmentParticipant.type = this.appointmentParticipant.type || [];
this.appointmentParticipant.type.push(value);
return this;
}
/**
* @description Sets the actor value
* @description A Person, Location/HealthcareService or Device that is participating in the appointment.
* @param value - the value to set
* @returns {this}
*/
setActor(value) {
this.appointmentParticipant.actor = value;
return this;
}
/**
* @description Sets the required value
* @description Whether this participant is required to be present at the meeting. This covers a use-case where two doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.
* @param value - the value to set
* @returns {this}
*/
setRequired(value) {
this.appointmentParticipant.required = value;
return this;
}
/**
* @description Sets the status value
* @description Participation status of the actor.
* @param value - the value to set
* @returns {this}
*/
setStatus(value) {
this.appointmentParticipant.status = value;
return this;
}
/**
* @description Sets the period value
* @description Participation period of the actor.
* @param value - the value to set
* @returns {this}
*/
setPeriod(value) {
this.appointmentParticipant.period = value;
return this;
}
}
exports.AppointmentParticipantBuilder = AppointmentParticipantBuilder;