cql-execution
Version:
An execution framework for the Clinical Quality Language (CQL)
347 lines (239 loc) • 8.81 kB
JavaScript
// Generated by CoffeeScript 1.9.3
(function() {
var Address, Attachment, BackboneElement, Bundle, BundleEntryComponent, BundleEntryDeletedComponent, BundleLinkComponent, CORE, CodeableConcept, Coding, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, HumanName, Identifier, Narrative, Parameters, Period, Quantity, 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 BundleLinkComponent
@exports BundleLinkComponent as BundleLinkComponent
*/
BundleLinkComponent = (function(superClass) {
extend(BundleLinkComponent, superClass);
function BundleLinkComponent(json) {
this.json = json;
BundleLinkComponent.__super__.constructor.call(this, this.json);
}
/**
A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].
@returns {Array} an array of {@link String} objects
*/
BundleLinkComponent.prototype.relation = function() {
return this.json['relation'];
};
/**
The reference details for the link.
@returns {Array} an array of {@link String} objects
*/
BundleLinkComponent.prototype.url = function() {
return this.json['url'];
};
return BundleLinkComponent;
})(BackboneElement);
/**
Embedded class
@class BundleEntryDeletedComponent
@exports BundleEntryDeletedComponent as BundleEntryDeletedComponent
*/
BundleEntryDeletedComponent = (function(superClass) {
extend(BundleEntryDeletedComponent, superClass);
function BundleEntryDeletedComponent(json) {
this.json = json;
BundleEntryDeletedComponent.__super__.constructor.call(this, this.json);
}
/**
The type of resource that was deleted (required to construct the identity).
@returns {Array} an array of {@link String} objects
*/
BundleEntryDeletedComponent.prototype.type = function() {
return this.json['type'];
};
/**
The id of the resource that was deleted.
@returns {Array} an array of {@link String} objects
*/
BundleEntryDeletedComponent.prototype.id = function() {
return this.json['id'];
};
/**
Version id for releted resource.
@returns {Array} an array of {@link String} objects
*/
BundleEntryDeletedComponent.prototype.versionId = function() {
return this.json['versionId'];
};
/**
The date/time that the resource was deleted.
@returns {Array} an array of {@link Date} objects
*/
BundleEntryDeletedComponent.prototype.instant = function() {
if (this.json['instant']) {
return DT.DateTime.parse(this.json['instant']);
}
};
return BundleEntryDeletedComponent;
})(BackboneElement);
/**
Embedded class
@class BundleEntryComponent
@exports BundleEntryComponent as BundleEntryComponent
*/
BundleEntryComponent = (function(superClass) {
extend(BundleEntryComponent, superClass);
function BundleEntryComponent(json) {
this.json = json;
BundleEntryComponent.__super__.constructor.call(this, this.json);
}
/**
The Base URL for the resource, if different to the base URL specified for the bundle as a whole.
@returns {Array} an array of {@link String} objects
*/
BundleEntryComponent.prototype.base = function() {
return this.json['base'];
};
/**
The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).
@returns {Array} an array of {@link String} objects
*/
BundleEntryComponent.prototype.status = function() {
return this.json['status'];
};
/**
Search URL for this resource when processing a transaction (see transaction documentation).
@returns {Array} an array of {@link String} objects
*/
BundleEntryComponent.prototype.search = function() {
return this.json['search'];
};
/**
When searching, the server's search ranking score for the entry.
@returns {Array} an array of {@link Number} objects
*/
BundleEntryComponent.prototype.score = function() {
return this.json['score'];
};
/**
If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.
@returns {BundleEntryDeletedComponent}
*/
BundleEntryComponent.prototype.deleted = function() {
if (this.json['deleted']) {
return new BundleEntryDeletedComponent(this.json['deleted']);
}
};
/**
The Resources for the entry.
@returns {Resource}
*/
BundleEntryComponent.prototype.resource = function() {
var req, typeName;
if (this.json['resource']) {
typeName = this.json['resource'].resourceType;
req = require('./' + typeName.toLowerCase())[typeName];
return new req(this.json['resource']);
}
};
return BundleEntryComponent;
})(BackboneElement);
/**
A container for a group of resources.
@class Bundle
@exports Bundle as Bundle
*/
Bundle = (function(superClass) {
extend(Bundle, superClass);
function Bundle(json) {
this.json = json;
Bundle.__super__.constructor.call(this, this.json);
}
/**
Indicates the purpose of this bundle- how it was intended to be used.
@returns {Array} an array of {@link String} objects
*/
Bundle.prototype.type = function() {
return this.json['type'];
};
/**
The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).
@returns {Array} an array of {@link String} objects
*/
Bundle.prototype.base = function() {
return this.json['base'];
};
/**
If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).
@returns {Array} an array of {@link Number} objects
*/
Bundle.prototype.total = function() {
return this.json['total'];
};
/**
A series of links that provide context to this bundle.
@returns {Array} an array of {@link BundleLinkComponent} objects
*/
Bundle.prototype.link = function() {
var i, item, len, ref, results;
if (this.json['link']) {
ref = this.json['link'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new BundleLinkComponent(item));
}
return results;
}
};
/**
An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).
@returns {Array} an array of {@link BundleEntryComponent} objects
*/
Bundle.prototype.entry = function() {
var i, item, len, ref, results;
if (this.json['entry']) {
ref = this.json['entry'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new BundleEntryComponent(item));
}
return results;
}
};
/**
XML Digital Signature - base64 encoded.
@returns {Array} an array of {@link } objects
*/
Bundle.prototype.signature = function() {
return this.json['signature'];
};
return Bundle;
})(Resource);
module.exports.Bundle = Bundle;
}).call(this);
//# sourceMappingURL=bundle.js.map