Hook to query for series data
This commit is contained in:
parent
97cbf076f5
commit
fb1b47b9c9
@ -113,27 +113,27 @@ function StudyListContainer({ history, data: studies, dataSource }) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchSeries = async studyInstanceUid => {
|
const fetchSeries = async studyInstanceUid => {
|
||||||
try {
|
try {
|
||||||
const expandedStudiesSeriesList = {};
|
const result = await dataSource.query.series.search(studyInstanceUid);
|
||||||
|
|
||||||
expandedStudiesSeriesList[
|
seriesInStudiesMap.set(studyInstanceUid, result);
|
||||||
studyInstanceUid
|
setStudiesWithSeriesData([...studiesWithSeriesData, studyInstanceUid]);
|
||||||
] = await dataSource.query.series.search(studyInstanceUid);
|
|
||||||
|
|
||||||
setSeriesInStudies(
|
|
||||||
Object.assign({}, seriesInStudies, expandedStudiesSeriesList)
|
|
||||||
);
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// TODO: UI Notification Service
|
// TODO: UI Notification Service
|
||||||
console.warn(ex);
|
console.warn(ex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: WHY WOULD YOU USE AN INDEX OF 1?!
|
||||||
|
// Note: expanded rows index begins at 1
|
||||||
for (let z = 0; z < expandedRows.length; z++) {
|
for (let z = 0; z < expandedRows.length; z++) {
|
||||||
const studyInstanceUid = studies[z].studyInstanceUid;
|
const expandedRowIndex = expandedRows[z] - 1;
|
||||||
if (seriesInStudies[studyInstanceUid]) {
|
console.log(sortedStudies[expandedRowIndex]);
|
||||||
|
const studyInstanceUid = sortedStudies[expandedRowIndex].studyInstanceUid;
|
||||||
|
if (studiesWithSeriesData.includes(studyInstanceUid)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`fetching for ${expandedRowIndex}`)
|
||||||
fetchSeries(studyInstanceUid);
|
fetchSeries(studyInstanceUid);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user