@phema/cql-execution
Version:
An execution framework for the Clinical Quality Language (CQL)
538 lines (403 loc) • 13.4 kB
JavaScript
// Generated by CoffeeScript 1.12.7
(function() {
var Address, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactPoint, Contract, ContractSignerComponent, ContractTermComponent, 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 ContractSignerComponent
@exports ContractSignerComponent as ContractSignerComponent
*/
ContractSignerComponent = (function(superClass) {
extend(ContractSignerComponent, superClass);
function ContractSignerComponent(json) {
this.json = json;
ContractSignerComponent.__super__.constructor.call(this, this.json);
}
/**
Party or role who is signing.
@returns {Coding}
*/
ContractSignerComponent.prototype.type = function() {
if (this.json['type']) {
return new Coding(this.json['type']);
}
};
/**
The DSIG signature contents in Base64.
@returns {Array} an array of {@link String} objects
*/
ContractSignerComponent.prototype.singnature = function() {
return this.json['singnature'];
};
return ContractSignerComponent;
})(BackboneElement);
/**
Embedded class
@class ContractTermComponent
@exports ContractTermComponent as ContractTermComponent
*/
ContractTermComponent = (function(superClass) {
extend(ContractTermComponent, superClass);
function ContractTermComponent(json) {
this.json = json;
ContractTermComponent.__super__.constructor.call(this, this.json);
}
/**
Unique Id for this particular term.
@returns {Identifier}
*/
ContractTermComponent.prototype.identifier = function() {
if (this.json['identifier']) {
return new Identifier(this.json['identifier']);
}
};
/**
The type of the term.
@returns {CodeableConcept}
*/
ContractTermComponent.prototype.type = function() {
if (this.json['type']) {
return new CodeableConcept(this.json['type']);
}
};
/**
The subttype of the term which is appropriate to the term type.
@returns {CodeableConcept}
*/
ContractTermComponent.prototype.subtype = function() {
if (this.json['subtype']) {
return new CodeableConcept(this.json['subtype']);
}
};
/**
Who or what the contract term is about.
@returns {Reference}
*/
ContractTermComponent.prototype.subject = function() {
if (this.json['subject']) {
return new Reference(this.json['subject']);
}
};
/**
Human readable form of the term of the contract.
@returns {Array} an array of {@link String} objects
*/
ContractTermComponent.prototype.text = function() {
return this.json['text'];
};
return ContractTermComponent;
})(BackboneElement);
/**
A formal agreement between parties regarding the conduct of business, exchange of information or other matters.
@class Contract
@exports Contract as Contract
*/
Contract = (function(superClass) {
extend(Contract, superClass);
function Contract(json) {
this.json = json;
Contract.__super__.constructor.call(this, this.json);
}
/**
Unique Id for this contract.
@returns {Array} an array of {@link Identifier} objects
*/
Contract.prototype.identifier = function() {
var i, item, len, ref, results;
if (this.json['identifier']) {
ref = this.json['identifier'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Identifier(item));
}
return results;
}
};
/**
Who and/or what this is about: typically Patient, Organization, property.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.subject = function() {
var i, item, len, ref, results;
if (this.json['subject']) {
ref = this.json['subject'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
Type of contract (Privacy-Security, Agreement, Insurance).
@returns {CodeableConcept}
*/
Contract.prototype.type = function() {
if (this.json['type']) {
return new CodeableConcept(this.json['type']);
}
};
/**
More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).
@returns {Array} an array of {@link CodeableConcept} objects
*/
Contract.prototype.subtype = function() {
var i, item, len, ref, results;
if (this.json['subtype']) {
ref = this.json['subtype'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new CodeableConcept(item));
}
return results;
}
};
/**
When this was issued.
@returns {Array} an array of {@link Date} objects
*/
Contract.prototype.issued = function() {
if (this.json['issued']) {
return DT.DateTime.parse(this.json['issued']);
}
};
/**
Relevant time/time-period when applicable.
@returns {Period}
*/
Contract.prototype.applies = function() {
if (this.json['applies']) {
return new Period(this.json['applies']);
}
};
/**
The number of repetitions of a service or product.
@returns {Quantity}
*/
Contract.prototype.quantity = function() {
if (this.json['quantity']) {
return new Quantity(this.json['quantity']);
}
};
/**
The unit price product.
@returns {Money}
*/
Contract.prototype.unitPrice = function() {
if (this.json['unitPrice']) {
return new Money(this.json['unitPrice']);
}
};
/**
A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
@returns {Array} an array of {@link Number} objects
*/
Contract.prototype.factor = function() {
return this.json['factor'];
};
/**
An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
@returns {Array} an array of {@link Number} objects
*/
Contract.prototype.points = function() {
return this.json['points'];
};
/**
The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.
@returns {Money}
*/
Contract.prototype.net = function() {
if (this.json['net']) {
return new Money(this.json['net']);
}
};
/**
Contract author or responsible party.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.author = function() {
var i, item, len, ref, results;
if (this.json['author']) {
ref = this.json['author'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
First Party to the contract, may be the party who confers or delegates the rights defined in the contract.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.grantor = function() {
var i, item, len, ref, results;
if (this.json['grantor']) {
ref = this.json['grantor'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.grantee = function() {
var i, item, len, ref, results;
if (this.json['grantee']) {
ref = this.json['grantee'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
Who witnesses the contract.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.witness = function() {
var i, item, len, ref, results;
if (this.json['witness']) {
ref = this.json['witness'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
First Party to the contract, may be the party who confers or delegates the rights defined in the contract.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.executor = function() {
var i, item, len, ref, results;
if (this.json['executor']) {
ref = this.json['executor'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
First Party to the contract, may be the party who confers or delegates the rights defined in the contract.
@returns {Array} an array of {@link Reference} objects
*/
Contract.prototype.notary = function() {
var i, item, len, ref, results;
if (this.json['notary']) {
ref = this.json['notary'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
List or contract signatures.
@returns {Array} an array of {@link ContractSignerComponent} objects
*/
Contract.prototype.signer = function() {
var i, item, len, ref, results;
if (this.json['signer']) {
ref = this.json['signer'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new ContractSignerComponent(item));
}
return results;
}
};
/**
A contract provision.
@returns {Array} an array of {@link ContractTermComponent} objects
*/
Contract.prototype.term = function() {
var i, item, len, ref, results;
if (this.json['term']) {
ref = this.json['term'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new ContractTermComponent(item));
}
return results;
}
};
/**
Friendly Human readable form (might be a reference to the UI used to capture the contract).
@returns {Attachment}
*/
Contract.prototype.friendly = function() {
if (this.json['friendly']) {
return new Attachment(this.json['friendly']);
}
};
/**
Legal text in Human readable form.
@returns {Attachment}
*/
Contract.prototype.legal = function() {
if (this.json['legal']) {
return new Attachment(this.json['legal']);
}
};
/**
Computable Policy rules (e.g. XACML, DKAL, SecPal).
@returns {Attachment}
*/
Contract.prototype.rule = function() {
if (this.json['rule']) {
return new Attachment(this.json['rule']);
}
};
return Contract;
})(DomainResource);
module.exports.Contract = Contract;
}).call(this);
//# sourceMappingURL=contract.js.map