OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.35k stars 3.36k forks source link

Added modality in worklist, unable to filter #8

Closed mtjvankuik closed 8 years ago

mtjvankuik commented 8 years ago

I've found out that the modalities tag is empty, so filtering on modalities tag would be impossible. Therefore the modalities filter is replaced by the modality filter. I have been succesfull at loading the corresponding modality tag for each study into the worklist.

Every filter works correctly, except the (recently added) modality filter. I have tried to debug the javascript WorklistResult.js through the console window of google chrome. The filter string is added successfully when looking at local variables in console, and the same goes for loading the modality string for the corresponding study. It seems something is going wrong when comparing string A vs string B, and check whether they are identical or not.

I have added this line of code in WorklistResult.js: modality: getFilter($('input#modality').val()), //added

The filter function seems to work when debugging (I can filter on other tags, i.e. Patient Name ). My suspicions are that the fault remains in this piece of code.

    // Loop through all identified studies
    studies.forEach(function(study) {

        // Search the rest of the parameters that aren't done via the server call
        if (isIndexOf(study.modalities, modality) &&
            (new Date(studyDateFrom).setHours(0, 0, 0, 0) <= convertStringToStudyDate(study.studyDate) || !studyDateFrom || studyDateFrom === "") &&
            (convertStringToStudyDate(study.studyDate) <= new Date(studyDateTo).setHours(0, 0, 0, 0) || !studyDateTo || studyDateTo === "")) {

            // Convert numberOfStudyRelatedInstance string into integer
            study.numberOfStudyRelatedInstances = parseInt(study.numberOfStudyRelatedInstances);
            // Insert any matching studies into the WorklistStudies Collection
            WorklistStudies.insert(study);
        }
    });

    if (WorklistStudies.find().count() === 0) {
        // Show notFound text
        searchResults.showNotFoundMessage = true;
        Session.set("searchResults", searchResults);
    }`
mtjvankuik commented 8 years ago

github_issue

ayselafsar commented 8 years ago

Hi Martin,

The modality tag was not set properly in server code. I just fixed it. Could you give it a try?

mtjvankuik commented 8 years ago

Hi ayselafsar,

I tried it but I still got a loading screen. The thing is that I use DICOM files in which the modalities tag 0008,0061 is empty. My studies consist of only 1 modality per study. Therefore I tried to replace the modalities tag with the modality tag 0008,0060. However, something is still going wrong.

I also had to add the following line of code in studies.js to be able to import the modality tag: studies.js function filterToQIDOURL(server, filter) { var commaSeparatedFields = [ '00081030', // Study Description '00080060' // Modality added // Add more fields here if you want them in the Study List ].join(',');

and

modality: DICOMWeb.getString(study['00080060'])

WorklistStudy.html `

{{modality}} ` WorklistResult.html ` Modality ` Any ideas?
ayselafsar commented 8 years ago

Hi @mtjvankuik I merged 0008,0060 - modality and 0008,0061- modalitiesInStudy tags and getting modalities tag that is shown in Study List table. Now modality is filtered between studies returned from WorklistSearch call. It works for me. Could you try again?

mtjvankuik commented 8 years ago

Hi @ayselafsar Thanks a lot! It is working for me as expected right now.