dcm_dict 0.26.0 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/LICENSE +1 -1
  4. data/README.md +80 -65
  5. data/bin/dcm_dict_converter.rb +3 -3
  6. data/lib/dcm_dict.rb +1 -1
  7. data/lib/dcm_dict/dictionary/base_dictionary.rb +1 -1
  8. data/lib/dcm_dict/dictionary/base_record.rb +1 -1
  9. data/lib/dcm_dict/dictionary/data_element_dictionary.rb +1 -1
  10. data/lib/dcm_dict/dictionary/data_element_record.rb +1 -1
  11. data/lib/dcm_dict/dictionary/uid_dictionary.rb +2 -4
  12. data/lib/dcm_dict/dictionary/uid_record.rb +6 -1
  13. data/lib/dcm_dict/encoder/data_to_code.rb +2 -2
  14. data/lib/dcm_dict/error/dictionary_error.rb +1 -1
  15. data/lib/dcm_dict/ext/object_extension.rb +1 -1
  16. data/lib/dcm_dict/refine/array_refine.rb +1 -1
  17. data/lib/dcm_dict/refine/data_element_refine.rb +1 -1
  18. data/lib/dcm_dict/refine/internal/array_refine_internal.rb +1 -1
  19. data/lib/dcm_dict/refine/internal/hash_refine_internal.rb +14 -1
  20. data/lib/dcm_dict/refine/internal/string_refine_internal.rb +1 -1
  21. data/lib/dcm_dict/refine/string_refine.rb +1 -1
  22. data/lib/dcm_dict/refine/symbol_refine.rb +2 -1
  23. data/lib/dcm_dict/refine/uid_refine.rb +1 -1
  24. data/lib/dcm_dict/rubies/rb_ext.rb +1 -1
  25. data/lib/dcm_dict/source_data/data_elements_data.rb +84 -3
  26. data/lib/dcm_dict/source_data/detached_data.rb +1 -1
  27. data/lib/dcm_dict/source_data/uid_values_data.rb +445 -421
  28. data/lib/dcm_dict/version.rb +3 -3
  29. data/lib/dcm_dict/xml/constant.rb +3 -2
  30. data/lib/dcm_dict/xml/field_data.rb +1 -1
  31. data/lib/dcm_dict/xml/nokogiri_tool.rb +1 -1
  32. data/lib/dcm_dict/xml/rexml_tool.rb +1 -1
  33. data/lib/dcm_dict/xml/tag_field_data.rb +1 -1
  34. data/lib/dcm_dict/xml/uid_field_data.rb +14 -4
  35. data/lib/dcm_dict/xml/xml_tool.rb +1 -1
  36. data/spec/data_element_sample_spec_helper.rb +12 -2
  37. data/spec/data_element_shared_example_spec_helper.rb +1 -1
  38. data/spec/dcm_dict/dictionary/data_element_dictionary_spec.rb +1 -1
  39. data/spec/dcm_dict/dictionary/data_element_record_spec.rb +1 -1
  40. data/spec/dcm_dict/dictionary/uid_dictionary_spec.rb +62 -17
  41. data/spec/dcm_dict/dictionary/uid_record_spec.rb +8 -4
  42. data/spec/dcm_dict/encoder/data_to_code_spec.rb +2 -2
  43. data/spec/dcm_dict/ext/object_extension_spec.rb +1 -1
  44. data/spec/dcm_dict/refine/array_refine_spec.rb +1 -1
  45. data/spec/dcm_dict/refine/internal/array_refine_internal_spec.rb +1 -1
  46. data/spec/dcm_dict/refine/internal/hash_refine_internal_spec.rb +19 -1
  47. data/spec/dcm_dict/refine/internal/string_refine_internal_spec.rb +1 -1
  48. data/spec/dcm_dict/refine/string_refine_spec.rb +4 -4
  49. data/spec/dcm_dict/refine/symbol_refine_spec.rb +26 -1
  50. data/spec/dcm_dict/rubies/rb_ext_spec.rb +1 -1
  51. data/spec/dcm_dict/source_data/data_elements_data_spec.rb +1 -1
  52. data/spec/dcm_dict/source_data/detached_data_spec.rb +1 -1
  53. data/spec/dcm_dict/source_data/uid_values_data_spec.rb +1 -1
  54. data/spec/dcm_dict/version_spec.rb +1 -1
  55. data/spec/dcm_dict/xml/tag_field_data_spec.rb +1 -1
  56. data/spec/dcm_dict/xml/uid_field_data_spec.rb +1 -1
  57. data/spec/dictionary_shared_example_spec_helper.rb +3 -3
  58. data/spec/refine_shared_example_spec_helper.rb +1 -1
  59. data/spec/spec_helper.rb +1 -1
  60. data/spec/xml_sample_spec_helper.rb +80 -32
  61. metadata +18 -18
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -22,6 +22,6 @@
22
22
  # applicable local, state, national or international regulations.
