class OpenEHR::Parser::ADLGrammar::Language

Attributes

original_language[R]
translations[R]

Public Class Methods

new(value) click to toggle source
# File lib/openehr/parser/adl_helper.rb, line 23
def initialize(value)
  self.original_language = value['original_language']
  self.translations = value['translations']
end

Public Instance Methods

original_language=(original_language) click to toggle source
# File lib/openehr/parser/adl_helper.rb, line 28
def original_language=(original_language)
  @original_language = original_language
end
translations=(translations) click to toggle source
# File lib/openehr/parser/adl_helper.rb, line 32
def translations=(translations)
  if translations.nil?
    @translations = nil
  else
    tr = translations.inject({ }) do |trans, lang|
      code, details  = lang
      td = OpenEHR::RM::Common::Resource::TranslationDetails.new(
             :language => details['language'],
             :author => details['author'],
             :accreditation => details['accreditation'],
             :other_details => details['other_details'])
      trans.update Hash[code, td]
    end
    @translations = tr
  end
end

Protected Instance Methods

code2lang(code) click to toggle source
# File lib/openehr/parser/adl_helper.rb, line 50
def code2lang(code)
  ti, la = code.split '::'
  ti = OpenEHR::RM::Support::Identification::TerminologyID.new(:value => ti)
  OpenEHR::RM::DataTypes::Text::CodePhrase.new(:code_string => la, :terminology_id => ti)
end