fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
62 lines (61 loc) • 1.98 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BundleSearchBuilder = 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 BundleSearch
* @class BundleSearchBuilder
* @extends {BackboneBuilder}
* @implements {IBundleSearchBuilder}
* @author Roberto Araneda Espinoza
*/
class BundleSearchBuilder extends base_1.BackboneBuilder {
bundleSearch;
constructor() {
super();
this.bundleSearch = new models_1.BundleSearch();
}
/**
* @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.bundleSearch[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {BundleSearch}
*/
build() {
return Object.assign(this.bundleSearch, super.build());
}
/**
* @description Sets the mode value
* @description Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.
match | include | outcome.
* @param value - the value to set
* @returns {this}
*/
setMode(value) {
this.bundleSearch.mode = value;
return this;
}
/**
* @description Sets the score value
* @description When searching, the server's search ranking score for the entry.
* @param value - the value to set
* @returns {this}
*/
setScore(value) {
this.bundleSearch.score = value;
return this;
}
}
exports.BundleSearchBuilder = BundleSearchBuilder;