cql-execution
Version:
An execution framework for the Clinical Quality Language (CQL)
575 lines (428 loc) • 14.2 kB
JavaScript
// Generated by CoffeeScript 1.9.3
(function() {
var Address, AnimalComponent, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactComponent, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, HumanName, Identifier, Narrative, Parameters, Patient, PatientLinkComponent, 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 ContactComponent
@exports ContactComponent as ContactComponent
*/
ContactComponent = (function(superClass) {
extend(ContactComponent, superClass);
function ContactComponent(json) {
this.json = json;
ContactComponent.__super__.constructor.call(this, this.json);
}
/**
The nature of the relationship between the patient and the contact person.
@returns {Array} an array of {@link CodeableConcept} objects
*/
ContactComponent.prototype.relationship = function() {
var i, item, len, ref, results;
if (this.json['relationship']) {
ref = this.json['relationship'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new CodeableConcept(item));
}
return results;
}
};
/**
A name associated with the person.
@returns {HumanName}
*/
ContactComponent.prototype.name = function() {
if (this.json['name']) {
return new HumanName(this.json['name']);
}
};
/**
A contact detail for the person, e.g. a telephone number or an email address.
@returns {Array} an array of {@link ContactPoint} objects
*/
ContactComponent.prototype.telecom = function() {
var i, item, len, ref, results;
if (this.json['telecom']) {
ref = this.json['telecom'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new ContactPoint(item));
}
return results;
}
};
/**
Address for the contact person.
@returns {Address}
*/
ContactComponent.prototype.address = function() {
if (this.json['address']) {
return new Address(this.json['address']);
}
};
/**
Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
@returns {Array} an array of {@link String} objects
*/
ContactComponent.prototype.gender = function() {
return this.json['gender'];
};
/**
Organization on behalf of which the contact is acting or for which the contact is working.
@returns {Reference}
*/
ContactComponent.prototype.organization = function() {
if (this.json['organization']) {
return new Reference(this.json['organization']);
}
};
/**
The period during which this person or organisation is valid to be contacted relating to this patient.
@returns {Period}
*/
ContactComponent.prototype.period = function() {
if (this.json['period']) {
return new Period(this.json['period']);
}
};
return ContactComponent;
})(BackboneElement);
/**
Embedded class
@class AnimalComponent
@exports AnimalComponent as AnimalComponent
*/
AnimalComponent = (function(superClass) {
extend(AnimalComponent, superClass);
function AnimalComponent(json) {
this.json = json;
AnimalComponent.__super__.constructor.call(this, this.json);
}
/**
Identifies the high level categorization of the kind of animal.
@returns {CodeableConcept}
*/
AnimalComponent.prototype.species = function() {
if (this.json['species']) {
return new CodeableConcept(this.json['species']);
}
};
/**
Identifies the detailed categorization of the kind of animal.
@returns {CodeableConcept}
*/
AnimalComponent.prototype.breed = function() {
if (this.json['breed']) {
return new CodeableConcept(this.json['breed']);
}
};
/**
Indicates the current state of the animal's reproductive organs.
@returns {CodeableConcept}
*/
AnimalComponent.prototype.genderStatus = function() {
if (this.json['genderStatus']) {
return new CodeableConcept(this.json['genderStatus']);
}
};
return AnimalComponent;
})(BackboneElement);
/**
Embedded class
@class PatientLinkComponent
@exports PatientLinkComponent as PatientLinkComponent
*/
PatientLinkComponent = (function(superClass) {
extend(PatientLinkComponent, superClass);
function PatientLinkComponent(json) {
this.json = json;
PatientLinkComponent.__super__.constructor.call(this, this.json);
}
/**
The other patient resource that the link refers to.
@returns {Reference}
*/
PatientLinkComponent.prototype.other = function() {
if (this.json['other']) {
return new Reference(this.json['other']);
}
};
/**
The type of link between this patient resource and another patient resource.
@returns {Array} an array of {@link String} objects
*/
PatientLinkComponent.prototype.type = function() {
return this.json['type'];
};
return PatientLinkComponent;
})(BackboneElement);
/**
Demographics and other administrative information about a person or animal receiving care or other health-related services.
@class Patient
@exports Patient as Patient
*/
Patient = (function(superClass) {
extend(Patient, superClass);
function Patient(json) {
this.json = json;
Patient.__super__.constructor.call(this, this.json);
}
/**
An identifier that applies to this person as a patient.
@returns {Array} an array of {@link Identifier} objects
*/
Patient.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;
}
};
/**
A name associated with the individual.
@returns {Array} an array of {@link HumanName} objects
*/
Patient.prototype.name = function() {
var i, item, len, ref, results;
if (this.json['name']) {
ref = this.json['name'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new HumanName(item));
}
return results;
}
};
/**
A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
@returns {Array} an array of {@link ContactPoint} objects
*/
Patient.prototype.telecom = function() {
var i, item, len, ref, results;
if (this.json['telecom']) {
ref = this.json['telecom'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new ContactPoint(item));
}
return results;
}
};
/**
Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
@returns {Array} an array of {@link String} objects
*/
Patient.prototype.gender = function() {
return this.json['gender'];
};
/**
The date and time of birth for the individual.
@returns {Array} an array of {@link Date} objects
*/
Patient.prototype.birthDate = function() {
if (this.json['birthDate']) {
return DT.DateTime.parse(this.json['birthDate']);
}
};
/**
Indicates if the individual is deceased or not.
@returns {Array} an array of {@link boolean} objects
*/
Patient.prototype.deceasedBoolean = function() {
return this.json['deceasedBoolean'];
};
/**
Indicates if the individual is deceased or not.
@returns {Array} an array of {@link Date} objects
*/
Patient.prototype.deceasedDateTime = function() {
if (this.json['deceasedDateTime']) {
return DT.DateTime.parse(this.json['deceasedDateTime']);
}
};
/**
Addresses for the individual.
@returns {Array} an array of {@link Address} objects
*/
Patient.prototype.address = function() {
var i, item, len, ref, results;
if (this.json['address']) {
ref = this.json['address'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Address(item));
}
return results;
}
};
/**
This field contains a patient's most recent marital (civil) status.
@returns {CodeableConcept}
*/
Patient.prototype.maritalStatus = function() {
if (this.json['maritalStatus']) {
return new CodeableConcept(this.json['maritalStatus']);
}
};
/**
Indicates whether the patient is part of a multiple or indicates the actual birth order.
@returns {Array} an array of {@link boolean} objects
*/
Patient.prototype.multipleBirthBoolean = function() {
return this.json['multipleBirthBoolean'];
};
/**
Indicates whether the patient is part of a multiple or indicates the actual birth order.
@returns {Array} an array of {@link Number} objects
*/
Patient.prototype.multipleBirthInteger = function() {
return this.json['multipleBirthInteger'];
};
/**
Image of the person.
@returns {Array} an array of {@link Attachment} objects
*/
Patient.prototype.photo = function() {
var i, item, len, ref, results;
if (this.json['photo']) {
ref = this.json['photo'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Attachment(item));
}
return results;
}
};
/**
A contact party (e.g. guardian, partner, friend) for the patient.
@returns {Array} an array of {@link ContactComponent} objects
*/
Patient.prototype.contact = function() {
var i, item, len, ref, results;
if (this.json['contact']) {
ref = this.json['contact'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new ContactComponent(item));
}
return results;
}
};
/**
This element has a value if the patient is an animal.
@returns {AnimalComponent}
*/
Patient.prototype.animal = function() {
if (this.json['animal']) {
return new AnimalComponent(this.json['animal']);
}
};
/**
Languages which may be used to communicate with the patient about his or her health.
@returns {Array} an array of {@link CodeableConcept} objects
*/
Patient.prototype.communication = function() {
var i, item, len, ref, results;
if (this.json['communication']) {
ref = this.json['communication'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new CodeableConcept(item));
}
return results;
}
};
/**
Patient's nominated care provider.
@returns {Array} an array of {@link Reference} objects
*/
Patient.prototype.careProvider = function() {
var i, item, len, ref, results;
if (this.json['careProvider']) {
ref = this.json['careProvider'];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
item = ref[i];
results.push(new Reference(item));
}
return results;
}
};
/**
Organization that is the custodian of the patient record.
@returns {Reference}
*/
Patient.prototype.managingOrganization = function() {
if (this.json['managingOrganization']) {
return new Reference(this.json['managingOrganization']);
}
};
/**
Link to another patient resource that concerns the same actual person.
@returns {Array} an array of {@link PatientLinkComponent} objects
*/
Patient.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 PatientLinkComponent(item));
}
return results;
}
};
/**
Whether this patient record is in active use.
@returns {Array} an array of {@link boolean} objects
*/
Patient.prototype.active = function() {
return this.json['active'];
};
return Patient;
})(DomainResource);
module.exports.Patient = Patient;
}).call(this);
//# sourceMappingURL=patient.js.map