[372] | 1 | module OpenEHR
|
---|
[4] | 2 | module AM
|
---|
| 3 | module Archetype
|
---|
| 4 | module Ontology
|
---|
[372] | 5 | class ArchetypeOntology
|
---|
[4] | 6 | attr_accessor :constraint_codes, :specialisation_depth
|
---|
| 7 | attr_accessor :term_attribute_names, :term_codes
|
---|
[403] | 8 | attr_reader :terminologies_available
|
---|
[23] | 9 |
|
---|
[403] | 10 | def initialize(args = { })
|
---|
| 11 | self.terminologies_available = args[:terminologies_available]
|
---|
| 12 | self.specialisation_depth = args[:specialisation_depth]
|
---|
| 13 | self.term_codes = args[:term_codes]
|
---|
| 14 | self.constraint_codes = args[:constraint_codes]
|
---|
| 15 | self.term_attribute_names = args[:term_attribute_names]
|
---|
| 16 | end
|
---|
| 17 |
|
---|
| 18 | def terminologies_available=(terminologies_available)
|
---|
| 19 | if terminologies_available.nil?
|
---|
| 20 | raise ArgumentError, 'terminologies_available is mandatory'
|
---|
| 21 | end
|
---|
| 22 | @terminologies_available = terminologies_available
|
---|
| 23 | end
|
---|
| 24 |
|
---|
[4] | 25 | def constraint_binding(a_terminology, a_code)
|
---|
| 26 | end
|
---|
[23] | 27 |
|
---|
[4] | 28 | def constraint_definition(a_lang, a_code)
|
---|
| 29 | end
|
---|
[23] | 30 |
|
---|
[4] | 31 | def has_language?(a_lang)
|
---|
| 32 | end
|
---|
[23] | 33 |
|
---|
[4] | 34 | def has_terminology?(a_terminology)
|
---|
| 35 | end
|
---|
[23] | 36 |
|
---|
[4] | 37 | def term_binding(a_terminology, a_code)
|
---|
| 38 | end
|
---|
[23] | 39 |
|
---|
[4] | 40 | def term_definition(a_lang, a_code)
|
---|
| 41 | end
|
---|
| 42 | end
|
---|
[23] | 43 |
|
---|
[402] | 44 | class ARCHETYPE_ONTOLOGY < ArchetypeOntology
|
---|
[23] | 45 |
|
---|
[402] | 46 | end
|
---|
| 47 |
|
---|
| 48 | class ArchetypeTerm
|
---|
| 49 | attr_accessor :items
|
---|
| 50 | attr_reader :code
|
---|
| 51 |
|
---|
[23] | 52 | def initialize(args = { })
|
---|
[402] | 53 | self.code = args[:code]
|
---|
| 54 | self.items =args[:items]
|
---|
| 55 | end
|
---|
| 56 |
|
---|
| 57 | def code=(code)
|
---|
| 58 | if code.nil? or code.empty?
|
---|
| 59 | raise ArgumentError, 'code is mandatory'
|
---|
| 60 | end
|
---|
| 61 | @code = code
|
---|
[4] | 62 | end
|
---|
[23] | 63 |
|
---|
[4] | 64 | def keys
|
---|
[402] | 65 | if items.nil?
|
---|
| 66 | return Set.new
|
---|
| 67 | else
|
---|
| 68 | return Set.new(@items.keys)
|
---|
| 69 | end
|
---|
[4] | 70 | end
|
---|
| 71 | end
|
---|
[402] | 72 |
|
---|
| 73 | class ARCHETYPE_TERM < ArchetypeTerm
|
---|
| 74 |
|
---|
| 75 | end
|
---|
[4] | 76 | end # end of Ontology
|
---|
| 77 | end # end of Archetype
|
---|
| 78 | end # end of AM
|
---|
| 79 | end # end of OpenEHR
|
---|
| 80 |
|
---|