23
23
  #
24
24
  module DcmDict
25
- VERSION = "0.26.0"
26
- DICOM_DOC_VERSION = "2019e"
25
+ VERSION = "0.31.0"
26
+ DICOM_DOC_VERSION = "2020e"
27
27
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -32,7 +32,8 @@ module DcmDict
32
32
 
33
33
  UidNodeSetIdx = { uid_value: 0,
34
34
  uid_name: 1,
35
- uid_type: 2}.freeze
35
+ uid_key: 2,
36
+ uid_type: 3}.freeze
36
37
 
37
38
  end
38
39
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -27,6 +27,7 @@ module DcmDict
27
27
  # Class to handle uid data
28
28
  class UidFieldData < FieldData
29
29
  using DcmDict::Refine::Internal::StringRefineInternal
30
+ using DcmDict::Refine::Internal::HashRefineInternal
30
31
 
31
32
  MISSING_NAME_VALUE = "(Retired)"
32
33
 
@@ -38,18 +39,27 @@ module DcmDict
38
39
  # Extract and build uid data
39
40
  def uid_data
40
41
  extract_base_data
42
+ @data.check_base_data_uid_field!
43
+ # extend_base_data
44
+ @data
41
45
  end
42
46
 
43
47
  private
44
48
  def extract_base_data
45
49
  value = extract_content_data(:uid_value)
46
50
  type = extract_content_data(:uid_type).uid_type_to_sym
51
+ key = extract_content_data(:uid_key)
47
52
  name = check_uid_name_for(extract_content_data(:uid_name), value, type)
48
- { uid_value: value,
49
- uid_name: name,
50
- uid_type: type }
53
+ @data = { uid_value: value,
54
+ uid_name: name,
55
+ uid_type: type,
56
+ uid_key: key }
51
57
  end
52
58
 
59
+ # def extend_base_data
60
+ # @data[:uid_sym] = @data[:uid_key].tag_key_to_sym
61
+ # end
62
+
53
63
  # patch for 2016a source data ...
54
64
  def check_uid_name_for(name, value, type)
55
65
  name = "#{value} #{MISSING_NAME_VALUE}" if (name == MISSING_NAME_VALUE)
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
  #
3
- # Copyright (C) 2014-2019 Enrico Rivarola
3
+ # Copyright (C) 2014-2020 Enrico Rivarola
4
4
  #
5
5
  # This file is part of DcmDict gem (dcm_dict).
6
6
  #
