feat(google-cloud): Add support for Google Cloud Healthcare API DICOM Store Switch (#325)

* NOTASK: PoC for loading data from Healthcare API

* NOTASK: PoC for loading data from Healthcare API fix

* Add sample dialog for loading test dicom-picker

* Fix incorrect promise resolving

* NOTASK: PoC for loading dicom store

* Add web-components as git submodules. (Probably will be changed later)

* Add rough dicomStore picker

* Add dataset selector

* NOTASK: QIDO metadata first draft

* NOTASK: Not Implemented error for color images

* NOTASK: clean-up

* Dicom files uploader intermediate version

* NOTASK: Accept header

* NOTASK: docker configs

* NOTASK: fix

* NOTASK: howTo

* Add draft of DICOM uploader

* Add missing files

* Fix error with missing clientId

* Update submodule

* NOTASK: HowTo

* NOTASK: config for dev

* NOTASK: new docker file

* clean-up

* Update GCP web-components

* Add integration with async web components

* Fix errors in nginx.conf

* Structured reports views basic implementation

* NOTASK: qido -> wado

* NOTASK: config fix

* NOTASK: dirty copy-paste implementation

* Add "Change dicom store" button.
Add an ability to clear date.
Fix bug, when OAuth dosn't work if URL is not /

* Fix studylist filtering

* Fix dockerfile

* NOTASK: meteor update

* NOTASK: fix of package structure

* NOTASK: merge fix

* improvements

Move check for now SR into SR modal
Use simple button to open SR modal
Remove button styling
cleanup

* copy SR data retrieval to wado

* make search of SR simpler

* Codestyle fix

* NOTASK: palette color error message

* Fix date filter.
Fix server settings on first loading.
Add SR and PS buttons

* NOTASK: PS is now hidden by default

* NOTASK: dirty solution

* NOTASK:  new wadoimage lib version

* Fix PS and SR buttons

* Make modal dialogs vertically centered

* Update web components. Quick UI fixes

* Add missing files to the previous commit

* NOTASK:  show-hide for PS

* NOTASK:  show-hide for PS

* NOTASK:  fix of min-max PixelValue bug

* Add "sign out" functionality for Google OAuth. Update web-components.

* intermediate commit

* Add demo signin page

* Beautifying demo sign in page

* NOTASK:  merge

* NOTASK:  clean-up

* Use npm for getting healthcare-api-adapter instead of git submodule.

* NOTASK:  clean-up

* meteor update

* clean-up

* clean-up

* Clean up code

* Update healthcare-api-adapter version. Add location to dicom store path. Fix buttons style.

* Downgrade meteor and packages to master version. Use meteor-build-client-fixed2
This commit is contained in:
Egor Lezhnin authored and Erik Ziegler committed 2019-03-22 16:42:26 +01:00
1 parent 1783351f57
commit 9486522552
68 files changed
+1422 -514

No files matched your search

@@ -23,6 +23,8 @@
</div>
{{/section}}
{{/header}}
{{>Template.dynamic template=(choose this.template 'studylist') data=this}}
{{#if isStudyListReady}}
{{>Template.dynamic template=(choose this.template 'studylist') data=this}}
{{/if}}
</template>
@@ -8,6 +8,7 @@ import { OHIF } from 'meteor/ohif:core';
Template.ohifViewer.onCreated(() => {
const instance = Template.instance();
instance.headerClasses = new ReactiveVar('');
Session.set("IsStudyListReady", true);;
const headerItems = [{
action: () => OHIF.ui.showDialog('serverInformationModal'),
@@ -31,9 +32,11 @@ Template.ohifViewer.onCreated(() => {
icon: 'fa fa-info'
}];
if (OHIF.user.userLoggedIn() === true) {
const isUserLoggedIn = OHIF.user.userLoggedIn();
const isDemoUserLoggedIn = OHIF.demoMode && OHIF.demoMode.userLoggedIn();
if (isUserLoggedIn || isDemoUserLoggedIn) {
headerItems.push({
action: OHIF.user.logout,
action: isDemoUserLoggedIn ? OHIF.demoMode.logout : OHIF.user.logout,
text: 'Logout',
iconClasses: 'logout',
iconSvgUse: 'packages/ohif_viewerbase/assets/user-menu-icons.svg#logout'
@@ -57,6 +60,24 @@ Template.ohifViewer.onCreated(() => {
// Set the viewer open state on session
Session.set('ViewerOpened', isViewer);
});
if (OHIF.demoMode && OHIF.demoMode.userLoggedIn())
OHIF.demoMode.setDemoServerConfig();
else if (OHIF.gcloud && OHIF.gcloud.isEnabled()) {
const server = OHIF.servers.getCurrentServer();
if (!server || !server.isCloud) {
Session.set("IsStudyListReady", false);
OHIF.gcloud.showDicomStorePicker({canClose: OHIF.demoMode}).then(config => {
if (!config) {
if (OHIF.demoMode)
Router.go('/demo-signin');
return;
}
OHIF.servers.applyCloudServerConfig(config);
Session.set("IsStudyListReady", true);
});
}
}
});
Template.ohifViewer.events({
@@ -72,7 +93,8 @@ Template.ohifViewer.events({
Router.go('viewerStudies', { studyInstanceUids });
}
}
}
},
});
Template.ohifViewer.helpers({
@@ -86,5 +108,8 @@ Template.ohifViewer.helpers({
}
return instance.hasViewerData ? 'Back to viewer' : '';
},
isStudyListReady() {
return !!Session.get('IsStudyListReady');
}
});
@@ -0,0 +1,11 @@
<template name="structuredReportModal">
{{#dialogForm (extend this
id='structuredReportModal'
dialogClass='themed modal-lg'
title='Structured report'
hideCancel=true
hideConfirm=true
)}}
<div id="root"></div>
{{/dialogForm}}
</template>
@@ -0,0 +1,91 @@
import { $ } from 'meteor/jquery';
import { OHIF } from 'meteor/ohif:core';
Template.structuredReportModal.onRendered(() => {
const structuredReport = getStructureReport();
render(structuredReport);
});
// FIXME: we use just 1st SR for current study for now
function getStructureReport() {
let structuredReport;
OHIF.viewer.StudyMetadataList.find(studyMetadata => {
structuredReport = studyMetadata.findInstance(instance => instance.getData().modality === 'SR');
// If SR is found stop the search
return !!structuredReport;
});
return structuredReport;
}
function render(structureReport) {
const root = $('#root');
if (structureReport) {
renderStructuredReport(root, structureReport.getData());
} else {
renderNoData(root);
}
}
function renderStructuredReport(root, data) {
root.append(getMainDataHtml(data));
root.append(getContentSequenceHtml(data.contentSequence));
}
function renderNoData(root) {
root.append('<div>No structured report found</div>');
}
function getMainDataHtml(data) {
const root = $('<div></div>');
const { completionFlag, verificationFlag, manufacturer, contentDateTime } = data;
if (completionFlag) {
root.append(getMainDataItemHtml('Completion flag', completionFlag));
}
if (verificationFlag) {
root.append(getMainDataItemHtml('Verification flag', verificationFlag));
}
if (manufacturer) {
root.append(getMainDataItemHtml('Manufacturer', manufacturer));
}
if (contentDateTime) {
root.append(getMainDataItemHtml('Content Date/Time', contentDateTime));
}
return root;
}
const getContentSequenceHtml = (data, level = 1) => {
const root = $('<div></div>');
const header = data.header;
const items = data.items || [];
if (header) {
root.append(`<h${level}>${header}</h${level}>`);
}
items.forEach(item => {
root.append(
item instanceof Object
? getContentSequenceHtml(item, level + 1)
: `<div>${item}</div>`
);
});
return root;
}
function getMainDataItemHtml(key, value) {
return $(`<div><b>${key}</b>: ${value}</div>`);
}
@@ -261,6 +261,22 @@ Template.toolbarSection.helpers({
buttonTemplateName: 'layoutButton'
});
buttonData.push({
id: 'sr',
title: 'SR',
classes: 'imageViewerTool',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-sr'
});
buttonData.push({
id: 'ps',
title: 'PS',
iconClasses: 'fa fa-th-large',
classes: 'imageViewerTool',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-ps'
});
buttonData.push({
id: 'toggleMore',
title: 'More',
@@ -318,4 +334,4 @@ Template.toolbarSection.onRendered(function() {
}
}
}
});
});