Class: OpenEHR::AM::Archetype::Ontology::ArchetypeOntology
- Inherits:
-
Object
- Object
- OpenEHR::AM::Archetype::Ontology::ArchetypeOntology
- Defined in:
- lib/openehr/am/archetype/ontology.rb
Direct Known Subclasses
ARCHETYPE_ONTOLOGY, FlatArchetypeOntology, Terminology::ArchetypeTerminology
Instance Attribute Summary collapse
-
#constraint_bindings ⇒ Object
Returns the value of attribute constraint_bindings.
-
#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.
-
#terminologies_available ⇒ Object
Returns the value of attribute terminologies_available.
Instance Method Summary collapse
- #constraint_binding(args = {}) ⇒ 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
Constructor Details
#initialize(args = { }) ⇒ ArchetypeOntology
Returns a new instance of ArchetypeOntology.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/openehr/am/archetype/ontology.rb', line 13 def initialize(args = { }) self.primary_language = args[:primary_language] self.languages_available = args[:languages_available] self.terminologies_available = args[:terminologies_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] self.constraint_bindings = args[:constraint_bindings] end |
Instance Attribute Details
#constraint_bindings ⇒ Object
Returns the value of attribute constraint_bindings.
10 11 12 |
# File 'lib/openehr/am/archetype/ontology.rb', line 10 def constraint_bindings @constraint_bindings end |
#constraint_definitions ⇒ Object
Returns the value of attribute constraint_definitions.
11 12 13 |
# File 'lib/openehr/am/archetype/ontology.rb', line 11 def constraint_definitions @constraint_definitions end |
#languages_available ⇒ Object
Returns the value of attribute languages_available.
9 10 11 |
# File 'lib/openehr/am/archetype/ontology.rb', line 9 def languages_available @languages_available end |
#primary_language ⇒ Object
Returns the value of attribute primary_language.
7 8 9 |
# File 'lib/openehr/am/archetype/ontology.rb', line 7 def primary_language @primary_language end |
#specialisation_depth ⇒ Object
Returns the value of attribute specialisation_depth.
7 8 9 |
# File 'lib/openehr/am/archetype/ontology.rb', line 7 def specialisation_depth @specialisation_depth end |
#term_attribute_names ⇒ Object
Returns the value of attribute term_attribute_names.
8 9 10 |
# File 'lib/openehr/am/archetype/ontology.rb', line 8 def term_attribute_names @term_attribute_names end |
#term_bindings ⇒ Object
Returns the value of attribute term_bindings.
8 9 10 |
# File 'lib/openehr/am/archetype/ontology.rb', line 8 def term_bindings @term_bindings end |
#term_definitions ⇒ Object
Returns the value of attribute term_definitions.
11 12 13 |
# File 'lib/openehr/am/archetype/ontology.rb', line 11 def term_definitions @term_definitions end |
#terminologies_available ⇒ Object
Returns the value of attribute terminologies_available.
9 10 11 |
# File 'lib/openehr/am/archetype/ontology.rb', line 9 def terminologies_available @terminologies_available end |
Instance Method Details
#constraint_binding(args = {}) ⇒ Object
45 46 47 |
# File 'lib/openehr/am/archetype/ontology.rb', line 45 def constraint_binding(args = {}) return @constraint_bindings[args[:terminology]][args[:code]] end |
#constraint_codes ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/openehr/am/archetype/ontology.rb', line 37 def constraint_codes if @constraint_definitions.nil? return nil else code_set @constraint_definitions end end |
#constraint_definition(args = {}) ⇒ Object
53 54 55 |
# File 'lib/openehr/am/archetype/ontology.rb', line 53 def constraint_definition(args = {}) return @constraint_definitions[args[:lang]][args[:code]] end |
#has_language?(a_lang) ⇒ Boolean
57 58 59 |
# File 'lib/openehr/am/archetype/ontology.rb', line 57 def has_language?(a_lang) return @term_definitions.has_key? a_lang end |
#has_terminology?(a_terminology) ⇒ Boolean
61 62 63 64 65 66 67 68 |
# File 'lib/openehr/am/archetype/ontology.rb', line 61 def has_terminology?(a_terminology) if !@terminologies_available.nil? && (@terminologies_available.include? a_terminology) return true else return false end end |
#term_binding(args = { }) ⇒ Object
70 71 72 |
# File 'lib/openehr/am/archetype/ontology.rb', line 70 def term_binding(args = { }) return @term_bindings[args[:terminology]][args[:code]] end |
#term_codes ⇒ Object
33 34 35 |
# File 'lib/openehr/am/archetype/ontology.rb', line 33 def term_codes code_set @term_definitions end |
#term_definition(args = { }) ⇒ Object
74 75 76 |
# File 'lib/openehr/am/archetype/ontology.rb', line 74 def term_definition(args = { }) return @term_definitions[args[:lang]][args[:code]] end |