fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
172 lines (171 loc) • 5.96 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuestionnaireResponseAnswerBuilder = 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 QuestionnaireResponseAnswer
* @class QuestionnaireResponseAnswerBuilder
* @extends {BackboneBuilder}
* @implements {IQuestionnaireResponseAnswerBuilder}
* @author Roberto Araneda Espinoza
*/
class QuestionnaireResponseAnswerBuilder extends base_1.BackboneBuilder {
questionnaireResponseAnswer;
constructor() {
super();
this.questionnaireResponseAnswer = new models_1.QuestionnaireResponseAnswer();
}
/**
* @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.questionnaireResponseAnswer[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {QuestionnaireResponseAnswer}
*/
build() {
return Object.assign(this.questionnaireResponseAnswer, super.build());
}
/**
* @description Sets the valueBoolean value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueBoolean(value) {
this.questionnaireResponseAnswer.valueBoolean = value;
return this;
}
/**
* @description Sets the valueDecimal value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueDecimal(value) {
this.questionnaireResponseAnswer.valueDecimal = value;
return this;
}
/**
* @description Sets the valueInteger value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueInteger(value) {
this.questionnaireResponseAnswer.valueInteger = value;
return this;
}
/**
* @description Sets the valueDate value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueDate(value) {
this.questionnaireResponseAnswer.valueDate = value;
return this;
}
/**
* @description Sets the valueDateTime value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueDateTime(value) {
this.questionnaireResponseAnswer.valueDateTime = value;
return this;
}
/**
* @description Sets the valueTime value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueTime(value) {
this.questionnaireResponseAnswer.valueTime = value;
return this;
}
/**
* @description Sets the valueString value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueString(value) {
this.questionnaireResponseAnswer.valueString = value;
return this;
}
/**
* @description Sets the valueUri value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueUri(value) {
this.questionnaireResponseAnswer.valueUri = value;
return this;
}
/**
* @description Sets the valueAttachment value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueAttachment(value) {
this.questionnaireResponseAnswer.valueAttachment = value;
return this;
}
/**
* @description Sets the valueCoding value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueCoding(value) {
this.questionnaireResponseAnswer.valueCoding = value;
return this;
}
/**
* @description Sets the valueQuantity value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueQuantity(value) {
this.questionnaireResponseAnswer.valueQuantity = value;
return this;
}
/**
* @description Sets the valueReference value
* @description The answer (or one of the answers) provided by the respondent to the question.
* @param value - the value to set
* @returns {this}
*/
setValueReference(value) {
this.questionnaireResponseAnswer.valueReference = value;
return this;
}
/**
* @description Adds a value to the item array
* @description Nested groups and/or questions found within this particular answer.
* @param value - the value to add
* @returns {this}
*/
addItem(value) {
this.questionnaireResponseAnswer.item = this.questionnaireResponseAnswer.item || [];
this.questionnaireResponseAnswer.item.push(value);
return this;
}
}
exports.QuestionnaireResponseAnswerBuilder = QuestionnaireResponseAnswerBuilder;