comparison Plugins/DicomWeb/Run.py @ 487:18f2d55182fd

more dicom-web tests
author Alain Mazy <am@osimis.io>
date Wed, 29 Jun 2022 11:23:33 +0200
parents 06eea14c5906
children 9a6fa1ffb23a
comparison
equal deleted inserted replaced
486:6144ef431512 487:18f2d55182fd
1006 self.assertFalse('00100010' in a[0]) # PatientName 1006 self.assertFalse('00100010' in a[0]) # PatientName
1007 self.assertEqual(study, a[0]['0020000D']['Value'][0]) 1007 self.assertEqual(study, a[0]['0020000D']['Value'][0])
1008 self.assertEqual(series, a[0]['0020000E']['Value'][0]) 1008 self.assertEqual(series, a[0]['0020000E']['Value'][0])
1009 self.assertEqual('MR', a[0]['00080060']['Value'][0]) 1009 self.assertEqual('MR', a[0]['00080060']['Value'][0])
1010 1010
1011 # if we ask explicitely for the Patient and Study tags, we must get it
1012 a = DoGet(ORTHANC, '/dicom-web/series?0020000D=%s&includefield=00100010&includefield=00080020' % study)
1013 self.assertEqual(1, len(a))
1014 self.assertTrue('00100010' in a[0]) # PatientName
1015 self.assertTrue('00080020' in a[0]) # StudyDate
1016
1017 # if {StudyInstanceUID} *is not* specified, we must get the PatientName
1018 a = DoGet(ORTHANC, '/dicom-web/series')
1019 self.assertTrue('00100010' in a[0]) # PatientName
1020
1011 # http://dicom.nema.org/medical/dicom/2019a/output/html/part18.html#table_6.7.1-2b 1021 # http://dicom.nema.org/medical/dicom/2019a/output/html/part18.html#table_6.7.1-2b
1012 a = DoGet(ORTHANC, '/dicom-web/instances?0020000D=%s' % study) 1022 a = DoGet(ORTHANC, '/dicom-web/instances?0020000D=%s' % study)
1013 self.assertEqual(1, len(a)) 1023 self.assertEqual(1, len(a))
1014 self.assertFalse('00100010' in a[0]) # PatientName 1024 self.assertFalse('00100010' in a[0]) # PatientName
1015 self.assertEqual(study, a[0]['0020000D']['Value'][0]) 1025 self.assertEqual(study, a[0]['0020000D']['Value'][0])
1027 self.assertEqual(1, len(a)) 1037 self.assertEqual(1, len(a))
1028 self.assertFalse('00100010' in a[0]) # PatientName 1038 self.assertFalse('00100010' in a[0]) # PatientName
1029 self.assertFalse('00080060' in a[0]) # Modality 1039 self.assertFalse('00080060' in a[0]) # Modality
1030 self.assertEqual(study, a[0]['0020000D']['Value'][0]) 1040 self.assertEqual(study, a[0]['0020000D']['Value'][0])
1031 self.assertEqual(series, a[0]['0020000E']['Value'][0]) 1041 self.assertEqual(series, a[0]['0020000E']['Value'][0])
1042
1043 # if we ask explicitely for the Patient and Study tags, we must get it
1044 a = DoGet(ORTHANC, '/dicom-web/instances?0020000D=%s&includefield=00100010&includefield=00080020' % study)
1045 self.assertEqual(1, len(a))
1046 self.assertTrue('00100010' in a[0]) # PatientName
1047 self.assertTrue('00080020' in a[0]) # StudyDate
1048
1049 # if {StudyInstanceUID} *is not* specified, we must get all Study, Series and Patient tags
1050 a = DoGet(ORTHANC, '/dicom-web/instances')
1051 self.assertTrue('00100010' in a[0]) # PatientName
1052 self.assertTrue('00080020' in a[0]) # StudyDate
1053 self.assertTrue('00080060' in a[0]) # Modality
1032 1054
1033 1055
1034 #@unittest.skip("Skip this test on GDCM 2.8.4") 1056 #@unittest.skip("Skip this test on GDCM 2.8.4")
1035 def test_bitbucket_issue_164(self): 1057 def test_bitbucket_issue_164(self):
1036 # WARNING - This makes GDCM 2.8.4 crash 1058 # WARNING - This makes GDCM 2.8.4 crash