From 68a0021d2c01b47902c53da4bcc490be869c8dc0 Mon Sep 17 00:00:00 2001 From: Bradley Spaulding Date: Tue, 27 Sep 2016 20:10:37 -0700 Subject: [PATCH 1/2] Added initial Allergy model --- app/models/allergy.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 app/models/allergy.js diff --git a/app/models/allergy.js b/app/models/allergy.js new file mode 100644 index 0000000000..84c2ae51e0 --- /dev/null +++ b/app/models/allergy.js @@ -0,0 +1,8 @@ +import AbstractModel from 'hospitalrun/models/abstract'; +import DS from 'ember-data'; + +export default AbstractModel.extend({ + description: DS.attr('string'), + icd9CMCode: DS.attr('string'), + icd10Code: DS.attr('string') +}); From b7f234928cde94804f53919fe432a307329a11c4 Mon Sep 17 00:00:00 2001 From: Bradley Spaulding Date: Tue, 27 Sep 2016 20:10:52 -0700 Subject: [PATCH 2/2] Patient hasMany allergies --- app/models/patient.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/patient.js b/app/models/patient.js index 6adcbdb219..92c4c03ca1 100644 --- a/app/models/patient.js +++ b/app/models/patient.js @@ -12,6 +12,9 @@ export default AbstractModel.extend(DOBDays, PatientName, { address2: DS.attr('string'), address3: DS.attr('string'), address4: DS.attr('string'), + allergies: DS.hasMany('allergy', { + async: true + }), bloodType: DS.attr('string'), clinic: DS.attr('string'), country: DS.attr('string'),