# HG changeset patch # User Alain Mazy # Date 1748860117 -7200 # Node ID d665c049308eb37769ce843c62c993b1ee1d25e9 # Parent 276a054d7c32ef965ef4045cfb2fe8f6d718cb8c IsProtected diff -r 276a054d7c32 -r d665c049308e Tests/Tests.py --- a/Tests/Tests.py Mon May 26 19:37:15 2025 +0200 +++ b/Tests/Tests.py Mon Jun 02 12:28:37 2025 +0200 @@ -907,9 +907,19 @@ self.assertEqual(0, DoGet(_REMOTE, '/patients/%s/protected' % a)) DoPut(_REMOTE, '/patients/%s/protected' % a, '1', 'text/plain') self.assertEqual(1, DoGet(_REMOTE, '/patients/%s/protected' % a)) + + if IsOrthancVersionAbove(_REMOTE, 1, 12, 8): + p = DoGet(_REMOTE, '/patients/%s' % a) + self.assertIn('IsProtected', p) + self.assertTrue(p['IsProtected']) + DoPut(_REMOTE, '/patients/%s/protected' % a, '0', 'text/plain') self.assertEqual(0, DoGet(_REMOTE, '/patients/%s/protected' % a)) + if IsOrthancVersionAbove(_REMOTE, 1, 12, 8): + p = DoGet(_REMOTE, '/patients/%s' % a) + self.assertIn('IsProtected', p) + self.assertFalse(p['IsProtected']) def test_raw_tags(self): i = UploadInstance(_REMOTE, 'PrivateTags.dcm')['ID'] @@ -11519,6 +11529,7 @@ self.assertIn('IsStable', a[0]) self.assertNotIn('Attachments', a[0]) self.assertNotIn('Metadata', a[0]) + self.assertNotIn('IsProtected', a[0]) a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Series', @@ -11542,6 +11553,7 @@ self.assertNotIn('IsStable', a[0]) self.assertNotIn('Attachments', a[0]) self.assertNotIn('Metadata', a[0]) + self.assertNotIn('IsProtected', a[0]) a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Series', @@ -11564,6 +11576,7 @@ self.assertIn('Status', a[0]) self.assertIn('IsStable', a[0]) self.assertNotIn('Attachments', a[0]) + self.assertNotIn('IsProtected', a[0]) a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Instances', @@ -11585,6 +11598,7 @@ self.assertIn('Labels', a[0]) self.assertNotIn('Attachments', a[0]) self.assertNotIn('Metadata', a[0]) + self.assertNotIn('IsProtected', a[0]) a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Instances', 'Query' : { @@ -11616,6 +11630,18 @@ self.assertIn('RequestedTags', a[0]) # the RequestedTags are always in the response as soon as you have requested them self.assertIn('SOPClassUID', a[0]['RequestedTags']) + if IsOrthancVersionAbove(_REMOTE, 1, 12, 8): + a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Patients', + 'Query' : { + }, + 'ResponseContent' : ['IsProtected'] + }) + + self.assertIn('ID', a[0]) # the ID is always in the response + self.assertIn('Type', a[0]) # the Type is always in the response + self.assertIn('IsProtected', a[0]) + + def test_extended_find_full(self): if IsOrthancVersionAbove(_REMOTE, 1, 12, 5) and HasExtendedFind(_REMOTE):