no expertise btn on only ecg file

This commit is contained in:
mario
2025-07-10 14:29:16 +07:00
parent 14f3eee2c4
commit 506e052fe3
2 changed files with 99 additions and 21 deletions

View File

@@ -23,9 +23,9 @@ window.config = {
// above, the number of requests can be go a lot higher.
prefetch: 25,
},
expertise_host: `http://10.9.10.86`, // IP ke NV di PACS Server, untuk fetch expertise bawaan versi NV
pacs_document_host: `10.9.10.86`, // IP ke NV di PACS Server untuk ambil pdf
pacs_document_port: 8080,
expertise_host: `http://152.42.173.210`, // IP ke NV di PACS Server, untuk fetch expertise bawaan versi NV
pacs_document_host: `152.42.173.210`, // IP ke NV di PACS Server untuk ambil pdf
pacs_document_port: 8585,
defaultDataSourceName: 'local-proxy',
dataSources: [
{
@@ -34,8 +34,8 @@ window.config = {
configuration: {
friendlyName: 'Static WADO Local Data',
name: 'DCM4CHEE',
qidoRoot: `http://10.9.10.86:5000/rs`, // IP ke dicomweb-proxy PACS Server. URI selalu /rs
wadoRoot: `http://10.9.10.86:5000/rs`, // IP ke dicomweb-proxy PACS Server. URI selalu /rs
qidoRoot: `http://152.42.173.210:5000/rs`, // IP ke dicomweb-proxy PACS Server. URI selalu /rs
wadoRoot: `http://152.42.173.210:5000/rs`, // IP ke dicomweb-proxy PACS Server. URI selalu /rs
qidoSupportsIncludeField: false,
supportsReject: true,
supportsStow: true,

View File

@@ -1,4 +1,4 @@
import React from 'react';
import React, { useMemo, useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { ThumbnailList } from '../ThumbnailList';
@@ -23,7 +23,85 @@ const StudyItem = ({
servicesManager, // Tambah servicesManager as a prop
studyInstanceUid = '',
}: withAppTypes) => {
// FETCHING ACCESSION NUMBER DAN EXPERTISE
const prevShowExpertiseRef = useRef(false);
/*
* V1: If the display sets only contain ECG or PDFs, don't show expertise button
* Tips: use .every
*/
const shouldShowExpertiseButton = useMemo(() => {
// If no display sets, don't show expertise by default
if (!displaySets?.length) {
return false;
}
// Check if all display sets are ECG or PDF
const allECGOrPDF = displaySets.every(
ds => ds.modality === 'ECG' || (ds.modality === 'OT' && ds.description === 'PDF')
);
// If all display sets are ECG or PDF, don't show expertise button
return !allECGOrPDF;
}, [displaySets]);
/*
* V2: Show expertise button only if:
* - There are display sets and active display set
* - The active display set is not ECG or PDF
* - If the active display is ECG, don't show expertise button and close the panel reset expertise panel
*
* This logic ensures that the expertise button is shown only when appropriate.
TODO: Need to fix this logic
*/
// const shouldShowExpertiseButton = useMemo(() => {
// // If no display sets or no active display set, didnt show expertise by default
// if (!displaySets?.length || !activeDisplaySetInstanceUIDs?.length) {
// return false;
// }
// // Get the active display set UID (first item in the array)
// const activeUID = activeDisplaySetInstanceUIDs[0];
// // Find the active display set
// const activeDisplaySet = displaySets.find(ds => ds.displaySetInstanceUID === activeUID);
// // If active display set not found, show expertise button
// if (!activeDisplaySet) {
// return false;
// }
// // Hide expertise button for ECG
// if (activeDisplaySet.modality === 'ECG') {
// return false;
// }
// // Hide expertise button for PDFs
// if (activeDisplaySet.modality === 'OT' && activeDisplaySet.description === 'PDF') {
// return false;
// }
// // Default to showing expertise
// return true;
// }, [displaySets, activeDisplaySetInstanceUIDs]);
// console.log('Display sets:', displaySets);
// console.log('Prev show expertise:', prevShowExpertiseRef.current);
// console.log('Current show expertise button:', shouldShowExpertiseButton);
// // TODO: Fix this logic
// // Kalau ganti dari Series yang ada Expertise ke Series yang tidak ada Expertise, deactivate panel (jarang terjadi) (masih bug)
// useEffect(() => {
// // If changing from true to false
// if (prevShowExpertiseRef.current === true && shouldShowExpertiseButton === false) {
// servicesManager.services.panelService.activatePanel(
// `@ohif/extension-cornerstone.panelModule.panelSegmentation-exp-${studyInstanceUid}`,
// true
// );
// }
// // Update ref with current value for next comparison
// prevShowExpertiseRef.current = shouldShowExpertiseButton;
// }, [shouldShowExpertiseButton, servicesManager, studyInstanceUid]);
return (
<Accordion
@@ -60,20 +138,20 @@ const StudyItem = ({
>
{isExpanded && displaySets && (
<>
{/* Expertise Button */}
<div
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"
onClick={() => {
// Trigger the expertise panel in the right side panel (segmentation Panel)
servicesManager.services.panelService.activatePanel(
// '@ohif/extension-cornerstone.panelModule.panelSegmentation-exp',
`@ohif/extension-cornerstone.panelModule.panelSegmentation-exp-${studyInstanceUid}`,
true
);
}}
>
Expertise
</div>
{/* Expertise Button - Only show if not ECG */}
{shouldShowExpertiseButton && (
<div
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"
onClick={() => {
servicesManager.services.panelService.activatePanel(
`@ohif/extension-cornerstone.panelModule.panelSegmentation-exp-${studyInstanceUid}`,
true
);
}}
>
Expertise
</div>
)}
{/* Thumbnails */}
<ThumbnailList