@@ -152,7 +152,17 @@ module DataElementSampleSpecHelper
152
152
  [0x0002,0x0027] => { tag_ps: '(0002,0027)', tag_name: "Sending Presentation Address", tag_key: 'SendingPresentationAddress',
153
153
  tag_vr: [:UR], tag_vm: ["1"], tag_str: '(0002,0027)', tag_sym: :sending_presentation_address,
154
154
  tag_ndm: '00020027', tag_ary: [0x0002,0x0027], tag_multiple: false,
155
- tag_note: ''}
155
+ tag_note: ''},
156
+ [0x3010,0x0096] => { tag_ps: '(3010,0096)', tag_name: "Radiation Source Coordinate System Pitch Angle",
157
+ tag_key: 'RadiationSourceCoordinateSystemPitchAngle', tag_vr: [:FD], tag_vm: ["1"], tag_str: '(3010,0096)',
158
+ tag_sym: :radiation_source_coordinate_system_pitch_angle, tag_ndm: '30100096',
159
+ tag_ary: [0x3010,0x0096], tag_multiple: false, tag_note: ''},
160
+ [0x0016,0x1002] => { tag_ps: '(0016,1002)', tag_name: "Emitter Color Temperature", tag_key: 'EmitterColorTemperature',
161
+ tag_vr: [:DS], tag_vm: ["1"], tag_str: '(0016,1002)', tag_sym: :emitter_color_temperature,
162
+ tag_ndm: '00161002', tag_ary: [0x0016,0x1002], tag_multiple: false, tag_note: ''},
163
+ [0x0072,0x0082] => { tag_ps: '(0072,0082)', tag_name: "Selector SV Value", tag_key: 'SelectorSVValue',
164
+ tag_vr: [:SV], tag_vm: ["1-n"], tag_str: '(0072,0082)', tag_sym: :selector_sv_value,
165
+ tag_ndm: '00720082', tag_ary: [0x0072,0x0082], tag_multiple: false, tag_note: ''},
156
166
  }
157
167
  end
158
168
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -24,28 +24,73 @@ require 'spec_helper'
24
24
  describe DcmDict::Dictionary::UidDictionary do
25
25
 
26
26
  include_examples "Map all source data",
27
- [:uid_value, :uid_name],
27
+ [:uid_value, :uid_name, :uid_key, :uid_sym],
28
28
  DcmDict::SourceData::UidValuesData,
29
29
  DcmDict::Dictionary::TheUidDictionary,
30
30
  DcmDict::Dictionary::UidRecord,
31
- [:uid_value, :uid_name, :uid_type]
31
+ [:uid_value, :uid_name, :uid_key, :uid_sym, :uid_type]
32
32
 
