UNPKG

fhirbuilder

Version:
85 lines (84 loc) 2.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContactPoint = void 0; const builders_1 = require("../../builders"); const base_1 = require("../../../core/r4/validators/base"); const Element_1 = require("../base/Element"); /** * @description Details for all kinds of technology-mediated contact points for a person or organization, including telephone, email, etc. * @property {string} id - Unique id for inter-element referencing * @property {IExtension[]} extension - Additional content defined by implementations * @property {IPeriod} period - Time period when the contact point was/is in use * @property {number} rank - Specify preferred order of use (1 = highest) * @property {ContactPointSystemEnum} system - phone | fax | email | pager | url | sms | other * @property {string} value - The actual contact point details * @property {ContactPointUseEnum} use - home | work | temp | old | mobile - purpose of this contact point * @property {IElement} _system - Extension of system element * @property {IElement} _value - Extension of value element * @property {IElement} _use - Extension of use element * @property {IElement} _rank - Extension of rank element * @see https://www.hl7.org/fhir/datatypes.html#ContactPoint ContactPoint * @author Roberto Araneda */ class ContactPoint extends Element_1.Element { /** * @description phone | fax | email | pager | url | sms | other */ system; /** * @description The actual contact point details */ value; /** * @description home | work | temp | old | mobile - purpose of this contact point */ use; /** * @description Specify preferred order of use (1 = highest) */ rank; /** * @description Time period when the contact point was/is in use */ period; // Extensions /** * @description Extension of system element */ _system; /** * @description Extension of value element */ _value; /** * @description Extension of use element */ _use; /** * @description Extension of rank element */ _rank; toJson() { return JSON.parse(JSON.stringify(this)); } toPrettyString() { return `ContactPoint${JSON.stringify(this.toJson(), null, 2)}`; } toString() { return `ContactPoint${JSON.stringify(this.toJson())}`; } validate() { return (0, base_1.ConformanceValidator)('ContactPoint', this); } constructor(args) { super(); Object.assign(this, args); } builderInstance() { return new builders_1.ContactPointBuilder(); } serialize() { return JSON.stringify(this.toJson()); } } exports.ContactPoint = ContactPoint;