UNPKG

fhirbuilder

Version:
53 lines (52 loc) 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CodeableConcept = void 0; const builders_1 = require("../../builders"); const base_1 = require("../../../core/r4/validators/base"); const Element_1 = require("../base/Element"); /** * @description Concept - reference to a terminology or just text. * @property {string} id - Unique id for inter-element referencing * @property {ICoding[]} coding - Code defined by a terminology system * @property {string} text - Plain text representation of the concept * @property {IElement} _text - Extension of text element * @see https://www.hl7.org/fhir/datatypes.html#CodeableConcept CodeableConcept * @author Roberto Araneda */ class CodeableConcept extends Element_1.Element { /** * @description Code defined by a terminology system */ coding; /** * @description Plain text representation of the concept */ text; /** * @description Extension of text element */ _text; toJson() { return JSON.parse(JSON.stringify(this)); } toPrettyString() { return `CodeableConcept${JSON.stringify(this.toJson(), null, 2)}`; } toString() { return `CodeableConcept${JSON.stringify(this.toJson())}`; } validate() { return (0, base_1.ConformanceValidator)('CodeableConcept', this); } constructor(args) { super(); Object.assign(this, args); } builderInstance() { return new builders_1.CodeableConceptBuilder(); } serialize() { return JSON.stringify(this.toJson()); } } exports.CodeableConcept = CodeableConcept;