class DcmDict::Dictionary::DataElementRecord
Class to handle data element record from source dictionary data
Public Class Methods
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 49 def initialize(data) super end
Calls superclass method
DcmDict::Dictionary::BaseRecord::new
Public Instance Methods
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 64 def extract_multiple_tag_record(tag) if ( record_data[:tag_multiple] && match_tag?(tag) ) DataElementRecord.new( record_data.merge( { tag_str: tag.to_tag_str, tag_ndm: tag.to_tag_ndm, tag_ary: tag.to_tag_ary } )) end end
Extract data from ‘multiple tag’ record using tag
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 59 def tag_element record_data[:tag_ary].tag_element_num end
Element of tag
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 54 def tag_group record_data[:tag_ary].tag_group_num end
Group of tag
Private Instance Methods
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 77 def match_tag?(tag) tag_to_match = tag.to_tag_str tag_pattern.each do |pattern| re = Regexp.new(pattern) return true if re.match(tag_to_match) end false end
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 73 def method_map DataElementMethodMap end
Source
# File lib/dcm_dict/dictionary/data_element_record.rb, line 86 def tag_pattern gs, es = self.tag_ps.gsub(/[\(|\)]/, '').gsub(/[xX]/,"[0-9A-Fa-f]").split(',') ["^\\(#{gs}\\,#{es}\\)$", "^#{gs}#{es}$" ] end