diff Plugins/DicomWeb/Run.py @ 224:f5414254ccaa

test_bitbucket_issue_113
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 Feb 2019 18:16:12 +0100
parents f5aca0917d60
children 4d5af1f49cb2
line wrap: on
line diff
--- a/Plugins/DicomWeb/Run.py	Tue Feb 26 17:58:07 2019 +0100
+++ b/Plugins/DicomWeb/Run.py	Tue Feb 26 18:16:12 2019 +0100
@@ -1,4 +1,6 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
@@ -446,6 +448,34 @@
         self.assertEqual(1, b)
 
 
+    def test_bitbucket_issue_113(self):
+        # Wrong serialization of PN VR
+        # https://bitbucket.org/sjodogne/orthanc/issues/113
+        # https://bitbucket.org/sjodogne/orthanc-dicomweb/issues/2/
+        
+        UploadInstance(ORTHANC, 'Encodings/DavidClunie/SCSX1')
+        study = '1.3.6.1.4.1.5962.1.2.0.1175775771.5711.0'
+
+        # This is the WADO-RS testing
+        a = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % study)
+        self.assertEqual(1, len(a))
+
+        pn = a[0]['00100010']  # Patient name
+        self.assertEqual('PN', pn['vr'])
+        self.assertEqual(1, len(pn['Value']))
+        self.assertEqual('Wang^XiaoDong', pn['Value'][0]['Alphabetic'])
+        self.assertEqual(u'王^小東', pn['Value'][0]['Ideographic'])
+
+        # This is the QIDO-RS testing
+        a = DoGet(ORTHANC, '/dicom-web/studies')
+        self.assertEqual(1, len(a))
+
+        pn = a[0]['00100010']  # Patient name
+        self.assertEqual('PN', pn['vr'])
+        self.assertEqual(1, len(pn['Value']))
+        self.assertEqual('Wang^XiaoDong', pn['Value'][0]['Alphabetic'])
+        self.assertEqual(u'王^小東', pn['Value'][0]['Ideographic'])
+
 
 try:
     print('\nStarting the tests...')