-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix : Differentiate recent and all in study panel #4085
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ohif-platform-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4085 +/- ##
==========================================
- Coverage 46.23% 44.41% -1.83%
==========================================
Files 78 80 +2
Lines 1276 1333 +57
Branches 312 327 +15
==========================================
+ Hits 590 592 +2
- Misses 548 588 +40
- Partials 138 153 +15 ☔ View full report in Codecov by Sentry. |
//If primary study, add to primary study | ||
if (primaryStudyInstanceUIDs.includes(study.studyInstanceUid)) { | ||
primaryStudies.push(tabStudy); | ||
} else { | ||
// TODO: Filter allStudies to dates within one year of current date | ||
recentStudies.push(tabStudy); | ||
allStudies.push(tabStudy); | ||
} | ||
//In all case add to all Studies tab | ||
allStudies.push(tabStudy); | ||
}); | ||
|
||
//Get primary studies date as time stamp | ||
const primaryStudiesTimestamps = primaryStudies.filter(study => study.date).map((study) => new Date(study.date).getTime()) | ||
|
||
if (primaryStudiesTimestamps.length > 0) { | ||
|
||
const oldestPrimaryTimeStamp = Math.min(...primaryStudiesTimestamps) | ||
const oneYearInMs = 365 * 24 * 3600 * 1000 | ||
|
||
//Select studies date previous to primary studies and up to one year earlier | ||
recentStudies = allStudies.filter(study => { | ||
if (!study.date) return false | ||
const studyTimeStamp = new Date(study.date).getTime() | ||
return (oldestPrimaryTimeStamp - studyTimeStamp) < oneYearInMs | ||
}) | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the issue here is that it's not following the same logic as PanelStudyBrowserTracking
. Instead of having it here, could we please export it as a utility so that both PanelStudyBrowser
and PanelStudyBrowserTracking
can utilize it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IbrahimCSAE will do this
Context
This PR tries to solve : #3714
It were remaining a partial implementation in which the "recent" tab and "all" tab was displaying the same content.
Changes & Results
For Primary tab => No changes
For Recent => It now list studies prior to the oldest primary study with a limit time of 1y
For All => It now list all patient's studies without restrictions (including primary studies)
Testing
This change does not affect Basic mode as this mode uses PanelStudyBrowserTracking, while this PR updated PanelStudyBrowser
@sedghi is there any plane to make this two sharing at least a common code base ? There a lot of duplicated code between both.
Checklist
PR
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Chrome Latest