changeset 652:dfd42a6c13fa

added test_tags_after_pixel_data
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Jun 2024 17:47:11 +0200
parents c3aa39672db1
children fdd90df1e8ff
files Database/2024-05-30-GuillemVela.dcm Tests/Tests.py
diffstat 2 files changed, 45 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file Database/2024-05-30-GuillemVela.dcm has changed
--- a/Tests/Tests.py	Mon Jun 03 14:20:17 2024 +0200
+++ b/Tests/Tests.py	Tue Jun 04 17:47:11 2024 +0200
@@ -10150,6 +10150,51 @@
         s = re.findall('\(0008,0000\).*?\[(.*?)\]', i)
         self.assertEqual(0, len(s))
 
+
+    def test_tags_after_pixel_data(self):
+        # https://discourse.orthanc-server.org/t/private-tags-with-group-7fe0-are-not-provided-via-rest-api/4744
+        u = UploadInstance(_REMOTE, '2024-05-30-GuillemVela.dcm') ['ID']
+
+        a = DoGet(_REMOTE, '/instances/%s/tags' % u)
+        self.assertFalse('8e05,1000' in a)
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?whole' % u)
+        self.assertTrue('8e05,1000' in a)
+        self.assertEqual('XEOS_Attributes', a['8e05,0010']['Value'])
+        self.assertEqual('acquisition', a['8e05,1000']['Value'])
+        self.assertEqual('specimen', a['8e05,1001']['Value'])
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?full' % u)
+        self.assertFalse('8e05,1000' in a)
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?full&whole' % u)
+        self.assertTrue('8e05,1000' in a)
+        self.assertEqual('XEOS_Attributes', a['8e05,0010']['Value'])
+        self.assertEqual('acquisition', a['8e05,1000']['Value'])
+        self.assertEqual('specimen', a['8e05,1001']['Value'])
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?short' % u)
+        self.assertFalse('8e05,1000' in a)
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?short&whole' % u)
+        self.assertTrue('8e05,1000' in a)
+        self.assertEqual('XEOS_Attributes', a['8e05,0010'])
+        self.assertEqual('acquisition', a['8e05,1000'])
+        self.assertEqual('specimen', a['8e05,1001'])
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?simplify' % u)
+        self.assertFalse('Unknown Tag & Data' in a)
+
+        a = DoGet(_REMOTE, '/instances/%s/tags?simplify&whole' % u)
+        self.assertTrue('Unknown Tag & Data' in a)
+
+        a = DoGet(_REMOTE, '/instances/%s/simplified-tags' % u)
+        self.assertFalse('Unknown Tag & Data' in a)
+
+        a = DoGet(_REMOTE, '/instances/%s/simplified-tags?whole' % u)
+        self.assertTrue('Unknown Tag & Data' in a)
+
+
     def test_requested_tags(self):
         u = UploadInstance(_REMOTE, 'DummyCT.dcm')