UNPKG

@interoperability/atna-audit-messages

Version:

The ATNA Audit Messages Generator is a JavaScript library that provides a set of reusable static methods for generating Audit Trail and Node Authentication (ATNA) compliant audit messages. This library is particularly useful in healthcare systems and othe

62 lines (58 loc) 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Code = void 0; var _ATNAComplexType = require("./ATNAComplexType.js"); var _XMLElement = require("../helpers/xml/XMLElement.js"); /** * Represents a code element for ATNA. */ class Code extends _ATNAComplexType.ATNAComplexType { /** * @param {string} code - The code value. * @param {string} system - The code system. */ constructor(code, system) { super(); this.code = code; this.system = system; } /** * Sets the original text for the code. * @param {string} originalText - The original text value. * @returns {Code} - Returns the current instance for chaining. */ setOriginalText(originalText) { this.originalText = originalText; return this; } /** * Sets the display value for the code. * @param {string} display - The display value. * @returns {Code} - Returns the current instance for chaining. */ setDisplay(display) { this.display = display; return this; } /** * Prepares XML representation of the Code element. * @returns {XMLElement} - The XML representation of the Code element. */ prepareXML() { let attributes = { 'csd-code': this.code, codeSystemName: this.system }; if (this.originalText) { attributes.originalText = this.originalText; } if (this.display) { attributes.displayName = this.display; } this.xml = new _XMLElement.XMLElement().setName('Code').setAttributes(attributes); return this.xml; } } exports.Code = Code;