feat(handler): Add handler for unsupported sopclassUIDs (#3601)
This commit is contained in:
parent
de6976df3b
commit
f845f87716
@ -131,7 +131,7 @@ function PanelStudyBrowser({
|
|||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
|
||||||
// TODO: Is it okay that imageIds are not returned here for SR displaySets?
|
// TODO: Is it okay that imageIds are not returned here for SR displaySets?
|
||||||
if (imageId) {
|
if (imageId && !displaySet?.unsupported) {
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
imageId
|
imageId
|
||||||
@ -175,20 +175,22 @@ function PanelStudyBrowser({
|
|||||||
const displaySet = displaySetService.getDisplaySetByUID(
|
const displaySet = displaySetService.getDisplaySetByUID(
|
||||||
dSet.displaySetInstanceUID
|
dSet.displaySetInstanceUID
|
||||||
);
|
);
|
||||||
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
if (!displaySet?.unsupported) {
|
||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
||||||
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
|
||||||
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
if (imageId) {
|
if (imageId) {
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
imageId,
|
imageId,
|
||||||
dSet.initialViewport
|
dSet.initialViewport
|
||||||
);
|
);
|
||||||
if (isMounted.current) {
|
if (isMounted.current) {
|
||||||
setThumbnailImageSrcMap(prevState => {
|
setThumbnailImageSrcMap(prevState => {
|
||||||
return { ...prevState, ...newImageSrcEntry };
|
return { ...prevState, ...newImageSrcEntry };
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -308,7 +310,7 @@ function _mapDisplaySets(displaySets, thumbnailImageSrcMap) {
|
|||||||
.filter(ds => !ds.excludeFromThumbnailBrowser)
|
.filter(ds => !ds.excludeFromThumbnailBrowser)
|
||||||
.forEach(ds => {
|
.forEach(ds => {
|
||||||
const imageSrc = thumbnailImageSrcMap[ds.displaySetInstanceUID];
|
const imageSrc = thumbnailImageSrcMap[ds.displaySetInstanceUID];
|
||||||
const componentType = _getComponentType(ds.Modality);
|
const componentType = _getComponentType(ds);
|
||||||
|
|
||||||
const array =
|
const array =
|
||||||
componentType === 'thumbnail'
|
componentType === 'thumbnail'
|
||||||
@ -348,8 +350,8 @@ const thumbnailNoImageModalities = [
|
|||||||
'RTDOSE',
|
'RTDOSE',
|
||||||
];
|
];
|
||||||
|
|
||||||
function _getComponentType(Modality) {
|
function _getComponentType(ds) {
|
||||||
if (thumbnailNoImageModalities.includes(Modality)) {
|
if (thumbnailNoImageModalities.includes(ds.Modality) || ds?.unsupported) {
|
||||||
// TODO probably others.
|
// TODO probably others.
|
||||||
return 'thumbnailNoImage';
|
return 'thumbnailNoImage';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
import ImageSet from '@ohif/core/src/classes/ImageSet';
|
||||||
|
import { DisplaySetMessage, DisplaySetMessageList } from '@ohif/core';
|
||||||
|
/**
|
||||||
|
* Default handler for a instance list with an unsupported sopClassUID
|
||||||
|
*/
|
||||||
|
export default function getDisplaySetsFromUnsupportedSeries(instances) {
|
||||||
|
const imageSet = new ImageSet(instances);
|
||||||
|
const messages = new DisplaySetMessageList();
|
||||||
|
messages.addMessage(DisplaySetMessage.CODES.UNSUPPORTED_DISPLAYSET);
|
||||||
|
const instance = instances[0];
|
||||||
|
|
||||||
|
imageSet.setAttributes({
|
||||||
|
displaySetInstanceUID: imageSet.uid, // create a local alias for the imageSet UID
|
||||||
|
SeriesDate: instance.SeriesDate,
|
||||||
|
SeriesTime: instance.SeriesTime,
|
||||||
|
SeriesInstanceUID: instance.SeriesInstanceUID,
|
||||||
|
StudyInstanceUID: instance.StudyInstanceUID,
|
||||||
|
SeriesNumber: instance.SeriesNumber || 0,
|
||||||
|
FrameRate: instance.FrameTime,
|
||||||
|
SOPClassUID: instance.SOPClassUID,
|
||||||
|
SeriesDescription: instance.SeriesDescription || '',
|
||||||
|
Modality: instance.Modality,
|
||||||
|
numImageFrames: instances.length,
|
||||||
|
unsupported: true,
|
||||||
|
SOPClassHandlerId: 'unsupported',
|
||||||
|
isReconstructable: false,
|
||||||
|
messages,
|
||||||
|
});
|
||||||
|
return [imageSet];
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import ImageSet from '@ohif/core/src/classes/ImageSet';
|
|||||||
import isDisplaySetReconstructable from '@ohif/core/src/utils/isDisplaySetReconstructable';
|
import isDisplaySetReconstructable from '@ohif/core/src/utils/isDisplaySetReconstructable';
|
||||||
import { id } from './id';
|
import { id } from './id';
|
||||||
import getDisplaySetMessages from './getDisplaySetMessages';
|
import getDisplaySetMessages from './getDisplaySetMessages';
|
||||||
|
import getDisplaySetsFromUnsupportedSeries from './getDisplaySetsFromUnsupportedSeries';
|
||||||
|
|
||||||
const sopClassHandlerName = 'stack';
|
const sopClassHandlerName = 'stack';
|
||||||
|
|
||||||
@ -213,6 +214,11 @@ function getSopClassHandlerModule() {
|
|||||||
sopClassUids,
|
sopClassUids,
|
||||||
getDisplaySetsFromSeries,
|
getDisplaySetsFromSeries,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'not-supported-display-sets-handler',
|
||||||
|
sopClassUids: [],
|
||||||
|
getDisplaySetsFromSeries: getDisplaySetsFromUnsupportedSeries,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@ function PanelStudyBrowserTracking({
|
|||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
|
||||||
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
if (imageId) {
|
if (imageId && !displaySet?.unsupported) {
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
imageId
|
imageId
|
||||||
@ -212,23 +212,24 @@ function PanelStudyBrowserTracking({
|
|||||||
const displaySet = displaySetService.getDisplaySetByUID(
|
const displaySet = displaySetService.getDisplaySetByUID(
|
||||||
displaySetInstanceUID
|
displaySetInstanceUID
|
||||||
);
|
);
|
||||||
|
if (!displaySet?.unsupported) {
|
||||||
|
if (options.madeInClient) {
|
||||||
|
setJumpToDisplaySet(displaySetInstanceUID);
|
||||||
|
}
|
||||||
|
|
||||||
if (options.madeInClient) {
|
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
||||||
setJumpToDisplaySet(displaySetInstanceUID);
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
}
|
|
||||||
|
|
||||||
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
if (imageId) {
|
||||||
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
newImageSrcEntry[displaySetInstanceUID] = await getImageSrc(
|
||||||
if (imageId) {
|
imageId
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
);
|
||||||
newImageSrcEntry[displaySetInstanceUID] = await getImageSrc(
|
setThumbnailImageSrcMap(prevState => {
|
||||||
imageId
|
return { ...prevState, ...newImageSrcEntry };
|
||||||
);
|
});
|
||||||
setThumbnailImageSrcMap(prevState => {
|
}
|
||||||
return { ...prevState, ...newImageSrcEntry };
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -424,7 +425,7 @@ function _mapDisplaySets(
|
|||||||
.filter(ds => !ds.excludeFromThumbnailBrowser)
|
.filter(ds => !ds.excludeFromThumbnailBrowser)
|
||||||
.forEach(ds => {
|
.forEach(ds => {
|
||||||
const imageSrc = thumbnailImageSrcMap[ds.displaySetInstanceUID];
|
const imageSrc = thumbnailImageSrcMap[ds.displaySetInstanceUID];
|
||||||
const componentType = _getComponentType(ds.Modality);
|
const componentType = _getComponentType(ds);
|
||||||
const numPanes = viewportGridService.getNumViewportPanes();
|
const numPanes = viewportGridService.getNumViewportPanes();
|
||||||
const viewportIdentificator =
|
const viewportIdentificator =
|
||||||
numPanes === 1
|
numPanes === 1
|
||||||
@ -471,7 +472,7 @@ function _mapDisplaySets(
|
|||||||
|
|
||||||
if (componentType === 'thumbnailNoImage') {
|
if (componentType === 'thumbnailNoImage') {
|
||||||
if (dataSource.reject && dataSource.reject.series) {
|
if (dataSource.reject && dataSource.reject.series) {
|
||||||
thumbnailProps.canReject = true;
|
thumbnailProps.canReject = !ds?.unsupported;
|
||||||
thumbnailProps.onReject = () => {
|
thumbnailProps.onReject = () => {
|
||||||
uiDialogService.create({
|
uiDialogService.create({
|
||||||
id: 'ds-reject-sr',
|
id: 'ds-reject-sr',
|
||||||
@ -564,8 +565,8 @@ const thumbnailNoImageModalities = [
|
|||||||
'OT',
|
'OT',
|
||||||
];
|
];
|
||||||
|
|
||||||
function _getComponentType(Modality) {
|
function _getComponentType(ds) {
|
||||||
if (thumbnailNoImageModalities.includes(Modality)) {
|
if (thumbnailNoImageModalities.includes(ds.Modality) || ds?.unsupported) {
|
||||||
return 'thumbnailNoImage';
|
return 'thumbnailNoImage';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -280,6 +280,10 @@ function ViewerViewportGrid(props) {
|
|||||||
displaySetService.getDisplaySetByUID(displaySetInstanceUID) || {}
|
displaySetService.getDisplaySetByUID(displaySetInstanceUID) || {}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
).filter(
|
||||||
|
(displaySet) => {
|
||||||
|
return !displaySet?.unsupported;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const ViewportComponent = _getViewportComponent(
|
const ViewportComponent = _getViewportComponent(
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class DisplaySetMessage {
|
|||||||
INCONSISTENT_COMPONENTS: 10,
|
INCONSISTENT_COMPONENTS: 10,
|
||||||
INCONSISTENT_ORIENTATIONS: 11,
|
INCONSISTENT_ORIENTATIONS: 11,
|
||||||
INCONSISTENT_POSITION_INFORMATION: 12,
|
INCONSISTENT_POSITION_INFORMATION: 12,
|
||||||
|
UNSUPPORTED_DISPLAYSET: 13,
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(id: number) {
|
constructor(id: number) {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ export type DisplaySet = {
|
|||||||
StudyInstanceUID: string;
|
StudyInstanceUID: string;
|
||||||
SeriesInstanceUID?: string;
|
SeriesInstanceUID?: string;
|
||||||
numImages?: number;
|
numImages?: number;
|
||||||
|
unsupported?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const displaySetCache = new Map<string, DisplaySet>();
|
const displaySetCache = new Map<string, DisplaySet>();
|
||||||
@ -48,6 +49,7 @@ export default class DisplaySetService extends PubSubService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public activeDisplaySets = [];
|
public activeDisplaySets = [];
|
||||||
|
public unsuportedSOPClassHandler;
|
||||||
extensionManager: ExtensionManager;
|
extensionManager: ExtensionManager;
|
||||||
|
|
||||||
protected activeDisplaySetsMap = new Map<string, DisplaySet>();
|
protected activeDisplaySetsMap = new Map<string, DisplaySet>();
|
||||||
@ -58,6 +60,8 @@ export default class DisplaySetService extends PubSubService {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(EVENTS);
|
super(EVENTS);
|
||||||
|
this.unsuportedSOPClassHandler =
|
||||||
|
'@ohif/extension-default.sopClassHandlerModule.not-supported-display-sets-handler';
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(extensionManager, SOPClassHandlerIds): void {
|
public init(extensionManager, SOPClassHandlerIds): void {
|
||||||
@ -85,6 +89,14 @@ export default class DisplaySetService extends PubSubService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the handler for unsupported sop classes
|
||||||
|
* @param sopClassHandlerUID
|
||||||
|
*/
|
||||||
|
public setUnsuportedSOPClassHandler(sopClassHandler) {
|
||||||
|
this.unsuportedSOPClassHandler = sopClassHandler;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds new display sets directly, as specified.
|
* Adds new display sets directly, as specified.
|
||||||
* Use this function when the display sets are created externally directly
|
* Use this function when the display sets are created externally directly
|
||||||
@ -256,6 +268,47 @@ export default class DisplaySetService extends PubSubService {
|
|||||||
this.activeDisplaySetsMap.clear();
|
this.activeDisplaySetsMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function hides the old makeDisplaySetForInstances function to first
|
||||||
|
* separate the instances by sopClassUID so each call have only instances
|
||||||
|
* with the same sopClassUID, to avoid a series composed by different
|
||||||
|
* sopClassUIDs be filtered inside one of the SOPClassHandler functions and
|
||||||
|
* didn't appear in the series list.
|
||||||
|
* @param instancesSrc
|
||||||
|
* @param settings
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
public makeDisplaySetForInstances(
|
||||||
|
instancesSrc: InstanceMetadata[],
|
||||||
|
settings
|
||||||
|
): DisplaySet[] {
|
||||||
|
// creating a sopClassUID list and for each sopClass associate its respective
|
||||||
|
// instance list
|
||||||
|
const instancesForSetSOPClasses = instancesSrc.reduce(
|
||||||
|
(sopClassList, instance) => {
|
||||||
|
if (!(instance.SOPClassUID in sopClassList)) {
|
||||||
|
sopClassList[instance.SOPClassUID] = [];
|
||||||
|
}
|
||||||
|
sopClassList[instance.SOPClassUID].push(instance);
|
||||||
|
return sopClassList;
|
||||||
|
},
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
// for each sopClassUID, call the old makeDisplaySetForInstances with a
|
||||||
|
// instance list composed only by instances with the same sopClassUID and
|
||||||
|
// accumulate the displaySets in the variable allDisplaySets
|
||||||
|
const sopClasses = Object.keys(instancesForSetSOPClasses);
|
||||||
|
let allDisplaySets = [];
|
||||||
|
sopClasses.forEach(sopClass => {
|
||||||
|
const displaySets = this._makeDisplaySetForInstances(
|
||||||
|
instancesForSetSOPClasses[sopClass],
|
||||||
|
settings
|
||||||
|
);
|
||||||
|
allDisplaySets = [...allDisplaySets, ...displaySets];
|
||||||
|
});
|
||||||
|
return allDisplaySets;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new display sets for the instances contained in instancesSrc
|
* Creates new display sets for the instances contained in instancesSrc
|
||||||
* according to the sop class handlers registered.
|
* according to the sop class handlers registered.
|
||||||
@ -272,7 +325,7 @@ export default class DisplaySetService extends PubSubService {
|
|||||||
* @param settings are settings to add
|
* @param settings are settings to add
|
||||||
* @returns Array of the display sets added.
|
* @returns Array of the display sets added.
|
||||||
*/
|
*/
|
||||||
public makeDisplaySetForInstances(
|
private _makeDisplaySetForInstances(
|
||||||
instancesSrc: InstanceMetadata[],
|
instancesSrc: InstanceMetadata[],
|
||||||
settings
|
settings
|
||||||
): DisplaySet[] {
|
): DisplaySet[] {
|
||||||
@ -355,6 +408,26 @@ export default class DisplaySetService extends PubSubService {
|
|||||||
allDisplaySets.push(...displaySets);
|
allDisplaySets.push(...displaySets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// applying the default sopClassUID handler
|
||||||
|
if (allDisplaySets.length === 0) {
|
||||||
|
// applying hp-defined viewport settings to the displaysets
|
||||||
|
const handler = this.extensionManager.getModuleEntry(
|
||||||
|
this.unsuportedSOPClassHandler
|
||||||
|
);
|
||||||
|
const displaySets = handler.getDisplaySetsFromSeries(instances);
|
||||||
|
if (displaySets?.length) {
|
||||||
|
displaySets.forEach(ds => {
|
||||||
|
Object.keys(settings).forEach(key => {
|
||||||
|
ds[key] = settings[key];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this._addDisplaySetsToCache(displaySets);
|
||||||
|
this._addActiveDisplaySets(displaySets);
|
||||||
|
|
||||||
|
allDisplaySets.push(...displaySets);
|
||||||
|
}
|
||||||
|
}
|
||||||
return allDisplaySets;
|
return allDisplaySets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ interface IDisplaySet {
|
|||||||
StudyInstanceUID: string;
|
StudyInstanceUID: string;
|
||||||
SeriesInstanceUID?: string;
|
SeriesInstanceUID?: string;
|
||||||
SeriesNumber?: string;
|
SeriesNumber?: string;
|
||||||
|
unsupported?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default IDisplaySet;
|
export default IDisplaySet;
|
||||||
|
|||||||
@ -559,6 +559,13 @@ export default class HangingProtocolService extends PubSubService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViewportsRequireUpdate(viewportIndex, displaySetInstanceUID) {
|
getViewportsRequireUpdate(viewportIndex, displaySetInstanceUID) {
|
||||||
|
const { displaySetService } = this._servicesManager.services;
|
||||||
|
const displaySet = displaySetService.getDisplaySetByUID(
|
||||||
|
displaySetInstanceUID
|
||||||
|
);
|
||||||
|
if (displaySet?.unsupported) {
|
||||||
|
throw new Error('Unsupported displaySet');
|
||||||
|
}
|
||||||
const newDisplaySetInstanceUID = displaySetInstanceUID;
|
const newDisplaySetInstanceUID = displaySetInstanceUID;
|
||||||
const protocol = this.protocol;
|
const protocol = this.protocol;
|
||||||
const protocolStage = protocol.stages[this.stageIndex];
|
const protocolStage = protocol.stages[this.stageIndex];
|
||||||
@ -1431,7 +1438,7 @@ export default class HangingProtocolService extends PubSubService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const studyDisplaySets = this.displaySets.filter(
|
const studyDisplaySets = this.displaySets.filter(
|
||||||
it => it.StudyInstanceUID === study.StudyInstanceUID
|
it => it.StudyInstanceUID === study.StudyInstanceUID && !it?.unsupported
|
||||||
);
|
);
|
||||||
|
|
||||||
const studyMatchDetails = this.protocolEngine.findMatch(
|
const studyMatchDetails = this.protocolEngine.findMatch(
|
||||||
|
|||||||
@ -10,5 +10,6 @@
|
|||||||
"9": "DisplaySet has inconsistent dimensions between frames.",
|
"9": "DisplaySet has inconsistent dimensions between frames.",
|
||||||
"10": "DisplaySet has frames with inconsistent number of components.",
|
"10": "DisplaySet has frames with inconsistent number of components.",
|
||||||
"11": "DisplaySet has frames with inconsistent orientations.",
|
"11": "DisplaySet has frames with inconsistent orientations.",
|
||||||
"12": "DisplaySet has inconsistent position information."
|
"12": "DisplaySet has inconsistent position information.",
|
||||||
|
"13": "Unsupported displaySet."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,5 +10,6 @@
|
|||||||
"9": "Série possui dimensões inconsistentes entre frames.",
|
"9": "Série possui dimensões inconsistentes entre frames.",
|
||||||
"10": "Série possui frames com componentes inconsistentes.",
|
"10": "Série possui frames com componentes inconsistentes.",
|
||||||
"11": "Série possui frames com orientações inconsistentes.",
|
"11": "Série possui frames com orientações inconsistentes.",
|
||||||
"12": "Série possui informação de posição inconsistentes."
|
"12": "Série possui informação de posição inconsistentes.",
|
||||||
|
"13": "Série não suportada."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
const DisplaySetMessageListTooltip = ({ messages, id }): React.ReactNode => {
|
const DisplaySetMessageListTooltip = ({ messages, id }): React.ReactNode => {
|
||||||
const { t } = useTranslation('Messages');
|
const { t } = useTranslation('Messages');
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
if (messages.size()) {
|
if (messages?.size()) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Icon
|
<Icon
|
||||||
@ -29,7 +29,7 @@ const DisplaySetMessageListTooltip = ({ messages, id }): React.ReactNode => {
|
|||||||
arrow="center"
|
arrow="center"
|
||||||
parent={`#${id}`}
|
parent={`#${id}`}
|
||||||
>
|
>
|
||||||
<div className="bg-primary-dark border border-secondary-light text-white text-base rounded text-left max-w-40">
|
<div className="bg-primary-dark border border-secondary-light text-white text-base rounded text-left max-w-64">
|
||||||
<div
|
<div
|
||||||
className="break-normal text-base text-blue-300 font-bold"
|
className="break-normal text-base text-blue-300 font-bold"
|
||||||
style={{
|
style={{
|
||||||
@ -42,6 +42,7 @@ const DisplaySetMessageListTooltip = ({ messages, id }): React.ReactNode => {
|
|||||||
<ol
|
<ol
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '12px',
|
marginLeft: '12px',
|
||||||
|
marginRight: '12px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{messages.messages.map((message, index) => (
|
{messages.messages.map((message, index) => (
|
||||||
|
|||||||
@ -82,7 +82,7 @@ const Thumbnail = ({
|
|||||||
</div>
|
</div>
|
||||||
<DisplaySetMessageListTooltip
|
<DisplaySetMessageListTooltip
|
||||||
messages={messages}
|
messages={messages}
|
||||||
id={`display-set-tooltip-${seriesNumber}`}
|
id={`display-set-tooltip-${displaySetInstanceUID}`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-base text-white break-all">{description}</div>
|
<div className="text-base text-white break-all">{description}</div>
|
||||||
|
|||||||
@ -159,7 +159,7 @@ function _getModalityTooltip(modality) {
|
|||||||
const _modalityTooltips = {
|
const _modalityTooltips = {
|
||||||
SR: 'Structured Report',
|
SR: 'Structured Report',
|
||||||
SEG: 'Segmentation',
|
SEG: 'Segmentation',
|
||||||
RT: 'RT Structure Set',
|
RTSTRUCT: 'RT Structure Set',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ThumbnailList;
|
export default ThumbnailList;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { useDrag } from 'react-dnd';
|
|||||||
import Icon from '../Icon';
|
import Icon from '../Icon';
|
||||||
import Tooltip from '../Tooltip';
|
import Tooltip from '../Tooltip';
|
||||||
import Typography from '../Typography';
|
import Typography from '../Typography';
|
||||||
|
import DisplaySetMessageListTooltip from '../DisplaySetMessageListTooltip';
|
||||||
|
|
||||||
const ThumbnailNoImage = ({
|
const ThumbnailNoImage = ({
|
||||||
displaySetInstanceUID,
|
displaySetInstanceUID,
|
||||||
@ -57,23 +58,10 @@ const ThumbnailNoImage = ({
|
|||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<span className="ml-4 text-base text-blue-300">{seriesDate}</span>
|
<span className="ml-4 text-base text-blue-300">{seriesDate}</span>
|
||||||
{messages?.size() ? (
|
<DisplaySetMessageListTooltip
|
||||||
<div>
|
messages={messages}
|
||||||
<Tooltip
|
id={`display-set-tooltip-${displaySetInstanceUID}`}
|
||||||
position="left"
|
/>
|
||||||
tight={true}
|
|
||||||
content={
|
|
||||||
<div className="text-left max-w-40">
|
|
||||||
{messages.thumbnailContents()}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Icon name="notifications-warning" className="w-3 h-3" />
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row">
|
<div className="flex flex-row">
|
||||||
{canReject && (
|
{canReject && (
|
||||||
@ -107,7 +95,7 @@ ThumbnailNoImage.propTypes = {
|
|||||||
/** Must match the "type" a dropTarget expects */
|
/** Must match the "type" a dropTarget expects */
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
}),
|
}),
|
||||||
description: PropTypes.string.isRequired,
|
description: PropTypes.string,
|
||||||
modality: PropTypes.string.isRequired,
|
modality: PropTypes.string.isRequired,
|
||||||
/* Tooltip message to display when modality text is hovered */
|
/* Tooltip message to display when modality text is hovered */
|
||||||
modalityTooltip: PropTypes.string.isRequired,
|
modalityTooltip: PropTypes.string.isRequired,
|
||||||
|
|||||||
@ -198,7 +198,7 @@ ViewportActionBar.propTypes = {
|
|||||||
patientAge: PropTypes.string.isRequired,
|
patientAge: PropTypes.string.isRequired,
|
||||||
MRN: PropTypes.string.isRequired,
|
MRN: PropTypes.string.isRequired,
|
||||||
thickness: PropTypes.string.isRequired,
|
thickness: PropTypes.string.isRequired,
|
||||||
thicknessUnits: PropTypes.string.isRequired,
|
thicknessUnits: PropTypes.string,
|
||||||
spacing: PropTypes.string.isRequired,
|
spacing: PropTypes.string.isRequired,
|
||||||
scanner: PropTypes.string.isRequired,
|
scanner: PropTypes.string.isRequired,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user