33
33
  {
34
- '1.2.3.4.5.6' => { :uid_value => '1.2.3.4.5.6',
35
- :uid_name => 'Unknown UID',
36
- :uid_type => :unknown },
34
+ '1.2.3.4.5.6' => { :uid_value => '1.2.3.4.5.6',
35
+ :uid_name => '1.2.3.4.5.6 (Unknown UID)',
36
+ :uid_type => :unknown,
37
+ :uid_key => 'UID_1_2_3_4_5_6',
38
+ :uid_sym => :uid_1_2_3_4_5_6,
39
+ },
37
40
  '1.2.840.10008.5.1.4.1.1.12.77' => { :uid_value => '1.2.840.10008.5.1.4.1.1.12.77',
38
- :uid_name => '1.2.840.10008.5.1.4.1.1.12.77 (Retired)',
39
- :uid_type => :sop_class },
40
- '1.2.840.10008.5.1.4.1.1.40' => { :uid_value => '1.2.840.10008.5.1.4.1.1.40',
41
- :uid_name => '1.2.840.10008.5.1.4.1.1.40 (Retired)',
42
- :uid_type => :sop_class },
43
- '1.2.840.10008.5.1.4.39.3' => { :uid_value => '1.2.840.10008.5.1.4.39.3',
44
- :uid_name => 'Color Palette Query/Retrieve Information Model - MOVE',
45
- :uid_type => :sop_class },
46
- '1.2.840.10008.5.1.4.34.6.5' => { :uid_value => '1.2.840.10008.5.1.4.34.6.5',
47
- :uid_name => 'Unified Procedure Step - Query SOP Class',
48
- :uid_type => :sop_class }
41
+ :uid_name => '1.2.840.10008.5.1.4.1.1.12.77 (Retired)',
42
+ :uid_key => 'UID_1_2_840_10008_5_1_4_1_1_12_77',
43
+ :uid_sym => :uid_1_2_840_10008_5_1_4_1_1_12_77,
44
+ :uid_type => :sop_class
45
+ },
46
+ '1.2.840.10008.5.1.4.1.1.12.77 (Retired)' => { :uid_value => '1.2.840.10008.5.1.4.1.1.12.77',
47
+ :uid_name => '1.2.840.10008.5.1.4.1.1.12.77 (Retired)',
48
+ :uid_key => 'UID_1_2_840_10008_5_1_4_1_1_12_77',
49
+ :uid_sym => :uid_1_2_840_10008_5_1_4_1_1_12_77,
50
+ :uid_type => :sop_class
51
+ },
52
+ 'UID_1_2_840_10008_5_1_4_1_1_12_77' => { :uid_value => '1.2.840.10008.5.1.4.1.1.12.77',
53
+ :uid_name => '1.2.840.10008.5.1.4.1.1.12.77 (Retired)',
54
+ :uid_key => 'UID_1_2_840_10008_5_1_4_1_1_12_77',
55
+ :uid_sym => :uid_1_2_840_10008_5_1_4_1_1_12_77,
56
+ :uid_type => :sop_class
57
+ },
58
+ :uid_1_2_840_10008_5_1_4_1_1_12_77 => { :uid_value => '1.2.840.10008.5.1.4.1.1.12.77',
59
+ :uid_name => '1.2.840.10008.5.1.4.1.1.12.77 (Retired)',
60
+ :uid_key => 'UID_1_2_840_10008_5_1_4_1_1_12_77',
61
+ :uid_sym => :uid_1_2_840_10008_5_1_4_1_1_12_77,
62
+ :uid_type => :sop_class
63
+ },
64
+ '1.2.840.10008.5.1.4.1.1.40' => { :uid_value => '1.2.840.10008.5.1.4.1.1.40',
65
+ :uid_name => '1.2.840.10008.5.1.4.1.1.40 (Retired)',
66
+ :uid_key => 'UID_1_2_840_10008_5_1_4_1_1_40',
67
+ :uid_sym => :uid_1_2_840_10008_5_1_4_1_1_40,
68
+ :uid_type => :sop_class
69
+ },
70
+ '1.2.840.10008.5.1.4.39.3' => { :uid_value => '1.2.840.10008.5.1.4.39.3',
71
+ :uid_name => 'Color Palette Query/Retrieve Information Model - MOVE',
72
+ :uid_key => 'ColorPaletteQueryRetrieveInformationModelMove',
73
+ :uid_sym => :color_palette_query_retrieve_information_model_move,
74
+ :uid_type => :sop_class
75
+ },
76
+ 'Color Palette Query/Retrieve Information Model - MOVE' => { :uid_value => '1.2.840.10008.5.1.4.39.3',
77
+ :uid_name => 'Color Palette Query/Retrieve Information Model - MOVE',
78
+ :uid_key => 'ColorPaletteQueryRetrieveInformationModelMove',
79
+ :uid_sym => :color_palette_query_retrieve_information_model_move,
80
+ :uid_type => :sop_class
81
+ },
82
+ 'ColorPaletteQueryRetrieveInformationModelMove' => { :uid_value => '1.2.840.10008.5.1.4.39.3',
83
+ :uid_name => 'Color Palette Query/Retrieve Information Model - MOVE',
84
+ :uid_key => 'ColorPaletteQueryRetrieveInformationModelMove',
85
+ :uid_sym => :color_palette_query_retrieve_information_model_move,
86
+ :uid_type => :sop_class
87
+ },
88
+ :color_palette_query_retrieve_information_model_move => { :uid_value => '1.2.840.10008.5.1.4.39.3',
89
+ :uid_name => 'Color Palette Query/Retrieve Information Model - MOVE',
90
+ :uid_key => 'ColorPaletteQueryRetrieveInformationModelMove',
91
+ :uid_sym => :color_palette_query_retrieve_information_model_move,
92
+ :uid_type => :sop_class
93
+ },
49
94
  }.each do |uid, data|
