Reverting wrong logic for baseline time points
This commit is contained in:
1 parent
45d660636b
commit
29a8a3db8f
9 files changed
+35
-39
No files matched your search
@@ -86,12 +86,12 @@ class MeasurementApi {
|
||||
|
||||
// Get the current location (if already defined)
|
||||
let location;
|
||||
const previousTimepoint = timepointApi.priorOrBaseline();
|
||||
const previousGroupEntry = groupCollection.findOne({
|
||||
timepointId: previousTimepoint.timepointId
|
||||
const baselineTimepoint = timepointApi.baseline();
|
||||
const baselineGroupEntry = groupCollection.findOne({
|
||||
timepointId: baselineTimepoint.timepointId
|
||||
});
|
||||
if (previousGroupEntry) {
|
||||
const tool = this.tools[previousGroupEntry.toolId];
|
||||
if (baselineGroupEntry) {
|
||||
const tool = this.tools[baselineGroupEntry.toolId];
|
||||
const found = tool.findOne({ measurementNumber });
|
||||
if (found) {
|
||||
location = found.location;
|
||||
@@ -273,7 +273,7 @@ class MeasurementApi {
|
||||
});
|
||||
}
|
||||
|
||||
sortMeasurements() {
|
||||
sortMeasurements(baselineTimepointId) {
|
||||
const tools = configuration.measurementTools;
|
||||
|
||||
const includedTools = tools.filter(tool => {
|
||||
|
||||
@@ -167,11 +167,6 @@ class TimepointApi {
|
||||
});
|
||||
}
|
||||
|
||||
// Return the prior timepoint or baseline if not found
|
||||
priorOrBaseline() {
|
||||
return this.prior() || this.baseline();
|
||||
}
|
||||
|
||||
// Return only the current and prior Timepoints
|
||||
currentAndPrior() {
|
||||
const timepoints = [];
|
||||
|
||||
Reference in new issue
Block a user