UNPKG

fhirbuilder

Version:
111 lines (110 loc) 3.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QuestionnaireAnswerOptionBuilder = 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 QuestionnaireAnswerOption * @class QuestionnaireAnswerOptionBuilder * @extends {BackboneBuilder} * @implements {IQuestionnaireAnswerOptionBuilder} * @author Roberto Araneda Espinoza */ class QuestionnaireAnswerOptionBuilder extends base_1.BackboneBuilder { questionnaireAnswerOption; constructor() { super(); this.questionnaireAnswerOption = new models_1.QuestionnaireAnswerOption(); } /** * @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.questionnaireAnswerOption[param] = extension; return this; } /** * @description Builds the model * @returns {QuestionnaireAnswerOption} */ build() { return Object.assign(this.questionnaireAnswerOption, super.build()); } /** * @description Sets the valueInteger value * @description A potential answer that's allowed as the answer to this question. * @param value - the value to set * @returns {this} */ setValueInteger(value) { this.questionnaireAnswerOption.valueInteger = value; return this; } /** * @description Sets the valueDate value * @description A potential answer that's allowed as the answer to this question. * @param value - the value to set * @returns {this} */ setValueDate(value) { this.questionnaireAnswerOption.valueDate = value; return this; } /** * @description Sets the valueTime value * @description A potential answer that's allowed as the answer to this question. * @param value - the value to set * @returns {this} */ setValueTime(value) { this.questionnaireAnswerOption.valueTime = value; return this; } /** * @description Sets the valueString value * @description A potential answer that's allowed as the answer to this question. * @param value - the value to set * @returns {this} */ setValueString(value) { this.questionnaireAnswerOption.valueString = value; return this; } /** * @description Sets the valueCoding value * @description A potential answer that's allowed as the answer to this question. * @param value - the value to set * @returns {this} */ setValueCoding(value) { this.questionnaireAnswerOption.valueCoding = value; return this; } /** * @description Sets the valueReference value * @description A potential answer that's allowed as the answer to this question. * @param value - the value to set * @returns {this} */ setValueReference(value) { this.questionnaireAnswerOption.valueReference = value; return this; } /** * @description Sets the initialSelected value * @description Indicates whether the answer value is selected when the list of possible answers is initially shown. * @param value - the value to set * @returns {this} */ setInitialSelected(value) { this.questionnaireAnswerOption.initialSelected = value; return this; } } exports.QuestionnaireAnswerOptionBuilder = QuestionnaireAnswerOptionBuilder;