LT-298: Updating location on all timepoints when updated on any of them
This commit is contained in:
1 parent
820ba1e969
commit
2cc7fcc846
4 files changed
+36
-23
No files matched your search
+1
-1
@@ -13,7 +13,7 @@
|
||||
{{/unless}}
|
||||
{{#if rowItem.responseStatus}}
|
||||
<div class="response-status-icon">
|
||||
{{ rowItem.responseStatus }}
|
||||
{{rowItem.responseStatus}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
+18
-19
@@ -1,31 +1,30 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Template.measurementTableView.helpers({
|
||||
isFollowup() {
|
||||
const instance = Template.instance();
|
||||
const current = instance.data.timepointApi.current();
|
||||
return (current && current.timepointType === 'followup');
|
||||
},
|
||||
|
||||
groupByMeasurementNumber(measurementTypeId) {
|
||||
const api = Template.instance().data.measurementApi;
|
||||
const Collection = api[measurementTypeId];
|
||||
const data = Collection.find().fetch();
|
||||
const api = Template.instance().data.measurementApi;
|
||||
const Collection = api[measurementTypeId];
|
||||
const data = Collection.find().fetch();
|
||||
|
||||
const groupObject = _.groupBy(data, entry => entry.measurementNumber);
|
||||
|
||||
return Object.keys(groupObject).map(key => {
|
||||
const anEntry = groupObject[key][0];
|
||||
const getLocation = collection => {
|
||||
for (let i = 0; i < collection.length; i++) {
|
||||
if (collection[i].location) {
|
||||
return collection[i].location;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
measurementTypeId: measurementTypeId,
|
||||
measurementNumber: key,
|
||||
location: anEntry.location,
|
||||
responseStatus: false, // TODO: Get the latest timepoint and determine the response status
|
||||
entries: groupObject[key]
|
||||
};
|
||||
});
|
||||
return Object.keys(groupObject).map(key => ({
|
||||
measurementTypeId: measurementTypeId,
|
||||
measurementNumber: key,
|
||||
location: getLocation(groupObject[key]),
|
||||
responseStatus: false, // TODO: Get the latest timepoint and determine the response status
|
||||
entries: groupObject[key]
|
||||
}));
|
||||
},
|
||||
|
||||
newMeasurements() {
|
||||
|
||||
Reference in new issue
Block a user