Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: group measurements by study #4617

Open
wants to merge 11 commits into
base: feat/measurements-service-filtering
Choose a base branch
from

Conversation

pedrokohler
Copy link
Collaborator

Context

Building on top of: #4501

Changes & Results

These changes group the measurements of the all-measurements tab by study.

Testing

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] OS:
  • [] Node version:
  • [] Browser:

Copy link

netlify bot commented Dec 19, 2024

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit a511a62
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/67643855b1f2e80008179325
😎 Deploy Preview https://deploy-preview-4617--ohif-platform-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 19, 2024

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit a511a62
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/67643855de2b420009f8dae0
😎 Deploy Preview https://deploy-preview-4617--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pedrokohler pedrokohler changed the title Feat/measurements service filtering feat(measurementsPanel): group measurements by study Dec 19, 2024
@pedrokohler pedrokohler changed the title feat(measurementsPanel): group measurements by study feat: group measurements by study Dec 19, 2024
@wayfarer3130 wayfarer3130 changed the base branch from master to feat/measurements-service-filtering December 20, 2024 15:32
…/Viewers into feat/measurements-service-filtering
@@ -53,6 +53,7 @@ function PanelMeasurementTableTracking({
extensionManager={extensionManager}
commandsManager={commandsManager}
measurementFilters={measurementFilters}
title="Measurements"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grouping function should get passed in here to PanelMeasurements, and should be a grouping function that groups things into "Tracked Measurements" with a group header being the study header, and the body being the default PanelMeasurements sub-grouping.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the default grouping function for PanelMeasurements is fine, just passing in the top level selector which selects only tracked measurements, and that should ONLY use series instance UID so that when we add multiple studies to PanelMeasurement it just automatically creates multiple sub-groups.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering measurements to include only tracked ones is understandable—that makes sense.

However, I don’t understand why, or even what it means, to 'group' measurements by 'tracked measurements.' Could you clarify?

@wayfarer3130
Copy link
Contributor

Could you add two additional breakdown to the PanelMeasurements, and change the configuration of PanelMeasurements to use that. The classes/functions we want are:

groupStudyMeasurement(props, measurements)

  • this is a configurable function that takes the list of measurements and produces a set of grouping items for them, using the props to define any of the grouping methods.
  • the return type is an array of object containing an optional header and a mandatory body, maybe a collapsed body
  • the return instance value creates one array element per study UID found in the measurements, and has an instance of PanelMeasurementGroup as it's default body instance if not configured otherwise in the props
  • For example, it might have [ {key: studyInstanceUID, body: PanelMeasurementGroup, items: filtered measurements }, ... same sort of item for every study]

Then split the existing primary items/additional items into a separate component that just shows the two items, along with the primary header.

@@ -28,7 +28,7 @@ function PanelMeasurementTableTracking({
});

useEffect(() => {
let updatedMeasurementFilters = { ...measurementFilters };
const updatedMeasurementFilters = { ...measurementFilters };
if (trackedMeasurements.matches('tracking') && trackedStudy) {
updatedMeasurementFilters.measurementFilter = filterTracked(trackedStudy, trackedSeries);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the measurementFilter to be just a single filter, and make it independent of the tracked study.

variant="ghost"
className="pl-1.5"
onClick={() => {
commandsManager.runCommand('clearMeasurements', measurementFilters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch - this one is running clear measurements instead of saveCSV - can you fix that so it runs saveCSV (or whatever the command name is to save the CSV)
Also, can you pass in the nested measurement filter instead of the top level measurement filter for all 3 commands - that is the new filter I (just) asked to be created in the PanelMeasurement table - that way the command applies to the correct set of data.

@@ -0,0 +1,13 @@
export const groupByStudy = displaySetService => (groupedMeasurements, item) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add a docs to indicate that this groups measurements by study in order to allow display and saving by study.

Copy link
Contributor

@wayfarer3130 wayfarer3130 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very close now, I did notice one bug that had been previously introduced (probably by me) that needs fixing, and another issue that would only occur if we enabled multiple study tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants