Skip to content

Commit

Permalink
PageLoadSize
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Dec 19, 2024
1 parent ea6921e commit b5cb181
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
7 changes: 6 additions & 1 deletion Plugin/DefaultConfiguration.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@
"wsi"
],

"MaxStudiesDisplayed": 100, // The maximum number of studies displayed in the study list
"MaxStudiesDisplayed": 100, // The maximum number of studies displayed in the study list.
// From v 1.7.0, this option is not used anymore in the local study list when using
// a DB backend that supports ExtendedFind (SQLite and PostgreSQL)
// but is still used in the DicomWeb queries.
"PageLoadSize": 50, // The number of items that are loaded when scrolling the study or instance list.
// Only applicable with a DB backend that supports ExtendedFind.
"MaxMyJobsHistorySize": 5, // The maximum number of jobs appearing under 'my jobs' in side bar (0 = unlimited)

"StudyListSearchMode": "search-as-you-type",// mode to trigger a search in the StudyList. Accepted values: 'search-as-you-type' or 'search-button'
Expand Down
6 changes: 2 additions & 4 deletions WebApplication/src/components/SeriesDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ export default {
uiOptions: state => state.configuration.uiOptions,
studiesSourceType: state => state.studies.sourceType,
studiesRemoteSource: state => state.studies.remoteSource,
hasExtendedFind: state => state.configuration.hasExtendedFind
}),
...mapGetters([
'configuration/hasExtendedFind', // -> this['configuration/hasExtendedFind']
]),
useExtendedInstanceList() {
return this['configuration/hasExtendedFind'] && this.studiesSourceType == SourceType.LOCAL_ORTHANC;
return this.hasExtendedFind && this.studiesSourceType == SourceType.LOCAL_ORTHANC;
}
},
async mounted() {
Expand Down
6 changes: 2 additions & 4 deletions WebApplication/src/components/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ export default {
configuration: state => state.configuration,
studiesSourceType: state => state.studies.sourceType,
studiesRemoteSource: state => state.studies.remoteSource,
hasExtendedFind: state => state.configuration.hasExtendedFind
}),
...mapGetters([
'configuration/hasExtendedFind', // -> this['configuration/hasExtendedFind']
]),
customLogoUrl() {
if (this.hasCustomLogo && this.configuration.customLogoUrl) {
return this.customLogoUrl;
Expand Down Expand Up @@ -124,7 +122,7 @@ export default {
this.labelsStudyCount[label] = null;
}
}
if (this['configuration/hasExtendedFind']) {
if (this.hasExtendedFind) {
if (this.uiOptions.EnableLabelsCount) {
for (const [k, v] of Object.entries(this.labelsStudyCount)) {
if (v == null) {
Expand Down
20 changes: 10 additions & 10 deletions WebApplication/src/components/StudyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ export default {
selectedStudiesIds: state => state.studies.selectedStudiesIds,
isSearching: state => state.studies.isSearching,
statistics: state => state.studies.statistics,
hasExtendedFind: state => state.configuration.hasExtendedFind,
hasExtendedChanges: state => state.configuration.hasExtendedChanges
}),
...mapGetters([
'studies/isFilterEmpty', // -> this['studies/isFilterEmpty']
'configuration/hasExtendedFind', // -> this['configuration/hasExtendedFind']
'configuration/hasExtendedChanges', // -> this['configuration/hasExtendedChanges']
]),
notShowingAllResults() {
if (this.sourceType == SourceType.LOCAL_ORTHANC) {
if (this.sourceType == SourceType.LOCAL_ORTHANC && this.hasExtendedFind) {
if (this.studiesIds.length >= this.statistics.CountStudies) {
return false;
}
Expand Down Expand Up @@ -326,7 +326,7 @@ export default {
}
},
isOrderable(tagName) {
if (this.sourceType != SourceType.LOCAL_ORTHANC || !this['configuration/hasExtendedFind']) {
if (this.sourceType != SourceType.LOCAL_ORTHANC || !this.hasExtendedFind) {
return false;
}
Expand Down Expand Up @@ -739,12 +739,12 @@ export default {
await this.$router.replace(newUrl);
},
async extendStudyList() {
if (this.sourceType == SourceType.LOCAL_ORTHANC && this['configuration/hasExtendedFind']) {
if (this.sourceType == SourceType.LOCAL_ORTHANC && this.hasExtendedFind) {
await this.$store.dispatch('studies/extendFilteredStudies');
}
},
async reloadStudyList() {
if (this.sourceType == SourceType.LOCAL_ORTHANC && this['configuration/hasExtendedFind']) {
if (this.sourceType == SourceType.LOCAL_ORTHANC && this.hasExtendedFind) {
await this.$store.dispatch('studies/clearStudies');
await this.$store.dispatch('studies/reloadFilteredStudies');
} else {
Expand All @@ -755,8 +755,8 @@ export default {
await this.$store.dispatch('studies/clearStudies');
if (this.uiOptions.StudyListContentIfNoSearch == "empty") {
return;
} else if (this.uiOptions.StudyListContentIfNoSearch == "most-recents" && this['configuration/hasExtendedFind']) {
const studies = await api.getMostRecentStudies((this.filterLabels.length > 0 ? this.filterLabels[0] : null));
} else if (this.uiOptions.StudyListContentIfNoSearch == "most-recents" && this.hasExtendedFind) {
const studies = await api.getMostRecentStudiesExtended((this.filterLabels.length > 0 ? this.filterLabels[0] : null));
for (const study of studies) {
this.$store.dispatch('studies/addStudy', { studyId: study["ID"], study: study, reloadStats: false });
}
Expand Down Expand Up @@ -792,7 +792,7 @@ export default {
async loadStudiesFromChange(toChangeId, limit) {
let changes;
let changesResponse;
if (this['configuration/hasExtendedChanges']) {
if (this.hasExtendedChanges) {
changesResponse = await api.getChangesExtended(toChangeId, limit, ["NewStudy", "StableStudy"]);
changes = changesResponse["Changes"];
} else {
Expand Down Expand Up @@ -827,7 +827,7 @@ export default {
}
if (!this.shouldStopLoadingLatestStudies) {
if (this.latestStudiesIds.size < this.statistics.CountStudies) {
if (this['configuration/hasExtendedChanges']) {
if (this.hasExtendedChanges) {
if (!changesResponse["Done"]) {
setTimeout(() => {this.loadStudiesFromChange(changesResponse["First"], 1000)}, 1);
}
Expand Down
13 changes: 9 additions & 4 deletions WebApplication/src/orthancApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ export default {
await this.cancelFindStudies();
window.axiosFindStudiesAbortController = new AbortController();

let limit = store.state.configuration.uiOptions.MaxStudiesDisplayed;
if (store.state.configuration.hasExtendedFind) {
limit = store.state.configuration.uiOptions.PageLoadSize;
}

let payload = {
"Level": "Study",
"Limit": store.state.configuration.uiOptions.MaxStudiesDisplayed,
"Limit": limit,
"Query": filterQuery,
"RequestedTags": store.state.configuration.requestedTagsForStudyList,
"Expand": true
Expand All @@ -104,13 +109,13 @@ export default {
signal: window.axiosFindStudiesAbortController.signal
})).data;
},
async getMostRecentStudies(label) {
async getMostRecentStudiesExtended(label) {
await this.cancelFindStudies();
window.axiosFindStudiesAbortController = new AbortController();

let payload = {
"Level": "Study",
"Limit": store.state.configuration.uiOptions.MaxStudiesDisplayed,
"Limit": store.state.configuration.uiOptions.PageLoadSize,
"Query": {},
"RequestedTags": store.state.configuration.requestedTagsForStudyList,
"OrderBy" : [{
Expand Down Expand Up @@ -341,7 +346,7 @@ export default {
return (await axios.get(orthancApiUrl + "series/" + orthancId + "/instances")).data;
},
async getSeriesInstancesExtended(orthancId, since) {
const limit = store.state.configuration.uiOptions.MaxStudiesDisplayed;
const limit = store.state.configuration.uiOptions.PageLoadSize;
let payload = {
"Level": "Instance",
"Limit": limit,
Expand Down
21 changes: 5 additions & 16 deletions WebApplication/src/store/modules/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,13 @@ const state = () => ({
ohifDataSource: "dicom-web",
customLogoUrl: null,
hasCustomLogo: false,
requestedTagsForStudyList: []
requestedTagsForStudyList: [],
hasExtendedFind: false,
hasExtendedChanges: false,
})

///////////////////////////// GETTERS
const getters = {
hasExtendedFind: (state) => {
if ("Capabilities" in state.system){
return state.system.Capabilities.HasExtendedFind;
} else {
return false;
}
},
hasExtendedChanges: (state) => {
if ("Capabilities" in state.system){
return state.system.Capabilities.HasExtendedChanges;
} else {
return false;
}

}
}

///////////////////////////// MUTATIONS
Expand Down Expand Up @@ -82,6 +69,8 @@ const mutations = {
},
setSystem(state, { system }) {
state.system = system;
state.hasExtendedFind = "Capabilities" in state.system && state.system.Capabilities.HasExtendedFind;
state.hasExtendedChanges = "Capabilities" in state.system && state.system.Capabilities.HasExtendedChanges;
},
setLoaded(state) {
state.loaded = true;
Expand Down
7 changes: 6 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending changes in the mainline
Pending changes in the mainline (upcoming 1.7.0)
===============================

Changes:
Expand All @@ -8,6 +8,11 @@ Changes:
- Optimized loading of "most-recent" studies
- Load the following studies when scrolling to the bottom of the current list.
- New configuration "EnableLabelsCount" to enable/disable the display of the number of studies with each label.
- The "MaxStudiesDisplayed" configuration is not taken into account anymore for
the local study list since we have implemented "infinite-scroll". However, the option
is still used when performing remote DicomWEB queries.
- New configuration "PageLoadSize" that defines the number of items that are loaded when scrolling the study or instance list.

- Disable some UI components on ReadOnly systems.
- The study list header is now sticking on top of the screen.

Expand Down

0 comments on commit b5cb181

Please sign in to comment.