ohif-viewer/src/routes/IHEInvokeImageDisplay.js

46 lines
1.4 KiB
JavaScript
Raw Normal View History

import React from "react";
2018-12-14 15:23:48 +01:00
import PropTypes from "prop-types";
import ViewerRetrieveStudyData from "../connectedComponents/ViewerRetrieveStudyData.js";
2018-12-14 15:23:48 +01:00
function IHEInvokeImageDisplay({ match }) {
const requestType = match.params.query.requestType;
let studyInstanceUids;
//let patientUids;
2018-12-14 15:23:48 +01:00
let displayStudyList = false;
2018-12-14 15:23:48 +01: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(';');
2018-12-14 15:23:48 +01:00
displayStudyList = true
} else {
displayStudyList = true
}
if (displayStudyList) {
return ('')//<StudyList patientUids={patientUids}/>);
2018-12-14 15:23:48 +01:00
}
return (
<ViewerRetrieveStudyData studyInstanceUids={studyInstanceUids}/>
2018-12-14 15:23:48 +01:00
);
}
IHEInvokeImageDisplay.propTypes = {
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;