kalwar / orthanc

Automatically exported from code.google.com/p/orthanc
GNU General Public License v3.0
0 stars 0 forks source link

QR response missing "Query/Retrieve Level" (008,0052) #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run test QR tool
2. tool reports that there is no "query retrieve level" in the responses

What is the expected output? What do you see instead?

The request from the test client is something like:

QueryUser::Query(): REQUEST -----------
(0008,0020) - StudyDate = 
(0008,0030) - StudyTime = 
(0008,0050) - AccessionNumber = 
(0008,0052) - QueryRetrieveLevel = STUDY
(0008,0061) - ModalitiesInStudy = 
(0008,0062) - SOPClassesInStudy = 
(0008,0090) - ReferringPhysicianName = 
etc

and the response from Orthanc has:

----progressCallback(): RESPONSE: 1 (Pending)
(0008,0020) - StudyDate = 20071018
(0008,0030) - StudyTime = 112403
(0008,0050) - AccessionNumber = 0001092453
(0008,0061) - ModalitiesInStudy = 
(0008,0062) - SOPClassesInStudy = 
etc

Note that the required (0008,0052) element is missing.

What version of the product are you using? On what operating system?

version 0.8.6
running on Windows 7 x64

Please provide any additional information below.

Original issue reported on code.google.com by pbheffer...@gmail.com on 28 Mar 2015 at 6:39

GoogleCodeExporter commented 9 years ago
Thanks for reporting this issue!

It has just been fixed in the mainline:
https://code.google.com/p/orthanc/source/detail?r=f2033e228864783f67b12819c77bd9
3fe95d32c1

Original comment by s.jodo...@gmail.com on 30 Mar 2015 at 12:36

GoogleCodeExporter commented 9 years ago
I downloaded the code with the fix and did a build, but it seems to have not 
helped. the code in question appears to be:

      // Fix issue 30 (QR response missing "Query/Retrieve Level" (008,0052))
      /*if (query.GetElement(i).GetTag() != DICOM_TAG_QUERY_RETRIEVE_LEVEL &&
        query.GetElement(i).GetTag() != DICOM_TAG_SPECIFIC_CHARACTER_SET)*/
      {
        std::string tag = query.GetElement(i).GetTag().Format();
        std::string value;
        if (resource.isMember(tag))
        {
          value = resource.get(tag, Json::arrayValue).get("Value", "").asString();
          result.SetValue(query.GetElement(i).GetTag(), value);
        }
        else
        {
          result.SetValue(query.GetElement(i).GetTag(), "");
        }
      }
    }

I don't know the architecture, but "assuming" that "resource" refers to the 
information from a matching object, then I would expect that 
resource.isMember(tag) will be "false" as the query level is passed in, it is 
not part of the object. the fix is probably more like:

      // Fix issue 30 (QR response missing "Query/Retrieve Level" (008,0052))
      /*if (query.GetElement(i).GetTag() != DICOM_TAG_QUERY_RETRIEVE_LEVEL &&
        query.GetElement(i).GetTag() != DICOM_TAG_SPECIFIC_CHARACTER_SET)*/
        if (query.GetElement(i).GetTag() == DICOM_TAG_QUERY_RETRIEVE_LEVEL)
        {
            result.SetValue(query.GetElement(i).GetTag(), query.GetElement(i).GetValue());
        }
        else if (query.GetElement(i).GetTag() == DICOM_TAG_SPECIFIC_CHARACTER_SET)
        {
        }
        else

Original comment by pbheffer...@gmail.com on 19 Apr 2015 at 8:05

GoogleCodeExporter commented 9 years ago
Hi,

Sorry for this bad fix, you are of course fully right!

Just pushed the right patch:
https://code.google.com/p/orthanc/source/detail?r=911a1ad5ebe876a4e4d4e223671373
d94bdfb38a

Original comment by s.jodo...@gmail.com on 20 Apr 2015 at 3:27