UNPKG

cql-execution

Version:

An execution framework for the Clinical Quality Language (CQL)

562 lines (411 loc) 17.4 kB
// Generated by CoffeeScript 1.9.3 (function() { var Address, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, HumanName, Identifier, MedicationDispense, MedicationDispenseDispenseComponent, MedicationDispenseDispenseDosageComponent, MedicationDispenseSubstitutionComponent, 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 MedicationDispenseDispenseDosageComponent @exports MedicationDispenseDispenseDosageComponent as MedicationDispenseDispenseDosageComponent */ MedicationDispenseDispenseDosageComponent = (function(superClass) { extend(MedicationDispenseDispenseDosageComponent, superClass); function MedicationDispenseDispenseDosageComponent(json) { this.json = json; MedicationDispenseDispenseDosageComponent.__super__.constructor.call(this, this.json); } /** Additional instructions such as "Swallow with plenty of water" which may or may not be coded. @returns {CodeableConcept} */ MedicationDispenseDispenseDosageComponent.prototype.additionalInstructions = function() { if (this.json['additionalInstructions']) { return new CodeableConcept(this.json['additionalInstructions']); } }; /** The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". @returns {Array} an array of {@link Date} objects */ MedicationDispenseDispenseDosageComponent.prototype.scheduleDateTime = function() { if (this.json['scheduleDateTime']) { return DT.DateTime.parse(this.json['scheduleDateTime']); } }; /** The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". @returns {Period} */ MedicationDispenseDispenseDosageComponent.prototype.schedulePeriod = function() { if (this.json['schedulePeriod']) { return new Period(this.json['schedulePeriod']); } }; /** The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". @returns {Timing} */ MedicationDispenseDispenseDosageComponent.prototype.scheduleTiming = function() { if (this.json['scheduleTiming']) { return new Timing(this.json['scheduleTiming']); } }; /** If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. @returns {Array} an array of {@link boolean} objects */ MedicationDispenseDispenseDosageComponent.prototype.asNeededBoolean = function() { return this.json['asNeededBoolean']; }; /** If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. @returns {CodeableConcept} */ MedicationDispenseDispenseDosageComponent.prototype.asNeededCodeableConcept = function() { if (this.json['asNeededCodeableConcept']) { return new CodeableConcept(this.json['asNeededCodeableConcept']); } }; /** A coded specification of the anatomic site where the medication first enters the body. @returns {CodeableConcept} */ MedicationDispenseDispenseDosageComponent.prototype.site = function() { if (this.json['site']) { return new CodeableConcept(this.json['site']); } }; /** A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. @returns {CodeableConcept} */ MedicationDispenseDispenseDosageComponent.prototype.route = function() { if (this.json['route']) { return new CodeableConcept(this.json['route']); } }; /** A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. @returns {CodeableConcept} */ MedicationDispenseDispenseDosageComponent.prototype.method = function() { if (this.json['method']) { return new CodeableConcept(this.json['method']); } }; /** The amount of therapeutic or other substance given at one administration event. @returns {Quantity} */ MedicationDispenseDispenseDosageComponent.prototype.quantity = function() { if (this.json['quantity']) { return new Quantity(this.json['quantity']); } }; /** Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. @returns {Ratio} */ MedicationDispenseDispenseDosageComponent.prototype.rate = function() { if (this.json['rate']) { return new Ratio(this.json['rate']); } }; /** The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. @returns {Ratio} */ MedicationDispenseDispenseDosageComponent.prototype.maxDosePerPeriod = function() { if (this.json['maxDosePerPeriod']) { return new Ratio(this.json['maxDosePerPeriod']); } }; return MedicationDispenseDispenseDosageComponent; })(BackboneElement); /** Embedded class @class MedicationDispenseDispenseComponent @exports MedicationDispenseDispenseComponent as MedicationDispenseDispenseComponent */ MedicationDispenseDispenseComponent = (function(superClass) { extend(MedicationDispenseDispenseComponent, superClass); function MedicationDispenseDispenseComponent(json) { this.json = json; MedicationDispenseDispenseComponent.__super__.constructor.call(this, this.json); } /** Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. @returns {Identifier} */ MedicationDispenseDispenseComponent.prototype.identifier = function() { if (this.json['identifier']) { return new Identifier(this.json['identifier']); } }; /** A code specifying the state of the dispense event. @returns {Array} an array of {@link String} objects */ MedicationDispenseDispenseComponent.prototype.status = function() { return this.json['status']; }; /** Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. @returns {CodeableConcept} */ MedicationDispenseDispenseComponent.prototype.type = function() { if (this.json['type']) { return new CodeableConcept(this.json['type']); } }; /** The amount of medication that has been dispensed. Includes unit of measure. @returns {Quantity} */ MedicationDispenseDispenseComponent.prototype.quantity = function() { if (this.json['quantity']) { return new Quantity(this.json['quantity']); } }; /** Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. @returns {Reference} */ MedicationDispenseDispenseComponent.prototype.medication = function() { if (this.json['medication']) { return new Reference(this.json['medication']); } }; /** The time when the dispensed product was packaged and reviewed. @returns {Array} an array of {@link Date} objects */ MedicationDispenseDispenseComponent.prototype.whenPrepared = function() { if (this.json['whenPrepared']) { return DT.DateTime.parse(this.json['whenPrepared']); } }; /** The time the dispensed product was provided to the patient or their representative. @returns {Array} an array of {@link Date} objects */ MedicationDispenseDispenseComponent.prototype.whenHandedOver = function() { if (this.json['whenHandedOver']) { return DT.DateTime.parse(this.json['whenHandedOver']); } }; /** Identification of the facility/location where the medication was shipped to, as part of the dispense event. @returns {Reference} */ MedicationDispenseDispenseComponent.prototype.destination = function() { if (this.json['destination']) { return new Reference(this.json['destination']); } }; /** Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional. @returns {Array} an array of {@link Reference} objects */ MedicationDispenseDispenseComponent.prototype.receiver = function() { var i, item, len, ref, results; if (this.json['receiver']) { ref = this.json['receiver']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new Reference(item)); } return results; } }; /** Indicates how the medication is to be used by the patient. @returns {Array} an array of {@link MedicationDispenseDispenseDosageComponent} objects */ MedicationDispenseDispenseComponent.prototype.dosage = function() { var i, item, len, ref, results; if (this.json['dosage']) { ref = this.json['dosage']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new MedicationDispenseDispenseDosageComponent(item)); } return results; } }; return MedicationDispenseDispenseComponent; })(BackboneElement); /** Embedded class @class MedicationDispenseSubstitutionComponent @exports MedicationDispenseSubstitutionComponent as MedicationDispenseSubstitutionComponent */ MedicationDispenseSubstitutionComponent = (function(superClass) { extend(MedicationDispenseSubstitutionComponent, superClass); function MedicationDispenseSubstitutionComponent(json) { this.json = json; MedicationDispenseSubstitutionComponent.__super__.constructor.call(this, this.json); } /** A code signifying whether a different drug was dispensed from what was prescribed. @returns {CodeableConcept} */ MedicationDispenseSubstitutionComponent.prototype.type = function() { if (this.json['type']) { return new CodeableConcept(this.json['type']); } }; /** Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. @returns {Array} an array of {@link CodeableConcept} objects */ MedicationDispenseSubstitutionComponent.prototype.reason = function() { var i, item, len, ref, results; if (this.json['reason']) { ref = this.json['reason']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new CodeableConcept(item)); } return results; } }; /** The person or organization that has primary responsibility for the substitution. @returns {Array} an array of {@link Reference} objects */ MedicationDispenseSubstitutionComponent.prototype.responsibleParty = function() { var i, item, len, ref, results; if (this.json['responsibleParty']) { ref = this.json['responsibleParty']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new Reference(item)); } return results; } }; return MedicationDispenseSubstitutionComponent; })(BackboneElement); /** Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. @class MedicationDispense @exports MedicationDispense as MedicationDispense */ MedicationDispense = (function(superClass) { extend(MedicationDispense, superClass); function MedicationDispense(json) { this.json = json; MedicationDispense.__super__.constructor.call(this, this.json); } /** Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. @returns {Identifier} */ MedicationDispense.prototype.identifier = function() { if (this.json['identifier']) { return new Identifier(this.json['identifier']); } }; /** A code specifying the state of the set of dispense events. @returns {Array} an array of {@link String} objects */ MedicationDispense.prototype.status = function() { return this.json['status']; }; /** A link to a resource representing the person to whom the medication will be given. @returns {Reference} */ MedicationDispense.prototype.patient = function() { if (this.json['patient']) { return new Reference(this.json['patient']); } }; /** The individual responsible for dispensing the medication. @returns {Reference} */ MedicationDispense.prototype.dispenser = function() { if (this.json['dispenser']) { return new Reference(this.json['dispenser']); } }; /** Indicates the medication order that is being dispensed against. @returns {Array} an array of {@link Reference} objects */ MedicationDispense.prototype.authorizingPrescription = function() { var i, item, len, ref, results; if (this.json['authorizingPrescription']) { ref = this.json['authorizingPrescription']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new Reference(item)); } return results; } }; /** Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. @returns {Array} an array of {@link MedicationDispenseDispenseComponent} objects */ MedicationDispense.prototype.dispense = function() { var i, item, len, ref, results; if (this.json['dispense']) { ref = this.json['dispense']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new MedicationDispenseDispenseComponent(item)); } return results; } }; /** Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. @returns {MedicationDispenseSubstitutionComponent} */ MedicationDispense.prototype.substitution = function() { if (this.json['substitution']) { return new MedicationDispenseSubstitutionComponent(this.json['substitution']); } }; return MedicationDispense; })(DomainResource); module.exports.MedicationDispense = MedicationDispense; }).call(this); //# sourceMappingURL=medicationdispense.js.map