fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
79 lines (78 loc) • 2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CodingBuilder = void 0;
const models_1 = require("../../models");
const ElementBuilder_1 = require("../base/ElementBuilder");
/**
* @description Coding builder
*
*/
class CodingBuilder extends ElementBuilder_1.ElementBuilder {
coding;
constructor() {
super();
this.coding = new models_1.Coding();
}
/**
* @description Add a param extension to the coding
* @param param
* @param extension
*/
addPrimitiveExtension(param, extension) {
this.coding[param] = extension;
return this;
}
/**
* @description Set the system of the coding
* @param system
* @returns {CodingBuilder} The builder
*/
setSystem(system) {
this.coding.system = system;
return this;
}
/**
* @description Set the version of the coding
* @param version
* @returns {CodingBuilder} The builder
*/
setVersion(version) {
this.coding.version = version;
return this;
}
/**
* @description Set the code of the coding
* @param code
* @returns {CodingBuilder} The builder
*/
setCode(code) {
this.coding.code = code;
return this;
}
/**
* @description Set the display of the coding
* @param display
* @returns {CodingBuilder} The builder
*/
setDisplay(display) {
this.coding.display = display;
return this;
}
/**
* @description Set the userSelected of the coding
* @param userSelected
* @returns {CodingBuilder} The builder
*/
setUserSelected(userSelected) {
this.coding.userSelected = userSelected;
return this;
}
/**
* @description Return the coding as a ICoding object
* @returns {Coding} The coding
*/
build() {
return Object.assign(this.coding, super.build());
}
}
exports.CodingBuilder = CodingBuilder;