diff --git a/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx b/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx
index 03a05f728..2f1f26532 100644
--- a/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx
+++ b/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx
@@ -21,6 +21,8 @@ import {
StudyListFilter,
} from '@ohif/ui';
+const seriesInStudiesMap = new Map();
+
/**
* TODO:
* - debounce `setFilterValues` (150ms?)
@@ -77,7 +79,7 @@ function StudyListContainer({ history, data: studies, dataSource }) {
});
// ~ Rows & Studies
const [expandedRows, setExpandedRows] = useState([]);
- const [seriesInStudies, setSeriesInStudies] = useState({});
+ const [studiesWithSeriesData, setStudiesWithSeriesData] = useState([]);
const numOfStudies = studies.length;
const totalPages = Math.floor(numOfStudies / resultsPerPage);
@@ -185,172 +187,151 @@ function StudyListContainer({ history, data: studies, dataSource }) {
return filterValues[name] !== defaultFilterValues[name];
});
};
- const rowKey = key + 1;
- const isExpanded = expandedRows.some(k => k === rowKey);
- const {
- studyInstanceUid,
- accession,
- modalities,
- instances,
- description,
- mrn,
- patientName,
- date,
- time,
- } = study;
- return {
- row: [
- {
- key: 'patientName',
- content: patientName ? (
- patientName
- ) : (
- (Empty)
- ),
- title: patientName,
- gridCol: 4,
- },
- {
- key: 'mrn',
- content: mrn,
- title: mrn,
- gridCol: 2,
- },
- {
- key: 'studyDate',
- content: (
-
-
- {date &&
- moment(date, ['YYYYMMDD', 'YYYY.MM.DD'], true).isValid() &&
- moment(date, ['YYYYMMDD', 'YYYY.MM.DD']).format(
- 'MMM-DD-YYYY'
const tableDataSource = sortedStudies.map((study, key) => {
+ const rowKey = key + 1;
+ const isExpanded = expandedRows.some(k => k === rowKey);
+ const {
+ studyInstanceUid,
+ accession,
+ modalities,
+ instances,
+ description,
+ mrn,
+ patientName,
+ date,
+ time,
+ } = study;
+ return {
+ row: [
+ {
+ key: 'patientName',
+ content: patientName ? (
+ patientName
+ ) : (
+ (Empty)
+ ),
+ title: patientName,
+ gridCol: 4,
+ },
+ {
+ key: 'mrn',
+ content: mrn,
+ title: mrn,
+ gridCol: 2,
+ },
+ {
+ key: 'studyDate',
+ content: (
+
+
+ {date &&
+ moment(date, ['YYYYMMDD', 'YYYY.MM.DD'], true).isValid() &&
+ moment(date, ['YYYYMMDD', 'YYYY.MM.DD']).format(
+ 'MMM-DD-YYYY'
+ )}
+
+ {time && (
+
+ {time &&
+ moment(time, [
+ 'HH',
+ 'HHmm',
+ 'HHmmss',
+ 'HHmmss.SSS',
+ ]).isValid() &&
+ moment(time, ['HH', 'HHmm', 'HHmmss', 'HHmmss.SSS']).format(
+ 'hh:mm A'
)}
- {time && (
-
- {time &&
- moment(time, [
- 'HH',
- 'HHmm',
- 'HHmmss',
- 'HHmmss.SSS',
- ]).isValid() &&
- moment(time, [
- 'HH',
- 'HHmm',
- 'HHmmss',
- 'HHmmss.SSS',
- ]).format('hh:mm A')}
-
- )}
-
- ),
- title: 'time',
- gridCol: 5,
- },
- {
- key: 'description',
- content: description,
- title: description,
- gridCol: 4,
- },
- {
- key: 'modality',
- content: modalities,
- title: modalities,
- gridCol: 3,
- },
- {
- key: 'accession',
- content: accession,
- title: accession,
- gridCol: 4,
- },
- {
- key: 'instances',
- content: (
- <>
-
- {instances}
- >
- ),
- title: (instances || 0).toString(),
- gridCol: 4,
- },
- ],
- expandedContent: (
- {
- return {
- description: s.description || '(empty)',
- seriesNumber: s.seriesNumber || '',
- modality: s.modality || '',
- instances: s.numSeriesInstances || '',
- };
- })
- : []
- }
- >
-
- }
- >
- Basic Viewer
-
-
- }
- >
- Segmentation
-
- }
- className="font-bold"
- >
- Module 3
-
-
-
- Feedback text lorem ipsum dolor sit amet
+ )}
-
- ),
- onClickRow: () =>
- setExpandedRows(s =>
- isExpanded ? s.filter(n => rowKey !== n) : [...s, rowKey]
),
- isExpanded,
- };
- });
+ title: 'time',
+ gridCol: 5,
+ },
+ {
+ key: 'description',
+ content: description,
+ title: description,
+ gridCol: 4,
+ },
+ {
+ key: 'modality',
+ content: modalities,
+ title: modalities,
+ gridCol: 3,
+ },
+ {
+ key: 'accession',
+ content: accession,
+ title: accession,
+ gridCol: 4,
+ },
+ {
+ key: 'instances',
+ content: (
+ <>
+
+ {instances}
+ >
+ ),
+ title: (instances || 0).toString(),
+ gridCol: 4,
+ },
+ ],
+ expandedContent: (
+ {
+ return {
+ description: s.description || '(empty)',
+ seriesNumber: s.seriesNumber || '',
+ modality: s.modality || '',
+ instances: s.numSeriesInstances || '',
+ };
+ })
+ : []
+ }
+ >
+ }
+ className="font-bold"
+ >
+ Comparison
+
+ }
+ className="font-bold ml-4"
+ >
+ View: Segmentation
+
+
+ ),
+ onClickRow: () =>
+ setExpandedRows(s =>
+ isExpanded ? s.filter(n => rowKey !== n) : [...s, rowKey]
+ ),
+ isExpanded,
+ };
+ });
const hasStudies = numOfStudies > 0;