source: ruby/trunk/lib/open_ehr/am/archetype.rb@ 372

Last change on this file since 372 was 372, checked in by KOBAYASHI, Shinji, 14 years ago

refs #74 archetype
rails updated

File size: 2.6 KB
Line 
1include OpenEHR::RM::Common::Resource
2
3module OpenEHR
4 module AM
5 module Archetype
6 module ADLDefinition
7 include OpenEHR::RM::Support::Terminology
8# include OpenEHR::RM::Support::Terminology::OpenEHR_Code_Set_Identifier
9 CURRENT_ADL_VERSION = "1.4"
10 end
11
12 class Archetype < AuthoredResource
13 include ADLDefinition
14 attr_reader :archetype_id, :concept, :definition, :ontology
15 attr_accessor :uid, :adl_version, :parent_archetype_id, :invariants
16
17 def initialize(args = {})
18 super(args)
19 self.adl_version = args[:adl_version]
20 self.archetype_id = args[:archetype_id]
21 self.uid = args[:uid]
22 self.concept = args[:concept]
23 self.parent_archetype_id = args[:parent_archetype_id]
24 self.definition = args[:definition]
25 self.ontology = args[:ontology]
26 self.invariants = args[:invariants]
27 end
28
29 def archetype_id=(archetype_id)
30 if archetype_id.nil?
31 raise ArgumentError, 'archetype_id is mandatory'
32 end
33 @archetype_id = archetype_id
34 end
35
36 def concept=(concept)
37 if concept.nil?
38 raise ArgumentError, 'concept is mandatory'
39 end
40 @concept = concept
41 end
42
43 def definition=(definition)
44 if definition.nil?
45 raise ArgumentError, 'definition is mandatory'
46 end
47 @definition = definition
48 end
49
50 def ontology=(ontology)
51 if ontology.nil?
52 raise ArgumentError, 'ontology is mandatory'
53 end
54 @ontology = ontology
55 end
56
57 def version
58 return @archetype_id.version_id
59 end
60
61 def short_concept_name
62 return @archetype_id.concept_name
63 end
64
65 def self.create(args ={}, &block)
66 archetype = new(args)
67 if block_given?
68 yield archetype
69 end
70 return archetype
71 end
72
73 def concept_name(a_lang)
74 end
75
76 def constraint_references_valid?
77 end
78
79 def internal_references_valid?
80 end
81
82 def is_specialised?
83 end
84
85 def is_valid?
86 end
87
88 def logical_paths(a_lang)
89 end
90
91 def node_ids_vaild?
92 end
93
94 def physical_paths
95 end
96
97 def previous_version
98 end
99
100 def specialisation_depth
101 end
102
103 end # end of Archetype
104 # original file:
105 # ref_imple_eiffel/components/adl_parser/src/interface/adl_definition.e
106
107 class VALIDITY_KIND
108 end
109 end
110 end # of AM
111end # of OpenEHR
Note: See TracBrowser for help on using the repository browser.