Class: OpenEHR::RM::Common::Resource::AuthoredResource

Inherits:
Object
  • Object
show all
Defined in:
lib/open_ehr/rm/common/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) ⇒ AuthoredResource

Returns a new instance of AuthoredResource.



10
11
12
13
14
15
# File 'lib/open_ehr/rm/common/resource.rb', line 10

def initialize(args = { })
  self.original_language = args[:original_language]
  self.translations = args[:translations]
  self.revision_history = args[:revision_history]
  self.description = args[:description]
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/open_ehr/rm/common/resource.rb', line 8

def description
  @description
end

#original_languageObject

Returns the value of attribute original_language.



7
8
9
# File 'lib/open_ehr/rm/common/resource.rb', line 7

def original_language
  @original_language
end

#revision_historyObject

Returns the value of attribute revision_history.



8
9
10
# File 'lib/open_ehr/rm/common/resource.rb', line 8

def revision_history
  @revision_history
end

#translationsObject

Returns the value of attribute translations.



7
8
9
# File 'lib/open_ehr/rm/common/resource.rb', line 7

def translations
  @translations
end

Instance Method Details

#current_revisionObject



31
32
33
# File 'lib/open_ehr/rm/common/resource.rb', line 31

def current_revision
  @revision_history.most_recent_version
end

#is_controlled?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/open_ehr/rm/common/resource.rb', line 39

def is_controlled?
  return !@revision_history.nil?
end

#languages_availableObject



35
36
37
# File 'lib/open_ehr/rm/common/resource.rb', line 35

def languages_available
  return Set.new(@translations.keys) << original_language.code_string
end