UNPKG

cql-execution

Version:

An execution framework for the Clinical Quality Language (CQL)

58 lines (43 loc) 1.91 kB
// Generated by CoffeeScript 1.12.7 (function() { var Expression, ParameterDef, ParameterRef, build, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; Expression = require('./expression').Expression; build = require('./builder').build; module.exports.ParameterDef = ParameterDef = (function(superClass) { extend(ParameterDef, superClass); function ParameterDef(json) { ParameterDef.__super__.constructor.apply(this, arguments); this.name = json.name; this["default"] = build(json["default"]); this.parameterTypeSpecifier = json.parameterTypeSpecifier; } ParameterDef.prototype.exec = function(ctx) { var ref; if (((ctx != null ? ctx.parameters[this.name] : void 0) != null)) { return ctx.parameters[this.name]; } else if (this["default"] != null) { return (ref = this["default"]) != null ? ref.execute(ctx) : void 0; } else { return ctx.getParentParameter(this.name); } }; return ParameterDef; })(Expression); module.exports.ParameterRef = ParameterRef = (function(superClass) { extend(ParameterRef, superClass); function ParameterRef(json) { ParameterRef.__super__.constructor.apply(this, arguments); this.name = json.name; this.library = json.libraryName; } ParameterRef.prototype.exec = function(ctx) { var ref; ctx = this.library ? ctx.getLibraryContext(this.library) : ctx; return (ref = ctx.getParameter(this.name)) != null ? ref.execute(ctx) : void 0; }; return ParameterRef; })(Expression); }).call(this); //# sourceMappingURL=parameters.js.map