Allowing loading prior timepoints without the need of baseline data

This commit is contained in:
Bruno Alves de Faria committed 2017-09-18 15:45:55 -03:00
1 parent 84bcffe860
commit 823a422c26
10 files changed
+67 -35

No files matched your search

@@ -89,12 +89,11 @@ const getDataFromTimepoint = timepoint => {
};
}
// Otherwise, this is a follow-up exam, so we should also find the baseline timepoint,
// and all studies related to it. We also enforce that the Baseline should have a studyDate
// Otherwise, this is a follow-up exam, so we should also find the prior timepoint,
// and all studies related to it. We also enforce that the Prior should have a studyDate
// prior to the latest studyDate in the current (Follow-up) Timepoint.
const Timepoints = OHIF.studylist.timepointApi.timepoints;
const baseline = Timepoints.findOne({
timepointType: 'baseline',
const priorTimepoint = Timepoints.findOne({
patientId: timepoint.patientId,
latestDate: {
$lte: timepoint.latestDate
@@ -102,11 +101,11 @@ const getDataFromTimepoint = timepoint => {
});
let timepointIds = [];
if (baseline) {
relatedStudies = relatedStudies.concat(baseline.studyInstanceUids);
timepointIds.push(baseline.timepointId);
if (priorTimepoint) {
relatedStudies = relatedStudies.concat(priorTimepoint.studyInstanceUids);
timepointIds.push(priorTimepoint.timepointId);
} else {
OHIF.log.warn('No Baseline found while opening a Follow-up Timepoint');
OHIF.log.warn('No prior Timepoint found while opening a Follow-up Timepoint');
}
timepointIds.push(timepoint.timepointId);