Skip to content

Commit

Permalink
Fixed broken calls to medication in VisualizerManager
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoleng12 committed Jul 5, 2018
1 parent f7099c1 commit 17cd305
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/summary/VisualizerManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ class VisualizerManager {
newsection.name = "";
newsection.headings = ["Medication", "Dosage", "Timing", "Start", "End"];
newsection.items = itemList.map((med) => {
const dose = med.amountPerDose ? `${med.amountPerDose.value} ${med.amountPerDose.units}` : "";
const dose = med.medication.amountPerDose ? `${med.medication.amountPerDose.value} ${med.medication.amountPerDose.units}` : "";
let timing;
if (med.timingOfDoses) {
if (!Lang.isNull(med.timingOfDoses.units)) {
timing = `${med.timingOfDoses.value} ${med.timingOfDoses.units}`;
if (med.medication.timingOfDoses) {
if (!Lang.isNull(med.medication.timingOfDoses.units)) {
timing = `${med.medication.timingOfDoses.value} ${med.medication.timingOfDoses.units}`;
} else {
timing = med.timingOfDoses.value;
timing = med.medication.timingOfDoses.value;
}
} else {
timing = "";
}

return [ med.medication,
return [ med.medication.medication,
dose,
timing,
med.expectedPerformanceTime.timePeriodStart,
med.expectedPerformanceTime.timePeriodEnd ];
med.medication.expectedPerformanceTime.timePeriodStart,
med.medication.expectedPerformanceTime.timePeriodEnd ];
});
return newsection;
};
Expand Down

0 comments on commit 17cd305

Please sign in to comment.