@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
46 lines (44 loc) • 1.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AuditSourceIdentification = void 0;
var _ATNAComplexType = require("./ATNAComplexType.js");
var _Code = require("./Code.js");
var _XMLElement = require("../helpers/xml/XMLElement.js");
/**
* Represents an AuditSourceIdentification element for ATNA.
*/
class AuditSourceIdentification extends _ATNAComplexType.ATNAComplexType {
/**
* @param {string} auditEnterpriseSiteId - The audit enterprise site ID.
* @param {string} auditSourceId - The audit source ID.
* @param {Code} auditSourceTypeCode - The audit source type code.
*/
constructor(auditEnterpriseSiteId, auditSourceId, auditSourceTypeCode) {
super();
this.auditEnterpriseSiteId = auditEnterpriseSiteId;
this.auditSourceId = auditSourceId;
if (auditSourceTypeCode instanceof _Code.Code) {
this.auditSourceTypeCode = auditSourceTypeCode;
} else {
throw new Error(`Not a valid AuditSourceTypeCode`, auditSourceTypeCode);
}
}
/**
* Prepares XML representation of the AuditSourceIdentification element.
* @returns {XMLElement} - The XML representation of the AuditSourceIdentification element.
*/
prepareXML() {
let attributes = {
AuditEnterpriseSiteID: this.auditEnterpriseSiteId,
AuditSourceID: this.auditSourceId,
code: this.auditSourceTypeCode['csd-code'],
codeSystemName: this.auditSourceTypeCode.codeSystemName,
originalText: this.auditSourceTypeCode.originalText
};
this.xml = new _XMLElement.XMLElement().setName('AuditSourceIdentification').setAttributes(attributes);
return this.xml;
}
}
exports.AuditSourceIdentification = AuditSourceIdentification;