Compare commits
3 Commits
auth-patch
...
coba-panel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca84179aa6 | ||
|
|
841f84bfdb | ||
|
|
02a1abc93f |
@@ -26,6 +26,8 @@ const SidePanelWithServices = ({
|
|||||||
const [sidePanelOpen, setSidePanelOpen] = useState(activeTabIndexProp !== null);
|
const [sidePanelOpen, setSidePanelOpen] = useState(activeTabIndexProp !== null);
|
||||||
const [activeTabIndex, setActiveTabIndex] = useState(activeTabIndexProp);
|
const [activeTabIndex, setActiveTabIndex] = useState(activeTabIndexProp);
|
||||||
const [tabs, setTabs] = useState(tabsProp ?? panelService.getPanels(side));
|
const [tabs, setTabs] = useState(tabsProp ?? panelService.getPanels(side));
|
||||||
|
const [studyInstanceUID, setStudyInstanceUID] = useState('');
|
||||||
|
const [lastActivatedStudyUID, setLastActivatedStudyUID] = useState('');
|
||||||
|
|
||||||
const handleActiveTabIndexChange = useCallback(({ activeTabIndex }) => {
|
const handleActiveTabIndexChange = useCallback(({ activeTabIndex }) => {
|
||||||
setActiveTabIndex(activeTabIndex);
|
setActiveTabIndex(activeTabIndex);
|
||||||
@@ -71,11 +73,35 @@ const SidePanelWithServices = ({
|
|||||||
const activatePanelSubscription = panelService.subscribe(
|
const activatePanelSubscription = panelService.subscribe(
|
||||||
panelService.EVENTS.ACTIVATE_PANEL,
|
panelService.EVENTS.ACTIVATE_PANEL,
|
||||||
(activatePanelEvent: Types.ActivatePanelEvent) => {
|
(activatePanelEvent: Types.ActivatePanelEvent) => {
|
||||||
if (sidePanelOpen || activatePanelEvent.forceActive) {
|
const isExpertisePanel = activatePanelEvent.panelId.includes('-exp-');
|
||||||
const tabIndex = tabs.findIndex(tab => tab.id === activatePanelEvent.panelId);
|
const realPanelID = isExpertisePanel
|
||||||
if (tabIndex !== -1) {
|
? activatePanelEvent.panelId.split('-exp-')[0]
|
||||||
setActiveTabIndex(tabIndex);
|
: activatePanelEvent.panelId;
|
||||||
}
|
|
||||||
|
// studyInstanceUID = take from activatePanelEvent.panelId after '-exp-
|
||||||
|
setStudyInstanceUID(isExpertisePanel ? activatePanelEvent.panelId.split('-exp-')[1] : null);
|
||||||
|
|
||||||
|
const tabIndex = tabs.findIndex(tab => tab.id === realPanelID);
|
||||||
|
|
||||||
|
if (isExpertisePanel && side === 'right') {
|
||||||
|
// Extract study UID from the panel ID
|
||||||
|
const currentStudyUID = activatePanelEvent.panelId.split('-exp-')[1];
|
||||||
|
|
||||||
|
// Toggle logic - close if same study is clicked again, open if different study
|
||||||
|
if (currentStudyUID === lastActivatedStudyUID && sidePanelOpen) {
|
||||||
|
// Same study - close panel
|
||||||
|
setSidePanelOpen(false);
|
||||||
|
setActiveTabIndex(null);
|
||||||
|
setLastActivatedStudyUID('');
|
||||||
|
} else {
|
||||||
|
// Different study or panel was closed - open panel with new study
|
||||||
|
setSidePanelOpen(true);
|
||||||
|
setActiveTabIndex(tabIndex !== -1 ? tabIndex : null);
|
||||||
|
setStudyInstanceUID(currentStudyUID);
|
||||||
|
setLastActivatedStudyUID(currentStudyUID);
|
||||||
|
}
|
||||||
|
} else if (tabIndex !== -1) {
|
||||||
|
setActiveTabIndex(tabIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -83,7 +109,7 @@ const SidePanelWithServices = ({
|
|||||||
return () => {
|
return () => {
|
||||||
activatePanelSubscription.unsubscribe();
|
activatePanelSubscription.unsubscribe();
|
||||||
};
|
};
|
||||||
}, [tabs, sidePanelOpen, panelService]);
|
}, [tabs, sidePanelOpen, panelService, lastActivatedStudyUID]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidePanel
|
<SidePanel
|
||||||
@@ -95,6 +121,8 @@ const SidePanelWithServices = ({
|
|||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
onActiveTabIndexChange={handleActiveTabIndexChange}
|
onActiveTabIndexChange={handleActiveTabIndexChange}
|
||||||
expandedWidth={expandedWidth}
|
expandedWidth={expandedWidth}
|
||||||
|
servicesManager={servicesManager} // Pass servicesManager ke SidePanel
|
||||||
|
studyInstanceUID={studyInstanceUID}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ window.config = {
|
|||||||
// above, the number of requests can be go a lot higher.
|
// above, the number of requests can be go a lot higher.
|
||||||
prefetch: 25,
|
prefetch: 25,
|
||||||
},
|
},
|
||||||
expertise: true, //* Tambahan untuk enable expertise (CustomizableViewportOverlay)
|
expertise: false, //* Tambahan untuk enable expertise (CustomizableViewportOverlay)
|
||||||
|
expertise_host: `http://${window.location.hostname}`, //* Tambahan untuk fetch data Expertise)
|
||||||
// filterQueryParam: false,
|
// filterQueryParam: false,
|
||||||
// defaultDataSourceName: 'dicomweb',
|
// defaultDataSourceName: 'dicomweb',
|
||||||
defaultDataSourceName: 'local-proxy',
|
defaultDataSourceName: 'local-proxy',
|
||||||
@@ -38,100 +39,14 @@ window.config = {
|
|||||||
// regex: /.*/,
|
// regex: /.*/,
|
||||||
// },
|
// },
|
||||||
dataSources: [
|
dataSources: [
|
||||||
{
|
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
|
||||||
sourceName: 'dicomweb',
|
|
||||||
configuration: {
|
|
||||||
friendlyName: 'AWS S3 Static wado server',
|
|
||||||
name: 'aws',
|
|
||||||
wadoUriRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
wadoRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoSupportsIncludeField: false,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
enableStudyLazyLoad: true,
|
|
||||||
supportsFuzzyMatching: false,
|
|
||||||
supportsWildcard: true,
|
|
||||||
staticWado: true,
|
|
||||||
singlepart: 'bulkdata,video',
|
|
||||||
// whether the data source should use retrieveBulkData to grab metadata,
|
|
||||||
// and in case of relative path, what would it be relative to, options
|
|
||||||
// are in the series level or study level (some servers like series some study)
|
|
||||||
bulkDataURI: {
|
|
||||||
enabled: true,
|
|
||||||
relativeResolution: 'studies',
|
|
||||||
transform: url => url.replace('/pixeldata.mp4', '/rendered'),
|
|
||||||
},
|
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
|
||||||
sourceName: 'ohif2',
|
|
||||||
configuration: {
|
|
||||||
friendlyName: 'AWS S3 Static wado secondary server',
|
|
||||||
name: 'aws',
|
|
||||||
wadoUriRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
wadoRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoSupportsIncludeField: false,
|
|
||||||
supportsReject: false,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
enableStudyLazyLoad: true,
|
|
||||||
supportsFuzzyMatching: false,
|
|
||||||
supportsWildcard: true,
|
|
||||||
staticWado: true,
|
|
||||||
singlepart: 'bulkdata,video',
|
|
||||||
// whether the data source should use retrieveBulkData to grab metadata,
|
|
||||||
// and in case of relative path, what would it be relative to, options
|
|
||||||
// are in the series level or study level (some servers like series some study)
|
|
||||||
bulkDataURI: {
|
|
||||||
enabled: true,
|
|
||||||
relativeResolution: 'studies',
|
|
||||||
},
|
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
|
||||||
sourceName: 'ohif3',
|
|
||||||
configuration: {
|
|
||||||
friendlyName: 'AWS S3 Static wado secondary server',
|
|
||||||
name: 'aws',
|
|
||||||
wadoUriRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
|
|
||||||
qidoRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
|
|
||||||
wadoRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
|
|
||||||
qidoSupportsIncludeField: false,
|
|
||||||
supportsReject: false,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
enableStudyLazyLoad: true,
|
|
||||||
supportsFuzzyMatching: false,
|
|
||||||
supportsWildcard: true,
|
|
||||||
staticWado: true,
|
|
||||||
singlepart: 'bulkdata,video',
|
|
||||||
// whether the data source should use retrieveBulkData to grab metadata,
|
|
||||||
// and in case of relative path, what would it be relative to, options
|
|
||||||
// are in the series level or study level (some servers like series some study)
|
|
||||||
bulkDataURI: {
|
|
||||||
enabled: true,
|
|
||||||
relativeResolution: 'studies',
|
|
||||||
},
|
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
||||||
sourceName: 'local-proxy',
|
sourceName: 'local-proxy',
|
||||||
configuration: {
|
configuration: {
|
||||||
friendlyName: 'Static WADO Local Data',
|
friendlyName: 'Static WADO Local Data',
|
||||||
name: 'DCM4CHEE',
|
name: 'DCM4CHEE',
|
||||||
qidoRoot: 'http://128.199.154.150:5000/rs',
|
qidoRoot: `http://${window.location.hostname}:5050/rs`,
|
||||||
wadoRoot: 'http://128.199.154.150:5000/rs',
|
wadoRoot: `http://${window.location.hostname}:5050/rs`,
|
||||||
qidoSupportsIncludeField: false,
|
qidoSupportsIncludeField: false,
|
||||||
supportsReject: true,
|
supportsReject: true,
|
||||||
supportsStow: true,
|
supportsStow: true,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|||||||
import { Icons } from '../Icons';
|
import { Icons } from '../Icons';
|
||||||
import { TooltipTrigger, TooltipContent, TooltipProvider, Tooltip } from '../Tooltip';
|
import { TooltipTrigger, TooltipContent, TooltipProvider, Tooltip } from '../Tooltip';
|
||||||
import { Separator } from '../Separator';
|
import { Separator } from '../Separator';
|
||||||
|
import { ScrollArea } from '../ScrollArea';
|
||||||
|
|
||||||
type StyleMap = {
|
type StyleMap = {
|
||||||
open: {
|
open: {
|
||||||
@@ -152,10 +153,23 @@ const SidePanel = ({
|
|||||||
onClose,
|
onClose,
|
||||||
expandedWidth = 280,
|
expandedWidth = 280,
|
||||||
onActiveTabIndexChange,
|
onActiveTabIndexChange,
|
||||||
|
servicesManager, // Tambah servicesManager as a prop
|
||||||
|
studyInstanceUID,
|
||||||
}) => {
|
}) => {
|
||||||
const [panelOpen, setPanelOpen] = useState(activeTabIndexProp !== null);
|
const [panelOpen, setPanelOpen] = useState(activeTabIndexProp !== null);
|
||||||
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
||||||
|
|
||||||
|
const [isExpertiseVisible, setIsExpertiseVisible] = useState(false); // New state for expertise visibility
|
||||||
|
const [expertiseData, setExpertiseData] = useState(null);
|
||||||
|
const [isExpertiseLoading, setIsExpertiseLoading] = useState(false);
|
||||||
|
|
||||||
|
const { cornerstoneViewportService } = servicesManager.services;
|
||||||
|
const [viewportData, setViewportData] = useState(null);
|
||||||
|
|
||||||
|
// Harusnya (viewportId), tapi karena gabutuh perubahan viewport maka dihardcode 'default'
|
||||||
|
// const viewportInfo = cornerstoneViewportService.getViewportInfo('default');
|
||||||
|
// const studyInstanceUID = viewportInfo?.viewportData?.data?.[0]?.StudyInstanceUID || '';
|
||||||
|
|
||||||
const styleMap = createStyleMap(expandedWidth, borderSize, collapsedWidth);
|
const styleMap = createStyleMap(expandedWidth, borderSize, collapsedWidth);
|
||||||
const baseStyle = createBaseStyle(expandedWidth);
|
const baseStyle = createBaseStyle(expandedWidth);
|
||||||
const gridAvailableWidth = expandedWidth - closeIconWidth - gridHorizontalPadding;
|
const gridAvailableWidth = expandedWidth - closeIconWidth - gridHorizontalPadding;
|
||||||
@@ -196,6 +210,16 @@ const SidePanel = ({
|
|||||||
updateActiveTabIndex(activeTabIndexProp);
|
updateActiveTabIndex(activeTabIndexProp);
|
||||||
}, [activeTabIndexProp, updateActiveTabIndex]);
|
}, [activeTabIndexProp, updateActiveTabIndex]);
|
||||||
|
|
||||||
|
const toggleExpertiseVisibility = () => {
|
||||||
|
const shouldOpenExpertise = !isExpertiseVisible;
|
||||||
|
setIsExpertiseVisible(shouldOpenExpertise);
|
||||||
|
|
||||||
|
// Open the side panel if the expertise panel is being shown
|
||||||
|
if (shouldOpenExpertise && !panelOpen) {
|
||||||
|
updatePanelOpen(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const getCloseStateComponent = () => {
|
const getCloseStateComponent = () => {
|
||||||
const _childComponents = Array.isArray(tabs) ? tabs : [tabs];
|
const _childComponents = Array.isArray(tabs) ? tabs : [tabs];
|
||||||
return (
|
return (
|
||||||
@@ -255,6 +279,191 @@ const SidePanel = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Tambahkan di atas useEffect fetchExpertiseData
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchAccessionNumber = async () => {
|
||||||
|
if (!studyInstanceUID) {
|
||||||
|
console.warn('No StudyInstanceUID available');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const qidoRootUrl = getQidoRootUrl();
|
||||||
|
if (!qidoRootUrl) {
|
||||||
|
console.warn('QIDO root URL not configured');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch data with specific fields including Accession Number
|
||||||
|
const response = await fetch(
|
||||||
|
`${qidoRootUrl}/studies?includefield=00080050&StudyInstanceUID=${studyInstanceUID}`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Failed to fetch study data');
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
// Extract accession number from DICOM tag 00080050
|
||||||
|
const accessionNumber = data[0]['00080050']?.Value?.[0] || '';
|
||||||
|
|
||||||
|
// If we have an accession number, call fetchExpertiseData
|
||||||
|
if (accessionNumber) {
|
||||||
|
console.log('Found Accession Number:', accessionNumber);
|
||||||
|
fetchExpertiseData(accessionNumber);
|
||||||
|
} else {
|
||||||
|
console.warn('Accession number not found in study data');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn('No study data returned');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching accession number:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Helper function to get QIDO root URL
|
||||||
|
const getQidoRootUrl = () => {
|
||||||
|
const { config } = window;
|
||||||
|
if (!config?.dataSources || !config.defaultDataSourceName) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const dataSource = config.dataSources.find(
|
||||||
|
ds => ds.sourceName === config.defaultDataSourceName
|
||||||
|
);
|
||||||
|
|
||||||
|
return dataSource?.configuration?.qidoRoot;
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchAccessionNumber();
|
||||||
|
}, [studyInstanceUID]); // Run when studyInstanceUID changes
|
||||||
|
|
||||||
|
// Ubah fungsi fetchExpertiseData menjadi dengan parameter accessionNumber
|
||||||
|
const fetchExpertiseData = async accessionNumber => {
|
||||||
|
try {
|
||||||
|
// Check if window.config.expertise_host exists
|
||||||
|
if (!window.config?.expertise_host) {
|
||||||
|
console.warn('Expertise host not configured in window.config.expertise_host');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!accessionNumber) {
|
||||||
|
console.warn('No accession number available for expertise lookup');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsExpertiseLoading(true);
|
||||||
|
const url = `${window.config.expertise_host}/nv/query.php?method=view&AccessionNumber=${encodeURIComponent(accessionNumber)}`;
|
||||||
|
|
||||||
|
const response = await fetch(url);
|
||||||
|
const data = await response.json();
|
||||||
|
console.log('Study data:', data);
|
||||||
|
|
||||||
|
if (data?.study?.expertise && data.study.expertise.length > 0) {
|
||||||
|
setExpertiseData(data.study.expertise[0]);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching expertise data:', error);
|
||||||
|
} finally {
|
||||||
|
setIsExpertiseLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getExpertisePanel = () => {
|
||||||
|
if (side !== 'right') return null; // Only show in the right side panel
|
||||||
|
|
||||||
|
if (isExpertiseLoading) {
|
||||||
|
return (
|
||||||
|
<div className="flex h-[500px] w-[350px] items-center justify-center text-white">
|
||||||
|
Loading expertise data...
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!expertiseData) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parseExpertise = text => {
|
||||||
|
if (!text) return {};
|
||||||
|
|
||||||
|
const result = {};
|
||||||
|
let currentSection = 'Keterangan';
|
||||||
|
|
||||||
|
// Split expertise text by lines and process each line
|
||||||
|
const lines = text.split('\r\n').filter(line => line.trim() !== '');
|
||||||
|
|
||||||
|
lines.forEach(line => {
|
||||||
|
// Check if this is a section header
|
||||||
|
if (line.includes(':') && !line.trim().startsWith('-')) {
|
||||||
|
const parts = line.split(':');
|
||||||
|
currentSection = parts[0].trim();
|
||||||
|
const value = parts[1]?.trim() || '';
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
if (!result[currentSection]) {
|
||||||
|
result[currentSection] = [];
|
||||||
|
}
|
||||||
|
result[currentSection].push(value);
|
||||||
|
}
|
||||||
|
} else if (line.toLowerCase().includes('kesan')) {
|
||||||
|
currentSection = 'Kesan';
|
||||||
|
} else {
|
||||||
|
// Add line to current section
|
||||||
|
if (!result[currentSection]) {
|
||||||
|
result[currentSection] = [];
|
||||||
|
}
|
||||||
|
result[currentSection].push(line.trim());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
const parsedSections = parseExpertise(expertiseData.expertise);
|
||||||
|
|
||||||
|
// Create formatted data structure
|
||||||
|
const formattedData = [
|
||||||
|
{ label: 'Dokter Pengirim', value: expertiseData.ordering_physician || '' },
|
||||||
|
{ label: 'Dokter Radiologis', value: expertiseData.radiologist || '' },
|
||||||
|
{ label: 'Waktu Expertise', value: expertiseData.expertise_dttm || '' },
|
||||||
|
];
|
||||||
|
|
||||||
|
// Add additional sections from parsed text
|
||||||
|
Object.entries(parsedSections).forEach(([key, value]) => {
|
||||||
|
formattedData.push({
|
||||||
|
label: key,
|
||||||
|
value: Array.isArray(value) ? value : [value],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScrollArea className="border-input bg-background h-[500px] w-[350px] rounded-md border p-2 text-sm text-white">
|
||||||
|
<h3 className="mb-4 text-lg font-bold">Expertise</h3>
|
||||||
|
{formattedData.map((section, index) => (
|
||||||
|
<div
|
||||||
|
key={index}
|
||||||
|
className="mb-4"
|
||||||
|
>
|
||||||
|
<h5 className="text-base font-bold">{section.label}:</h5>
|
||||||
|
{Array.isArray(section.value) ? (
|
||||||
|
<ul className="list-disc pl-6">
|
||||||
|
{section.value.map((item, idx) => (
|
||||||
|
<li key={idx}>{item}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
) : (
|
||||||
|
<p>{section.value}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</ScrollArea>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const getCloseIcon = () => {
|
const getCloseIcon = () => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -386,6 +595,7 @@ const SidePanel = ({
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
})}
|
})}
|
||||||
|
{getExpertisePanel()} {/* Add expertise panel here */}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<React.Fragment>{getCloseStateComponent()}</React.Fragment>
|
<React.Fragment>{getCloseStateComponent()}</React.Fragment>
|
||||||
@@ -413,6 +623,8 @@ SidePanel.propTypes = {
|
|||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func,
|
||||||
onActiveTabIndexChange: PropTypes.func,
|
onActiveTabIndexChange: PropTypes.func,
|
||||||
expandedWidth: PropTypes.number,
|
expandedWidth: PropTypes.number,
|
||||||
|
servicesManager: PropTypes.object.isRequired, // Tambah servicesManager prop
|
||||||
|
studyInstanceUID: PropTypes.string, // Tambahkan prop studyInstanceUID
|
||||||
};
|
};
|
||||||
|
|
||||||
export { SidePanel };
|
export { SidePanel };
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ const StudyBrowser = ({
|
|||||||
data-cy="thumbnail-list"
|
data-cy="thumbnail-list"
|
||||||
viewPreset={viewPreset}
|
viewPreset={viewPreset}
|
||||||
onThumbnailContextMenu={onThumbnailContextMenu}
|
onThumbnailContextMenu={onThumbnailContextMenu}
|
||||||
|
servicesManager={servicesManager} // Pass servicesManager ke Study Item
|
||||||
|
studyInstanceUid={studyInstanceUid}
|
||||||
/>
|
/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,7 +20,11 @@ const StudyItem = ({
|
|||||||
onClickUntrack,
|
onClickUntrack,
|
||||||
viewPreset = 'thumbnails',
|
viewPreset = 'thumbnails',
|
||||||
onThumbnailContextMenu,
|
onThumbnailContextMenu,
|
||||||
|
servicesManager, // Tambah servicesManager as a prop
|
||||||
|
studyInstanceUid = '',
|
||||||
}: withAppTypes) => {
|
}: withAppTypes) => {
|
||||||
|
// FETCHING ACCESSION NUMBER DAN EXPERTISE
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Accordion
|
<Accordion
|
||||||
type="single"
|
type="single"
|
||||||
@@ -55,15 +59,33 @@ const StudyItem = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isExpanded && displaySets && (
|
{isExpanded && displaySets && (
|
||||||
<ThumbnailList
|
<>
|
||||||
thumbnails={displaySets}
|
{/* Expertise Button */}
|
||||||
activeDisplaySetInstanceUIDs={activeDisplaySetInstanceUIDs}
|
<div
|
||||||
onThumbnailClick={onClickThumbnail}
|
className="bg-primary-dark hover:bg-primary-active mx-8 my-4 cursor-pointer rounded-lg border border-white py-3 text-center text-white"
|
||||||
onThumbnailDoubleClick={onDoubleClickThumbnail}
|
onClick={() => {
|
||||||
onClickUntrack={onClickUntrack}
|
// Trigger the expertise panel in the right side panel (segmentation Panel)
|
||||||
viewPreset={viewPreset}
|
servicesManager.services.panelService.activatePanel(
|
||||||
onThumbnailContextMenu={onThumbnailContextMenu}
|
// '@ohif/extension-cornerstone.panelModule.panelSegmentation-exp',
|
||||||
/>
|
`@ohif/extension-cornerstone.panelModule.panelSegmentation-exp-${studyInstanceUid}`,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Expertise
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Thumbnails */}
|
||||||
|
<ThumbnailList
|
||||||
|
thumbnails={displaySets}
|
||||||
|
activeDisplaySetInstanceUIDs={activeDisplaySetInstanceUIDs}
|
||||||
|
onThumbnailClick={onClickThumbnail}
|
||||||
|
onThumbnailDoubleClick={onDoubleClickThumbnail}
|
||||||
|
onClickUntrack={onClickUntrack}
|
||||||
|
viewPreset={viewPreset}
|
||||||
|
onThumbnailContextMenu={onThumbnailContextMenu}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
@@ -86,6 +108,8 @@ StudyItem.propTypes = {
|
|||||||
onDoubleClickThumbnail: PropTypes.func,
|
onDoubleClickThumbnail: PropTypes.func,
|
||||||
onClickUntrack: PropTypes.func,
|
onClickUntrack: PropTypes.func,
|
||||||
viewPreset: PropTypes.string,
|
viewPreset: PropTypes.string,
|
||||||
|
servicesManager: PropTypes.object.isRequired, // Tambah servicesManager prop
|
||||||
|
studyInstanceUid: PropTypes.string.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { StudyItem };
|
export { StudyItem };
|
||||||
|
|||||||
Reference in New Issue
Block a user