Sha256: 7a7b5eacd4b37ea94d8a2300eba63229190876db562f5e61fd08e58eb92f7184
Contents?: true
Size: 1.91 KB
Versions: 3
Compression:
Stored size: 1.91 KB
Contents
# # Copyright (C) 2014-2020 Enrico Rivarola # # This file is part of DcmDict gem (dcm_dict). # # DcmDict is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # DcmDict is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with DcmDict. If not, see <http://www.gnu.org/licenses/>. # # This software has neither been tested nor approved for clinical use # or for incorporation in a medical device. # It is the redistributor's or user's responsibility to comply with any # applicable local, state, national or international regulations. # module DcmDict module XML # Class to handle uid data class UidFieldData < FieldData using DcmDict::Refine::Internal::StringRefineInternal MISSING_NAME_VALUE = "(Retired)" # Initialize object using +extract_proc+ as proc to extract data from xml element def initialize(extract_proc) super end # Extract and build uid data def uid_data extract_base_data end private def extract_base_data value = extract_content_data(:uid_value) type = extract_content_data(:uid_type).uid_type_to_sym name = check_uid_name_for(extract_content_data(:uid_name), value, type) { uid_value: value, uid_name: name, uid_type: type } end # patch for 2016a source data ... def check_uid_name_for(name, value, type) name = "#{value} #{MISSING_NAME_VALUE}" if (name == MISSING_NAME_VALUE) name end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
dcm_dict-0.29.0 | lib/dcm_dict/xml/uid_field_data.rb |
dcm_dict-0.28.1 | lib/dcm_dict/xml/uid_field_data.rb |
dcm_dict-0.27.0 | lib/dcm_dict/xml/uid_field_data.rb |