-
Notifications
You must be signed in to change notification settings - Fork 0
/
19.bundle.9dab19b5807a225691f6.js.map
1 lines (1 loc) · 114 KB
/
19.bundle.9dab19b5807a225691f6.js.map
1
{"version":3,"file":"19.bundle.9dab19b5807a225691f6.js","mappings":"iLAGA,MAAMA,GACO,EADPA,EAEI,EAFJA,EAGW,EAHXA,EAIQ,EAJRA,EAKkB,EALlBA,EAMe,EANfA,EAOY,EAGZC,EAAuB,CAC3BC,GAAI,sBACJC,QAAS,OACTC,QAAS,CACPC,iBAAkB,KAClBC,aAAc,GACdC,cAAe,GACfC,cAAe,GAEfC,iBAAkB,GAClBC,kBAAmB,GACnBC,kBAAmB,GAEnBC,4BAA6B,GAC7BC,SAAS,GAEXC,OAAQ,CACNC,IAAK,CACHC,KAAM,SAERC,KAAM,CACJC,MAAO,eACPC,GAAI,CACFC,aAAc,sBAEdC,mBAAoB,CAClB,CACEC,OAAQ,WACRC,QAAS,CAAC,mCAAoC,uBAGlDC,kBAAmB,CACjBF,OAAQ,gCACRG,KAAM,qCAERC,0BAA2B,gCAC3BC,WAAY,0BACZC,0BAA2B,CACzBL,SAASM,EAAAA,EAAAA,IAAO,CACdxB,iBAAkBA,CAACyB,EAAGC,IAAUA,EAAM1B,sBAK9C2B,oBAAqB,CACnBC,OAAQ,CACNC,IAAK,sBACLC,OAAQ,CACN,CACEb,OAAQ,WACRC,QAAS,CAAC,2BAA4B,cACtCE,KAAM,2BAER,CACEH,OAAQ,MACRG,KAAM,qBAER,CACEH,OAAQ,SAGZc,QAAS,CACPd,OAAQ,UAIde,SAAU,CACRlB,GAAI,CACFC,aAAc,CACZ,CACEE,OAAQ,sBACRG,KAAM,cAER,CACEH,OAAQ,uBACRG,KAAM,gBAGVa,eAAgB,CACd,CACEhB,OAAQ,WACRC,QAAS,CAAC,sBAAuB,cACjCE,KAAM,6BAER,CACEH,OAAQ,SAGZD,mBAAoB,CAClB,CACEC,OAAQ,WACRC,QAAS,CAAC,sCAGdgB,YAAa,mBACbC,UAA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BACNgT,SAAU,aACVC,UAAW,UACXxM,MAAO,eACPyM,UAAWzF,EAA8B5O,KAAK,KAAM,CAClD7E,kBACAzB,mBACAD,qBAIR,E,oOC/BA,MAAM6a,EAAY5W,EAAAA,MAAW,IACpB,iCAGH6W,EAA0BC,GAE5B9W,EAAAA,cAACA,EAAAA,SAAc,CAAC+W,SAAU/W,EAAAA,cAAA,WAAK,eAC7BA,EAAAA,cAAC4W,EAAcE,IAyBrB,QApBA,SAA0Bhb,GAAyD,IAAxD,gBAAEC,EAAe,gBAAE0B,EAAe,iBAAEzB,GAAkBF,EAY/E,MAAO,CACL,CACE2H,KAAM,sBACNkT,UAd4CG,GAE5C9W,EAAAA,cAAC6W,EAAuBG,EAAA,CACtBjb,gBAAiBA,EACjB0B,gBAAiBA,EACjBzB,iBAAkBA,GACd8a,KAWZ,EChBA,EAXqC,CAInCphB,G,4DCPSuhB,GDSTC,iBAAgB,IAChBC,eAAc,EACdC,kBAAiBA,E","sources":["webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/measurementTrackingMachine.js","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/promptBeginTracking.js","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/promptTrackNewSeries.js","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/promptTrackNewStudy.js","webpack:///../../../extensions/measurement-tracking/src/_shared/getNextSRSeriesNumber.js","webpack:///../../../extensions/measurement-tracking/src/_shared/PROMPT_RESPONSES.js","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/promptSaveReport.js","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/promptHydrateStructuredReport.js","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/hydrateStructuredReport.tsx","webpack:///../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/TrackedMeasurementsContext.tsx","webpack:///../../../extensions/measurement-tracking/src/getContextModule.tsx","webpack:///../../../extensions/measurement-tracking/src/panels/PanelStudyBrowserTracking/PanelStudyBrowserTracking.tsx","webpack:///../../../extensions/measurement-tracking/src/panels/PanelStudyBrowserTracking/getImageSrcFromImageId.js","webpack:///../../../extensions/measurement-tracking/src/panels/PanelStudyBrowserTracking/requestDisplaySetCreationForStudy.js","webpack:///../../../extensions/measurement-tracking/src/panels/PanelStudyBrowserTracking/index.tsx","webpack:///../../../extensions/measurement-tracking/src/panels/PanelMeasurementTableTracking/ActionButtons.tsx","webpack:///../../../extensions/measurement-tracking/src/panels/PanelMeasurementTableTracking/index.tsx","webpack:///../../../extensions/measurement-tracking/src/getPanelModule.tsx","webpack:///../../../extensions/measurement-tracking/src/getViewportModule.tsx","webpack:///../../../extensions/measurement-tracking/src/index.tsx","webpack:///../../../extensions/measurement-tracking/src/id.js"],"sourcesContent":["import { hydrateStructuredReport } from '@ohif/extension-cornerstone-dicom-sr';\nimport { assign } from 'xstate';\n\nconst RESPONSE = {\n NO_NEVER: -1,\n CANCEL: 0,\n CREATE_REPORT: 1,\n ADD_SERIES: 2,\n SET_STUDY_AND_SERIES: 3,\n NO_NOT_FOR_SERIES: 4,\n HYDRATE_REPORT: 5,\n};\n\nconst machineConfiguration = {\n id: 'measurementTracking',\n initial: 'idle',\n context: {\n activeViewportId: null,\n trackedStudy: '',\n trackedSeries: [],\n ignoredSeries: [],\n //\n prevTrackedStudy: '',\n prevTrackedSeries: [],\n prevIgnoredSeries: [],\n //\n ignoredSRSeriesForHydration: [],\n isDirty: false,\n },\n states: {\n off: {\n type: 'final',\n },\n idle: {\n entry: 'clearContext',\n on: {\n TRACK_SERIES: 'promptBeginTracking',\n // Unused? We may only do PROMPT_HYDRATE_SR now?\n SET_TRACKED_SERIES: [\n {\n target: 'tracking',\n actions: ['setTrackedStudyAndMultipleSeries', 'setIsDirtyToClean'],\n },\n ],\n PROMPT_HYDRATE_SR: {\n target: 'promptHydrateStructuredReport',\n cond: 'hasNotIgnoredSRSeriesForHydration',\n },\n RESTORE_PROMPT_HYDRATE_SR: 'promptHydrateStructuredReport',\n HYDRATE_SR: 'hydrateStructuredReport',\n UPDATE_ACTIVE_VIEWPORT_ID: {\n actions: assign({\n activeViewportId: (_, event) => event.activeViewportId,\n }),\n },\n },\n },\n promptBeginTracking: {\n invoke: {\n src: 'promptBeginTracking',\n onDone: [\n {\n target: 'tracking',\n actions: ['setTrackedStudyAndSeries', 'setIsDirty'],\n cond: 'shouldSetStudyAndSeries',\n },\n {\n target: 'off',\n cond: 'shouldKillMachine',\n },\n {\n target: 'idle',\n },\n ],\n onError: {\n target: 'idle',\n },\n },\n },\n tracking: {\n on: {\n TRACK_SERIES: [\n {\n target: 'promptTrackNewStudy',\n cond: 'isNewStudy',\n },\n {\n target: 'promptTrackNewSeries',\n cond: 'isNewSeries',\n },\n ],\n UNTRACK_SERIES: [\n {\n target: 'tracking',\n actions: ['removeTrackedSeries', 'setIsDirty'],\n cond: 'hasRemainingTrackedSeries',\n },\n {\n target: 'idle',\n },\n ],\n SET_TRACKED_SERIES: [\n {\n target: 'tracking',\n actions: ['setTrackedStudyAndMultipleSeries'],\n },\n ],\n SAVE_REPORT: 'promptSaveReport',\n SET_DIRTY: [\n {\n target: 'tracking',\n actions: ['setIsDirty'],\n cond: 'shouldSetDirty',\n },\n {\n target: 'tracking',\n },\n ],\n },\n },\n promptTrackNewSeries: {\n invoke: {\n src: 'promptTrackNewSeries',\n onDone: [\n {\n target: 'tracking',\n actions: ['addTrackedSeries', 'setIsDirty'],\n cond: 'shouldAddSeries',\n },\n {\n target: 'tracking',\n actions: [\n 'discardPreviouslyTrackedMeasurements',\n 'setTrackedStudyAndSeries',\n 'setIsDirty',\n ],\n cond: 'shouldSetStudyAndSeries',\n },\n {\n target: 'promptSaveReport',\n cond: 'shouldPromptSaveReport',\n },\n {\n target: 'tracking',\n },\n ],\n onError: {\n target: 'idle',\n },\n },\n },\n promptTrackNewStudy: {\n invoke: {\n src: 'promptTrackNewStudy',\n onDone: [\n {\n target: 'tracking',\n actions: [\n 'discardPreviouslyTrackedMeasurements',\n 'setTrackedStudyAndSeries',\n 'setIsDirty',\n ],\n cond: 'shouldSetStudyAndSeries',\n },\n {\n target: 'tracking',\n actions: ['ignoreSeries'],\n cond: 'shouldAddIgnoredSeries',\n },\n {\n target: 'promptSaveReport',\n cond: 'shouldPromptSaveReport',\n },\n {\n target: 'tracking',\n },\n ],\n onError: {\n target: 'idle',\n },\n },\n },\n promptSaveReport: {\n invoke: {\n src: 'promptSaveReport',\n onDone: [\n // \"clicked the save button\"\n // - should clear all measurements\n // - show DICOM SR\n {\n target: 'idle',\n actions: ['clearAllMeasurements', 'showStructuredReportDisplaySetInActiveViewport'],\n cond: 'shouldSaveAndContinueWithSameReport',\n },\n // \"starting a new report\"\n // - remove \"just saved\" measurements\n // - start tracking a new study + report\n {\n target: 'tracking',\n actions: ['discardPreviouslyTrackedMeasurements', 'setTrackedStudyAndSeries'],\n cond: 'shouldSaveAndStartNewReport',\n },\n // Cancel, back to tracking\n {\n target: 'tracking',\n },\n ],\n onError: {\n target: 'idle',\n },\n },\n },\n promptHydrateStructuredReport: {\n invoke: {\n src: 'promptHydrateStructuredReport',\n onDone: [\n {\n target: 'tracking',\n actions: [\n 'setTrackedStudyAndMultipleSeries',\n 'jumpToFirstMeasurementInActiveViewport',\n 'setIsDirtyToClean',\n ],\n cond: 'shouldHydrateStructuredReport',\n },\n {\n target: 'idle',\n actions: ['ignoreHydrationForSRSeries'],\n cond: 'shouldIgnoreHydrationForSR',\n },\n ],\n onError: {\n target: 'idle',\n },\n },\n },\n hydrateStructuredReport: {\n invoke: {\n src: 'hydrateStructuredReport',\n onDone: [\n {\n target: 'tracking',\n actions: [\n 'setTrackedStudyAndMultipleSeries',\n 'jumpToFirstMeasurementInActiveViewport',\n 'setIsDirtyToClean',\n ],\n },\n ],\n onError: {\n target: 'idle',\n },\n },\n },\n },\n strict: true,\n};\n\nconst defaultOptions = {\n services: {\n promptBeginTracking: (ctx, evt) => {\n // return { userResponse, StudyInstanceUID, SeriesInstanceUID }\n },\n promptTrackNewStudy: (ctx, evt) => {\n // return { userResponse, StudyInstanceUID, SeriesInstanceUID }\n },\n promptTrackNewSeries: (ctx, evt) => {\n // return { userResponse, StudyInstanceUID, SeriesInstanceUID }\n },\n },\n actions: {\n discardPreviouslyTrackedMeasurements: (ctx, evt) => {\n console.log('discardPreviouslyTrackedMeasurements: not implemented');\n },\n clearAllMeasurements: (ctx, evt) => {\n console.log('clearAllMeasurements: not implemented');\n },\n jumpToFirstMeasurementInActiveViewport: (ctx, evt) => {\n console.warn('jumpToFirstMeasurementInActiveViewport: not implemented');\n },\n showStructuredReportDisplaySetInActiveViewport: (ctx, evt) => {\n console.warn('showStructuredReportDisplaySetInActiveViewport: not implemented');\n },\n clearContext: assign({\n trackedStudy: '',\n trackedSeries: [],\n ignoredSeries: [],\n prevTrackedStudy: '',\n prevTrackedSeries: [],\n prevIgnoredSeries: [],\n }),\n // Promise resolves w/ `evt.data.*`\n setTrackedStudyAndSeries: assign((ctx, evt) => ({\n prevTrackedStudy: ctx.trackedStudy,\n prevTrackedSeries: ctx.trackedSeries.slice(),\n prevIgnoredSeries: ctx.ignoredSeries.slice(),\n //\n trackedStudy: evt.data.StudyInstanceUID,\n trackedSeries: [evt.data.SeriesInstanceUID],\n ignoredSeries: [],\n })),\n setTrackedStudyAndMultipleSeries: assign((ctx, evt) => {\n const studyInstanceUID = evt.StudyInstanceUID || evt.data.StudyInstanceUID;\n const seriesInstanceUIDs = evt.SeriesInstanceUIDs || evt.data.SeriesInstanceUIDs;\n\n return {\n prevTrackedStudy: ctx.trackedStudy,\n prevTrackedSeries: ctx.trackedSeries.slice(),\n prevIgnoredSeries: ctx.ignoredSeries.slice(),\n //\n trackedStudy: studyInstanceUID,\n trackedSeries: [...ctx.trackedSeries, ...seriesInstanceUIDs],\n ignoredSeries: [],\n };\n }),\n setIsDirtyToClean: assign((ctx, evt) => ({\n isDirty: false,\n })),\n setIsDirty: assign((ctx, evt) => ({\n isDirty: true,\n })),\n ignoreSeries: assign((ctx, evt) => ({\n prevIgnoredSeries: [...ctx.ignoredSeries],\n ignoredSeries: [...ctx.ignoredSeries, evt.data.SeriesInstanceUID],\n })),\n ignoreHydrationForSRSeries: assign((ctx, evt) => ({\n ignoredSRSeriesForHydration: [\n ...ctx.ignoredSRSeriesForHydration,\n evt.data.srSeriesInstanceUID,\n ],\n })),\n addTrackedSeries: assign((ctx, evt) => ({\n prevTrackedSeries: [...ctx.trackedSeries],\n trackedSeries: [...ctx.trackedSeries, evt.data.SeriesInstanceUID],\n })),\n removeTrackedSeries: assign((ctx, evt) => ({\n prevTrackedSeries: ctx.trackedSeries.slice().filter(ser => ser !== evt.SeriesInstanceUID),\n trackedSeries: ctx.trackedSeries.slice().filter(ser => ser !== evt.SeriesInstanceUID),\n })),\n },\n guards: {\n // We set dirty any time we performan an action that:\n // - Tracks a new study\n // - Tracks a new series\n // - Adds a measurement to an already tracked study/series\n //\n // We set clean any time we restore from an SR\n //\n // This guard/condition is specific to \"new measurements\"\n // to make sure we only track dirty when the new measurement is specific\n // to a series we're already tracking\n //\n // tl;dr\n // Any report change, that is not a hydration of an existing report, should\n // result in a \"dirty\" report\n //\n // Where dirty means there would be \"loss of data\" if we blew away measurements\n // without creating a new SR.\n shouldSetDirty: (ctx, evt) => {\n return (\n // When would this happen?\n evt.SeriesInstanceUID === undefined || ctx.trackedSeries.includes(evt.SeriesInstanceUID)\n );\n },\n shouldKillMachine: (ctx, evt) => evt.data && evt.data.userResponse === RESPONSE.NO_NEVER,\n shouldAddSeries: (ctx, evt) => evt.data && evt.data.userResponse === RESPONSE.ADD_SERIES,\n shouldSetStudyAndSeries: (ctx, evt) =>\n evt.data && evt.data.userResponse === RESPONSE.SET_STUDY_AND_SERIES,\n shouldAddIgnoredSeries: (ctx, evt) =>\n evt.data && evt.data.userResponse === RESPONSE.NO_NOT_FOR_SERIES,\n shouldPromptSaveReport: (ctx, evt) =>\n evt.data && evt.data.userResponse === RESPONSE.CREATE_REPORT,\n shouldIgnoreHydrationForSR: (ctx, evt) => evt.data && evt.data.userResponse === RESPONSE.CANCEL,\n shouldSaveAndContinueWithSameReport: (ctx, evt) =>\n evt.data &&\n evt.data.userResponse === RESPONSE.CREATE_REPORT &&\n evt.data.isBackupSave === true,\n shouldSaveAndStartNewReport: (ctx, evt) =>\n evt.data &&\n evt.data.userResponse === RESPONSE.CREATE_REPORT &&\n evt.data.isBackupSave === false,\n shouldHydrateStructuredReport: (ctx, evt) =>\n evt.data && evt.data.userResponse === RESPONSE.HYDRATE_REPORT,\n // Has more than 1, or SeriesInstanceUID is not in list\n // --> Post removal would have non-empty trackedSeries array\n hasRemainingTrackedSeries: (ctx, evt) =>\n ctx.trackedSeries.length > 1 || !ctx.trackedSeries.includes(evt.SeriesInstanceUID),\n hasNotIgnoredSRSeriesForHydration: (ctx, evt) => {\n return !ctx.ignoredSRSeriesForHydration.includes(evt.SeriesInstanceUID);\n },\n isNewStudy: (ctx, evt) =>\n !ctx.ignoredSeries.includes(evt.SeriesInstanceUID) &&\n ctx.trackedStudy !== evt.StudyInstanceUID,\n isNewSeries: (ctx, evt) =>\n !ctx.ignoredSeries.includes(evt.SeriesInstanceUID) &&\n !ctx.trackedSeries.includes(evt.SeriesInstanceUID),\n },\n};\n\nexport { defaultOptions, machineConfiguration };\n","import { ButtonEnums } from '@ohif/ui';\n\nconst RESPONSE = {\n NO_NEVER: -1,\n CANCEL: 0,\n CREATE_REPORT: 1,\n ADD_SERIES: 2,\n SET_STUDY_AND_SERIES: 3,\n};\n\nfunction promptBeginTracking({ servicesManager, extensionManager }, ctx, evt) {\n const { uiViewportDialogService } = servicesManager.services;\n const { viewportId, StudyInstanceUID, SeriesInstanceUID } = evt;\n\n return new Promise(async function (resolve, reject) {\n let promptResult = await _askTrackMeasurements(uiViewportDialogService, viewportId);\n\n resolve({\n userResponse: promptResult,\n StudyInstanceUID,\n SeriesInstanceUID,\n viewportId,\n });\n });\n}\n\nfunction _askTrackMeasurements(uiViewportDialogService, viewportId) {\n return new Promise(function (resolve, reject) {\n const message = 'Track measurements for this series?';\n const actions = [\n {\n id: 'prompt-begin-tracking-cancel',\n type: ButtonEnums.type.secondary,\n text: 'No',\n value: RESPONSE.CANCEL,\n },\n {\n id: 'prompt-begin-tracking-no-do-not-ask-again',\n type: ButtonEnums.type.secondary,\n text: 'No, do not ask again',\n value: RESPONSE.NO_NEVER,\n },\n {\n id: 'prompt-begin-tracking-yes',\n type: ButtonEnums.type.primary,\n text: 'Yes',\n value: RESPONSE.SET_STUDY_AND_SERIES,\n },\n ];\n const onSubmit = result => {\n uiViewportDialogService.hide();\n resolve(result);\n };\n\n uiViewportDialogService.show({\n viewportId,\n id: 'measurement-tracking-prompt-begin-tracking',\n type: 'info',\n message,\n actions,\n onSubmit,\n onOutsideClick: () => {\n uiViewportDialogService.hide();\n resolve(RESPONSE.CANCEL);\n },\n });\n });\n}\n\nexport default promptBeginTracking;\n","import { ButtonEnums } from '@ohif/ui';\n\nconst RESPONSE = {\n NO_NEVER: -1,\n CANCEL: 0,\n CREATE_REPORT: 1,\n ADD_SERIES: 2,\n SET_STUDY_AND_SERIES: 3,\n NO_NOT_FOR_SERIES: 4,\n};\n\nfunction promptTrackNewSeries({ servicesManager, extensionManager }, ctx, evt) {\n const { UIViewportDialogService } = servicesManager.services;\n const { viewportId, StudyInstanceUID, SeriesInstanceUID } = evt;\n\n return new Promise(async function (resolve, reject) {\n let promptResult = await _askShouldAddMeasurements(UIViewportDialogService, viewportId);\n\n if (promptResult === RESPONSE.CREATE_REPORT) {\n promptResult = ctx.isDirty\n ? await _askSaveDiscardOrCancel(UIViewportDialogService, viewportId)\n : RESPONSE.SET_STUDY_AND_SERIES;\n }\n\n resolve({\n userResponse: promptResult,\n StudyInstanceUID,\n SeriesInstanceUID,\n viewportId,\n isBackupSave: false,\n });\n });\n}\n\nfunction _askShouldAddMeasurements(uiViewportDialogService, viewportId) {\n return new Promise(function (resolve, reject) {\n const message = 'Do you want to add this measurement to the existing report?';\n const actions = [\n {\n type: ButtonEnums.type.secondary,\n text: 'Cancel',\n value: RESPONSE.CANCEL,\n },\n {\n type: ButtonEnums.type.primary,\n text: 'Create new report',\n value: RESPONSE.CREATE_REPORT,\n },\n {\n type: ButtonEnums.type.primary,\n text: 'Add to existing report',\n value: RESPONSE.ADD_SERIES,\n },\n ];\n const onSubmit = result => {\n uiViewportDialogService.hide();\n resolve(result);\n };\n\n uiViewportDialogService.show({\n viewportId,\n type: 'info',\n message,\n actions,\n onSubmit,\n onOutsideClick: () => {\n uiViewportDialogService.hide();\n resolve(RESPONSE.CANCEL);\n },\n });\n });\n}\n\nfunction _askSaveDiscardOrCancel(UIViewportDialogService, viewportId) {\n return new Promise(function (resolve, reject) {\n const message =\n 'You have existing tracked measurements. What would you like to do with your existing tracked measurements?';\n const actions = [\n { type: 'cancel', text: 'Cancel', value: RESPONSE.CANCEL },\n {\n type: 'secondary',\n text: 'Save',\n value: RESPONSE.CREATE_REPORT,\n },\n {\n type: 'primary',\n text: 'Discard',\n value: RESPONSE.SET_STUDY_AND_SERIES,\n },\n ];\n const onSubmit = result => {\n UIViewportDialogService.hide();\n resolve(result);\n };\n\n UIViewportDialogService.show({\n viewportId,\n type: 'warning',\n message,\n actions,\n onSubmit,\n onOutsideClick: () => {\n UIViewportDialogService.hide();\n resolve(RESPONSE.CANCEL);\n },\n });\n });\n}\n\nexport default promptTrackNewSeries;\n","const RESPONSE = {\n NO_NEVER: -1,\n CANCEL: 0,\n CREATE_REPORT: 1,\n ADD_SERIES: 2,\n SET_STUDY_AND_SERIES: 3,\n NO_NOT_FOR_SERIES: 4,\n};\n\nfunction promptTrackNewStudy({ servicesManager, extensionManager }, ctx, evt) {\n const { UIViewportDialogService } = servicesManager.services;\n const { viewportId, StudyInstanceUID, SeriesInstanceUID } = evt;\n\n return new Promise(async function (resolve, reject) {\n let promptResult = await _askTrackMeasurements(UIViewportDialogService, viewportId);\n\n if (promptResult === RESPONSE.SET_STUDY_AND_SERIES) {\n promptResult = ctx.isDirty\n ? await _askSaveDiscardOrCancel(UIViewportDialogService, viewportId)\n : RESPONSE.SET_STUDY_AND_SERIES;\n }\n\n resolve({\n userResponse: promptResult,\n StudyInstanceUID,\n SeriesInstanceUID,\n viewportId,\n isBackupSave: false,\n });\n });\n}\n\nfunction _askTrackMeasurements(UIViewportDialogService, viewportId) {\n return new Promise(function (resolve, reject) {\n const message = 'Track measurements for this series?';\n const actions = [\n { type: 'cancel', text: 'No', value: RESPONSE.CANCEL },\n {\n type: 'secondary',\n text: 'No, do not ask again for this series',\n value: RESPONSE.NO_NOT_FOR_SERIES,\n },\n {\n type: 'primary',\n text: 'Yes',\n value: RESPONSE.SET_STUDY_AND_SERIES,\n },\n ];\n const onSubmit = result => {\n UIViewportDialogService.hide();\n resolve(result);\n };\n\n UIViewportDialogService.show({\n viewportId,\n type: 'info',\n message,\n actions,\n onSubmit,\n onOutsideClick: () => {\n UIViewportDialogService.hide();\n resolve(RESPONSE.CANCEL);\n },\n });\n });\n}\n\nfunction _askSaveDiscardOrCancel(UIViewportDialogService, viewportId) {\n return new Promise(function (resolve, reject) {\n const message =\n 'Measurements cannot span across multiple studies. Do you want to save your tracked measurements?';\n const actions = [\n { type: 'cancel', text: 'Cancel', value: RESPONSE.CANCEL },\n {\n type: 'secondary',\n text: 'No, discard previously tracked series & measurements',\n value: RESPONSE.SET_STUDY_AND_SERIES,\n },\n {\n type: 'primary',\n text: 'Yes',\n value: RESPONSE.CREATE_REPORT,\n },\n ];\n const onSubmit = result => {\n UIViewportDialogService.hide();\n resolve(result);\n };\n\n UIViewportDialogService.show({\n viewportId,\n type: 'warning',\n message,\n actions,\n onSubmit,\n onOutsideClick: () => {\n UIViewportDialogService.hide();\n resolve(RESPONSE.CANCEL);\n },\n });\n });\n}\n\nexport default promptTrackNewStudy;\n","const MIN_SR_SERIES_NUMBER = 4700;\n\nexport default function getNextSRSeriesNumber(displaySetService) {\n const activeDisplaySets = displaySetService.getActiveDisplaySets();\n const srDisplaySets = activeDisplaySets.filter(ds => ds.Modality === 'SR');\n const srSeriesNumbers = srDisplaySets.map(ds => ds.SeriesNumber);\n const maxSeriesNumber = Math.max(...srSeriesNumbers, MIN_SR_SERIES_NUMBER);\n\n return maxSeriesNumber + 1;\n}\n","const RESPONSE = {\n NO_NEVER: -1,\n CANCEL: 0,\n CREATE_REPORT: 1,\n ADD_SERIES: 2,\n SET_STUDY_AND_SERIES: 3,\n NO_NOT_FOR_SERIES: 4,\n};\n\nexport default RESPONSE;\n","import { createReportAsync, createReportDialogPrompt } from '@ohif/extension-default';\nimport getNextSRSeriesNumber from '../../_shared/getNextSRSeriesNumber';\nimport RESPONSE from '../../_shared/PROMPT_RESPONSES';\n\nfunction promptSaveReport({ servicesManager, commandsManager, extensionManager }, ctx, evt) {\n const { uiDialogService, measurementService, displaySetService } = servicesManager.services;\n const viewportId = evt.viewportId === undefined ? evt.data.viewportId : evt.viewportId;\n const isBackupSave = evt.isBackupSave === undefined ? evt.data.isBackupSave : evt.isBackupSave;\n const StudyInstanceUID = evt?.data?.StudyInstanceUID;\n const SeriesInstanceUID = evt?.data?.SeriesInstanceUID;\n\n const { trackedStudy, trackedSeries } = ctx;\n let displaySetInstanceUIDs;\n\n return new Promise(async function (resolve, reject) {\n // TODO: Fallback if (uiDialogService) {\n const promptResult = await createReportDialogPrompt(uiDialogService, {\n extensionManager,\n });\n\n if (promptResult.action === RESPONSE.CREATE_REPORT) {\n const dataSources = extensionManager.getDataSources();\n const dataSource = dataSources[0];\n const measurements = measurementService.getMeasurements();\n const trackedMeasurements = measurements.filter(\n m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID)\n );\n\n const SeriesDescription =\n // isUndefinedOrEmpty\n promptResult.value === undefined || promptResult.value === ''\n ? 'Research Derived Series' // default\n : promptResult.value; // provided value\n\n const SeriesNumber = getNextSRSeriesNumber(displaySetService);\n\n const getReport = async () => {\n return commandsManager.runCommand(\n 'storeMeasurements',\n {\n measurementData: trackedMeasurements,\n dataSource,\n additionalFindingTypes: ['ArrowAnnotate'],\n options: {\n SeriesDescription,\n SeriesNumber,\n },\n },\n 'CORNERSTONE_STRUCTURED_REPORT'\n );\n };\n displaySetInstanceUIDs = await createReportAsync({\n servicesManager,\n getReport,\n });\n } else if (promptResult.action === RESPONSE.CANCEL) {\n // Do nothing\n }\n\n resolve({\n userResponse: promptResult.action,\n createdDisplaySetInstanceUIDs: displaySetInstanceUIDs,\n StudyInstanceUID,\n SeriesInstanceUID,\n viewportId,\n isBackupSave,\n });\n });\n}\n\nexport default promptSaveReport;\n","import { hydrateStructuredReport } from '@ohif/extension-cornerstone-dicom-sr';\nimport { ButtonEnums } from '@ohif/ui';\n\nconst RESPONSE = {\n NO_NEVER: -1,\n CANCEL: 0,\n CREATE_REPORT: 1,\n ADD_SERIES: 2,\n SET_STUDY_AND_SERIES: 3,\n NO_NOT_FOR_SERIES: 4,\n HYDRATE_REPORT: 5,\n};\n\nfunction promptHydrateStructuredReport({ servicesManager, extensionManager, appConfig }, ctx, evt) {\n const { uiViewportDialogService, displaySetService } = servicesManager.services;\n const { viewportId, displaySetInstanceUID } = evt;\n const srDisplaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);\n\n return new Promise(async function (resolve, reject) {\n const promptResult = await _askTrackMeasurements(uiViewportDialogService, viewportId);\n\n // Need to do action here... So we can set state...\n let StudyInstanceUID, SeriesInstanceUIDs;\n\n if (promptResult === RESPONSE.HYDRATE_REPORT) {\n console.warn('!! HYDRATING STRUCTURED REPORT');\n const hydrationResult = hydrateStructuredReport(\n { servicesManager, extensionManager, appConfig },\n displaySetInstanceUID\n );\n\n StudyInstanceUID = hydrationResult.StudyInstanceUID;\n SeriesInstanceUIDs = hydrationResult.SeriesInstanceUIDs;\n }\n\n resolve({\n userResponse: promptResult,\n displaySetInstanceUID: evt.displaySetInstanceUID,\n srSeriesInstanceUID: srDisplaySet.SeriesInstanceUID,\n viewportId,\n StudyInstanceUID,\n SeriesInstanceUIDs,\n });\n });\n}\n\nfunction _askTrackMeasurements(uiViewportDialogService, viewportId) {\n return new Promise(function (resolve, reject) {\n const message = 'Do you want to continue tracking measurements for this study?';\n const actions = [\n {\n type: ButtonEnums.type.secondary,\n text: 'No',\n value: RESPONSE.CANCEL,\n },\n {\n type: ButtonEnums.type.primary,\n text: 'Yes',\n value: RESPONSE.HYDRATE_REPORT,\n },\n ];\n const onSubmit = result => {\n uiViewportDialogService.hide();\n resolve(result);\n };\n\n uiViewportDialogService.show({\n viewportId,\n type: 'info',\n message,\n actions,\n onSubmit,\n onOutsideClick: () => {\n uiViewportDialogService.hide();\n resolve(RESPONSE.CANCEL);\n },\n });\n });\n}\n\nexport default promptHydrateStructuredReport;\n","import { hydrateStructuredReport as baseHydrateStructuredReport } from '@ohif/extension-cornerstone-dicom-sr';\n\nfunction hydrateStructuredReport({ servicesManager, extensionManager }, ctx, evt) {\n const { displaySetService } = servicesManager.services;\n const { viewportId, displaySetInstanceUID } = evt;\n const srDisplaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);\n\n return new Promise((resolve, reject) => {\n const hydrationResult = baseHydrateStructuredReport(\n { servicesManager, extensionManager },\n displaySetInstanceUID\n );\n\n const StudyInstanceUID = hydrationResult.StudyInstanceUID;\n const SeriesInstanceUIDs = hydrationResult.SeriesInstanceUIDs;\n\n resolve({\n displaySetInstanceUID: evt.displaySetInstanceUID,\n srSeriesInstanceUID: srDisplaySet.SeriesInstanceUID,\n viewportId,\n StudyInstanceUID,\n SeriesInstanceUIDs,\n });\n });\n}\n\nexport default hydrateStructuredReport;\n","import React, { useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Machine } from 'xstate';\nimport { useMachine } from '@xstate/react';\nimport { useViewportGrid } from '@ohif/ui';\nimport { machineConfiguration, defaultOptions } from './measurementTrackingMachine';\nimport promptBeginTracking from './promptBeginTracking';\nimport promptTrackNewSeries from './promptTrackNewSeries';\nimport promptTrackNewStudy from './promptTrackNewStudy';\nimport promptSaveReport from './promptSaveReport';\nimport promptHydrateStructuredReport from './promptHydrateStructuredReport';\nimport hydrateStructuredReport from './hydrateStructuredReport';\nimport { useAppConfig } from '@state';\n\nconst TrackedMeasurementsContext = React.createContext();\nTrackedMeasurementsContext.displayName = 'TrackedMeasurementsContext';\nconst useTrackedMeasurements = () => useContext(TrackedMeasurementsContext);\n\nconst SR_SOPCLASSHANDLERID = '@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr';\n\n/**\n *\n * @param {*} param0\n */\nfunction TrackedMeasurementsContextProvider(\n { servicesManager, commandsManager, extensionManager }, // Bound by consumer\n { children } // Component props\n) {\n const [appConfig] = useAppConfig();\n\n const [viewportGrid, viewportGridService] = useViewportGrid();\n const { activeViewportId, viewports } = viewportGrid;\n const { measurementService, displaySetService } = servicesManager.services;\n\n const machineOptions = Object.assign({}, defaultOptions);\n machineOptions.actions = Object.assign({}, machineOptions.actions, {\n jumpToFirstMeasurementInActiveViewport: (ctx, evt) => {\n const { trackedStudy, trackedSeries, activeViewportId } = ctx;\n const measurements = measurementService.getMeasurements();\n const trackedMeasurements = measurements.filter(\n m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID)\n );\n\n console.log(\n 'jumping to measurement reset viewport',\n activeViewportId,\n trackedMeasurements[0]\n );\n\n const referencedDisplaySetUID = trackedMeasurements[0].displaySetInstanceUID;\n const referencedDisplaySet = displaySetService.getDisplaySetByUID(referencedDisplaySetUID);\n\n const referencedImages = referencedDisplaySet.images;\n const isVolumeIdReferenced = referencedImages[0].imageId.startsWith('volumeId');\n\n const measurementData = trackedMeasurements[0].data;\n\n let imageIndex = 0;\n if (!isVolumeIdReferenced && measurementData) {\n // if it is imageId referenced find the index of the imageId, we don't have\n // support for volumeId referenced images yet\n imageIndex = referencedImages.findIndex(image => {\n const imageIdToUse = Object.keys(measurementData)[0].substring(8);\n return image.imageId === imageIdToUse;\n });\n\n if (imageIndex === -1) {\n console.warn('Could not find image index for tracked measurement, using 0');\n imageIndex = 0;\n }\n }\n\n viewportGridService.setDisplaySetsForViewport({\n viewportId: activeViewportId,\n displaySetInstanceUIDs: [referencedDisplaySetUID],\n viewportOptions: {\n initialImageOptions: {\n index: imageIndex,\n },\n },\n });\n },\n showStructuredReportDisplaySetInActiveViewport: (ctx, evt) => {\n if (evt.data.createdDisplaySetInstanceUIDs.length > 0) {\n const StructuredReportDisplaySetInstanceUID = evt.data.createdDisplaySetInstanceUIDs[0];\n\n viewportGridService.setDisplaySetsForViewport({\n viewportId: evt.data.viewportId,\n displaySetInstanceUIDs: [StructuredReportDisplaySetInstanceUID],\n });\n }\n },\n discardPreviouslyTrackedMeasurements: (ctx, evt) => {\n const measurements = measurementService.getMeasurements();\n const filteredMeasurements = measurements.filter(ms =>\n ctx.prevTrackedSeries.includes(ms.referenceSeriesUID)\n );\n const measurementIds = filteredMeasurements.map(fm => fm.id);\n\n for (let i = 0; i < measurementIds.length; i++) {\n measurementService.remove(measurementIds[i]);\n }\n },\n clearAllMeasurements: (ctx, evt) => {\n const measurements = measurementService.getMeasurements();\n const measurementIds = measurements.map(fm => fm.uid);\n\n for (let i = 0; i < measurementIds.length; i++) {\n measurementService.remove(measurementIds[i]);\n }\n },\n });\n machineOptions.services = Object.assign({}, machineOptions.services, {\n promptBeginTracking: promptBeginTracking.bind(null, {\n servicesManager,\n extensionManager,\n appConfig,\n }),\n promptTrackNewSeries: promptTrackNewSeries.bind(null, {\n servicesManager,\n extensionManager,\n appConfig,\n }),\n promptTrackNewStudy: promptTrackNewStudy.bind(null, {\n servicesManager,\n extensionManager,\n appConfig,\n }),\n promptSaveReport: promptSaveReport.bind(null, {\n servicesManager,\n commandsManager,\n extensionManager,\n appConfig,\n }),\n promptHydrateStructuredReport: promptHydrateStructuredReport.bind(null, {\n servicesManager,\n extensionManager,\n appConfig,\n }),\n hydrateStructuredReport: hydrateStructuredReport.bind(null, {\n servicesManager,\n extensionManager,\n appConfig,\n }),\n });\n\n // TODO: IMPROVE\n // - Add measurement_updated to cornerstone; debounced? (ext side, or consumption?)\n // - Friendlier transition/api in front of measurementTracking machine?\n // - Blocked: viewport overlay shouldn't clip when resized\n // TODO: PRIORITY\n // - Fix \"ellipses\" series description dynamic truncate length\n // - Fix viewport border resize\n // - created/destroyed hooks for extensions (cornerstone measurement subscriptions in it's `init`)\n\n const measurementTrackingMachine = Machine(machineConfiguration, machineOptions);\n\n const [trackedMeasurements, sendTrackedMeasurementsEvent] = useMachine(\n measurementTrackingMachine\n );\n\n useEffect(() => {\n // Update the state machine with the active viewport ID\n sendTrackedMeasurementsEvent('UPDATE_ACTIVE_VIEWPORT_ID', {\n activeViewportId,\n });\n }, [activeViewportId, sendTrackedMeasurementsEvent]);\n\n // ~~ Listen for changes to ViewportGrid for potential SRs hung in panes when idle\n useEffect(() => {\n if (viewports.size > 0) {\n const activeViewport = viewports.get(activeViewportId);\n\n if (!activeViewport || !activeViewport?.displaySetInstanceUIDs?.length) {\n return;\n }\n\n // Todo: Getting the first displaySetInstanceUID is wrong, but we don't have\n // tracking fusion viewports yet. This should change when we do.\n const { displaySetService } = servicesManager.services;\n const displaySet = displaySetService.getDisplaySetByUID(\n activeViewport.displaySetInstanceUIDs[0]\n );\n\n if (!displaySet) {\n return;\n }\n\n // If this is an SR produced by our SR SOPClassHandler,\n // and it hasn't been loaded yet, do that now so we\n // can check if it can be rehydrated or not.\n //\n // Note: This happens:\n // - If the viewport is not currently an OHIFCornerstoneSRViewport\n // - If the displaySet has never been hung\n //\n // Otherwise, the displaySet will be loaded by the useEffect handler\n // listening to displaySet changes inside OHIFCornerstoneSRViewport.\n // The issue here is that this handler in TrackedMeasurementsContext\n // ends up occurring before the Viewport is created, so the displaySet\n // is not loaded yet, and isRehydratable is undefined unless we call load().\n if (\n displaySet.SOPClassHandlerId === SR_SOPCLASSHANDLERID &&\n !displaySet.isLoaded &&\n displaySet.load\n ) {\n displaySet.load();\n }\n\n // Magic string\n // load function added by our sopClassHandler module\n if (\n displaySet.SOPClassHandlerId === SR_SOPCLASSHANDLERID &&\n displaySet.isRehydratable === true\n ) {\n console.log('sending event...', trackedMeasurements);\n sendTrackedMeasurementsEvent('PROMPT_HYDRATE_SR', {\n displaySetInstanceUID: displaySet.displaySetInstanceUID,\n SeriesInstanceUID: displaySet.SeriesInstanceUID,\n viewportId: activeViewportId,\n });\n }\n }\n }, [activeViewportId, sendTrackedMeasurementsEvent, servicesManager.services, viewports]);\n\n return (\n <TrackedMeasurementsContext.Provider\n value={[trackedMeasurements, sendTrackedMeasurementsEvent]}\n >\n {children}\n </TrackedMeasurementsContext.Provider>\n );\n}\n\nTrackedMeasurementsContextProvider.propTypes = {\n children: PropTypes.oneOf([PropTypes.func, PropTypes.node]),\n servicesManager: PropTypes.object.isRequired,\n commandsManager: PropTypes.object.isRequired,\n extensionManager: PropTypes.object.isRequired,\n appConfig: PropTypes.object,\n};\n\nexport { TrackedMeasurementsContext, TrackedMeasurementsContextProvider, useTrackedMeasurements };\n","import {\n TrackedMeasurementsContext,\n TrackedMeasurementsContextProvider,\n useTrackedMeasurements,\n} from './contexts';\n\nfunction getContextModule({ servicesManager, extensionManager, commandsManager }) {\n const BoundTrackedMeasurementsContextProvider = TrackedMeasurementsContextProvider.bind(null, {\n servicesManager,\n extensionManager,\n commandsManager,\n });\n\n return [\n {\n name: 'TrackedMeasurementsContext',\n context: TrackedMeasurementsContext,\n provider: BoundTrackedMeasurementsContextProvider,\n },\n ];\n}\n\nexport { useTrackedMeasurements };\nexport default getContextModule;\n","import React, { useState, useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useTranslation } from 'react-i18next';\nimport PropTypes from 'prop-types';\nimport { utils } from '@ohif/core';\nimport { StudyBrowser, useImageViewer, useViewportGrid, Dialog, ButtonEnums } from '@ohif/ui';\nimport { useTrackedMeasurements } from '../../getContextModule';\n\nconst { formatDate } = utils;\n\n/**\n *\n * @param {*} param0\n */\nfunction PanelStudyBrowserTracking({\n servicesManager,\n getImageSrc,\n getStudiesForPatientByMRN,\n requestDisplaySetCreationForStudy,\n dataSource,\n}) {\n const { displaySetService, uiDialogService, hangingProtocolService, uiNotificationService } =\n servicesManager.services;\n const navigate = useNavigate();\n\n const { t } = useTranslation('Common');\n\n // Normally you nest the components so the tree isn't so deep, and the data\n // doesn't have to have such an intense shape. This works well enough for now.\n // Tabs --> Studies --> DisplaySets --> Thumbnails\n const { StudyInstanceUIDs } = useImageViewer();\n const [{ activeViewportId, viewports }, viewportGridService] = useViewportGrid();\n const [trackedMeasurements, sendTrackedMeasurementsEvent] = useTrackedMeasurements();\n const [activeTabName, setActiveTabName] = useState('primary');\n const [expandedStudyInstanceUIDs, setExpandedStudyInstanceUIDs] = useState([\n ...StudyInstanceUIDs,\n ]);\n const [studyDisplayList, setStudyDisplayList] = useState([]);\n const [displaySets, setDisplaySets] = useState([]);\n const [thumbnailImageSrcMap, setThumbnailImageSrcMap] = useState({});\n const [jumpToDisplaySet, setJumpToDisplaySet] = useState(null);\n\n const onDoubleClickThumbnailHandler = displaySetInstanceUID => {\n let updatedViewports = [];\n const viewportId = activeViewportId;\n try {\n updatedViewports = hangingProtocolService.getViewportsRequireUpdate(\n viewportId,\n displaySetInstanceUID\n );\n } catch (error) {\n console.warn(error);\n uiNotificationService.show({\n title: 'Thumbnail Double Click',\n message:\n 'The selected display sets could not be added to the viewport due to a mismatch in the Hanging Protocol rules.',\n type: 'info',\n duration: 3000,\n });\n }\n\n viewportGridService.setDisplaySetsForViewports(updatedViewports);\n };\n\n const activeViewportDisplaySetInstanceUIDs =\n viewports.get(activeViewportId)?.displaySetInstanceUIDs;\n\n const { trackedSeries } = trackedMeasurements.context;\n\n // ~~ studyDisplayList\n useEffect(() => {\n // Fetch all studies for the patient in each primary study\n async function fetchStudiesForPatient(StudyInstanceUID) {\n // current study qido\n const qidoForStudyUID = await dataSource.query.studies.search({\n studyInstanceUid: StudyInstanceUID,\n });\n\n if (!qidoForStudyUID?.length) {\n navigate('/notfoundstudy', '_self');\n throw new Error('Invalid study URL');\n }\n\n let qidoStudiesForPatient = qidoForStudyUID;\n\n // try to fetch the prior studies based on the patientID if the\n // server can respond.\n try {\n qidoStudiesForPatient = await getStudiesForPatientByMRN(qidoForStudyUID);\n } catch (error) {\n console.warn(error);\n }\n\n const mappedStudies = _mapDataSourceStudies(qidoStudiesForPatient);\n const actuallyMappedStudies = mappedStudies.map(qidoStudy => {\n return {\n studyInstanceUid: qidoStudy.StudyInstanceUID,\n date: formatDate(qidoStudy.StudyDate) || t('NoStudyDate'),\n description: qidoStudy.StudyDescription,\n modalities: qidoStudy.ModalitiesInStudy,\n numInstances: qidoStudy.NumInstances,\n };\n });\n\n setStudyDisplayList(prevArray => {\n const ret = [...prevArray];\n for (const study of actuallyMappedStudies) {\n if (!prevArray.find(it => it.studyInstanceUid === study.studyInstanceUid)) {\n ret.push(study);\n }\n }\n return ret;\n });\n }\n\n StudyInstanceUIDs.forEach(sid => fetchStudiesForPatient(sid));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [StudyInstanceUIDs, getStudiesForPatientByMRN]);\n\n // ~~ Initial Thumbnails\n useEffect(() => {\n const currentDisplaySets = displaySetService.activeDisplaySets;\n\n if (!currentDisplaySets.length) {\n return;\n }\n\n currentDisplaySets.forEach(async dSet => {\n const newImageSrcEntry = {};\n const displaySet = displaySetService.getDisplaySetByUID(dSet.displaySetInstanceUID);\n const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);\n const imageId = imageIds[Math.floor(imageIds.length / 2)];\n\n // TODO: Is it okay that imageIds are not returned here for SR displaySets?\n if (!imageId || displaySet?.unsupported) {\n return;\n }\n // When the image arrives, render it and store the result in the thumbnailImgSrcMap\n newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId);\n\n setThumbnailImageSrcMap(prevState => {\n return { ...prevState, ...newImageSrcEntry };\n });\n });\n }, [displaySetService, dataSource, getImageSrc]);\n\n // ~~ displaySets\n useEffect(() => {\n const currentDisplaySets = displaySetService.activeDisplaySets;\n\n if (!currentDisplaySets.length) {\n return;\n }\n\n const mappedDisplaySets = _mapDisplaySets(\n currentDisplaySets,\n thumbnailImageSrcMap,\n trackedSeries,\n viewports,\n viewportGridService,\n dataSource,\n displaySetService,\n uiDialogService,\n uiNotificationService\n );\n\n setDisplaySets(mappedDisplaySets);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n displaySetService.activeDisplaySets,\n trackedSeries,\n viewports,\n dataSource,\n thumbnailImageSrcMap,\n ]);\n\n // ~~ subscriptions --> displaySets\n useEffect(() => {\n // DISPLAY_SETS_ADDED returns an array of DisplaySets that were added\n const SubscriptionDisplaySetsAdded = displaySetService.subscribe(\n displaySetService.EVENTS.DISPLAY_SETS_ADDED,\n data => {\n const { displaySetsAdded, options } = data;\n displaySetsAdded.forEach(async dSet => {\n const displaySetInstanceUID = dSet.displaySetInstanceUID;\n\n const newImageSrcEntry = {};\n const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);\n if (displaySet?.unsupported) {\n return;\n }\n\n if (options.madeInClient) {\n setJumpToDisplaySet(displaySetInstanceUID);\n }\n\n const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);\n const imageId = imageIds[Math.floor(imageIds.length / 2)];\n\n // TODO: Is it okay that imageIds are not returned here for SR displaysets?\n if (!imageId) {\n return;\n }\n\n // When the image arrives, render it and store the result in the thumbnailImgSrcMap\n newImageSrcEntry[displaySetInstanceUID] = await getImageSrc(imageId);\n setThumbnailImageSrcMap(prevState => {\n return { ...prevState, ...newImageSrcEntry };\n });\n });\n }\n );\n\n return () => {\n SubscriptionDisplaySetsAdded.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [displaySetService, dataSource, getImageSrc, thumbnailImageSrcMap, trackedSeries, viewports]);\n\n useEffect(() => {\n // TODO: Will this always hold _all_ the displaySets we care about?\n // DISPLAY_SETS_CHANGED returns `DisplaySerService.activeDisplaySets`\n const SubscriptionDisplaySetsChanged = displaySetService.subscribe(\n displaySetService.EVENTS.DISPLAY_SETS_CHANGED,\n changedDisplaySets => {\n const mappedDisplaySets = _mapDisplaySets(\n changedDisplaySets,\n thumbnailImageSrcMap,\n trackedSeries,\n viewports,\n viewportGridService,\n dataSource,\n displaySetService,\n uiDialogService,\n uiNotificationService\n );\n\n setDisplaySets(mappedDisplaySets);\n }\n );\n\n const SubscriptionDisplaySetMetaDataInvalidated = displaySetService.subscribe(\n displaySetService.EVENTS.DISPLAY_SET_SERIES_METADATA_INVALIDATED,\n () => {\n const mappedDisplaySets = _mapDisplaySets(\n displaySetService.getActiveDisplaySets(),\n thumbnailImageSrcMap,\n trackedSeries,\n viewports,\n viewportGridService,\n dataSource,\n displaySetService,\n uiDialogService,\n uiNotificationService\n );\n\n setDisplaySets(mappedDisplaySets);\n }\n );\n\n return () => {\n SubscriptionDisplaySetsChanged.unsubscribe();\n SubscriptionDisplaySetMetaDataInvalidated.unsubscribe();\n };\n }, [thumbnailImageSrcMap, trackedSeries, viewports, dataSource, displaySetService]);\n\n const tabs = _createStudyBrowserTabs(\n StudyInstanceUIDs,\n studyDisplayList,\n displaySets,\n hangingProtocolService\n );\n\n // TODO: Should not fire this on \"close\"\n function _handleStudyClick(StudyInstanceUID) {\n const shouldCollapseStudy = expandedStudyInstanceUIDs.includes(StudyInstanceUID);\n const updatedExpandedStudyInstanceUIDs = shouldCollapseStudy\n ? [...expandedStudyInstanceUIDs.filter(stdyUid => stdyUid !== StudyInstanceUID)]\n : [...expandedStudyInstanceUIDs, StudyInstanceUID];\n\n setExpandedStudyInstanceUIDs(updatedExpandedStudyInstanceUIDs);\n\n if (!shouldCollapseStudy) {\n const madeInClient = true;\n requestDisplaySetCreationForStudy(displaySetService, StudyInstanceUID, madeInClient);\n }\n }\n\n useEffect(() => {\n if (jumpToDisplaySet) {\n // Get element by displaySetInstanceUID\n const displaySetInstanceUID = jumpToDisplaySet;\n const element = document.getElementById(`thumbnail-${displaySetInstanceUID}`);\n\n if (element && typeof element.scrollIntoView === 'function') {\n // TODO: Any way to support IE here?\n element.scrollIntoView({ behavior: 'smooth' });\n\n setJumpToDisplaySet(null);\n }\n }\n }, [jumpToDisplaySet, expandedStudyInstanceUIDs, activeTabName]);\n\n useEffect(() => {\n if (!jumpToDisplaySet) {\n return;\n }\n\n const displaySetInstanceUID = jumpToDisplaySet;\n // Set the activeTabName and expand the study\n const thumbnailLocation = _findTabAndStudyOfDisplaySet(displaySetInstanceUID, tabs);\n if (!thumbnailLocation) {\n console.warn('jumpToThumbnail: displaySet thumbnail not found.');\n\n return;\n }\n const { tabName, StudyInstanceUID } = thumbnailLocation;\n setActiveTabName(tabName);\n const studyExpanded = expandedStudyInstanceUIDs.includes(StudyInstanceUID);\n if (!studyExpanded) {\n const updatedExpandedStudyInstanceUIDs = [...expandedStudyInstanceUIDs, StudyInstanceUID];\n setExpandedStudyInstanceUIDs(updatedExpandedStudyInstanceUIDs);\n }\n }, [expandedStudyInstanceUIDs, jumpToDisplaySet, tabs]);\n\n return (\n <StudyBrowser\n tabs={tabs}\n servicesManager={servicesManager}\n activeTabName={activeTabName}\n expandedStudyInstanceUIDs={expandedStudyInstanceUIDs}\n onClickStudy={_handleStudyClick}\n onClickTab={clickedTabName => {\n setActiveTabName(clickedTabName);\n }}\n onClickUntrack={displaySetInstanceUID => {\n const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);\n // TODO: shift this somewhere else where we're centralizing this logic?\n // Potentially a helper from displaySetInstanceUID to this\n sendTrackedMeasurementsEvent('UNTRACK_SERIES', {\n SeriesInstanceUID: displaySet.SeriesInstanceUID,\n });\n }}\n onClickThumbnail={() => {}}\n onDoubleClickThumbnail={onDoubleClickThumbnailHandler}\n activeDisplaySetInstanceUIDs={activeViewportDisplaySetInstanceUIDs}\n />\n );\n}\n\nPanelStudyBrowserTracking.propTypes = {\n servicesManager: PropTypes.object.isRequired,\n dataSource: PropTypes.shape({\n getImageIdsForDisplaySet: PropTypes.func.isRequired,\n }).isRequired,\n getImageSrc: PropTypes.func.isRequired,\n getStudiesForPatientByMRN: PropTypes.func.isRequired,\n requestDisplaySetCreationForStudy: PropTypes.func.isRequired,\n};\n\nexport default PanelStudyBrowserTracking;\n\n/**\n * Maps from the DataSource's format to a naturalized object\n *\n * @param {*} studies\n */\nfunction _mapDataSourceStudies(studies) {\n return studies.map(study => {\n // TODO: Why does the data source return in this format?\n return {\n AccessionNumber: study.accession,\n StudyDate: study.date,\n StudyDescription: study.description,\n NumInstances: study.instances,\n ModalitiesInStudy: study.modalities,\n PatientID: study.mrn,\n PatientName: study.patientName,\n StudyInstanceUID: study.studyInstanceUid,\n StudyTime: study.time,\n };\n });\n}\n\nfunction _mapDisplaySets(\n displaySets,\n thumbnailImageSrcMap,\n trackedSeriesInstanceUIDs,\n viewports, // TODO: make array of `displaySetInstanceUIDs`?\n viewportGridService,\n dataSource,\n displaySetService,\n uiDialogService,\n uiNotificationService\n) {\n const thumbnailDisplaySets = [];\n const thumbnailNoImageDisplaySets = [];\n displaySets\n .filter(ds => !ds.excludeFromThumbnailBrowser)\n .forEach(ds => {\n const imageSrc = thumbnailImageSrcMap[ds.displaySetInstanceUID];\n const componentType = _getComponentType(ds);\n const numPanes = viewportGridService.getNumViewportPanes();\n const viewportIdentificator = [];\n\n if (numPanes !== 1) {\n viewports.forEach(viewportData => {\n if (viewportData?.displaySetInstanceUIDs?.includes(ds.displaySetInstanceUID)) {\n viewportIdentificator.push(viewportData.viewportLabel);\n }\n });\n }\n\n const array =\n componentType === 'thumbnailTracked' ? thumbnailDisplaySets : thumbnailNoImageDisplaySets;\n\n const { displaySetInstanceUID } = ds;\n\n const thumbnailProps = {\n displaySetInstanceUID,\n description: ds.SeriesDescription,\n seriesNumber: ds.SeriesNumber,\n modality: ds.Modality,\n seriesDate: formatDate(ds.SeriesDate),\n numInstances: ds.numImageFrames,\n countIcon: ds.countIcon,\n messages: ds.messages,\n StudyInstanceUID: ds.StudyInstanceUID,\n componentType,\n imageSrc,\n dragData: {\n type: 'displayset',\n displaySetInstanceUID,\n // .. Any other data to pass\n },\n isTracked: trackedSeriesInstanceUIDs.includes(ds.SeriesInstanceUID),\n isHydratedForDerivedDisplaySet: ds.isHydrated,\n viewportIdentificator,\n };\n\n if (componentType === 'thumbnailNoImage') {\n if (dataSource.reject && dataSource.reject.series) {\n thumbnailProps.canReject = !ds?.unsupported;\n thumbnailProps.onReject = () => {\n uiDialogService.create({\n id: 'ds-reject-sr',\n centralize: true,\n isDraggable: false,\n showOverlay: true,\n content: Dialog,\n contentProps: {\n title: 'Delete Report',\n body: () => (\n <div className=\"bg-primary-dark p-4 text-white\">\n <p>Are you sure you want to delete this report?</p>\n <p className=\"mt-2\">This action cannot be undone.</p>\n </div>\n ),\n actions: [\n {\n id: 'cancel',\n text: 'Cancel',\n type: ButtonEnums.type.secondary,\n },\n {\n id: 'yes',\n text: 'Yes',\n type: ButtonEnums.type.primary,\n classes: ['reject-yes-button'],\n },\n ],\n onClose: () => uiDialogService.dismiss({ id: 'ds-reject-sr' }),\n onShow: () => {\n const yesButton = document.querySelector('.reject-yes-button');\n\n yesButton.focus();\n },\n onSubmit: async ({ action }) => {\n switch (action.id) {\n case 'yes':\n try {\n await dataSource.reject.series(ds.StudyInstanceUID, ds.SeriesInstanceUID);\n displaySetService.deleteDisplaySet(displaySetInstanceUID);\n uiDialogService.dismiss({ id: 'ds-reject-sr' });\n uiNotificationService.show({\n title: 'Delete Report',\n message: 'Report deleted successfully',\n type: 'success',\n });\n } catch (error) {\n uiDialogService.dismiss({ id: 'ds-reject-sr' });\n uiNotificationService.show({\n title: 'Delete Report',\n message: 'Failed to delete report',\n type: 'error',\n });\n }\n break;\n case 'cancel':\n uiDialogService.dismiss({ id: 'ds-reject-sr' });\n break;\n }\n },\n },\n });\n };\n } else {\n thumbnailProps.canReject = false;\n }\n }\n\n array.push(thumbnailProps);\n });\n\n return [...thumbnailDisplaySets, ...thumbnailNoImageDisplaySets];\n}\n\nconst thumbnailNoImageModalities = ['SR', 'SEG', 'SM', 'RTSTRUCT', 'RTPLAN', 'RTDOSE', 'DOC', 'OT'];\n\nfunction _getComponentType(ds) {\n if (thumbnailNoImageModalities.includes(ds.Modality) || ds?.unsupported) {\n return 'thumbnailNoImage';\n }\n\n return 'thumbnailTracked';\n}\n\n/**\n *\n * @param {string[]} primaryStudyInstanceUIDs\n * @param {object[]} studyDisplayList\n * @param {string} studyDisplayList.studyInstanceUid\n * @param {string} studyDisplayList.date\n * @param {string} studyDisplayList.description\n * @param {string} studyDisplayList.modalities\n * @param {number} studyDisplayList.numInstances\n * @param {object[]} displaySets\n * @returns tabs - The prop object expected by the StudyBrowser component\n */\nfunction _createStudyBrowserTabs(\n primaryStudyInstanceUIDs,\n studyDisplayList,\n displaySets,\n hangingProtocolService\n) {\n const primaryStudies = [];\n const recentStudies = [];\n const allStudies = [];\n\n // Iterate over each study...\n studyDisplayList.forEach(study => {\n // Find it's display sets\n const displaySetsForStudy = displaySets.filter(\n ds => ds.StudyInstanceUID === study.studyInstanceUid\n );\n\n // Sort them\n const dsSortFn = hangingProtocolService.getDisplaySetSortFunction();\n displaySetsForStudy.sort(dsSortFn);\n\n /* Sort by series number, then by series date\n displaySetsForStudy.sort((a, b) => {\n if (a.seriesNumber !== b.seriesNumber) {\n return a.seriesNumber - b.seriesNumber;\n }\n\n const seriesDateA = Date.parse(a.seriesDate);\n const seriesDateB = Date.parse(b.seriesDate);\n\n return seriesDateA - seriesDateB;\n });\n */\n\n // Map the study to it's tab/view representation\n const tabStudy = Object.assign({}, study, {\n displaySets: displaySetsForStudy,\n });\n\n // Add the \"tab study\" to the 'primary', 'recent', and/or 'all' tab group(s)\n if (primaryStudyInstanceUIDs.includes(study.studyInstanceUid)) {\n primaryStudies.push(tabStudy);\n allStudies.push(tabStudy);\n } else {\n // TODO: Filter allStudies to dates within one year of current date\n recentStudies.push(tabStudy);\n allStudies.push(tabStudy);\n }\n });\n\n // Newest first\n const _byDate = (a, b) => {\n const dateA = Date.parse(a);\n const dateB = Date.parse(b);\n\n return dateB - dateA;\n };\n\n const tabs = [\n {\n name: 'primary',\n label: 'Primary',\n studies: primaryStudies.sort((studyA, studyB) => _byDate(studyA.date, studyB.date)),\n },\n {\n name: 'recent',\n label: 'Recent',\n studies: recentStudies.sort((studyA, studyB) => _byDate(studyA.date, studyB.date)),\n },\n {\n name: 'all',\n label: 'All',\n studies: allStudies.sort((studyA, studyB) => _byDate(studyA.date, studyB.date)),\n },\n ];\n\n return tabs;\n}\n\nfunction _findTabAndStudyOfDisplaySet(displaySetInstanceUID, tabs) {\n for (let t = 0; t < tabs.length; t++) {\n const { studies } = tabs[t];\n\n for (let s = 0; s < studies.length; s++) {\n const { displaySets } = studies[s];\n\n for (let d = 0; d < displaySets.length; d++) {\n const displaySet = displaySets[d];\n\n if (displaySet.displaySetInstanceUID === displaySetInstanceUID) {\n return {\n tabName: tabs[t].name,\n StudyInstanceUID: studies[s].studyInstanceUid,\n };\n }\n }\n }\n }\n}\n","/**\n * @param {*} cornerstone\n * @param {*} imageId\n */\nfunction getImageSrcFromImageId(cornerstone, imageId) {\n return new Promise((resolve, reject) => {\n const canvas = document.createElement('canvas');\n cornerstone.utilities\n .loadImageToCanvas({ canvas, imageId })\n .then(imageId => {\n resolve(canvas.toDataURL());\n })\n .catch(reject);\n });\n}\n\nexport default getImageSrcFromImageId;\n","function requestDisplaySetCreationForStudy(\n dataSource,\n displaySetService,\n StudyInstanceUID,\n madeInClient\n) {\n if (\n displaySetService.activeDisplaySets.some(\n displaySet => displaySet.StudyInstanceUID === StudyInstanceUID\n )\n ) {\n return;\n }\n\n dataSource.retrieve.series.metadata({ StudyInstanceUID, madeInClient });\n}\n\nexport default requestDisplaySetCreationForStudy;\n","import React, { useCallback } from 'react';\nimport PropTypes from 'prop-types';\n//\nimport PanelStudyBrowserTracking from './PanelStudyBrowserTracking';\nimport getImageSrcFromImageId from './getImageSrcFromImageId';\nimport requestDisplaySetCreationForStudy from './requestDisplaySetCreationForStudy';\n\nfunction _getStudyForPatientUtility(extensionManager) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-default.utilityModule.common'\n );\n\n const { getStudiesForPatientByMRN } = utilityModule.exports;\n return getStudiesForPatientByMRN;\n}\n\n/**\n * Wraps the PanelStudyBrowser and provides features afforded by managers/services\n *\n * @param {object} params\n * @param {object} commandsManager\n * @param {object} extensionManager\n */\nfunction WrappedPanelStudyBrowserTracking({ commandsManager, extensionManager, servicesManager }) {\n const dataSource = extensionManager.getActiveDataSource()[0];\n\n const getStudiesForPatientByMRN = _getStudyForPatientUtility(extensionManager);\n const _getStudiesForPatientByMRN = getStudiesForPatientByMRN.bind(null, dataSource);\n const _getImageSrcFromImageId = useCallback(\n _createGetImageSrcFromImageIdFn(extensionManager),\n []\n );\n const _requestDisplaySetCreationForStudy = requestDisplaySetCreationForStudy.bind(\n null,\n dataSource\n );\n\n return (\n <PanelStudyBrowserTracking\n servicesManager={servicesManager}\n dataSource={dataSource}\n getImageSrc={_getImageSrcFromImageId}\n getStudiesForPatientByMRN={_getStudiesForPatientByMRN}\n requestDisplaySetCreationForStudy={_requestDisplaySetCreationForStudy}\n />\n );\n}\n\n/**\n * Grabs cornerstone library reference using a dependent command from\n * the @ohif/extension-cornerstone extension. Then creates a helper function\n * that can take an imageId and return an image src.\n *\n * @param {func} getCommand - CommandManager's getCommand method\n * @returns {func} getImageSrcFromImageId - A utility function powered by\n * cornerstone\n */\nfunction _createGetImageSrcFromImageIdFn(extensionManager) {\n const utilities = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.common'\n );\n\n try {\n const { cornerstone } = utilities.exports.getCornerstoneLibraries();\n return getImageSrcFromImageId.bind(null, cornerstone);\n } catch (ex) {\n throw new Error('Required command not found');\n }\n}\n\nWrappedPanelStudyBrowserTracking.propTypes = {\n commandsManager: PropTypes.object.isRequired,\n extensionManager: PropTypes.object.isRequired,\n servicesManager: PropTypes.object.isRequired,\n};\n\nexport default WrappedPanelStudyBrowserTracking;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useTranslation } from 'react-i18next';\n\nimport { Button, ButtonEnums } from '@ohif/ui';\n\nfunction ActionButtons({ onExportClick, onCreateReportClick, disabled }) {\n const { t } = useTranslation('MeasurementTable');\n\n return (\n <React.Fragment>\n <Button\n onClick={onExportClick}\n disabled={disabled}\n type={ButtonEnums.type.secondary}\n size={ButtonEnums.size.small}\n >\n {t('Export')}\n </Button>\n <Button\n className=\"ml-2\"\n onClick={onCreateReportClick}\n type={ButtonEnums.type.secondary}\n size={ButtonEnums.size.small}\n disabled={disabled}\n >\n {t('Create Report')}\n </Button>\n </React.Fragment>\n );\n}\n\nActionButtons.propTypes = {\n onExportClick: PropTypes.func,\n onCreateReportClick: PropTypes.func,\n disabled: PropTypes.bool,\n};\n\nActionButtons.defaultProps = {\n onExportClick: () => alert('Export'),\n onCreateReportClick: () => alert('Create Report'),\n disabled: false,\n};\n\nexport default ActionButtons;\n","import React, { useEffect, useState, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n StudySummary,\n MeasurementTable,\n Dialog,\n Input,\n useViewportGrid,\n ButtonEnums,\n} from '@ohif/ui';\nimport { DicomMetadataStore, utils } from '@ohif/core';\nimport { useDebounce } from '@hooks';\nimport ActionButtons from './ActionButtons';\nimport { useTrackedMeasurements } from '../../getContextModule';\nimport debounce from 'lodash.debounce';\n\nconst { downloadCSVReport } = utils;\nconst { formatDate } = utils;\n\nconst DISPLAY_STUDY_SUMMARY_INITIAL_VALUE = {\n key: undefined, //\n date: '', // '07-Sep-2010',\n modality: '', // 'CT',\n description: '', // 'CHEST/ABD/PELVIS W CONTRAST',\n};\n\nfunction PanelMeasurementTableTracking({ servicesManager, extensionManager }) {\n const [viewportGrid] = useViewportGrid();\n const [measurementChangeTimestamp, setMeasurementsUpdated] = useState(Date.now().toString());\n const debouncedMeasurementChangeTimestamp = useDebounce(measurementChangeTimestamp, 200);\n const { measurementService, uiDialogService, displaySetService } = servicesManager.services;\n const [trackedMeasurements, sendTrackedMeasurementsEvent] = useTrackedMeasurements();\n const { trackedStudy, trackedSeries } = trackedMeasurements.context;\n const [displayStudySummary, setDisplayStudySummary] = useState(\n DISPLAY_STUDY_SUMMARY_INITIAL_VALUE\n );\n const [displayMeasurements, setDisplayMeasurements] = useState([]);\n const measurementsPanelRef = useRef(null);\n\n useEffect(() => {\n const measurements = measurementService.getMeasurements();\n const filteredMeasurements = measurements.filter(\n m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID)\n );\n\n const mappedMeasurements = filteredMeasurements.map(m =>\n _mapMeasurementToDisplay(m, measurementService.VALUE_TYPES, displaySetService)\n );\n setDisplayMeasurements(mappedMeasurements);\n // eslint-ignore-next-line\n }, [measurementService, trackedStudy, trackedSeries, debouncedMeasurementChangeTimestamp]);\n\n const updateDisplayStudySummary = async () => {\n if (trackedMeasurements.matches('tracking')) {\n const StudyInstanceUID = trackedStudy;\n const studyMeta = DicomMetadataStore.getStudy(StudyInstanceUID);\n const instanceMeta = studyMeta.series[0].instances[0];\n const { StudyDate, StudyDescription } = instanceMeta;\n\n const modalities = new Set();\n studyMeta.series.forEach(series => {\n if (trackedSeries.includes(series.SeriesInstanceUID)) {\n modalities.add(series.instances[0].Modality);\n }\n });\n const modality = Array.from(modalities).join('/');\n\n if (displayStudySummary.key !== StudyInstanceUID) {\n setDisplayStudySummary({\n key: StudyInstanceUID,\n date: StudyDate, // TODO: Format: '07-Sep-2010'\n modality,\n description: StudyDescription,\n });\n }\n } else if (trackedStudy === '' || trackedStudy === undefined) {\n setDisplayStudySummary(DISPLAY_STUDY_SUMMARY_INITIAL_VALUE);\n }\n };\n\n // ~~ DisplayStudySummary\n useEffect(() => {\n updateDisplayStudySummary();\n }, [displayStudySummary.key, trackedMeasurements, trackedStudy, updateDisplayStudySummary]);\n\n // TODO: Better way to consolidated, debounce, check on change?\n // Are we exposing the right API for measurementService?\n // This watches for ALL measurementService changes. It updates a timestamp,\n // which is debounced. After a brief period of inactivity, this triggers\n // a re-render where we grab up-to-date measurements\n useEffect(() => {\n const added = measurementService.EVENTS.MEASUREMENT_ADDED;\n const addedRaw = measurementService.EVENTS.RAW_MEASUREMENT_ADDED;\n const updated = measurementService.EVENTS.MEASUREMENT_UPDATED;\n const removed = measurementService.EVENTS.MEASUREMENT_REMOVED;\n const cleared = measurementService.EVENTS.MEASUREMENTS_CLEARED;\n const subscriptions = [];\n\n [added, addedRaw, updated, removed, cleared].forEach(evt => {\n subscriptions.push(\n measurementService.subscribe(evt, () => {\n setMeasurementsUpdated(Date.now().toString());\n if (evt === added) {\n debounce(() => {\n measurementsPanelRef.current.scrollTop = measurementsPanelRef.current.scrollHeight;\n }, 300)();\n }\n }).unsubscribe\n );\n });\n\n return () => {\n subscriptions.forEach(unsub => {\n unsub();\n });\n };\n }, [measurementService, sendTrackedMeasurementsEvent]);\n\n async function exportReport() {\n const measurements = measurementService.getMeasurements();\n const trackedMeasurements = measurements.filter(\n m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID)\n );\n\n downloadCSVReport(trackedMeasurements, measurementService);\n }\n\n const jumpToImage = ({ uid, isActive }) => {\n measurementService.jumpToMeasurement(viewportGrid.activeViewportId, uid);\n\n onMeasurementItemClickHandler({ uid, isActive });\n };\n\n const onMeasurementItemEditHandler = ({ uid, isActive }) => {\n const measurement = measurementService.getMeasurement(uid);\n jumpToImage({ uid, isActive });\n\n const onSubmitHandler = ({ action, value }) => {\n switch (action.id) {\n case 'save': {\n measurementService.update(\n uid,\n {\n ...measurement,\n ...value,\n },\n true\n );\n }\n }\n uiDialogService.dismiss({ id: 'enter-annotation' });\n };\n\n uiDialogService.create({\n id: 'enter-annotation',\n centralize: true,\n isDraggable: false,\n showOverlay: true,\n content: Dialog,\n contentProps: {\n title: 'Annotation',\n noCloseButton: true,\n value: { label: measurement.label || '' },\n body: ({ value, setValue }) => {\n const onChangeHandler = event => {\n event.persist();\n setValue(value => ({ ...value, label: event.target.value }));\n };\n\n const onKeyPressHandler = event => {\n if (event.key === 'Enter') {\n onSubmitHandler({ value, action: { id: 'save' } });\n }\n };\n return (\n <Input\n label=\"Enter your annotation\"\n labelClassName=\"text-white grow text-[14px] leading-[1.2]\"\n autoFocus\n id=\"annotation\"\n className=\"border-primary-main bg-black\"\n type=\"text\"\n value={value.label}\n onChange={onChangeHandler}\n onKeyPress={onKeyPressHandler}\n />\n );\n },\n actions: [\n { id: 'cancel', text: 'Cancel', type: ButtonEnums.type.secondary },\n { id: 'save', text: 'Save', type: ButtonEnums.type.primary },\n ],\n onSubmit: onSubmitHandler,\n },\n });\n };\n\n const onMeasurementItemClickHandler = ({ uid, isActive }) => {\n if (!isActive) {\n const measurements = [...displayMeasurements];\n const measurement = measurements.find(m => m.uid === uid);\n\n measurements.forEach(m => (m.isActive = m.uid !== uid ? false : true));\n measurement.isActive = true;\n setDisplayMeasurements(measurements);\n }\n };\n\n const displayMeasurementsWithoutFindings = displayMeasurements.filter(\n dm => dm.measurementType !== measurementService.VALUE_TYPES.POINT\n );\n const additionalFindings = displayMeasurements.filter(\n dm => dm.measurementType === measurementService.VALUE_TYPES.POINT\n );\n\n return (\n <>\n <div\n className=\"invisible-scrollbar overflow-y-auto overflow-x-hidden\"\n ref={measurementsPanelRef}\n data-cy={'trackedMeasurements-panel'}\n >\n {displayStudySummary.key && (\n <StudySummary\n date={formatDate(displayStudySummary.date)}\n modality={displayStudySummary.modality}\n description={displayStudySummary.description}\n />\n )}\n <MeasurementTable\n title=\"Measurements\"\n data={displayMeasurementsWithoutFindings}\n servicesManager={servicesManager}\n onClick={jumpToImage}\n onEdit={onMeasurementItemEditHandler}\n />\n {additionalFindings.length !== 0 && (\n <MeasurementTable\n title=\"Additional Findings\"\n data={additionalFindings}\n servicesManager={servicesManager}\n onClick={jumpToImage}\n onEdit={onMeasurementItemEditHandler}\n />\n )}\n </div>\n <div className=\"flex justify-center p-4\">\n <ActionButtons\n onExportClick={exportReport}\n onCreateReportClick={() => {\n sendTrackedMeasurementsEvent('SAVE_REPORT', {\n viewportId: viewportGrid.activeViewportId,\n isBackupSave: true,\n });\n }}\n disabled={\n additionalFindings.length === 0 && displayMeasurementsWithoutFindings.length === 0\n }\n />\n </div>\n </>\n );\n}\n\nPanelMeasurementTableTracking.propTypes = {\n servicesManager: PropTypes.shape({\n services: PropTypes.shape({\n measurementService: PropTypes.shape({\n getMeasurements: PropTypes.func.isRequired,\n VALUE_TYPES: PropTypes.object.isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n};\n\n// TODO: This could be a measurementService mapper\nfunction _mapMeasurementToDisplay(measurement, types, displaySetService) {\n const { referenceStudyUID, referenceSeriesUID, SOPInstanceUID } = measurement;\n\n // TODO: We don't deal with multiframe well yet, would need to update\n // This in OHIF-312 when we add FrameIndex to measurements.\n\n const instance = DicomMetadataStore.getInstance(\n referenceStudyUID,\n referenceSeriesUID,\n SOPInstanceUID\n );\n\n const displaySets = displaySetService.getDisplaySetsForSeries(referenceSeriesUID);\n\n if (!displaySets[0] || !displaySets[0].images) {\n throw new Error('The tracked measurements panel should only be tracking \"stack\" displaySets.');\n }\n\n const {\n displayText: baseDisplayText,\n uid,\n label: baseLabel,\n type,\n selected,\n findingSites,\n finding,\n } = measurement;\n\n const firstSite = findingSites?.[0];\n const label = baseLabel || finding?.text || firstSite?.text || '(empty)';\n let displayText = baseDisplayText || [];\n if (findingSites) {\n const siteText = [];\n findingSites.forEach(site => {\n if (site?.text !== label) {\n siteText.push(site.text);\n }\n });\n displayText = [...siteText, ...displayText];\n }\n if (finding && finding?.text !== label) {\n displayText = [finding.text, ...displayText];\n }\n\n return {\n uid,\n label,\n baseLabel,\n measurementType: type,\n displayText,\n baseDisplayText,\n isActive: selected,\n finding,\n findingSites,\n };\n}\n\nexport default PanelMeasurementTableTracking;\n","import { Types } from '@ohif/core';\nimport { PanelMeasurementTableTracking, PanelStudyBrowserTracking } from './panels';\n\n// TODO:\n// - No loading UI exists yet\n// - cancel promises when component is destroyed\n// - show errors in UI for thumbnails if promise fails\nfunction getPanelModule({ commandsManager, extensionManager, servicesManager }): Types.Panel[] {\n return [\n {\n name: 'seriesList',\n iconName: 'tab-studies',\n iconLabel: 'Studies',\n label: 'Studies',\n component: PanelStudyBrowserTracking.bind(null, {\n commandsManager,\n extensionManager,\n servicesManager,\n }),\n },\n\n {\n name: 'trackedMeasurements',\n iconName: 'tab-linear',\n iconLabel: 'Measure',\n label: 'Measurements',\n component: PanelMeasurementTableTracking.bind(null, {\n commandsManager,\n extensionManager,\n servicesManager,\n }),\n },\n ];\n}\n\nexport default getPanelModule;\n","import React from 'react';\n\nconst Component = React.lazy(() => {\n return import(/* webpackPrefetch: true */ './viewports/TrackedCornerstoneViewport');\n});\n\nconst OHIFCornerstoneViewport = props => {\n return (\n <React.Suspense fallback={<div>Loading...</div>}>\n <Component {...props} />\n </React.Suspense>\n );\n};\n\nfunction getViewportModule({ servicesManager, commandsManager, extensionManager }) {\n const ExtendedOHIFCornerstoneTrackingViewport = props => {\n return (\n <OHIFCornerstoneViewport\n servicesManager={servicesManager}\n commandsManager={commandsManager}\n extensionManager={extensionManager}\n {...props}\n />\n );\n };\n\n return [\n {\n name: 'cornerstone-tracked',\n component: ExtendedOHIFCornerstoneTrackingViewport,\n },\n ];\n}\n\nexport default getViewportModule;\n","import getContextModule from './getContextModule';\nimport getPanelModule from './getPanelModule';\nimport getViewportModule from './getViewportModule';\nimport { id } from './id.js';\n\nconst measurementTrackingExtension = {\n /**\n * Only required property. Should be a unique value across all extensions.\n */\n id,\n\n getContextModule,\n getPanelModule,\n getViewportModule,\n};\n\nexport default measurementTrackingExtension;\n","import packageJson from '../package.json';\n\nconst id = packageJson.name;\n\nexport { id };\n"],"names":["RESPONSE","machineConfiguration","id","initial","context","activeViewportId","trackedStudy","trackedSeries","ignoredSeries","prevTrackedStudy","prevTrackedSeries","prevIgnoredSeries","ignoredSRSeriesForHydration","isDirty","states","off","type","idle","entry","on","TRACK_SERIES","SET_TRACKED_SERIES","target","actions","PROMPT_HYDRATE_SR","cond","RESTORE_PROMPT_HYDRATE_SR","HYDRATE_SR","UPDATE_ACTIVE_VIEWPORT_ID","assign","_","event","promptBeginTracking","invoke","src","onDone","onError","tracking","UNTRACK_SERIES","SAVE_REPORT","SET_DIRTY","promptTrackNewSeries","promptTrackNewStudy","promptSaveReport","promptHydrateStructuredReport","hydrateStructuredReport","strict","defaultOptions","services","ctx","evt","discardPreviouslyTrackedMeasurements","console","log","clearAllMeasurements","jumpToFirstMeasurementInActiveViewport","warn","showStructuredReportDisplaySetInActiveViewport","clearContext","setTrackedStudyAndSeries","slice","data","StudyInstanceUID","SeriesInstanceUID","setTrackedStudyAndMultipleSeries","studyInstanceUID","seriesInstanceUIDs","SeriesInstanceUIDs","setIsDirtyToClean","setIsDirty","ignoreSeries","ignoreHydrationForSRSeries","srSeriesInstanceUID","addTrackedSeries","removeTrackedSeries","filter","ser","guards","shouldSetDirty","undefined","includes","shouldKillMachine","userResponse","shouldAddSeries","shouldSetStudyAndSeries","shouldAddIgnoredSeries","shouldPromptSaveReport","shouldIgnoreHydrationForSR","shouldSaveAndContinueWithSameReport","isBackupSave","shouldSaveAndStartNewReport","shouldHydrateStructuredReport","hasRemainingTrackedSeries","length","hasNotIgnoredSRSeriesForHydration","isNewStudy","isNewSeries","NO_NEVER","CANCEL","CREATE_REPORT","ADD_SERIES","SET_STUDY_AND_SERIES","_ref","servicesManager","extensionManager","uiViewportDialogService","viewportId","Promise","async","resolve","reject","promptResult","message","ButtonEnums","secondary","text","value","primary","onSubmit","result","hide","show","onOutsideClick","_askTrackMeasurements","NO_NOT_FOR_SERIES","UIViewportDialogService","_askShouldAddMeasurements","_askSaveDiscardOrCancel","MIN_SR_SERIES_NUMBER","commandsManager","uiDialogService","measurementService","displaySetService","displaySetInstanceUIDs","createReportDialogPrompt","action","dataSource","getDataSources","trackedMeasurements","getMeasurements","m","referenceStudyUID","referenceSeriesUID","SeriesDescription","SeriesNumber","srSeriesNumbers","getActiveDisplaySets","ds","Modality","map","Math","max","getNextSRSeriesNumber","getReport","runCommand","measurementData","additionalFindingTypes","options","createReportAsync","createdDisplaySetInstanceUIDs","HYDRATE_REPORT","appConfig","displaySetInstanceUID","srDisplaySet","getDisplaySetByUID","hydrationResult","baseHydrateStructuredReport","TrackedMeasurementsContext","React","displayName","useTrackedMeasurements","useContext","SR_SOPCLASSHANDLERID","TrackedMeasurementsContextProvider","_ref2","children","useAppConfig","viewportGrid","viewportGridService","useViewportGrid","viewports","machineOptions","Object","referencedDisplaySetUID","referencedImages","images","isVolumeIdReferenced","imageId","startsWith","imageIndex","findIndex","image","imageIdToUse","keys","substring","setDisplaySetsForViewport","viewportOptions","initialImageOptions","index","StructuredReportDisplaySetInstanceUID","measurementIds","ms","fm","i","remove","uid","bind","measurementTrackingMachine","Machine","sendTrackedMeasurementsEvent","useMachine","useEffect","size","activeViewport","get","displaySet","SOPClassHandlerId","isLoaded","load","isRehydratable","Provider","propTypes","PropTypes","isRequired","BoundTrackedMeasurementsContextProvider","name","provider","formatDate","utils","PanelStudyBrowserTracking","getImageSrc","getStudiesForPatientByMRN","requestDisplaySetCreationForStudy","hangingProtocolService","uiNotificationService","navigate","useNavigate","t","useTranslation","StudyInstanceUIDs","useImageViewer","activeTabName","setActiveTabName","useState","expandedStudyInstanceUIDs","setExpandedStudyInstanceUIDs","studyDisplayList","setStudyDisplayList","displaySets","setDisplaySets","thumbnailImageSrcMap","setThumbnailImageSrcMap","jumpToDisplaySet","setJumpToDisplaySet","activeViewportDisplaySetInstanceUIDs","forEach","sid","qidoForStudyUID","query","studies","search","studyInstanceUid","Error","qidoStudiesForPatient","error","actuallyMappedStudies","study","AccessionNumber","accession","StudyDate","date","StudyDescription","description","NumInstances","instances","ModalitiesInStudy","modalities","PatientID","mrn","PatientName","patientName","StudyTime","time","qidoStudy","numInstances","prevArray","ret","find","it","push","fetchStudiesForPatient","currentDisplaySets","activeDisplaySets","newImageSrcEntry","dSet","imageIds","getImageIdsForDisplaySet","floor","unsupported","prevState","mappedDisplaySets","_mapDisplaySets","SubscriptionDisplaySetsAdded","subscribe","EVENTS","DISPLAY_SETS_ADDED","displaySetsAdded","madeInClient","unsubscribe","SubscriptionDisplaySetsChanged","DISPLAY_SETS_CHANGED","changedDisplaySets","SubscriptionDisplaySetMetaDataInvalidated","DISPLAY_SET_SERIES_METADATA_INVALIDATED","tabs","primaryStudyInstanceUIDs","primaryStudies","recentStudies","allStudies","displaySetsForStudy","dsSortFn","getDisplaySetSortFunction","sort","tabStudy","_byDate","a","b","dateA","Date","parse","label","studyA","studyB","_createStudyBrowserTabs","element","document","getElementById","scrollIntoView","behavior","thumbnailLocation","s","d","tabName","_findTabAndStudyOfDisplaySet","updatedExpandedStudyInstanceUIDs","StudyBrowser","onClickStudy","shouldCollapseStudy","stdyUid","onClickTab","clickedTabName","onClickUntrack","onClickThumbnail","onDoubleClickThumbnail","updatedViewports","getViewportsRequireUpdate","title","duration","setDisplaySetsForViewports","activeDisplaySetInstanceUIDs","trackedSeriesInstanceUIDs","thumbnailDisplaySets","thumbnailNoImageDisplaySets","excludeFromThumbnailBrowser","imageSrc","componentType","thumbnailNoImageModalities","_getComponentType","numPanes","getNumViewportPanes","viewportIdentificator","viewportData","viewportLabel","array","thumbnailProps","seriesNumber","modality","seriesDate","SeriesDate","numImageFrames","countIcon","messages","dragData","isTracked","isHydratedForDerivedDisplaySet","isHydrated","series","canReject","onReject","create","centralize","isDraggable","showOverlay","content","Dialog","contentProps","body","className","classes","onClose","dismiss","onShow","querySelector","focus","deleteDisplaySet","cornerstone","canvas","createElement","utilities","loadImageToCanvas","then","toDataURL","catch","some","retrieve","metadata","WrappedPanelStudyBrowserTracking","getActiveDataSource","utilityModule","getModuleEntry","exports","_getStudyForPatientUtility","_getStudiesForPatientByMRN","_getImageSrcFromImageId","useCallback","getCornerstoneLibraries","getImageSrcFromImageId","ex","_createGetImageSrcFromImageIdFn","_requestDisplaySetCreationForStudy","ActionButtons","onExportClick","onCreateReportClick","disabled","Button","onClick","small","defaultProps","alert","downloadCSVReport","DISPLAY_STUDY_SUMMARY_INITIAL_VALUE","key","PanelMeasurementTableTracking","measurementChangeTimestamp","setMeasurementsUpdated","now","toString","debouncedMeasurementChangeTimestamp","useDebounce","displayStudySummary","setDisplayStudySummary","displayMeasurements","setDisplayMeasurements","measurementsPanelRef","useRef","mappedMeasurements","measurement","types","SOPInstanceUID","DicomMetadataStore","getInstance","getDisplaySetsForSeries","displayText","baseDisplayText","baseLabel","selected","findingSites","finding","firstSite","siteText","site","measurementType","isActive","_mapMeasurementToDisplay","VALUE_TYPES","updateDisplayStudySummary","matches","studyMeta","getStudy","instanceMeta","Set","add","Array","from","join","added","MEASUREMENT_ADDED","addedRaw","RAW_MEASUREMENT_ADDED","updated","MEASUREMENT_UPDATED","removed","MEASUREMENT_REMOVED","cleared","MEASUREMENTS_CLEARED","subscriptions","debounce","current","scrollTop","scrollHeight","unsub","jumpToImage","jumpToMeasurement","onMeasurementItemClickHandler","onMeasurementItemEditHandler","_ref3","getMeasurement","onSubmitHandler","_ref4","update","noCloseButton","_ref5","setValue","Input","labelClassName","autoFocus","onChange","persist","onKeyPress","_ref6","measurements","displayMeasurementsWithoutFindings","dm","POINT","additionalFindings","ref","StudySummary","MeasurementTable","onEdit","iconName","iconLabel","component","Component","OHIFCornerstoneViewport","props","fallback","_extends","packageJson","getContextModule","getPanelModule","getViewportModule"],"sourceRoot":""}