# HG changeset patch # User Sebastien Jodogne # Date 1551200287 -3600 # Node ID f5aca0917d60228a80dd2986d4c04bd6f03b3e3f # Parent 0f03ee6ffa80d92466f910f4e90885e015891533 DICOMweb: test_bitbucket_issue_111 diff -r 0f03ee6ffa80 -r f5aca0917d60 Database/Issue111.dcm Binary file Database/Issue111.dcm has changed diff -r 0f03ee6ffa80 -r f5aca0917d60 Database/Issue111.dump --- /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 diff -r 0f03ee6ffa80 -r f5aca0917d60 Plugins/DicomWeb/Run.py --- 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: