changeset 383:05d0d0c2623c

added test_cp246
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 Feb 2021 12:16:07 +0100
parents a8dd562943a7
children 9a41306c1fe5
files Database/2021-02-19-MalaterreCP246.dcm Tests/Tests.py
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file Database/2021-02-19-MalaterreCP246.dcm has changed
--- a/Tests/Tests.py	Tue Feb 23 15:13:56 2021 +0100
+++ b/Tests/Tests.py	Wed Feb 24 12:16:07 2021 +0100
@@ -6507,3 +6507,25 @@
 
         self.assertEqual(1, len(DoGet(_LOCAL, '/patients')))
         self.assertEqual(0, len(DoGet(_REMOTE, '/patients')))
+
+
+    def test_cp246(self):
+        # This fails on Orthanc <= 1.9.0
+        a = UploadInstance(_REMOTE, '2021-02-19-MalaterreCP246.dcm')['ID']
+        self.assertEqual(1, len(DoGet(_REMOTE, '/instances')))
+
+        tags = DoGet(_REMOTE, '/instances/%s/tags?short' % a)
+        self.assertEqual('1.2.840.10008.5.1.4.1.1.128', tags['0008,0016'])
+        self.assertEqual('1.3.12.2.1107.5.1.4.36085.2.0.517715415141633', tags['0008,0018'])
+        self.assertEqual('1.2.840.113745.101000.1008000.38179.6792.6324567', tags['0020,000d'])
+        self.assertEqual('1.3.12.2.1107.5.1.4.36085.2.0.517714246252254', tags['0020,000e'])
+
+        study = DoGet(_REMOTE, '/instances/%s/study' % a)
+        self.assertEqual(tags['0020,000d'], study['MainDicomTags']['StudyInstanceUID'])
+
+        series = DoGet(_REMOTE, '/instances/%s/series' % a)
+        self.assertEqual(tags['0020,000e'], series['MainDicomTags']['SeriesInstanceUID'])
+
+        instance = DoGet(_REMOTE, '/instances/%s' % a)
+        self.assertEqual(tags['0008,0018'], instance['MainDicomTags']['SOPInstanceUID'])
+