changeset 223:f5aca0917d60

DICOMweb: test_bitbucket_issue_111
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 Feb 2019 17:58:07 +0100
parents 0f03ee6ffa80
children f5414254ccaa
files Database/Issue111.dcm Database/Issue111.dump Plugins/DicomWeb/Run.py
diffstat 3 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
Binary file Database/Issue111.dcm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Database/Issue111.dump	Tue Feb 26 17:58:07 2019 +0100
@@ -0,0 +1,5 @@
+# dump2dcm +Ug --write-xfer-little Issue111.dump Issue111.dcm
+
+(0010,0020) LO A              # Patient ID
+(0010,0010) PN HELLO^A        # Patient Name
+(0008,0050) SH (no value available)  #  AccessionNumber
--- a/Plugins/DicomWeb/Run.py	Tue Feb 26 17:34:32 2019 +0100
+++ b/Plugins/DicomWeb/Run.py	Tue Feb 26 17:58:07 2019 +0100
@@ -330,6 +330,10 @@
 
 
     def test_bitbucket_issue_111(self):
+        # Wrong serialization of empty values
+        # https://bitbucket.org/sjodogne/orthanc/issues/111
+        # https://bitbucket.org/sjodogne/orthanc-dicomweb/issues/3/
+
         # According to the standard, section F.2.5
         # (http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_F.2.5.html),
         # null values behave as follows: If an attribute is present in
@@ -338,11 +342,17 @@
         # "Value", "BulkDataURI" or "InlineBinary".
         # https://bitbucket.org/sjodogne/orthanc/issues/111/qido-rs-wrong-serialization-of-empty
 
-        UploadInstance(ORTHANC, 'ColorTestMalaterre.dcm')
+        UploadInstance(ORTHANC, 'Issue111.dcm')
 
-        a = DoGet(ORTHANC, '/dicom-web/studies',
-                  headers = { 'accept' : 'application/json' })
+        # Test WADO-RS
+        a = DoGet(ORTHANC, '/dicom-web/studies/1.2.276.0.7230010.3.1.2.8323329.30185.1551199973.371589/metadata')
+        self.assertEqual(1, len(a))
+        self.assertTrue('00080050' in a[0])  # AccessionNumber is null
+        self.assertEqual(1, len(a[0]['00080050']))  # 'vr' is the only field to be present
+        self.assertEqual('SH', a[0]['00080050']['vr'])
 
+        # Test QIDO-RS
+        a = DoGet(ORTHANC, '/dicom-web/studies')
         self.assertEqual(1, len(a))
         self.assertTrue('00080050' in a[0])  # AccessionNumber is null
         self.assertEqual(1, len(a[0]['00080050']))  # 'vr' is the only field to be present
@@ -410,7 +420,7 @@
 
 
     def test_bitbucket_issue_112(self):
-        # QIDO-RS: wrong serialization of number values
+        # Wrong serialization of number values
         # https://bitbucket.org/sjodogne/orthanc/issues/112
         # https://bitbucket.org/sjodogne/orthanc-dicomweb/issues/4/
         
@@ -434,7 +444,7 @@
         b = a[0]['00201208']['Value'][0]
         self.assertTrue(isinstance(b, (int, long)))
         self.assertEqual(1, b)
-        
+
 
 
 try: