Skip to content

Commit

Permalink
Fix Web UI Plugin Settings Files Not Handled Properly / Include Patie…
Browse files Browse the repository at this point in the history
…ntID in study view entries (#680)

* Return settings in servlet response; Pass settings into registered plugin.

* studyView.js - insert patientid into study entries

* series uid->image view; study uid -> series view

* Update dicoogle/src/main/resources/webapp/js/components/search/result/imageView.js

---------

Co-authored-by: Eduardo Pinho <[email protected]>
  • Loading branch information
tiberio-baptista and Enet4 committed Dec 1, 2023
1 parent 57ebdcf commit 03655ab
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ private String getPluginsBySlot(HttpServletRequest req, String... slotIds) throw
List<String> pkgList = new ArrayList<>(plugins.size());
for (WebUIPlugin plugin : plugins) {

String pkg = PluginController.getInstance().getWebUIPackageJSON(plugin.getName());
JSONObject pkgObject =
JSONObject.fromObject(PluginController.getInstance().getWebUIPackageJSON(plugin.getName()));
pkgObject.put("settings", plugin.getSettings());

String pkg = pkgObject.toString();
if (pkg == null) {
logger.warn("Ignoring web plugin {}", plugin.getName());
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ const ImageView = createReactClass({
// deprecated data properties
"data-result-type": "image",
"data-result-uri": item.uri,
"data-result-uid": item.sopInstanceUID
"data-result-uid": item.sopInstanceUID,
"data-result-seriesuid": item.serieuid
}}
/>
</div>
Expand Down Expand Up @@ -183,8 +184,14 @@ const ImageView = createReactClass({

render: function() {
let self = this;

var resultArray = this.props.serie.images;

for (let i = 0; i < resultArray.length; i++){
resultArray[i]['serieuid'] = this.props.serie.serieInstanceUID;
}


var selectRowProp = {
clickToSelect: true,
mode: "none",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ const SeriesView = createReactClass({
uid: item.serieInstanceUID,
// deprecated data fields
"data-result-type": "series",
"data-result-uid": item.serieInstanceUID
"data-result-uid": item.serieInstanceUID,
"data-result-studyuid": item.studyuid
}}
/>
</div>
Expand Down Expand Up @@ -156,6 +157,10 @@ const SeriesView = createReactClass({

var resultArray = this.props.study.series;

for (let i = 0; i < resultArray.length; i++){
resultArray[i]['studyuid'] = this.props.study.studyInstanceUID;
}

var selectRowProp = {
clickToSelect: true,
mode: "none",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ const StudyView = createReactClass({
uid: item.studyInstanceUID,
// deprecated data fields
"data-result-type": "study",
"data-result-uid": item.studyInstanceUID
"data-result-uid": item.studyInstanceUID,
"data-result-patientid": item.patientid
}}
/>
</div>
Expand Down Expand Up @@ -141,6 +142,9 @@ const StudyView = createReactClass({
var self = this;
var resultArray = this.props.patient.studies;

for (let i = 0; i < resultArray.length; i++)
resultArray[i]['patientid'] = this.props.patient.id;

var selectRowProp = {
clickToSelect: true,
mode: "none",
Expand Down
3 changes: 2 additions & 1 deletion webcore/src/dicoogle-webcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,14 @@ export const fetchModules = m.fetchModules;
pluginInstance.Name = name;
pluginInstance.SlotId = slotId;
pluginInstance.Caption = thisPackage.dicoogle.caption || name;
pluginInstance.Settings = thisPackage.settings;
plugins[name] = pluginInstance;
if (slots[slotId]) {
for (let slot of slots[slotId]) {
slot.attachPlugin(pluginInstance);
}
}
const eventData = {name, slotId, caption: pluginInstance.Caption};
const eventData = {name, slotId, caption: pluginInstance.Caption, settings: pluginInstance.Settings};
event_hub.emit('load', eventData);
};
export const onRegister = m.onRegister;
Expand Down

0 comments on commit 03655ab

Please sign in to comment.