1 | module OpenEHR
|
---|
2 | module AM
|
---|
3 | module Archetype
|
---|
4 | module Ontology
|
---|
5 | class ArchetypeOntology
|
---|
6 | attr_accessor :constraint_codes, :specialisation_depth
|
---|
7 | attr_accessor :term_attribute_names, :term_codes
|
---|
8 | attr_reader :terminologies_available
|
---|
9 |
|
---|
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 |
|
---|
25 | def constraint_binding(a_terminology, a_code)
|
---|
26 | end
|
---|
27 |
|
---|
28 | def constraint_definition(a_lang, a_code)
|
---|
29 | end
|
---|
30 |
|
---|
31 | def has_language?(a_lang)
|
---|
32 | end
|
---|
33 |
|
---|
34 | def has_terminology?(a_terminology)
|
---|
35 | end
|
---|
36 |
|
---|
37 | def term_binding(a_terminology, a_code)
|
---|
38 | end
|
---|
39 |
|
---|
40 | def term_definition(a_lang, a_code)
|
---|
41 | end
|
---|
42 | end
|
---|
43 |
|
---|
44 | class ARCHETYPE_ONTOLOGY < ArchetypeOntology
|
---|
45 |
|
---|
46 | end
|
---|
47 |
|
---|
48 | class ArchetypeTerm
|
---|
49 | attr_accessor :items
|
---|
50 | attr_reader :code
|
---|
51 |
|
---|
52 | def initialize(args = { })
|
---|
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
|
---|
62 | end
|
---|
63 |
|
---|
64 | def keys
|
---|
65 | if items.nil?
|
---|
66 | return Set.new
|
---|
67 | else
|
---|
68 | return Set.new(@items.keys)
|
---|
69 | end
|
---|
70 | end
|
---|
71 | end
|
---|
72 |
|
---|
73 | class ARCHETYPE_TERM < ArchetypeTerm
|
---|
74 |
|
---|
75 | end
|
---|
76 | end # end of Ontology
|
---|
77 | end # end of Archetype
|
---|
78 | end # end of AM
|
---|
79 | end # end of OpenEHR
|
---|
80 |
|
---|