UNPKG

fhirbuilder

Version:
89 lines (88 loc) 2.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Coding = void 0; const builders_1 = require("../../builders"); const base_1 = require("../../../core/r4/validators/base"); const Element_1 = require("../base/Element"); /** * @description A reference to a code defined by a terminology system. * @property {string} code - Symbol in syntax defined by the system * @property {string} display - Representation defined by the system * @property {string} system - Identity of the terminology system * @property {string} version - Version of the system - if relevant * @property {boolean} userSelected - If this coding was chosen directly by the user * @property {IElement} _system - Extension of system * @property {IElement} _version - Extension of version * @property {IElement} _code - Extension of code * @property {IElement} _display - Extension of display * @property {IElement} _userSelected - Extension of userSelected * @implements {ICoding} * @see https://www.hl7.org/fhir/datatypes.html#Coding Coding * @author Roberto Araneda */ class Coding extends Element_1.Element { /** * @description Identity of the terminology system */ system; /** * @description Version of the system - if relevant */ version; /** * @description Symbol in syntax defined by the system */ code; /** * @description Representation defined by the system */ display; /** * @description If this coding was chosen directly by the user */ userSelected; // Extensions /** * @description Extension of system */ _system; /** * @description Extension of version */ _version; /** * @description Extension of code */ _code; /** * @description Extension of display */ _display; /** * @description Extension of userSelected */ _userSelected; toJson() { return JSON.parse(JSON.stringify(this)); } toPrettyString() { return `Coding${JSON.stringify(this.toJson(), null, 2)}`; } toString() { return `Coding${JSON.stringify(this.toJson())}`; } validate() { return (0, base_1.ConformanceValidator)('Coding', this); } constructor(args) { super(); Object.assign(this, args); } builderInstance() { return new builders_1.CodingBuilder(); } serialize() { return JSON.stringify(this.toJson()); } } exports.Coding = Coding;