# HG changeset patch # User Sebastien Jodogne # Date 1551201372 -3600 # Node ID f5414254ccaaec4af1e3f7c20562ee7154a16d40 # Parent f5aca0917d60228a80dd2986d4c04bd6f03b3e3f test_bitbucket_issue_113 diff -r f5aca0917d60 -r f5414254ccaa GenerateConfigurationForTests.py --- a/GenerateConfigurationForTests.py Tue Feb 26 17:58:07 2019 +0100 +++ b/GenerateConfigurationForTests.py Tue Feb 26 18:16:12 2019 +0100 @@ -98,8 +98,7 @@ config = json.loads(nocomment) -del config['DefaultEncoding'] - +config['DefaultEncoding'] = 'Utf8' config['AllowFindSopClassesInStudy'] = False config['AuthenticationEnabled'] = True config['DicomAet'] = 'ORTHANC' diff -r f5aca0917d60 -r f5414254ccaa Plugins/DicomWeb/Run.py --- 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...')