comparison Plugins/DicomWeb/Run.py @ 184:e244312964d6

test_bitbucket_issue_111
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Nov 2018 11:54:49 +0100
parents 90e5331ddee9
children af8e034f4262
comparison
equal deleted inserted replaced
183:76747a374aff 184:e244312964d6
327 327
328 self.assertTrue(brainix in b) 328 self.assertTrue(brainix in b)
329 self.assertTrue(knee in b) 329 self.assertTrue(knee in b)
330 330
331 331
332 def test_bitbucket_issue_111(self):
333 # According to the standard, section F.2.5
334 # (http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_F.2.5.html),
335 # null values behave as follows: If an attribute is present in
336 # DICOM but empty (i.e., Value Length is 0), it shall be
337 # preserved in the DICOM JSON attribute object containing no
338 # "Value", "BulkDataURI" or "InlineBinary".
339 # https://bitbucket.org/sjodogne/orthanc/issues/111/qido-rs-wrong-serialization-of-empty
340
341 UploadInstance(ORTHANC, 'ColorTestMalaterre.dcm')
342
343 a = DoGet(ORTHANC, '/dicom-web/studies',
344 headers = { 'accept' : 'application/json' })
345
346 pprint.pprint(a)
347
348 self.assertEqual(1, len(a))
349 self.assertTrue('00080050' in a[0]) # AccessionNumber is null
350 self.assertEqual(1, len(a[0]['00080050'])) # 'vr' is the only field to be present
351 self.assertEqual('SH', a[0]['00080050']['vr'])
352
332 try: 353 try:
333 print('\nStarting the tests...') 354 print('\nStarting the tests...')
334 unittest.main(argv = [ sys.argv[0] ] + args.options) 355 unittest.main(argv = [ sys.argv[0] ] + args.options)
335 356
336 finally: 357 finally: