app/assets/javascripts/medication.js.coffee in hquery-patient-api-0.3.0 vs app/assets/javascripts/medication.js.coffee in hquery-patient-api-1.0.0

- old
+ new

@@ -35,11 +35,11 @@ Provides the period of medication administration as a Scalar. An example Scalar that would be returned would be with value = 8 and units = hours. This would mean that the medication should be taken every 8 hours. @returns {hQuery.Scalar} ### - period: -> new hQuery.Scalar @json['period'] + period: -> new hQuery.Scalar @json['period'] if @json['period'] ###* Indicates whether it is the interval (time between dosing), or frequency (number of doses in a time period) that is important. If instititutionSpecified is not present or is set to false, then the time between dosing is important (every 8 hours). @@ -52,38 +52,38 @@ @class DoseRestriction - restrictions on the medications dose, represented by a upper and lower dose @exports DoseRestriction as hQuery.DoseRestriction ### class hQuery.DoseRestriction constructor: (@json) -> - numerator: -> new hQuery.Scalar @json['numerator'] - denominator: -> new hQuery.Scalar @json['denominator'] + numerator: -> new hQuery.Scalar @json['numerator'] if @json['numerator'] + denominator: -> new hQuery.Scalar @json['denominator'] if @json['denominator'] ###* @class Fulfillment - information about when and who fulfilled an order for the medication @exports Fulfillment as hQuery.Fullfilement ### class hQuery.Fulfillment constructor: (@json) -> dispenseDate: -> hQuery.dateFromUtcSeconds @json['dispenseDate'] - dispensingPharmacyLocation: -> new hQuery.Address @json['dispensingPharmacyLocation'] - quantityDispensed: -> new hQuery.Scalar @json['quantityDispensed'] + dispensingPharmacyLocation: -> new hQuery.Address @json['dispensingPharmacyLocation'] if @json['dispensingPharmacyLocation'] + quantityDispensed: -> new hQuery.Scalar @json['quantityDispensed'] if @json['quantityDispensed'] prescriptionNumber: -> @json['prescriptionNumber'] fillNumber: -> @json['fillNumber'] - fillStatus: -> new hQuery.Status @json['fillStatus'] + fillStatus: -> new hQuery.Status @json['fillStatus'] if @json['fillStatus'] ###* @class OrderInformation - information abour an order for a medication @exports OrderInformation as hQuery.OrderInformation ### class hQuery.OrderInformation constructor: (@json) -> orderNumber: -> @json['orderNumber'] fills: -> @json['fills'] - quantityOrdered: -> new hQuery.Scalar @json['quantityOrdered'] + quantityOrdered: -> new hQuery.Scalar @json['quantityOrdered'] if @json['quantityOrdered'] orderExpirationDateTime: -> hQuery.dateFromUtcSeconds @json['orderExpirationDateTime'] orderDateTime: -> hQuery.dateFromUtcSeconds @json['orderDateTime'] ###* @@ -171,11 +171,11 @@ it combines this with medication start @returns {Date} ### indicateMedicationStop: -> hQuery.dateFromUtcSeconds @json['end_time'] - administrationTiming: -> new hQuery.AdministrationTiming @json['administrationTiming'] + administrationTiming: -> new hQuery.AdministrationTiming @json['administrationTiming'] if @json['administrationTiming'] ###* @returns {CodedValue} Contains routeCode or adminstrationUnitCode information. Route code shall have a a value drawn from FDA route of adminstration, and indicates how the medication is received by the patient. @@ -183,26 +183,26 @@ The administration unit code shall have a value drawn from the FDA dosage form, source NCI thesaurus and represents the physical form of the product as presented to the patient. See http://www.fda.gov/Drugs/InformationOnDrugs/ucm142454.htm ### - route: -> new hQuery.CodedValue @json['route']['code'], @json['route']['codeSystem'] + route: -> hQuery.createCodedValue @json['route'] ###* @returns {hQuery.Scalar} the dose ### - dose: -> new hQuery.Scalar @json['dose'] + dose: -> new hQuery.Scalar @json['dose'] if @json['dose'] ###* @returns {CodedValue} ### - site: -> new hQuery.CodedValue @json['site']['code'], @json['site']['codeSystem'] + site: -> hQuery.createCodedValue @json['site'] if @json['site'] ###* @returns {hQuery.DoseRestriction} ### - doseRestriction: -> new hQuery.DoseRestriction @json['doseRestriction'] + doseRestriction: -> new hQuery.DoseRestriction @json['doseRestriction'] if @json['doseRestriction'] ###* @returns {String} ### doseIndicator: -> @json['doseIndicator'] @@ -213,47 +213,47 @@ fulfillmentInstructions: -> @json['fulfillmentInstructions'] ###* @returns {CodedValue} ### - indication: -> new hQuery.CodedValue @json['indication']['code'], @json['indication']['codeSystem'] + indication: -> hQuery.createCodedValue @json['indication'] ###* @returns {CodedValue} ### - productForm: -> new hQuery.CodedValue @json['productForm']['code'], @json['productForm']['codeSystem'] + productForm: -> hQuery.createCodedValue @json['productForm'] ###* @returns {CodedValue} ### - vehicle: -> new hQuery.CodedValue @json['vehicle']['code'], @json['vehicle']['codeSystem'] + vehicle: -> hQuery.createCodedValue @json['vehicle'] ###* @returns {CodedValue} ### - reaction: -> new hQuery.CodedValue @json['reaction']['code'], @json['reaction']['codeSystem'] + reaction: -> hQuery.createCodedValue @json['reaction'] ###* @returns {CodedValue} ### - deliveryMethod: -> new hQuery.CodedValue @json['deliveryMethod']['code'], @json['deliveryMethod']['codeSystem'] + deliveryMethod: -> hQuery.createCodedValue @json['deliveryMethod'] ###* @returns {hQuery.MedicationInformation} ### medicationInformation: -> new hQuery.MedicationInformation @json ###* @returns {hQuery.TypeOfMedication} Indicates whether this is an over the counter or prescription medication ### - typeOfMedication: -> new hQuery.TypeOfMedication @json['typeOfMedication']['code'], @json['typeOfMedication']['codeSystem'] + typeOfMedication: -> new hQuery.TypeOfMedication @json['typeOfMedication']?['code'], @json['typeOfMedication']?['codeSystem'] ###* Values conform to value set 2.16.840.1.113883.1.11.20.7 - Medication Status Values may be: On Hold, No Longer Active, Active, Prior History @returns {hQuery.StatusOfMedication} Used to indicate the status of the medication. ### - statusOfMedication: -> new hQuery.StatusOfMedication @json['statusOfMedication']['code'], @json['statusOfMedication']['codeSystem'] + statusOfMedication: -> new hQuery.StatusOfMedication @json['statusOfMedication']?['code'], @json['statusOfMedication']?['codeSystem'] ###* @returns {String} free text instructions to the patient ### patientInstructions: -> @json['patientInstructions']