fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
61 lines (60 loc) • 2.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PatientCommunicationBuilder = 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 PatientCommunication
* @class PatientCommunicationBuilder
* @extends {BackboneBuilder}
* @implements {IPatientCommunicationBuilder}
* @author Roberto Araneda Espinoza
*/
class PatientCommunicationBuilder extends base_1.BackboneBuilder {
patientCommunication;
constructor() {
super();
this.patientCommunication = new models_1.PatientCommunication();
}
/**
* @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.patientCommunication[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {PatientCommunication}
*/
build() {
return Object.assign(this.patientCommunication, 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.patientCommunication.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.patientCommunication.preferred = value;
return this;
}
}
exports.PatientCommunicationBuilder = PatientCommunicationBuilder;