app/assets/javascripts/attributes/Entity.js in cqm-models-4.1.1 vs app/assets/javascripts/attributes/Entity.js in cqm-models-4.2.0

- old
+ new

@@ -49,9 +49,26 @@ if (add) { extended.add(add); } + /* eslint no-underscore-dangle: 0 */ + extended.methods._is = function _is(typeSpecifier) { + return this._typeHierarchy().some( + t => t.type === typeSpecifier.type && t.name === typeSpecifier.name + ); + }; + + extended.methods._typeHierarchy = function _typeHierarchy() { + const typeName = this._type.replace(/QDM::/, ''); + const ver = this.qdmVersion.replace('.', '_'); + return [ + { + name: `{urn:healthit-gov:qdm:v${ver}}${typeName}`, + type: 'NamedTypeSpecifier', + }, + ]; + }; return extended; } module.exports.Entity = Entity; module.exports.EntitySchemaFunction = EntitySchemaFunction;