# HG changeset patch # User Sebastien Jodogne # Date 1544784138 -3600 # Node ID bc8bc83465dcb32b2ae8982269a8c4535ecfabad # Parent 40c167db0e110366e33647cd5f5d9af99e0eda9d testing C-FIND optimization diff -r 40c167db0e11 -r bc8bc83465dc Tests/Tests.py --- a/Tests/Tests.py Mon Dec 10 16:25:59 2018 +0100 +++ b/Tests/Tests.py Fri Dec 14 11:42:18 2018 +0100 @@ -1161,11 +1161,6 @@ series = re.findall('\(0010,0010\).*?\[\s*(.*?)\s*\]', i) self.assertEqual(1, len(series)) - # Test returning sequence values (only since Orthanc 0.9.5) - i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0008,2112' ]) # "ColorTestImageJ" has this sequence tag - sequences = re.findall('\(0008,2112\)', i) - self.assertEqual(1, len(sequences)) - # Test range search (buggy if Orthanc <= 0.9.6) i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', 'StudyDate=19980312-' ]) studies = re.findall('\(0008,0020\).*?\[\s*(.*?)\s*\]', i) @@ -1182,6 +1177,38 @@ self.assertTrue('19980312' in studies) + def test_incoming_findscu_2(self): + # This test fails if "LookupMode_DatabaseOnly" is used + # (sequences are not available in this mode, and only main + # DICOM tags are returned) + UploadInstance(_REMOTE, 'Multiframe.dcm') + UploadInstance(_REMOTE, 'ColorTestImageJ.dcm') + + # Test returning sequence values (only since Orthanc 0.9.5) + i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0008,2112' ]) # "ColorTestImageJ" has this sequence tag + sequences = re.findall('\(0008,2112\)', i) + self.assertEqual(1, len(sequences)) + + # Test returning a non-main DICOM tag, + # "SecondaryCaptureDeviceID" (0018,1010), whose value is + # "MEDPC" in "ColorTestImageJ.dcm" + i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0018,1010' ]) + tags = re.findall('\(0018,1010\).*MEDPC', i) + self.assertEqual(1, len(tags)) + + + def test_incoming_findscu_3(self): + # This test fails if "LookupMode_DatabaseOnly" or + # "LookupMode_DiskOnAnswer" is used, as + # "SecondaryCaptureDeviceID" (0018,1010) is not a main DICOM + # tag, as thus a constraint cannot be applied to it + UploadInstance(_REMOTE, 'ColorTestImageJ.dcm') + + i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0018,1010=MEDPC' ]) + sequences = re.findall('\(0018,1010\)', i) + self.assertEqual(1, len(sequences)) + + def test_incoming_movescu(self): UploadInstance(_REMOTE, 'Multiframe.dcm')