[OHIF-177] - JSDocs (#1818)

* OHIF-177 JSDocs.

* Add proxy for activeDataSource to extensionManager.
This commit is contained in:
James Petts 2020-06-26 10:01:13 +01:00 committed by GitHub
parent 1a065855f2
commit 81a764a78f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -82,6 +82,11 @@ const storeMeasurementsOld = async (measurementData, filter, server) => {
} }
}; };
/**
*
* @param {object[]} measurementData An array of measurements from the measurements service
* that you wish to serialize.
*/
const downloadReport = measurementData => { const downloadReport = measurementData => {
const srDataset = generateReport(measurementData); const srDataset = generateReport(measurementData);
const reportBlob = dcmjs.data.datasetToBlob(srDataset); const reportBlob = dcmjs.data.datasetToBlob(srDataset);
@ -91,6 +96,11 @@ const downloadReport = measurementData => {
window.location.assign(objectUrl); window.location.assign(objectUrl);
}; };
/**
*
* @param {object[]} measurementData An array of measurements from the measurements service
* that you wish to serialize.
*/
const generateReport = measurementData => { const generateReport = measurementData => {
const ids = measurementData.map(md => md.id); const ids = measurementData.map(md => md.id);
const filteredToolState = _getFilteredCornerstoneToolState(ids); const filteredToolState = _getFilteredCornerstoneToolState(ids);
@ -103,6 +113,12 @@ const generateReport = measurementData => {
return report.dataset; return report.dataset;
}; };
/**
*
* @param {object[]} measurementData An array of measurements from the measurements service
* that you wish to serialize.
* @param {object} dataSource The dataSource that you wish to use to persist the data.
*/
const storeMeasurements = async (measurementData, dataSource) => { const storeMeasurements = async (measurementData, dataSource) => {
// TODO -> Eventually use the measurements directly and not the dcmjs adapter, // TODO -> Eventually use the measurements directly and not the dcmjs adapter,
// But it is good enough for now whilst we only have cornerstone as a datasource. // But it is good enough for now whilst we only have cornerstone as a datasource.

View File

@ -137,6 +137,7 @@ export default class ExtensionManager {
getDataSources = dataSourceName => { getDataSources = dataSourceName => {
if (dataSourceName === undefined) { if (dataSourceName === undefined) {
// Default to the activeDataSource
dataSourceName = this.activeDataSource; dataSourceName = this.activeDataSource;
} }
@ -144,6 +145,10 @@ export default class ExtensionManager {
return this.dataSourceMap[dataSourceName]; return this.dataSourceMap[dataSourceName];
}; };
getActiveDataSource = () => {
return this.activeDataSource;
};
/** /**
* @private * @private
* @param {string} moduleType * @param {string} moduleType