50
95
  include_examples "Handle specific record", data[:uid_name],
51
96
  uid, data, DcmDict::Dictionary::TheUidDictionary
@@ -55,7 +100,7 @@ describe DcmDict::Dictionary::UidDictionary do
55
100
  '1.2.abc.3.4', 'this string is not a valid uid', '1.2.3.04.5'
56
101
  ].each do |uid|
57
102
  include_examples "Dictionary with wrong key",
58
- uid, [:uid_value, :uid_name, :uid_type],
103
+ uid, [:uid_value, :uid_name, :uid_type, :uid_key, :uid_sym],
59
104
  DcmDict::Dictionary::TheUidDictionary
60
105
  end
61
106
 
@@ -1,5 +1,6 @@
1
+ # coding: utf-8
1
2
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
3
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
4
  #
4
5
  # This file is part of DcmDict gem (dcm_dict).
5
6
  #
@@ -27,14 +28,17 @@ describe DcmDict::Dictionary::UidRecord do
27
28
  [
28
29
  { uid_value: '1.2.840.10008.1.2',
29
30
  uid_name: "Implicit VR Little Endian: Default Transfer Syntax for DICOM",
31
+ uid_key: "ImplicitVRLittleEndian",
32
+ uid_sym: :implicit_vr_little_endian,
30
33
  uid_type: :transfer_syntax }
31
34
  ].each do |data|
32
- it "Handle Data Element Data correctly" do
35
+ it "Handle Data Element Data correctly (#{data[:uid_name]})" do
33
36
  ur = DcmDict::Dictionary::UidRecord.new(data.dup)
34
37
  expect(ur.uid_value).to eq(data[:uid_value])
35
38
  expect(ur.uid).to eq(data[:uid_value])
36
39
  expect(ur.uid_name).to eq(data[:uid_name])
37
40
  expect(ur.uid_type).to eq(data[:uid_type])
41
+ expect(ur.uid_key).to eq(data[:uid_key])
38
42
  end
39
43
 
40
44
 
@@ -42,12 +46,12 @@ describe DcmDict::Dictionary::UidRecord do
42
46
  DcmDict::Dictionary::UidRecord.new(data),
43
47
  data
44
48
 
45
- it "data should be not modifiable" do
49
+ it "data should be not modifiable (#{data[:uid_name]})" do
46
50
  uid = DcmDict::Dictionary::UidRecord.new(data.dup)
47
51
  old_value = uid.uid_value.dup
48
52
  expect{uid.uid_value << 'aaa'}.to raise_error(RuntimeError)
49
53
  expect(uid.uid_value).to eq(old_value)
50
54
  end
51
-
52
55
  end
56
+
53
57
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -92,7 +92,7 @@ END
92
92
  XmlSampleSpecHelper.xml_uid_set.each do |xml_string, data|
93
93
  it "for uid sample as #{data[:uid_value].inspect}" do
94
94
  indent = 4
95
- src_text = "#{' '*indent}{ uid_value: '#{data[:uid_value]}', uid_name: \"#{data[:uid_name]}\", uid_type: #{data[:uid_type].inspect}},"
95
+ src_text = "#{' '*indent}{ uid_value: '#{data[:uid_value]}', uid_name: '#{data[:uid_name]}', uid_key: '#{data[:uid_key]}', uid_sym: #{data[:uid_sym].inspect}, uid_type: #{data[:uid_type].inspect}},"
96
96
  src_line = DcmDict::Encoder::DataToCode.uid_data_to_code(data)
97
97
  expect(src_line).to eq(src_text)
98
98
  src_line = DcmDict::Encoder::DataToCode.uid_data_to_code(data, indent)
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -26,6 +26,24 @@ require 'spec_helper'
26
26
  describe "Hash internal refinement" do
27
27
  using DcmDict::Refine::Internal::HashRefineInternal
