feat(findingSite): Allow customizing the measurement panel and show site/finding (#3155)

* feat: Allow customizing the measurements panel.

Also includes default display of the site/finding values from the DICOM
SR object.

Update fixes

PR review comments - move the recordInteraction to COmmandsManager.run

PR fixes

fix: Dependency updates to allow right click to be recognized

PR fixes

* Use newer CSWIL

* Make both the base measurements and the tracking measurements show codes

* Fix the right click context menu bringing up menu
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-03-24 16:45:21 -04:00
1 parent dd22e37e4c
commit 8e9d7bd2bb
10 files changed
+152 -48

No files matched your search

@@ -218,6 +218,7 @@ export default function PanelMeasurementTable({
>
<MeasurementTable
title="Measurements"
servicesManager={servicesManager}
data={displayMeasurements}
onClick={jumpToImage}
onEdit={onMeasurementItemEditHandler}
@@ -248,14 +249,46 @@ function _getMappedMeasurements(measurementService) {
return mappedMeasurements;
}
/**
* Map the measurements to the display text.
* Adds finding and site inforamtion to the displayText and/or label,
* and provides as 'displayText' and 'label', while providing the original
* values as baseDisplayText and baseLabel
*/
function _mapMeasurementToDisplay(measurement, index, types) {
const { displayText, uid, label, type, selected } = measurement;
const {
displayText: baseDisplayText,
uid,
label: baseLabel,
type,
selected,
findingSites,
finding,
} = measurement;
const firstSite = findingSites?.[0];
const label = baseLabel || finding?.text || firstSite?.text || '(empty)';
let displayText = baseDisplayText || [];
if (findingSites) {
const siteText = [];
findingSites.forEach(site => {
if (site?.text !== label) siteText.push(site.text);
});
displayText = [...siteText, ...displayText];
}
if (finding && finding?.text !== label) {
displayText = [finding.text, ...displayText];
}
return {
uid,
label: label || '(empty)',
label,
baseLabel,
measurementType: type,
displayText: displayText || [],
displayText,
baseDisplayText,
isActive: selected,
finding,
findingSites,
};
}