cql-execution
Version:
An execution framework for the Clinical Quality Language (CQL)
287 lines (209 loc) • 6.77 kB
JavaScript
// Generated by CoffeeScript 1.9.3
(function() {
var Address, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, HumanName, Identifier, Narrative, Parameters, Period, Quantity, Query, QueryResponseComponent, Range, Ratio, Reference, Resource, SampledData, Timing,
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;
DT = require('../cql-datatypes');
CORE = require('./core');
Element = CORE.Element;
Resource = CORE.Resource;
Timing = CORE.Timing;
Period = CORE.Period;
Parameters = CORE.Parameters;
Coding = CORE.Coding;
Resource = CORE.Resource;
Range = CORE.Range;
Quantity = CORE.Quantity;
Attachment = CORE.Attachment;
BackboneElement = CORE.BackboneElement;
DomainResource = CORE.DomainResource;
ContactPoint = CORE.ContactPoint;
ElementDefinition = CORE.ElementDefinition;
Extension = CORE.Extension;
HumanName = CORE.HumanName;
Address = CORE.Address;
Ratio = CORE.Ratio;
SampledData = CORE.SampledData;
Reference = CORE.Reference;
CodeableConcept = CORE.CodeableConcept;
Identifier = CORE.Identifier;
Narrative = CORE.Narrative;
Element = CORE.Element;
/**
Embedded class
@class QueryResponseComponent
@exports QueryResponseComponent as QueryResponseComponent
*/
QueryResponseComponent = (function(superClass) {
extend(QueryResponseComponent, superClass);
function QueryResponseComponent(json) {
this.json = json;
QueryResponseComponent.__super__.constructor.call(this, this.json);
}
/**
Links response to source query.
@returns {Array} an array of {@link String} objects
*/
QueryResponseComponent.prototype.identifier = function() {
return this.json['identifier'];
};
/**
Outcome of processing the query.
@returns {Array} an array of {@link String} objects
*/
QueryResponseComponent.prototype.outcome = function() {
return this.json['outcome'];
};
/**
Total number of matching records.
@returns {Array} an array of {@link Number} objects
*/
QueryResponseComponent.prototype.total = function() {
return this.json['total'];
};
/**
Parameters server used.
@returns {Array} an array of {@link Extension} objects
*/
QueryResponseComponent.prototype.parameter = function() {
var i, item, len, ref, results;
if (this.json['parameter']) {
ref = this.json['parameter'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Extension(item));
}
return results;
}
};
/**
To get first page (if paged).
@returns {Array} an array of {@link Extension} objects
*/
QueryResponseComponent.prototype.first = function() {
var i, item, len, ref, results;
if (this.json['first']) {
ref = this.json['first'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Extension(item));
}
return results;
}
};
/**
To get previous page (if paged).
@returns {Array} an array of {@link Extension} objects
*/
QueryResponseComponent.prototype.previous = function() {
var i, item, len, ref, results;
if (this.json['previous']) {
ref = this.json['previous'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Extension(item));
}
return results;
}
};
/**
To get next page (if paged).
@returns {Array} an array of {@link Extension} objects
*/
QueryResponseComponent.prototype.next = function() {
var i, item, len, ref, results;
if (this.json['next']) {
ref = this.json['next'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Extension(item));
}
return results;
}
};
/**
To get last page (if paged).
@returns {Array} an array of {@link Extension} objects
*/
QueryResponseComponent.prototype.last = function() {
var i, item, len, ref, results;
if (this.json['last']) {
ref = this.json['last'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Extension(item));
}
return results;
}
};
/**
Resources that are the results of the search.
@returns {Array} an array of {@link Reference} objects
*/
QueryResponseComponent.prototype.reference = function() {
var i, item, len, ref, results;
if (this.json['reference']) {
ref = this.json['reference'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
return QueryResponseComponent;
})(BackboneElement);
/**
A description of a query with a set of parameters.
@class Query
@exports Query as Query
*/
Query = (function(superClass) {
extend(Query, superClass);
function Query(json) {
this.json = json;
Query.__super__.constructor.call(this, this.json);
}
/**
Links query and its response(s).
@returns {Array} an array of {@link String} objects
*/
Query.prototype.identifier = function() {
return this.json['identifier'];
};
/**
Set of query parameters with values.
@returns {Array} an array of {@link Extension} objects
*/
Query.prototype.parameter = function() {
var i, item, len, ref, results;
if (this.json['parameter']) {
ref = this.json['parameter'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Extension(item));
}
return results;
}
};
/**
If this is a response to a query.
@returns {QueryResponseComponent}
*/
Query.prototype.response = function() {
if (this.json['response']) {
return new QueryResponseComponent(this.json['response']);
}
};
return Query;
})(DomainResource);
module.exports.Query = Query;
}).call(this);
//# sourceMappingURL=query.js.map