Improve DICOM UPP relation visualizer
This commit is contained in:
@@ -439,11 +439,18 @@ function downloadSelectedSeries() {
|
||||
triggerDownload(exportDownloadUrl(app.exportDialog.ctNumber, selected));
|
||||
}
|
||||
|
||||
async function loadStudies() {
|
||||
function initialCtNumber() {
|
||||
return new URLSearchParams(location.search).get("ct_number") || "";
|
||||
}
|
||||
|
||||
async function loadStudies(preferredCtNumber = "") {
|
||||
const q = encodeURIComponent($("studySearch").value.trim());
|
||||
app.studies = sortStudies(await json(`/api/studies?q=${q}&limit=500`));
|
||||
renderStudies();
|
||||
if (!app.study && app.studies.length) await selectStudy(app.studies[0].ct_number);
|
||||
if (!app.study && app.studies.length) {
|
||||
const preferred = app.studies.find((study) => study.ct_number === preferredCtNumber);
|
||||
await selectStudy((preferred || app.studies[0]).ct_number);
|
||||
}
|
||||
}
|
||||
|
||||
function renderStudies() {
|
||||
@@ -1537,7 +1544,7 @@ async function boot() {
|
||||
if (location.pathname === "/settings" && isAdmin()) {
|
||||
await showSettingsPage(false);
|
||||
} else {
|
||||
await loadStudies();
|
||||
await loadStudies(initialCtNumber());
|
||||
await handleRoute(false);
|
||||
}
|
||||
if (!app.statusTimer) app.statusTimer = setInterval(refreshStatus, 15000);
|
||||
|
||||
Reference in New Issue
Block a user