fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
71 lines (70 loc) • 2.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrganizationContactBuilder = 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 OrganizationContact
* @class OrganizationContactBuilder
* @extends {BackboneBuilder}
* @implements {IOrganizationContactBuilder}
* @author Roberto Araneda Espinoza
*/
class OrganizationContactBuilder extends base_1.BackboneBuilder {
organizationContact;
constructor() {
super();
this.organizationContact = new models_1.OrganizationContact();
}
/**
* @description Builds the model
* @returns {OrganizationContact}
*/
build() {
return Object.assign(this.organizationContact, super.build());
}
/**
* @description Sets the purpose value
* @description Indicates a purpose for which the contact can be reached.
* @param value - the value to set
* @returns {this}
*/
setPurpose(value) {
this.organizationContact.purpose = value;
return this;
}
/**
* @description Sets the name value
* @description A name associated with the contact.
* @param value - the value to set
* @returns {this}
*/
setName(value) {
this.organizationContact.name = value;
return this;
}
/**
* @description Adds a value to the telecom array
* @description A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.
* @param value - the value to add
* @returns {this}
*/
addTelecom(value) {
this.organizationContact.telecom = this.organizationContact.telecom || [];
this.organizationContact.telecom.push(value);
return this;
}
/**
* @description Sets the address value
* @description Visiting or postal addresses for the contact.
* @param value - the value to set
* @returns {this}
*/
setAddress(value) {
this.organizationContact.address = value;
return this;
}
}
exports.OrganizationContactBuilder = OrganizationContactBuilder;