UNPKG

cql-execution

Version:

An execution framework for the Clinical Quality Language (CQL)

520 lines (373 loc) 13.2 kB
// Generated by CoffeeScript 1.12.7 (function() { var Address, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, GroupComponent, HumanName, Identifier, Narrative, Parameters, Period, Quantity, QuestionAnswerComponent, QuestionComponent, QuestionnaireAnswers, 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 QuestionAnswerComponent @exports QuestionAnswerComponent as QuestionAnswerComponent */ QuestionAnswerComponent = (function(superClass) { extend(QuestionAnswerComponent, superClass); function QuestionAnswerComponent(json) { this.json = json; QuestionAnswerComponent.__super__.constructor.call(this, this.json); } /** Single-valued answer to the question. @returns {Array} an array of {@link boolean} objects */ QuestionAnswerComponent.prototype.valueBoolean = function() { return this.json['valueBoolean']; }; /** Single-valued answer to the question. @returns {Array} an array of {@link Number} objects */ QuestionAnswerComponent.prototype.valueDecimal = function() { return this.json['valueDecimal']; }; /** Single-valued answer to the question. @returns {Array} an array of {@link Number} objects */ QuestionAnswerComponent.prototype.valueInteger = function() { return this.json['valueInteger']; }; /** Single-valued answer to the question. @returns {Array} an array of {@link Date} objects */ QuestionAnswerComponent.prototype.valueDate = function() { if (this.json['valueDate']) { return DT.DateTime.parse(this.json['valueDate']); } }; /** Single-valued answer to the question. @returns {Array} an array of {@link Date} objects */ QuestionAnswerComponent.prototype.valueDateTime = function() { if (this.json['valueDateTime']) { return DT.DateTime.parse(this.json['valueDateTime']); } }; /** Single-valued answer to the question. @returns {Array} an array of {@link Date} objects */ QuestionAnswerComponent.prototype.valueInstant = function() { if (this.json['valueInstant']) { return DT.DateTime.parse(this.json['valueInstant']); } }; /** Single-valued answer to the question. @returns {time} */ QuestionAnswerComponent.prototype.valueTime = function() { if (this.json['valueTime']) { return new time(this.json['valueTime']); } }; /** Single-valued answer to the question. @returns {Array} an array of {@link String} objects */ QuestionAnswerComponent.prototype.valueString = function() { return this.json['valueString']; }; /** Single-valued answer to the question. @returns {Attachment} */ QuestionAnswerComponent.prototype.valueAttachment = function() { if (this.json['valueAttachment']) { return new Attachment(this.json['valueAttachment']); } }; /** Single-valued answer to the question. @returns {Coding} */ QuestionAnswerComponent.prototype.valueCoding = function() { if (this.json['valueCoding']) { return new Coding(this.json['valueCoding']); } }; /** Single-valued answer to the question. @returns {Quantity} */ QuestionAnswerComponent.prototype.valueQuantity = function() { if (this.json['valueQuantity']) { return new Quantity(this.json['valueQuantity']); } }; /** Single-valued answer to the question. @returns {Reference} */ QuestionAnswerComponent.prototype.valueReference = function() { if (this.json['valueReference']) { return new Reference(this.json['valueReference']); } }; return QuestionAnswerComponent; })(BackboneElement); /** Embedded class @class QuestionComponent @exports QuestionComponent as QuestionComponent */ QuestionComponent = (function(superClass) { extend(QuestionComponent, superClass); function QuestionComponent(json) { this.json = json; QuestionComponent.__super__.constructor.call(this, this.json); } /** Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. @returns {Array} an array of {@link String} objects */ QuestionComponent.prototype.linkId = function() { return this.json['linkId']; }; /** Text of the question as it is shown to the user. @returns {Array} an array of {@link String} objects */ QuestionComponent.prototype.text = function() { return this.json['text']; }; /** The respondent's answer(s) to the question. @returns {Array} an array of {@link QuestionAnswerComponent} objects */ QuestionComponent.prototype.answer = function() { var i, item, len, ref, results; if (this.json['answer']) { ref = this.json['answer']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new QuestionAnswerComponent(item)); } return results; } }; /** Nested group, containing nested question for this question. The order of groups within the question is relevant. @returns {Array} an array of {@link GroupComponent} objects */ QuestionComponent.prototype.group = function() { var i, item, len, ref, results; if (this.json['group']) { ref = this.json['group']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new GroupComponent(item)); } return results; } }; return QuestionComponent; })(BackboneElement); /** Embedded class @class GroupComponent @exports GroupComponent as GroupComponent */ GroupComponent = (function(superClass) { extend(GroupComponent, superClass); function GroupComponent(json) { this.json = json; GroupComponent.__super__.constructor.call(this, this.json); } /** Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. @returns {Array} an array of {@link String} objects */ GroupComponent.prototype.linkId = function() { return this.json['linkId']; }; /** Text that is displayed above the contents of the group. @returns {Array} an array of {@link String} objects */ GroupComponent.prototype.title = function() { return this.json['title']; }; /** Additional text for the group, used for display purposes. @returns {Array} an array of {@link String} objects */ GroupComponent.prototype.text = function() { return this.json['text']; }; /** More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers. @returns {Reference} */ GroupComponent.prototype.subject = function() { if (this.json['subject']) { return new Reference(this.json['subject']); } }; /** A sub-group within a group. The ordering of groups within this group is relevant. @returns {Array} an array of {@link GroupComponent} objects */ GroupComponent.prototype.group = function() { var i, item, len, ref, results; if (this.json['group']) { ref = this.json['group']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new GroupComponent(item)); } return results; } }; /** Set of questions within this group. The order of questions within the group is relevant. @returns {Array} an array of {@link QuestionComponent} objects */ GroupComponent.prototype.question = function() { var i, item, len, ref, results; if (this.json['question']) { ref = this.json['question']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new QuestionComponent(item)); } return results; } }; return GroupComponent; })(BackboneElement); /** A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. @class QuestionnaireAnswers @exports QuestionnaireAnswers as QuestionnaireAnswers */ QuestionnaireAnswers = (function(superClass) { extend(QuestionnaireAnswers, superClass); function QuestionnaireAnswers(json) { this.json = json; QuestionnaireAnswers.__super__.constructor.call(this, this.json); } /** A business identifier assigned to a particular completed (or partially completed) questionnaire. @returns {Identifier} */ QuestionnaireAnswers.prototype.identifier = function() { if (this.json['identifier']) { return new Identifier(this.json['identifier']); } }; /** Indicates the Questionnaire resource that defines the form for which answers are being provided. @returns {Reference} */ QuestionnaireAnswers.prototype.questionnaire = function() { if (this.json['questionnaire']) { return new Reference(this.json['questionnaire']); } }; /** The lifecycle status of the questionnaire answers as a whole. @returns {Array} an array of {@link String} objects */ QuestionnaireAnswers.prototype.status = function() { return this.json['status']; }; /** The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. @returns {Reference} */ QuestionnaireAnswers.prototype.subject = function() { if (this.json['subject']) { return new Reference(this.json['subject']); } }; /** Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system. @returns {Reference} */ QuestionnaireAnswers.prototype.author = function() { if (this.json['author']) { return new Reference(this.json['author']); } }; /** The date and/or time that this version of the questionnaire answers was authored. @returns {Array} an array of {@link Date} objects */ QuestionnaireAnswers.prototype.authored = function() { if (this.json['authored']) { return DT.DateTime.parse(this.json['authored']); } }; /** The person who answered the questions about the subject. Only used when this is not the subject him/herself. @returns {Reference} */ QuestionnaireAnswers.prototype.source = function() { if (this.json['source']) { return new Reference(this.json['source']); } }; /** Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. @returns {Reference} */ QuestionnaireAnswers.prototype.encounter = function() { if (this.json['encounter']) { return new Reference(this.json['encounter']); } }; /** A group of questions to a possibly similarly grouped set of questions in the questionnaire answers. @returns {GroupComponent} */ QuestionnaireAnswers.prototype.group = function() { if (this.json['group']) { return new GroupComponent(this.json['group']); } }; return QuestionnaireAnswers; })(DomainResource); module.exports.QuestionnaireAnswers = QuestionnaireAnswers; }).call(this); //# sourceMappingURL=questionnaireanswers.js.map