Remove some subscription / reactivity / caching bugs and the unnecessary PatientLocations collection

This commit is contained in:
Erik Ziegler committed 2016-02-10 16:38:49 +01:00
1 parent 7d42456f57
commit 9cde04bcfe
43 files changed
+321 -234

No files matched your search

+3 -22
View File
@@ -1,20 +1,3 @@
/**
* Retrieve a location name (e.g. Liver Right) from the
* PatientLocations Collection by id, if it exists. Otherwise,
* return an empty string.
*
* @param id
* @returns {*|string}
*/
function getLocationName(id) {
var locationObject = PatientLocations.findOne(id);
if (!locationObject || !locationObject.location) {
return '';
}
return locationObject.location;
}
/**
* Update the Timepoint object for a specific Measurement.
* If no measurement exists yet, one will be created.
@@ -33,7 +16,6 @@ function updateLesionData(lesionData) {
return;
}
var timepoint = Timepoints.findOne({
timepointId: study.timepointId
});
@@ -84,7 +66,7 @@ function updateLesionData(lesionData) {
// Retrieve the location name given the locationUID
if (lesionData.locationUID !== undefined) {
var locationObj = PatientLocations.findOne({
var locationObj = LesionLocations.findOne({
locationUID: lesionData.locationUID
});
@@ -191,12 +173,11 @@ function lesionNumberExists(lesionData) {
return;
}
return measurement.locationUID;
return measurement.locationId;
}
LesionManager = {
updateLesionData: updateLesionData,
getNewLesionNumber: getNewLesionNumber,
lesionNumberExists: lesionNumberExists,
getLocationName: getLocationName
lesionNumberExists: lesionNumberExists
};