28
28
 
29
+ {
30
+ '1.2.3.4.5.6' => { :uid_value => '1.2.3.4.5.6',
31
+ :uid_name => '1.2.3.4.5.6 (Unknown UID)',
32
+ :uid_type => :unknown,
33
+ :uid_key => 'UID_1_2_3_4_5_6',
34
+ :uid_sym => :uid_1_2_3_4_5_6,
35
+ }
36
+ }.each do |uid_ref, expected_data|
37
+ it "should check base uid fields for '#{uid_ref}" do
38
+ data = {uid_value: uid_ref}
39
+ data.check_base_data_uid_field!
40
+ expect(data).to eq(expected_data)
41
+ end
42
+
43
+ end
44
+
45
+
46
+
29
47
  it "should check for lowercase tag_ps field" do
30
48
  h = {tag_ps: '(fffe,E000)'}
31
49
  h.check_tag_ps!
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
  #
3
- # Copyright (C) 2014-2019 Enrico Rivarola
3
+ # Copyright (C) 2014-2020 Enrico Rivarola
4
4
  #
5
5
  # This file is part of DcmDict gem (dcm_dict).
6
6
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -60,9 +60,9 @@ describe "String refinement" do
60
60
  describe "should permit access to single data uid dictionary information" do
61
61
  describe "for regular uids" do
62
62
  [
63
- '1.2.840.10008.1.1', "Verification SOP Class",
64
- '1.2.840.10008.1.2.1', "Explicit VR Little Endian",
65
- '1.2.840.10008.5.1.4.1.2.1.1', "Patient Root Query/Retrieve Information Model - FIND",
63
+ '1.2.840.10008.1.1', "Verification SOP Class", 'Verification',
64
+ '1.2.840.10008.1.2.1', "Explicit VR Little Endian", 'ExplicitVRLittleEndian',
65
+ '1.2.840.10008.5.1.4.1.2.1.1', "Patient Root Query/Retrieve Information Model - FIND", 'PatientRootQueryRetrieveInformationModelFind',
66
66
  '1.2.3.4.5.6'
67
67
  ].each do |uid|
68
68
  describe "as #{uid.inspect}" do
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2019 Enrico Rivarola
2
+ # Copyright (C) 2014-2020 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -38,4 +38,29 @@ describe "Symbol refinement" do
38
38
  [],
39
39
  Proc.new {|tag| tag.inspect}
40
40
 
41
+ {
42
+ :uid_1_2_840_10008_5_1_4_1_1_12_77 => { :uid_value => '1.2.840.10008.5.1.4.1.1.12.77',
43
+ :uid => '1.2.840.10008.5.1.4.1.1.12.77',
44
+ :uid_name => '1.2.840.10008.5.1.4.1.1.12.77 (Retired)',
45
+ :uid_key => 'UID_1_2_840_10008_5_1_4_1_1_12_77',
46
+ :uid_sym => :uid_1_2_840_10008_5_1_4_1_1_12_77,
47
+ :uid_type => :sop_class
48
+ },
49
+ :color_palette_query_retrieve_information_model_move => { :uid_value => '1.2.840.10008.5.1.4.39.3',
50
+ :uid => '1.2.840.10008.5.1.4.39.3',
51
+ :uid_name => 'Color Palette Query/Retrieve Information Model - MOVE',
52
+ :uid_key => 'ColorPaletteQueryRetrieveInformationModelMove',
53
+ :uid_sym => :color_palette_query_retrieve_information_model_move,
54
+ :uid_type => :sop_class
55
+ },
56
+ }.each do |sym, sym_data|
57
+ it "for uid as symbol (#{sym.inspect})" do
58
+ DcmDict::Dictionary::UidMethod.each do |method|
59
+ expr = "#{sym.inspect}.#{method.to_s}"
60
+ expected_value = sym_data[method]
61
+ value = eval(expr)
62
+ expect(value).to eq(expected_value)
63
+ end
64
+ end
65
+ end
41
66
  end