fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
161 lines (160 loc) • 5.79 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuestionnaireEnableWhenBuilder = 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 QuestionnaireEnableWhen
* @class QuestionnaireEnableWhenBuilder
* @extends {BackboneBuilder}
* @implements {IQuestionnaireEnableWhenBuilder}
* @author Roberto Araneda Espinoza
*/
class QuestionnaireEnableWhenBuilder extends base_1.BackboneBuilder {
questionnaireEnableWhen;
constructor() {
super();
this.questionnaireEnableWhen = new models_1.QuestionnaireEnableWhen();
}
/**
* @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.questionnaireEnableWhen[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {QuestionnaireEnableWhen}
*/
build() {
return Object.assign(this.questionnaireEnableWhen, super.build());
}
/**
* @description Sets the question value
* @description The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.
* @param value - the value to set
* @returns {this}
*/
setQuestion(value) {
this.questionnaireEnableWhen.question = value;
return this;
}
/**
* @description Sets the operator value
* @description Specifies the criteria by which the question is enabled.
* @param value - the value to set
* @returns {this}
*/
setOperator(value) {
this.questionnaireEnableWhen.operator = value;
return this;
}
/**
* @description Sets the answerBoolean value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerBoolean(value) {
this.questionnaireEnableWhen.answerBoolean = value;
return this;
}
/**
* @description Sets the answerDecimal value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerDecimal(value) {
this.questionnaireEnableWhen.answerDecimal = value;
return this;
}
/**
* @description Sets the answerInteger value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerInteger(value) {
this.questionnaireEnableWhen.answerInteger = value;
return this;
}
/**
* @description Sets the answerDate value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerDate(value) {
this.questionnaireEnableWhen.answerDate = value;
return this;
}
/**
* @description Sets the answerDateTime value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerDateTime(value) {
this.questionnaireEnableWhen.answerDateTime = value;
return this;
}
/**
* @description Sets the answerTime value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerTime(value) {
this.questionnaireEnableWhen.answerTime = value;
return this;
}
/**
* @description Sets the answerString value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerString(value) {
this.questionnaireEnableWhen.answerString = value;
return this;
}
/**
* @description Sets the answerCoding value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerCoding(value) {
this.questionnaireEnableWhen.answerCoding = value;
return this;
}
/**
* @description Sets the answerQuantity value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerQuantity(value) {
this.questionnaireEnableWhen.answerQuantity = value;
return this;
}
/**
* @description Sets the answerReference value
* @description A value that the referenced question is tested using the specified operator in order for the item to be enabled.
* @param value - the value to set
* @returns {this}
*/
setAnswerReference(value) {
this.questionnaireEnableWhen.answerReference = value;
return this;
}
}
exports.QuestionnaireEnableWhenBuilder = QuestionnaireEnableWhenBuilder;