UNPKG

cql-execution

Version:

An execution framework for the Clinical Quality Language (CQL)

401 lines (287 loc) 10.7 kB
// Generated by CoffeeScript 1.9.3 (function() { var Address, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, GroupComponent, HumanName, Identifier, Narrative, Parameters, Period, Quantity, QuestionComponent, Questionnaire, 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 QuestionComponent @exports QuestionComponent as QuestionComponent */ QuestionComponent = (function(superClass) { extend(QuestionComponent, superClass); function QuestionComponent(json) { this.json = json; QuestionComponent.__super__.constructor.call(this, this.json); } /** An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. @returns {Array} an array of {@link String} objects */ QuestionComponent.prototype.linkId = function() { return this.json['linkId']; }; /** Identifies a how this question is known in a particular terminology such as LOINC. @returns {Array} an array of {@link Coding} objects */ QuestionComponent.prototype.concept = function() { var i, item, len, ref, results; if (this.json['concept']) { ref = this.json['concept']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new Coding(item)); } return results; } }; /** 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 expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. @returns {Array} an array of {@link String} objects */ QuestionComponent.prototype.type = function() { return this.json['type']; }; /** If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. @returns {Array} an array of {@link boolean} objects */ QuestionComponent.prototype.required = function() { return this.json['required']; }; /** Whether the group may occur multiple times in the instance, containing multiple sets of answers. @returns {Array} an array of {@link boolean} objects */ QuestionComponent.prototype.repeats = function() { return this.json['repeats']; }; /** Reference to a valueset containing the possible options. @returns {Reference} */ QuestionComponent.prototype.options = function() { if (this.json['options']) { return new Reference(this.json['options']); } }; /** 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); } /** A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. @returns {Array} an array of {@link String} objects */ GroupComponent.prototype.linkId = function() { return this.json['linkId']; }; /** The human-readable name for this section of the questionnaire. @returns {Array} an array of {@link String} objects */ GroupComponent.prototype.title = function() { return this.json['title']; }; /** Identifies a how this group of questions is known in a particular terminology such as LOINC. @returns {Array} an array of {@link Coding} objects */ GroupComponent.prototype.concept = function() { var i, item, len, ref, results; if (this.json['concept']) { ref = this.json['concept']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new Coding(item)); } return results; } }; /** 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']; }; /** If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. @returns {Array} an array of {@link boolean} objects */ GroupComponent.prototype.required = function() { return this.json['required']; }; /** Whether the group may occur multiple times in the instance, containing multiple sets of answers. @returns {Array} an array of {@link boolean} objects */ GroupComponent.prototype.repeats = function() { return this.json['repeats']; }; /** 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 intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. @class Questionnaire @exports Questionnaire as Questionnaire */ Questionnaire = (function(superClass) { extend(Questionnaire, superClass); function Questionnaire(json) { this.json = json; Questionnaire.__super__.constructor.call(this, this.json); } /** This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). @returns {Array} an array of {@link Identifier} objects */ Questionnaire.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; } }; /** The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. @returns {Array} an array of {@link String} objects */ Questionnaire.prototype.version = function() { return this.json['version']; }; /** The lifecycle status of the questionnaire as a whole. @returns {Array} an array of {@link String} objects */ Questionnaire.prototype.status = function() { return this.json['status']; }; /** The date that this questionnaire was last changed. @returns {Array} an array of {@link Date} objects */ Questionnaire.prototype.date = function() { if (this.json['date']) { return DT.DateTime.parse(this.json['date']); } }; /** Organization responsible for developing and maintaining the questionnaire. @returns {Array} an array of {@link String} objects */ Questionnaire.prototype.publisher = function() { return this.json['publisher']; }; /** A collection of related questions (or further groupings of questions). @returns {GroupComponent} */ Questionnaire.prototype.group = function() { if (this.json['group']) { return new GroupComponent(this.json['group']); } }; return Questionnaire; })(DomainResource); module.exports.Questionnaire = Questionnaire; }).call(this); //# sourceMappingURL=questionnaire.js.map