Most JS files, all helpers and simple reconciliations

This commit is contained in:
Emanuel F. Oliveira committed 2017-01-29 22:11:17 -02:00
1 parent 21400c5836
commit 9e69c43dda
58 files changed
+776 -1025

No files matched your search

@@ -1,21 +1,19 @@
import { OHIFError } from './classes/OHIFError';
/**
* Sorts the series and instances inside a study instance by their series
* and instance numbers in ascending order.
*
* @param {Object} study The study instance
*/
sortStudy = function(study) {
export function sortStudy(study) {
if (!study || !study.seriesList) {
throw "Insufficient study data was provided to sortStudy";
throw new OHIFError('Insufficient study data was provided to sortStudy');
}
study.seriesList.sort(function(a, b) {
return a.seriesNumber - b.seriesNumber;
});
study.seriesList.forEach(function(series){
series.instances.sort(function(a, b) {
return a.instanceNumber - b.instanceNumber;
});
study.seriesList.sort((a, b) => a.seriesNumber - b.seriesNumber);
study.seriesList.forEach(series => {
series.instances.sort((a, b) => a.instanceNumber - b.instanceNumber);
});
};
}