ohif-viewer/extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/utils/getLabelFromDCMJSImportedToolData.js
Danny Brown 2a51d75f77
[OHIF-339] - workflow changes (#1931)
* workflow changes

* Cherry pick OHIF-310 into this PR.

* fix label bug and dead code

* remove comment

* Wire up CreateReportButton

* fix additionalFindingTypes + save interaction

* Remove unused createReportAsync call

* stub for report hydration prompt

* Update PR

* Remove debuggers

* push updated code

* Push updates

* push

* fix sidebar save

* enable tracking of new study or series

* fix for duplicate created report series in sidebard

* fix for unexpected viewport dialog after visiting study list then a new study

* Fix for hydration not marking multiple series as active

* Reviewer changes.

* Respond to final review comment, add series description setting for export.

Co-authored-by: James A. Petts <jamesapetts@gmail.com>
2020-08-04 10:11:23 +01:00

24 lines
760 B
JavaScript

/**
* Extracts the label from the toolData imported from dcmjs. We need to do this
* as dcmjs does not depeend on OHIF/the MeasurementService, it just produces data for cornestoneTools.
* This optional data is available for the consumer to process if they wish to.
* @param {object} toolData The tooldata relating to the
*
* @returns {string} The extracted label.
*/
export default function getLabelFromDCMJSImportedToolData(toolData) {
const { findingSites = [], finding } = toolData;
let freeTextLabel = findingSites.find(
fs => fs.CodeValue === 'CORNERSTONEFREETEXT'
);
if (freeTextLabel) {
return freeTextLabel.CodeMeaning;
}
if (finding && finding.CodeValue === 'CORNERSTONEFREETEXT') {
return finding.CodeMeaning;
}
}