Display series specified by URL parameters in viewer - #2979
Conversation
✅ Deploy Preview for ohif-platform-docs canceled.
|
|
|
||
| // const wadoDicomWebClient = new api.DICOMwebClient(wadoConfig); | ||
| const wadoDicomWebClient = staticWado | ||
| ? new StaticWadoClient(wadoConfig) |
There was a problem hiding this comment.
Just always create the StaticWadoClient, as it falls back to the base client if not required.
✅ Deploy Preview for ohif-platform-viewer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
| "build": "lerna run build:viewer --stream", | ||
| "build:dev": "lerna run build:dev --stream", | ||
| "build:ci": "lerna run build:viewer:ci --stream", | ||
| "build:static": "lerna run build:static --stream && cp -rf ./platform/viewer/dist/* ~/ohif/.", |
There was a problem hiding this comment.
Don't want to include this line - suggest you run:
set APP_CONFIG=config/local_static.js
yarn start
which will automatically rebuild
| wadoUriRoot: 'http://localhost:5000/dicomweb', | ||
| qidoRoot: 'http://localhost:5000/dicomweb', | ||
| wadoRoot: 'http://localhost:5000/dicomweb', | ||
| wadoUriRoot: 'http://localhost:5001/dicomweb', |
There was a problem hiding this comment.
Definitely don't commit this
| */ | ||
| function defaultRouteInit( | ||
| { servicesManager, studyInstanceUIDs, dataSource }, | ||
| { servicesManager, studyInstanceUIDs, dataSource, seriesInstanceUID }, |
There was a problem hiding this comment.
Grab the filters here direct, as there might be more than just seriesInstanceUID
Codecov Report
@@ Coverage Diff @@
## v3-stable #2979 +/- ##
==============================================
+ Coverage 25.15% 37.51% +12.35%
==============================================
Files 119 101 -18
Lines 2862 2154 -708
Branches 555 440 -115
==============================================
+ Hits 720 808 +88
+ Misses 1856 1103 -753
+ Partials 286 243 -43
Continue to review full report at Codecov.
|
|
|
||
|
|
||
| const setupRouteInit = async () => { | ||
| const seriesInstanceUID = query.get('SeriesInstaceUID'); |
There was a problem hiding this comment.
Grab from the query the actual full list of parameters as the filters, and then exclude the studyInstanceUIDs parameter from it, as that one shouldn't be present. Something like:
const filters = Object.fromEntries(query.values.filter(([key]) => key!='StudyInstanceUIDs'))
You should play with that in a nodejs command line tool - I may well not have it quite right there.
…re' of https://github.com/TFRadicalImaging/Viewers into feat/add-series-instance-uid-query-parameter-to-ohif-core
| if (!valueElem) return false; | ||
| if (valueElem.vr == 'DA') return this.compareDateRange(testValue, valueElem.Value[0]); | ||
| if (valueElem.vr == 'DA') | ||
| return this.compareDateRange(testValue, valueElem.Value[0]); |
There was a problem hiding this comment.
If this is a separate line, it needs { around it
| sortFunction | ||
| ); | ||
| const data = await retrieveMetadataLoader.execLoad(); | ||
|
|
There was a problem hiding this comment.
Please revert empty changes
| const query = useQuery(); | ||
| const params = useParams(); | ||
|
|
||
| // console.log('\n\n\n\n\n\n', { params, query }, '\n\n\n\n\n\n'); |
There was a problem hiding this comment.
Please delete the console.log message
| }; | ||
|
|
||
| static seriesFilterKeys = { | ||
| SeriesInstanceUID: '0020000E', |
There was a problem hiding this comment.
Can you add SeriesNumber to this list just to be able to test with an extra parameter for the filters.
|
@sedghi - other than two small changes I think this one is ready to go - it adds the ability to choose which series to display on going to the viewer page Otherwise doesn't affect functionality. |
| : new api.DICOMwebClient(qidoConfig); | ||
| const wadoDicomWebClient = new api.DICOMwebClient(wadoConfig); | ||
|
|
||
| const wadoDicomWebClient = new StaticWadoClient(wadoConfig); |
There was a problem hiding this comment.
ALireza requested with have the staticWado ? .... style instead of replacing the thing entirely
| const filters = Array.from(query.keys()).reduce( | ||
| (acc: Record<string, string>, val: string) => { | ||
| if (val !== 'StudyInstanceUIDs') { | ||
| return { ...acc, [val]: query.get(val) }; | ||
| } | ||
| }, | ||
| {} | ||
| ); |
There was a problem hiding this comment.
can you please write down what this reduce is making as a comment? like as an example in the top of it
| servicesManager, | ||
| studyInstanceUIDs, | ||
| dataSource, | ||
| filters, |
There was a problem hiding this comment.
this might need to be passed to the custom init above as well
There was a problem hiding this comment.
This is great addition. one major comments
Currently the filter only works if it is lower case seresInstanceUID and it does not work with SeriesInstanceUID. Since we have StudyInstanceUIDs right now as a param in URL this will be super confusing. We need to fix this before merge, and also possibly somewhere add some documentation
…th StudyInstanceUID
… right change on Mode.tsx
| /** | ||
| * The next line should get all the query parameters provided by the URL | ||
| * - except the StudyInstaceUIDs - and create an object called filters | ||
| * used to filtering the study as the user wants otherwise it will return | ||
| * a empty object. | ||
| * | ||
| * Example: | ||
| * const filters = { | ||
| * seriesInstaceUID: 1.2.276.0.7230010.3.1.3.1791068887.5412.1620253993.114611 | ||
| * } | ||
| */ |
There was a problem hiding this comment.
Nice comment, please keep it up always with details. Grat job
sedghi
left a comment
There was a problem hiding this comment.
This looks great, eventually we should have a page on doc (makes sense when we support more filters?) that demonstrate this feature. But for now good to go
Display the series specified by the URL parameter seriesInstanceUID, and potentially other series parameters.