fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
61 lines (60 loc) • 2.28 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RelatedPersonCommunicationBuilder = 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 RelatedPersonCommunication
* @class RelatedPersonCommunicationBuilder
* @extends {BackboneBuilder}
* @implements {IRelatedPersonCommunicationBuilder}
* @author Roberto Araneda Espinoza
*/
class RelatedPersonCommunicationBuilder extends base_1.BackboneBuilder {
relatedPersonCommunication;
constructor() {
super();
this.relatedPersonCommunication = new models_1.RelatedPersonCommunication();
}
/**
* @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.relatedPersonCommunication[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {RelatedPersonCommunication}
*/
build() {
return Object.assign(this.relatedPersonCommunication, super.build());
}
/**
* @description Sets the language value
* @description The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.
* @param value - the value to set
* @returns {this}
*/
setLanguage(value) {
this.relatedPersonCommunication.language = value;
return this;
}
/**
* @description Sets the preferred value
* @description Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
* @param value - the value to set
* @returns {this}
*/
setPreferred(value) {
this.relatedPersonCommunication.preferred = value;
return this;
}
}
exports.RelatedPersonCommunicationBuilder = RelatedPersonCommunicationBuilder;