How to use the @ohif/core.log.error function in @ohif/core

To help you get started, we’ve selected a few @ohif/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OHIF / Viewers / platform / viewer / src / lib / DICOMSR / dataExchange.js View on Github external
const firstMeasurementKey = Object.keys(measurementData)[0];
  const firstMeasurement = measurementData[firstMeasurementKey][0];
  const studyInstanceUid =
    firstMeasurement && firstMeasurement.studyInstanceUid;

  try {
    await stowSRFromMeasurements(measurementData, serverUrl);
    if (studyInstanceUid) {
      studies.deleteStudyMetadataPromise(studyInstanceUid);
    }

    return {
      message: 'Measurements were saved with success',
    };
  } catch (error) {
    log.error(`[DICOMSR] Error while saving the measurements: ${error.message}`);
    throw new Error('Error while saving the measurements.');
  }
};
github OHIF / Viewers / platform / viewer / src / lib / DICOMSR / dataExchange.js View on Github external
const storeMeasurements = async (measurementData, filter, server) => {
  log.info('[DICOMSR] storeMeasurements');

  if (!server || server.type !== 'dicomWeb') {
    log.error('[DICOMSR] DicomWeb server is required!');
    return Promise.reject({});
  }

  const serverUrl = server.wadoRoot;
  const firstMeasurementKey = Object.keys(measurementData)[0];
  const firstMeasurement = measurementData[firstMeasurementKey][0];
  const studyInstanceUid =
    firstMeasurement && firstMeasurement.studyInstanceUid;

  try {
    await stowSRFromMeasurements(measurementData, serverUrl);
    if (studyInstanceUid) {
      studies.deleteStudyMetadataPromise(studyInstanceUid);
    }

    return {