UNPKG

cql-execution

Version:

An execution framework for the Clinical Quality Language (CQL)

536 lines (385 loc) 18.2 kB
// Generated by CoffeeScript 1.9.3 (function() { var Address, Attachment, BackboneElement, CORE, CodeableConcept, Coding, ContactPoint, DT, DomainResource, Element, ElementDefinition, Extension, HumanName, Identifier, MedicationPrescription, MedicationPrescriptionDispenseComponent, MedicationPrescriptionDosageInstructionComponent, MedicationPrescriptionSubstitutionComponent, 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 MedicationPrescriptionDosageInstructionComponent @exports MedicationPrescriptionDosageInstructionComponent as MedicationPrescriptionDosageInstructionComponent */ MedicationPrescriptionDosageInstructionComponent = (function(superClass) { extend(MedicationPrescriptionDosageInstructionComponent, superClass); function MedicationPrescriptionDosageInstructionComponent(json) { this.json = json; MedicationPrescriptionDosageInstructionComponent.__super__.constructor.call(this, this.json); } /** Free text dosage instructions for cases where the instructions are too complex to code. @returns {Array} an array of {@link String} objects */ MedicationPrescriptionDosageInstructionComponent.prototype.text = function() { return this.json['text']; }; /** Additional instructions such as "Swallow with plenty of water" which may or may not be coded. @returns {CodeableConcept} */ MedicationPrescriptionDosageInstructionComponent.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 */ MedicationPrescriptionDosageInstructionComponent.prototype.scheduledDateTime = function() { if (this.json['scheduledDateTime']) { return DT.DateTime.parse(this.json['scheduledDateTime']); } }; /** 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} */ MedicationPrescriptionDosageInstructionComponent.prototype.scheduledPeriod = function() { if (this.json['scheduledPeriod']) { return new Period(this.json['scheduledPeriod']); } }; /** 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} */ MedicationPrescriptionDosageInstructionComponent.prototype.scheduledTiming = function() { if (this.json['scheduledTiming']) { return new Timing(this.json['scheduledTiming']); } }; /** 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 */ MedicationPrescriptionDosageInstructionComponent.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} */ MedicationPrescriptionDosageInstructionComponent.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} */ MedicationPrescriptionDosageInstructionComponent.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 patient. @returns {CodeableConcept} */ MedicationPrescriptionDosageInstructionComponent.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} */ MedicationPrescriptionDosageInstructionComponent.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} */ MedicationPrescriptionDosageInstructionComponent.prototype.doseQuantity = function() { if (this.json['doseQuantity']) { return new Quantity(this.json['doseQuantity']); } }; /** Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. @returns {Ratio} */ MedicationPrescriptionDosageInstructionComponent.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} */ MedicationPrescriptionDosageInstructionComponent.prototype.maxDosePerPeriod = function() { if (this.json['maxDosePerPeriod']) { return new Ratio(this.json['maxDosePerPeriod']); } }; return MedicationPrescriptionDosageInstructionComponent; })(BackboneElement); /** Embedded class @class MedicationPrescriptionDispenseComponent @exports MedicationPrescriptionDispenseComponent as MedicationPrescriptionDispenseComponent */ MedicationPrescriptionDispenseComponent = (function(superClass) { extend(MedicationPrescriptionDispenseComponent, superClass); function MedicationPrescriptionDispenseComponent(json) { this.json = json; MedicationPrescriptionDispenseComponent.__super__.constructor.call(this, this.json); } /** Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . 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} */ MedicationPrescriptionDispenseComponent.prototype.medication = function() { if (this.json['medication']) { return new Reference(this.json['medication']); } }; /** Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. @returns {Period} */ MedicationPrescriptionDispenseComponent.prototype.validityPeriod = function() { if (this.json['validityPeriod']) { return new Period(this.json['validityPeriod']); } }; /** An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. @returns {Array} an array of {@link Number} objects */ MedicationPrescriptionDispenseComponent.prototype.numberOfRepeatsAllowed = function() { return this.json['numberOfRepeatsAllowed']; }; /** The amount that is to be dispensed. @returns {Quantity} */ MedicationPrescriptionDispenseComponent.prototype.quantity = function() { if (this.json['quantity']) { return new Quantity(this.json['quantity']); } }; /** Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. @returns {Duration} */ MedicationPrescriptionDispenseComponent.prototype.expectedSupplyDuration = function() { if (this.json['expectedSupplyDuration']) { return new Duration(this.json['expectedSupplyDuration']); } }; return MedicationPrescriptionDispenseComponent; })(BackboneElement); /** Embedded class @class MedicationPrescriptionSubstitutionComponent @exports MedicationPrescriptionSubstitutionComponent as MedicationPrescriptionSubstitutionComponent */ MedicationPrescriptionSubstitutionComponent = (function(superClass) { extend(MedicationPrescriptionSubstitutionComponent, superClass); function MedicationPrescriptionSubstitutionComponent(json) { this.json = json; MedicationPrescriptionSubstitutionComponent.__super__.constructor.call(this, this.json); } /** A code signifying whether a different drug should be dispensed from what was prescribed. @returns {CodeableConcept} */ MedicationPrescriptionSubstitutionComponent.prototype.type = function() { if (this.json['type']) { return new CodeableConcept(this.json['type']); } }; /** Indicates the reason for the substitution, or why substitution must or must not be performed. @returns {CodeableConcept} */ MedicationPrescriptionSubstitutionComponent.prototype.reason = function() { if (this.json['reason']) { return new CodeableConcept(this.json['reason']); } }; return MedicationPrescriptionSubstitutionComponent; })(BackboneElement); /** An order for both supply of the medication and the instructions for administration of the medicine to a patient. @class MedicationPrescription @exports MedicationPrescription as MedicationPrescription */ MedicationPrescription = (function(superClass) { extend(MedicationPrescription, superClass); function MedicationPrescription(json) { this.json = json; MedicationPrescription.__super__.constructor.call(this, this.json); } /** External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. @returns {Array} an array of {@link Identifier} objects */ MedicationPrescription.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 date (and perhaps time) when the prescription was written. @returns {Array} an array of {@link Date} objects */ MedicationPrescription.prototype.dateWritten = function() { if (this.json['dateWritten']) { return DT.DateTime.parse(this.json['dateWritten']); } }; /** A code specifying the state of the order. Generally this will be active or completed state. @returns {Array} an array of {@link String} objects */ MedicationPrescription.prototype.status = function() { return this.json['status']; }; /** A link to a resource representing the person to whom the medication will be given. @returns {Reference} */ MedicationPrescription.prototype.patient = function() { if (this.json['patient']) { return new Reference(this.json['patient']); } }; /** The healthcare professional responsible for authorizing the prescription. @returns {Reference} */ MedicationPrescription.prototype.prescriber = function() { if (this.json['prescriber']) { return new Reference(this.json['prescriber']); } }; /** A link to a resource that identifies the particular occurrence of contact between patient and health care provider. @returns {Reference} */ MedicationPrescription.prototype.encounter = function() { if (this.json['encounter']) { return new Reference(this.json['encounter']); } }; /** Can be the reason or the indication for writing the prescription. @returns {CodeableConcept} */ MedicationPrescription.prototype.reasonCodeableConcept = function() { if (this.json['reasonCodeableConcept']) { return new CodeableConcept(this.json['reasonCodeableConcept']); } }; /** Can be the reason or the indication for writing the prescription. @returns {Reference} */ MedicationPrescription.prototype.reasonReference = function() { if (this.json['reasonReference']) { return new Reference(this.json['reasonReference']); } }; /** 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} */ MedicationPrescription.prototype.medication = function() { if (this.json['medication']) { return new Reference(this.json['medication']); } }; /** Indicates how the medication is to be used by the patient. @returns {Array} an array of {@link MedicationPrescriptionDosageInstructionComponent} objects */ MedicationPrescription.prototype.dosageInstruction = function() { var i, item, len, ref, results; if (this.json['dosageInstruction']) { ref = this.json['dosageInstruction']; results = []; for (i = 0, len = ref.length; i < len; i++) { item = ref[i]; results.push(new MedicationPrescriptionDosageInstructionComponent(item)); } return results; } }; /** Deals with details of the dispense part of the order. @returns {MedicationPrescriptionDispenseComponent} */ MedicationPrescription.prototype.dispense = function() { if (this.json['dispense']) { return new MedicationPrescriptionDispenseComponent(this.json['dispense']); } }; /** Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. @returns {MedicationPrescriptionSubstitutionComponent} */ MedicationPrescription.prototype.substitution = function() { if (this.json['substitution']) { return new MedicationPrescriptionSubstitutionComponent(this.json['substitution']); } }; return MedicationPrescription; })(DomainResource); module.exports.MedicationPrescription = MedicationPrescription; }).call(this); //# sourceMappingURL=medicationprescription.js.map