ohif-viewer/src/routes/IHEInvokeImageDisplay.js

44 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-05-29 14:39:54 +02:00
import React from 'react';
import PropTypes from 'prop-types';
import ViewerRetrieveStudyData from '../connectedComponents/ViewerRetrieveStudyData.js';
2018-12-14 15:23:48 +01:00
function IHEInvokeImageDisplay({ match }) {
2019-05-29 14:39:54 +02:00
const requestType = match.params.query.requestType;
let studyInstanceUids;
//let patientUids;
let displayStudyList = false;
2019-05-29 14:39:54 +02:00
if (requestType === 'STUDY') {
studyInstanceUids = match.params.query.studyUID.split(';');
} else if (requestType === 'STUDYBASE64') {
const uids = this.params.query.studyUID;
const decodedData = window.atob(uids);
studyInstanceUids = decodedData.split(';');
} else if (requestType === 'PATIENT') {
//patientUidspatientUids = this.params.query.patientID.split(';');
displayStudyList = true;
} else {
displayStudyList = true;
}
2018-12-14 15:23:48 +01:00
2019-05-29 14:39:54 +02:00
if (displayStudyList) {
return ''; //<StudyList patientUids={patientUids}/>);
}
2018-12-14 15:23:48 +01:00
2019-05-29 14:39:54 +02:00
return <ViewerRetrieveStudyData studyInstanceUids={studyInstanceUids} />;
2018-12-14 15:23:48 +01:00
}
IHEInvokeImageDisplay.propTypes = {
2019-05-29 14:39:54 +02:00
match: PropTypes.shape({
params: PropTypes.shape({
query: PropTypes.shape({
requestType: PropTypes.string.isRequired,
studyUID: PropTypes.string,
patientID: PropTypes.string,
}),
}),
}),
};
2018-12-14 15:23:48 +01:00
export default IHEInvokeImageDisplay;