Class: OpenEHR::AM::Archetype::Ontology::ArchetypeOntology
- Inherits:
-
Object
- Object
- OpenEHR::AM::Archetype::Ontology::ArchetypeOntology
- Defined in:
- lib/open_ehr/am/archetype/ontology.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#constraint_definitions ⇒ Object
Returns the value of attribute constraint_definitions.
-
#languages_available ⇒ Object
Returns the value of attribute languages_available.
-
#primary_language ⇒ Object
Returns the value of attribute primary_language.
-
#specialisation_depth ⇒ Object
Returns the value of attribute specialisation_depth.
-
#term_attribute_names ⇒ Object
Returns the value of attribute term_attribute_names.
-
#term_bindings ⇒ Object
Returns the value of attribute term_bindings.
-
#term_definitions ⇒ Object
Returns the value of attribute term_definitions.
Instance Method Summary collapse
- #constraint_binding(a_terminology, a_code) ⇒ Object
- #constraint_codes ⇒ Object
- #constraint_definition(args = {}) ⇒ Object
- #has_language?(a_lang) ⇒ Boolean
- #has_terminology?(a_terminology) ⇒ Boolean
-
#initialize(args = { }) ⇒ ArchetypeOntology
constructor
A new instance of ArchetypeOntology.
- #term_binding(args = { }) ⇒ Object
- #term_codes ⇒ Object
- #term_definition(args = { }) ⇒ Object
- #terminologies_available ⇒ Object
Constructor Details
#initialize(args = { }) ⇒ ArchetypeOntology
Returns a new instance of ArchetypeOntology.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 11 def initialize(args = { }) self.primary_language = args[:primary_language] self.languages_available = args[:languages_available] self.specialisation_depth = args[:specialisation_depth] self.term_definitions = args[:term_definitions] if args[:constraint_definitions] self.constraint_definitions = args[:constraint_definitions] end self.term_bindings = args[:term_bindings] end |
Instance Attribute Details
#constraint_definitions ⇒ Object
Returns the value of attribute constraint_definitions.
9 10 11 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 9 def constraint_definitions @constraint_definitions end |
#languages_available ⇒ Object
Returns the value of attribute languages_available.
8 9 10 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 8 def languages_available @languages_available end |
#primary_language ⇒ Object
Returns the value of attribute primary_language.
6 7 8 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 6 def primary_language @primary_language end |
#specialisation_depth ⇒ Object
Returns the value of attribute specialisation_depth.
6 7 8 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 6 def specialisation_depth @specialisation_depth end |
#term_attribute_names ⇒ Object
Returns the value of attribute term_attribute_names.
7 8 9 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 7 def term_attribute_names @term_attribute_names end |
#term_bindings ⇒ Object
Returns the value of attribute term_bindings.
7 8 9 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 7 def term_bindings @term_bindings end |
#term_definitions ⇒ Object
Returns the value of attribute term_definitions.
9 10 11 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 9 def term_definitions @term_definitions end |
Instance Method Details
#constraint_binding(a_terminology, a_code) ⇒ Object
48 49 50 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 48 def constraint_binding(a_terminology, a_code) end |
#constraint_codes ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 35 def constraint_codes if @constraint_definitions.nil? return nil else return @constraint_definitions.values.collect {|value| value.collect {|term| term.code}}.flatten.uniq end end |
#constraint_definition(args = {}) ⇒ Object
57 58 59 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 57 def constraint_definition(args = {}) return @constraint_definition_map[args[:lang]][args[:code]] end |
#has_language?(a_lang) ⇒ Boolean
61 62 63 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 61 def has_language?(a_lang) return @term_definition_map.has_key? a_lang end |
#has_terminology?(a_terminology) ⇒ Boolean
65 66 67 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 65 def has_terminology?(a_terminology) return @term_bindings.has_key? a_terminology end |
#term_binding(args = { }) ⇒ Object
69 70 71 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 69 def term_binding(args = { }) end |
#term_codes ⇒ Object
30 31 32 33 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 30 def term_codes return @term_definitions.values.collect {|value| value.collect {|term| term.code}}.flatten.uniq end |
#term_definition(args = { }) ⇒ Object
73 74 75 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 73 def term_definition(args = { }) return @term_definition_map[args[:lang]][args[:code]] end |
#terminologies_available ⇒ Object
44 45 46 |
# File 'lib/open_ehr/am/archetype/ontology.rb', line 44 def terminologies_available return @term_bindings.keys end |