@madie/cql-antlr-parser
Version:
Antlr Parsing of CQL in typescript
62 lines • 1.72 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class CqlFinder {
constructor(result, aliases) {
this.result = result;
this.aliases = aliases;
}
find(term) {
var _a;
if (this.aliases.find((a) => a === term)) {
return true;
}
if (((_a = this.result.context) === null || _a === void 0 ? void 0 : _a.name) === term) {
return true;
}
for (const i of this.result.includes) {
if (i.called === term) {
i.hits += 1;
return true;
}
}
for (const v of this.result.valueSets) {
if (v.name === term) {
v.hits += 1;
return true;
}
}
for (const v of this.result.parameters) {
if (v.name === term) {
v.hits += 1;
return true;
}
}
for (const v of this.result.expressionDefinitions) {
if (v.name === term) {
v.hits += 1;
return true;
}
}
for (const v of this.result.codeSystems) {
if (v.name === term) {
v.hits += 1;
return true;
}
}
for (const v of this.result.codes) {
if (v.name === term) {
v.hits += 1;
return true;
}
}
for (const v of this.result.identifiers) {
if (v.name === term) {
v.hits += 1;
return true;
}
}
return false;
}
}
exports.default = CqlFinder;
//# sourceMappingURL=CqlFinder.js.map