Index: /ruby/trunk/adl_parser/Rakefile
===================================================================
--- /ruby/trunk/adl_parser/Rakefile	(revision 20)
+++ /ruby/trunk/adl_parser/Rakefile	(revision 21)
@@ -83,9 +83,9 @@
   s.email = 'akimichi_tatsukawa@nifty.com'
   s.test_files = FileList['tests/*_test.rb', '*.adl']
-  candidates = Dir.glob("{bin, docs, lib, tests, ext}/**/*")
+  candidates = Dir.glob("{bin,docs,lib,tests,ext}/**/*")
   s.files = candidates.delete_if do |item|
     item.include?(".svn") || item.include?("rdoc")
   end
-  FileList['README', 'COPYING', 'Rakefile']
+  s.files = FileList['README', 'COPYING', 'Rakefile']
   s.require_path = "lib"
   s.has_rdoc = true
Index: /ruby/trunk/adl_parser/lib/parser.rb
===================================================================
--- /ruby/trunk/adl_parser/lib/parser.rb	(revision 20)
+++ /ruby/trunk/adl_parser/lib/parser.rb	(revision 21)
@@ -13,5 +13,7 @@
 require 'lib/util.rb'
 require 'lib/scanner.rb'
-require 'lib/model.rb'
+#require 'lib/model.rb'
+require 'rubygems'
+require 'am.rb'
 $DEBUG = true
 
@@ -25,5 +27,5 @@
     class Parser < Racc::Parser
 
-module_eval <<'..end lib/parser.y modeval..id134a7f5a66', 'lib/parser.y', 739
+module_eval <<'..end lib/parser.y modeval..id0eaae3c06b', 'lib/parser.y', 758
 
 @@log = Logger.new('log/parser.log','daily')
@@ -812,5 +814,5 @@
 
 
-..end lib/parser.y modeval..id134a7f5a66
+..end lib/parser.y modeval..id0eaae3c06b
 
 ##### racc 1.4.5 generates ###
@@ -818,7 +820,7 @@
 racc_reduce_table = [
  0, 0, :racc_error,
- 2, 95, :_reduce_none,
+ 2, 95, :_reduce_1,
  1, 95, :_reduce_none,
- 8, 96, :_reduce_none,
+ 8, 96, :_reduce_3,
  2, 97, :_reduce_none,
  2, 97, :_reduce_none,
@@ -839,12 +841,12 @@
  2, 100, :_reduce_none,
  0, 101, :_reduce_none,
+ 2, 101, :_reduce_22,
  2, 101, :_reduce_none,
- 2, 101, :_reduce_none,
+ 2, 102, :_reduce_24,
  2, 102, :_reduce_none,
- 2, 102, :_reduce_none,
+ 1, 110, :_reduce_26,
  1, 110, :_reduce_none,
- 1, 110, :_reduce_none,
- 5, 111, :_reduce_none,
- 5, 111, :_reduce_none,
+ 5, 111, :_reduce_28,
+ 5, 111, :_reduce_29,
  2, 113, :_reduce_none,
  1, 115, :_reduce_31,
@@ -871,5 +873,5 @@
  2, 132, :_reduce_none,
  1, 127, :_reduce_none,
- 1, 133, :_reduce_none,
+ 1, 133, :_reduce_54,
  1, 133, :_reduce_none,
  1, 133, :_reduce_none,
@@ -2012,9 +2014,22 @@
  # reduce 0 omitted
 
- # reduce 1 omitted
+module_eval <<'.,.,', 'lib/parser.y', 32
+  def _reduce_1( val, _values, result )
+    result = val[0]
+   result
+  end
+.,.,
 
  # reduce 2 omitted
 
- # reduce 3 omitted
+module_eval <<'.,.,', 'lib/parser.y', 41
+  def _reduce_3( val, _values, result )
+    result = OpenEHR::AM::Archetype::ARCHETYPE.new(
+                                                   :description => val[4],
+                                                   :definition => val[5]
+                                                   )
+   result
+  end
+.,.,
 
  # reduce 4 omitted
@@ -2048,5 +2063,5 @@
  # reduce 18 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 74
+module_eval <<'.,.,', 'lib/parser.y', 76
   def _reduce_19( val, _values, result )
     result = {:language => val[1]}
@@ -2059,23 +2074,48 @@
  # reduce 21 omitted
 
- # reduce 22 omitted
+module_eval <<'.,.,', 'lib/parser.y', 87
+  def _reduce_22( val, _values, result )
+    result = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new(:details => val[1])
+   result
+  end
+.,.,
 
  # reduce 23 omitted
 
- # reduce 24 omitted
+module_eval <<'.,.,', 'lib/parser.y', 95
+  def _reduce_24( val, _values, result )
+    result = val[1]
+   result
+  end
+.,.,
 
  # reduce 25 omitted
 
- # reduce 26 omitted
+module_eval <<'.,.,', 'lib/parser.y', 103
+  def _reduce_26( val, _values, result )
+    result = val[0]
+   result
+  end
+.,.,
 
  # reduce 27 omitted
 
- # reduce 28 omitted
-
- # reduce 29 omitted
+module_eval <<'.,.,', 'lib/parser.y', 111
+  def _reduce_28( val, _values, result )
+    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
+   result
+  end
+.,.,
+
+module_eval <<'.,.,', 'lib/parser.y', 115
+  def _reduce_29( val, _values, result )
+    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
+   result
+  end
+.,.,
 
  # reduce 30 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 111
+module_eval <<'.,.,', 'lib/parser.y', 124
   def _reduce_31( val, _values, result )
     result = {:c_complex_object_id => {:type_identifier => val[0]}}
@@ -2084,5 +2124,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 115
+module_eval <<'.,.,', 'lib/parser.y', 128
   def _reduce_32( val, _values, result )
     result = {:c_complex_object_id => {:type_identifier => val[0], :V_LOCAL_TERM_CODE_REF => val[1]}}
@@ -2133,5 +2173,11 @@
  # reduce 53 omitted
 
- # reduce 54 omitted
+module_eval <<'.,.,', 'lib/parser.y', 177
+  def _reduce_54( val, _values, result )
+    @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}")
+    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
+   result
+  end
+.,.,
 
  # reduce 55 omitted
@@ -2161,5 +2207,5 @@
  # reduce 67 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 186
+module_eval <<'.,.,', 'lib/parser.y', 203
   def _reduce_68( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
@@ -2168,5 +2214,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 190
+module_eval <<'.,.,', 'lib/parser.y', 207
   def _reduce_69( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}")
@@ -2221,5 +2267,5 @@
  # reduce 92 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 240
+module_eval <<'.,.,', 'lib/parser.y', 257
   def _reduce_93( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
@@ -2228,5 +2274,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 245
+module_eval <<'.,.,', 'lib/parser.y', 262
   def _reduce_94( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2251,5 +2297,5 @@
  # reduce 102 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 262
+module_eval <<'.,.,', 'lib/parser.y', 279
   def _reduce_103( val, _values, result )
     @@log.info("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2262,5 +2308,5 @@
  # reduce 105 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 270
+module_eval <<'.,.,', 'lib/parser.y', 287
   def _reduce_106( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
@@ -2269,5 +2315,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 275
+module_eval <<'.,.,', 'lib/parser.y', 292
   def _reduce_107( val, _values, result )
     @@log.info("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
@@ -2290,5 +2336,5 @@
  # reduce 114 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 287
+module_eval <<'.,.,', 'lib/parser.y', 304
   def _reduce_115( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[2]}> at #{@filename}:#{@lineno}")
@@ -2307,5 +2353,5 @@
  # reduce 120 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 296
+module_eval <<'.,.,', 'lib/parser.y', 313
   def _reduce_121( val, _values, result )
     @@log.info("string_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2314,5 +2360,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 300
+module_eval <<'.,.,', 'lib/parser.y', 317
   def _reduce_122( val, _values, result )
     @@log.info("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2321,5 +2367,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 304
+module_eval <<'.,.,', 'lib/parser.y', 321
   def _reduce_123( val, _values, result )
     @@log.info("real_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2328,5 +2374,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 308
+module_eval <<'.,.,', 'lib/parser.y', 325
   def _reduce_124( val, _values, result )
     @@log.info("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2335,5 +2381,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 312
+module_eval <<'.,.,', 'lib/parser.y', 329
   def _reduce_125( val, _values, result )
     @@log.info("character_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2342,5 +2388,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 316
+module_eval <<'.,.,', 'lib/parser.y', 333
   def _reduce_126( val, _values, result )
     @@log.info("date_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2349,5 +2395,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 320
+module_eval <<'.,.,', 'lib/parser.y', 337
   def _reduce_127( val, _values, result )
     @@log.info("time_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2356,5 +2402,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 324
+module_eval <<'.,.,', 'lib/parser.y', 341
   def _reduce_128( val, _values, result )
     @@log.info("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2363,5 +2409,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 328
+module_eval <<'.,.,', 'lib/parser.y', 345
   def _reduce_129( val, _values, result )
     @@log.info("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2370,5 +2416,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 332
+module_eval <<'.,.,', 'lib/parser.y', 349
   def _reduce_130( val, _values, result )
     @@log.info("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2407,5 +2453,5 @@
  # reduce 145 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 353
+module_eval <<'.,.,', 'lib/parser.y', 370
   def _reduce_146( val, _values, result )
     @@log.info("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2414,5 +2460,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 357
+module_eval <<'.,.,', 'lib/parser.y', 374
   def _reduce_147( val, _values, result )
     @@log.info("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2421,5 +2467,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 362
+module_eval <<'.,.,', 'lib/parser.y', 379
   def _reduce_148( val, _values, result )
     @@log.info("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2590,5 +2636,5 @@
  # reduce 229 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 473
+module_eval <<'.,.,', 'lib/parser.y', 490
   def _reduce_230( val, _values, result )
     @@log.info("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2621,5 +2667,5 @@
  # reduce 242 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 492
+module_eval <<'.,.,', 'lib/parser.y', 509
   def _reduce_243( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2634,5 +2680,5 @@
  # reduce 246 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 501
+module_eval <<'.,.,', 'lib/parser.y', 518
   def _reduce_247( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2721,5 +2767,5 @@
  # reduce 287 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 570
+module_eval <<'.,.,', 'lib/parser.y', 587
   def _reduce_288( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
@@ -2728,5 +2774,5 @@
 .,.,
 
-module_eval <<'.,.,', 'lib/parser.y', 574
+module_eval <<'.,.,', 'lib/parser.y', 591
   def _reduce_289( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
@@ -2885,5 +2931,5 @@
  # reduce 364 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 694
+module_eval <<'.,.,', 'lib/parser.y', 711
   def _reduce_365( val, _values, result )
     @in_interval = false
@@ -2909,5 +2955,5 @@
  # reduce 373 omitted
 
-module_eval <<'.,.,', 'lib/parser.y', 716
+module_eval <<'.,.,', 'lib/parser.y', 733
   def _reduce_374( val, _values, result )
     @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
Index: /ruby/trunk/adl_parser/lib/parser.y
===================================================================
--- /ruby/trunk/adl_parser/lib/parser.y	(revision 20)
+++ /ruby/trunk/adl_parser/lib/parser.y	(revision 21)
@@ -28,14 +28,16 @@
 
 input: archetype EOF
+  { 
+    result = val[0]
+  }
   | error
 
-archetype: arch_identification
-  arch_specialisation
-  arch_concept
-  arch_language
-  arch_description
-  arch_definition
-  arch_invariant
-  arch_ontology
+archetype: arch_identification arch_specialisation arch_concept arch_language arch_description arch_definition arch_invariant arch_ontology
+  { 
+    result = OpenEHR::AM::Archetype::ARCHETYPE.new(
+                                                   :description => val[4],
+                                                   :definition => val[5]
+                                                   )
+  }
 
 
@@ -81,9 +83,15 @@
 arch_description: #-- no meta-data ok
     | SYM_DESCRIPTION dadl_section
-    | SYM_DESCRIPTION error
-
+  { 
+    result = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new(:details => val[1])
+  }
+  | SYM_DESCRIPTION error
+  
 #arch_definition: SYM_DEFINITION V_CADL_TEXT
 #  | SYM_DEFINITION error
 arch_definition: SYM_DEFINITION cadl_section
+  { 
+    result = val[1]
+  }
   | SYM_DEFINITION error
 
@@ -91,4 +99,7 @@
 ### cADL section
 cadl_section: c_complex_object
+  { 
+    result = val[0]
+  }
   | assertions
 #  | error
@@ -96,10 +107,12 @@
 #c_complex_object: c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK
 c_complex_object: c_complex_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi
+  { 
+    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
+  }
     | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK
-#     | c_complex_object_head error SYM_END_CBLOCK
-#   {
-#     @adl_type.push(:cadl)
-#     yyerror
-#   }
+  { 
+    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
+  }
+#    | c_complex_object_head error SYM_END_CBLOCK
 #    | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body c_invariants SYM_END_CBLOCK
 
@@ -159,4 +172,8 @@
 
 c_primitive: c_integer
+  {
+    @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}")
+    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
+  }
   | c_real
   | c_date
@@ -731,5 +748,7 @@
 require 'lib/util.rb'
 require 'lib/scanner.rb'
-require 'lib/model.rb'
+#require 'lib/model.rb'
+require 'rubygems'
+require 'am.rb'
 $DEBUG = true
 
Index: /ruby/trunk/adl_parser/tests/parser_test.rb
===================================================================
--- /ruby/trunk/adl_parser/tests/parser_test.rb	(revision 20)
+++ /ruby/trunk/adl_parser/tests/parser_test.rb	(revision 21)
@@ -1,4 +1,2 @@
-#$:.unshift File.join(File.dirname(__FILE__))
-
 require 'lib/parser.rb'
 require 'test/unit'
@@ -16,17 +14,129 @@
     laboratory_request = File.read('tests/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl')
     assert_nothing_raised do
-      @parser.parse(laboratory_request, 'openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl')
+      result = @parser.parse(laboratory_request, 'openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl')
+      assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, result
+      assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, result.description
+      assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, result.definition
     end
 
-    apgar = File.read('tests/openEHR-EHR-OBSERVATION.apgar.v1.adl')
-    assert_nothing_raised do
-      result = @parser.parse(apgar, 'openEHR-EHR-OBSERVATION.apgar.v1.adl')
-      #       assert_equal "", result
-    end
+#     apgar = File.read('tests/openEHR-EHR-OBSERVATION.apgar.v1.adl')
+#     assert_nothing_raised do
+#       result = @parser.parse(apgar, 'openEHR-EHR-OBSERVATION.apgar.v1.adl')
+#       #       assert_equal "", result
+#     end
 
-    evaluation = File.read('tests/openEHR-EHR-EVALUATION.adverse.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(evaluation, 'openEHR-EHR-EVALUATION.adverse.v1.adl')
-    end
+#     evaluation = File.read('tests/openEHR-EHR-EVALUATION.adverse.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(evaluation, 'openEHR-EHR-EVALUATION.adverse.v1.adl')
+#     end
+
+
+
+#     referral = File.read('tests/openEHR-EHR-ITEM_TREE.referral.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(referral, 'openEHR-EHR-ITEM_TREE.referral.v1.adl')
+#     end
+
+#     exam_fetus = File.read('tests/openEHR-EHR-CLUSTER.exam-fetus.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_fetus, 'openEHR-EHR-CLUSTER.exam-fetus.v1.adl')
+#     end
+
+#     exam_uterine_cervix = File.read('tests/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_uterine_cervix, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
+#     end
+
+#     imaging = File.read('tests/openEHR-EHR-ACTION.imaging.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(imaging, 'openEHR-EHR-ACTION.imaging.v1.adl')
+#     end
+
+#     exam_nervous_system = File.read('tests/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_nervous_system, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
+#     end
+#     exam_generic = File.read('tests/openEHR-EHR-CLUSTER.exam-generic.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic, 'openEHR-EHR-CLUSTER.exam-generic.v1.adl')
+#     end
+#     exam_generic_mass = File.read('tests/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic_mass, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
+#     end
+#     exam_generic_lymphnode = File.read('tests/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic_lymphnode, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
+#     end
+#     exam_generic_joint = File.read('tests/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic_joint, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
+#     end
+#     exam_chest = File.read('tests/openEHR-EHR-CLUSTER.exam-chest.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_chest, 'openEHR-EHR-CLUSTER.exam-chest.v1.adl')
+#     end
+#     exam_abdomen = File.read('tests/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_abdomen, 'openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
+#     end
+#     cluster_auscultation = File.read('tests/openEHR-EHR-CLUSTER.auscultation.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(cluster_auscultation, 'openEHR-EHR-CLUSTER.auscultation.v1.adl')
+#     end
+#     cluster_auscultation_chest = File.read('tests/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(cluster_auscultation_chest, 'openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
+#     end
+#     vital_signs = File.read('tests/openEHR-EHR-SECTION.vital_signs.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(vital_signs, 'openEHR-EHR-SECTION.vital_signs.v1')
+#     end
+#     summary = File.read('tests/openEHR-EHR-SECTION.summary.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(summary, 'openEHR-EHR-SECTION.summary.v1.adl')
+#     end
+
+#     findings = File.read('tests/openEHR-EHR-SECTION.findings.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(findings, 'openEHR-EHR-SECTION.findings.v1.adl')
+#     end
+
+#     reason_for_encounter = File.read('tests/openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(reason_for_encounter, 'openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
+#     end
+
+#     imaging = File.read('tests/openEHR-EHR-ITEM_TREE.imaging.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(imaging, 'openEHR-EHR-ITEM_TREE.imaging.v1.adl')
+#     end
+#     instruction_referral = File.read('tests/openEHR-EHR-INSTRUCTION.referral.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(instruction_referral, 'openEHR-EHR-INSTRUCTION.referral.v1.adl')
+#     end
+#     instruction_medication = File.read('tests/openEHR-EHR-INSTRUCTION.medication.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(instruction_medication, 'openEHR-EHR-INSTRUCTION.medication.v1.adl')
+#     end
+#     action_referral = File.read('tests/openEHR-EHR-ACTION.referral.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(action_referral, 'openEHR-EHR-ACTION.referral.v1.adl')
+#     end
+
+#     dimensions_circumference = File.read('tests/openEHR-EHR-CLUSTER.dimensions.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(dimensions_circumference, 'openEHR-EHR-CLUSTER.dimensions.v1.adl')
+#     end
+
+#     discharge = File.read('tests/openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
+#     assert_nothing_raised do
+#       @parser.parse(discharge, 'openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
+#     end
+
+#     encounter = File.read('tests/openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
+#     assert_nothing_raised do
+#       @parser.parse(encounter, 'openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
+#     end
 
 
@@ -35,113 +145,4 @@
 #       @parser.parse(medication, 'openEHR-EHR-ITEM_TREE.medication.v1.adl')
 #     end
-
-    referral = File.read('tests/openEHR-EHR-ITEM_TREE.referral.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(referral, 'openEHR-EHR-ITEM_TREE.referral.v1.adl')
-    end
-
-    exam_fetus = File.read('tests/openEHR-EHR-CLUSTER.exam-fetus.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_fetus, 'openEHR-EHR-CLUSTER.exam-fetus.v1.adl')
-    end
-
-    exam_uterine_cervix = File.read('tests/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_uterine_cervix, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
-    end
-
-    imaging = File.read('tests/openEHR-EHR-ACTION.imaging.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(imaging, 'openEHR-EHR-ACTION.imaging.v1.adl')
-    end
-
-    exam_nervous_system = File.read('tests/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_nervous_system, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
-    end
-    exam_generic = File.read('tests/openEHR-EHR-CLUSTER.exam-generic.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic, 'openEHR-EHR-CLUSTER.exam-generic.v1.adl')
-    end
-    exam_generic_mass = File.read('tests/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic_mass, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
-    end
-    exam_generic_lymphnode = File.read('tests/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic_lymphnode, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
-    end
-    exam_generic_joint = File.read('tests/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic_joint, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
-    end
-    exam_chest = File.read('tests/openEHR-EHR-CLUSTER.exam-chest.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_chest, 'openEHR-EHR-CLUSTER.exam-chest.v1.adl')
-    end
-    exam_abdomen = File.read('tests/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_abdomen, 'openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
-    end
-    cluster_auscultation = File.read('tests/openEHR-EHR-CLUSTER.auscultation.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(cluster_auscultation, 'openEHR-EHR-CLUSTER.auscultation.v1.adl')
-    end
-    cluster_auscultation_chest = File.read('tests/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(cluster_auscultation_chest, 'openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
-    end
-    vital_signs = File.read('tests/openEHR-EHR-SECTION.vital_signs.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(vital_signs, 'openEHR-EHR-SECTION.vital_signs.v1')
-    end
-    summary = File.read('tests/openEHR-EHR-SECTION.summary.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(summary, 'openEHR-EHR-SECTION.summary.v1.adl')
-    end
-
-    findings = File.read('tests/openEHR-EHR-SECTION.findings.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(findings, 'openEHR-EHR-SECTION.findings.v1.adl')
-    end
-
-    reason_for_encounter = File.read('tests/openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(reason_for_encounter, 'openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
-    end
-
-    imaging = File.read('tests/openEHR-EHR-ITEM_TREE.imaging.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(imaging, 'openEHR-EHR-ITEM_TREE.imaging.v1.adl')
-    end
-    instruction_referral = File.read('tests/openEHR-EHR-INSTRUCTION.referral.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(instruction_referral, 'openEHR-EHR-INSTRUCTION.referral.v1.adl')
-    end
-    instruction_medication = File.read('tests/openEHR-EHR-INSTRUCTION.medication.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(instruction_medication, 'openEHR-EHR-INSTRUCTION.medication.v1.adl')
-    end
-    action_referral = File.read('tests/openEHR-EHR-ACTION.referral.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(action_referral, 'openEHR-EHR-ACTION.referral.v1.adl')
-    end
-
-    dimensions_circumference = File.read('tests/openEHR-EHR-CLUSTER.dimensions.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(dimensions_circumference, 'openEHR-EHR-CLUSTER.dimensions.v1.adl')
-    end
-
-    discharge = File.read('tests/openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
-    assert_nothing_raised do
-      @parser.parse(discharge, 'openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
-    end
-
-    encounter = File.read('tests/openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
-    assert_nothing_raised do
-      @parser.parse(encounter, 'openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
-    end
-
-
   end
 end
Index: /ruby/trunk/adl_parser/tests/semantic_test.rb
===================================================================
--- /ruby/trunk/adl_parser/tests/semantic_test.rb	(revision 21)
+++ /ruby/trunk/adl_parser/tests/semantic_test.rb	(revision 21)
@@ -0,0 +1,12 @@
+require 'lib/parser.rb'
+require 'test/unit'
+
+class ADLSemanticTest < Test::Unit::TestCase
+  def setup
+    @parser = ::OpenEHR::ADL::Parser.new
+  end
+
+  def test_init
+    assert_instance_of ::OpenEHR::ADL::Parser,@parser
+  end
+end
Index: by/trunk/adl_parser/tests/test_parser.rb
===================================================================
--- /ruby/trunk/adl_parser/tests/test_parser.rb	(revision 20)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#$:.unshift File.join(File.dirname(__FILE__))
-
-require 'lib/parser.rb'
-require 'test/unit'
-
-class ADLParserTest < Test::Unit::TestCase
-  def setup
-    @parser = ::OpenEHR::ADL::Parser.new
-  end
-
-  def test_init
-    assert_instance_of ::OpenEHR::ADL::Parser,@parser
-  end
-
-  def test_parse
-    exam_uterine_cervix = File.read('tests/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_uterine_cervix, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
-    end
-  end
-end
Index: /ruby/trunk/models/COPYING
===================================================================
--- /ruby/trunk/models/COPYING	(revision 21)
+++ /ruby/trunk/models/COPYING	(revision 21)
@@ -0,0 +1,3 @@
+openEHR Open Source Software License
+
+The openEHR Foundation uses the Mozilla Tri-license 1.1 on all software copyrighted to the Foundation. This licence essentially provides the user a choice of licence conditions under which to operate with any given piece of software, being: the Mozilla Public licence (MPL), and the Free Software Foundation GNU General Public Licence (GPL) and Lesser GNU Public Licence (LGPL). See the Mozilla relicensing FAQ for details of this license. This in no way constrains the way in which software created by other organisations is licenced. 
Index: /ruby/trunk/models/Rakefile
===================================================================
--- /ruby/trunk/models/Rakefile	(revision 20)
+++ /ruby/trunk/models/Rakefile	(revision 21)
@@ -34,4 +34,32 @@
 
 
+gem_spec = Gem::Specification.new do |s|
+  s.name = 'openehr_models'
+  s.author = 'Shinji KOBAYASHI, Akimichi TATSUKAWA'
+  s.version = '0.0.1'
+  s.summary = 'OpenEHR models'
+  s.email = 'openehr-jp@openehr.jp'
+  s.test_files = FileList['tests/test_*.rb', '*.adl']
+  candidates = Dir.glob("{am,rm,docs,tests}/**/*") + FileList['COPYING', 'Rakefile','am.rb','assumed_library_types.rb','rm.rb']
+  s.files = candidates.delete_if do |item|
+    item.include?(".svn") || item.include?("rdoc")
+  end
+#  s.files << FileList['COPYING', 'Rakefile','am.rb','assumed_library_types.rb','rm.rb']
+#  s.require_paths += [".","am","rm"]
+  s.require_path = "."
+#  s.has_rdoc = true
+#  s.extra_rdoc_files = ["README"]
+end
+
+
+Rake::GemPackageTask.new(gem_spec) do |pkg|
+  pkg.need_zip = false
+  pkg.need_tar = false
+end
+
+#CLOBBER.include('rdoc')
+#CLEAN.include('lib/*.output', 'log/*.log')
+
+
 
 
Index: /ruby/trunk/models/am.rb
===================================================================
--- /ruby/trunk/models/am.rb	(revision 20)
+++ /ruby/trunk/models/am.rb	(revision 21)
@@ -17,9 +17,14 @@
   module AM
     module Archetype
-      autoload :Archetype, "am/archetype/archetype.rb"
+      autoload :ARCHETYPE, "am/archetype/archetype.rb"
       autoload :Constraint_Model, "am/archetype/constraint_model/archetype_constraint.rb"
       autoload :Ontology, "am/archetype/ontology.rb"
-      autoload :Archetype_Description, "am/archetype/archetype_description/archetype_description.rb"
+      
+      module Archetype_Description
+        autoload :ARCHETYPE_DESCRIPTION, "am/archetype/archetype_description/archetype_description.rb"
+      end
+
       module Constraint_Model
+        autoload :ARCHETYPE_CONSTRAINT, "am/archetype/constraint_model/archetype_constraint.rb"
         autoload :Assertion, "am/archetype/constraint_model/assertion.rb"
         autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
Index: /ruby/trunk/models/am/archetype/archetype.rb
===================================================================
--- /ruby/trunk/models/am/archetype/archetype.rb	(revision 20)
+++ /ruby/trunk/models/am/archetype/archetype.rb	(revision 21)
@@ -9,5 +9,6 @@
         CURRENT_ADL_VERSION = "2.0"
       end
-      class Archetype < OpenEHR::RM::Common::Resource::Authored_Resource
+
+      class ARCHETYPE < OpenEHR::RM::Common::Resource::Authored_Resource
         include ADL_Definition
         attr_accessor :archetype_id, :concept_code, :is_controlled, :original_language, :parent_archtype_id, :uid
@@ -18,23 +19,24 @@
         attr_accessor :revision_history, :translation
 
-        def initialize(parent_id, concept,
-                       description, revision_history, is_controled,
-                       definition, ontology, adl_version,
-                       id = nil , original_language = nil, translation = nil)
+        def initialize(args = {})
+#         def initialize(parent_id, concept,
+#                        description, revision_history, is_controled,
+#                        definition, ontology, adl_version,
+#                        id = nil , original_language = nil, translation = nil)
 #          raise Exception.new("illegal argument error, id == nil") unless id
 #          raise Exception.new("illegal argument error, originalLanguage == nil") unless origina_language
 
 #          raise Exception.new("illegal argument error, translation == nil") unless translation
-          @adl_version = adl_version
-          @id = id
-          @parent_id = parent_id
-          @concept = concept
-          @original_language = original_language
-          @translation = translation
-          @description = description
-          @revision_history = revision_history
-          @is_controled = is_controled
-          @definition = definition
-          @ontology = ontology
+          @adl_version = args[:adl_version] if args[:adl_version]
+          @id = args[:id] ? args[:id] : nil
+          @parent_id = args[:parent_id] if args[:parent_id]
+          @concept = args[:concept] if args[:concept]
+          @original_language = args[:original_language] ? args[:original_language] : nil
+          @translation = args[:translation] ? args[:translation] : nil
+          @description = args[:description] if args[:description]
+          @revision_history = args[:revision_history] if args[:revision_history]
+          @is_controled = args[:is_controled] if args[:is_controled]
+          @definition = args[:definition] if args[:definition] 
+          @ontology = args[:ontology] if args[:ontology]
  #         loadMaps(definition)
         end
Index: /ruby/trunk/models/am/archetype/archetype_description/archetype_description.rb
===================================================================
--- /ruby/trunk/models/am/archetype/archetype_description/archetype_description.rb	(revision 20)
+++ /ruby/trunk/models/am/archetype/archetype_description/archetype_description.rb	(revision 21)
@@ -4,6 +4,9 @@
     module Archetype
       module Archetype_Description
-        class Archetype_Description
-          attr_accessor :archetype_package_uri, :lifecycle_state, :original_author, :other_contributors, :other_details
+        class ARCHETYPE_DESCRIPTION
+          attr_accessor :archetype_package_uri, :lifecycle_state, :original_author, :other_contributors, :other_details, :details
+          def initialize(args ={ })
+            @details = args[:details] ? args[:details] : []
+          end
         end
 
Index: /ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb
===================================================================
--- /ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb	(revision 20)
+++ /ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb	(revision 21)
@@ -4,7 +4,49 @@
     module Archetype
       module Constraint_Model
-        class Archetype_Constraint
+        class ARCHETYPE_CONSTRAINT
           
         end
+
+        class C_OBJECT < ARCHETYPE_CONSTRAINT
+          
+        end
+
+        class C_ATTRIBUTE < ARCHETYPE_CONSTRAINT
+          
+        end
+
+        class C_DEFINED_OBJECT < C_OBJECT
+          
+        end
+
+        class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT
+          
+        end
+
+        class C_COMPLEX_OBJECT < C_DEFINED_OBJECT
+          attr_accessor :attributes, :attributes_valid
+          
+        end
+
+        class C_DOMAIN_TYPE < C_DEFINED_OBJECT
+          
+        end
+
+        class C_REFERENCE_OBJECT < C_OBJECT
+          
+        end
+
+        class ARCHETYPE_INTERNAL_REF < C_REFERENCE_OBJECT
+          
+        end
+
+        class ARCHETYPE_SLOT < C_REFERENCE_OBJECT
+          
+        end
+
+        class CONSTRAINT_REF < C_REFERENCE_OBJECT
+          
+        end
+
       end
     end
Index: /ruby/trunk/models/am/archetype/constraint_model/primitive.rb
===================================================================
--- /ruby/trunk/models/am/archetype/constraint_model/primitive.rb	(revision 20)
+++ /ruby/trunk/models/am/archetype/constraint_model/primitive.rb	(revision 21)
@@ -3,5 +3,7 @@
     module Archetype
       module Constraint_Model
+
         module Primitive
+
           class C_Primitive
             def assumed_value
@@ -18,4 +20,5 @@
             end
           end
+
           class C_Boolean < C_Primitive
             attr_accessor :assumed_value
@@ -50,5 +53,7 @@
               end              
             end
+
             private 
+
             def binary_consistency(true_valid, false_valid)
               if !true_valid && !false_valid
@@ -57,4 +62,5 @@
             end
           end # of C_Boolean
+
           class C_Integer < C_Primitive
             
Index: /ruby/trunk/models/assumed_library_types.rb
===================================================================
--- /ruby/trunk/models/assumed_library_types.rb	(revision 20)
+++ /ruby/trunk/models/assumed_library_types.rb	(revision 21)
@@ -10,10 +10,13 @@
         set_upper_included(upper_included)
       end
+
       def set_lower(lower)
         check_lower_upper(lower, @upper)
       end
+
       def set_upper(upper)
         check_lower_upper(@lower, upper)
       end
+
       def set_lower_included(lower_included)
         if (lower == nil) && (lower_included != nil)
@@ -22,4 +25,5 @@
         @lower_included = lower_included
       end
+
       def set_upper_included(upper_included)
         @upper_included = upper_included
@@ -28,4 +32,5 @@
         end
       end
+
       def has?(value)
         if ((@lower < value) && (value < @upper) ||
@@ -37,5 +42,7 @@
         end
       end
+
       private
+
       def check_lower_upper(lower, upper)
         if (lower == nil) && (upper == nil)
Index: /ruby/trunk/models/tests/test_archetype_model.rb
===================================================================
--- /ruby/trunk/models/tests/test_archetype_model.rb	(revision 20)
+++ /ruby/trunk/models/tests/test_archetype_model.rb	(revision 21)
@@ -5,7 +5,7 @@
 class ArchetypeModelTest < Test::Unit::TestCase
   def setup
-    @archetype = OpenEHR::AM::Archetype::Archetype.new(nil,nil,nil,nil,nil,nil,nil,nil)
-    @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::Archetype_Description.new
-    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::Archetype_Constraint.new
+    @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new #(nil,nil,nil,nil,nil,nil,nil,nil)
+    @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new
+    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
     @assertion = OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion.new
     @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive.new
@@ -13,15 +13,39 @@
     @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
     @archetype_ontology = OpenEHR::AM::Archetype::Ontology::Archetype_Ontology.new
+
+    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
+    @c_object = OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT.new
+    @c_defined_object = OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT.new
+    @c_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE.new
+    @c_primitive_object = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new
+    @c_reference_object =  OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT.new
+    @archetype_internal_ref =  OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.new
+    @archetype_slot = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.new
+    @constraint_ref = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new
+    @c_domain_type = OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE.new
+    @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
   end
   
   def test_init
     assert_instance_of OpenEHR::AM::Archetype::Ontology::Archetype_Ontology, @archetype_ontology
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Archetype_Constraint, @archetype_constraint
-    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::Archetype_Description, @archetype_description
-    assert_instance_of OpenEHR::AM::Archetype::Archetype, @archetype
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
+    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
+    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion, @assertion
     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive, @c_primitive
     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean, @c_boolean
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT, @c_object
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT, @c_defined_object
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE, @c_attribute
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT, @c_primitive_object
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT, @c_reference_object
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF, @archetype_internal_ref
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT, @archetype_slot
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF, @constraint_ref
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE, @c_domain_type
+    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, @c_complex_object
   end
+
   def test_primitive
     assert @c_boolean.true_valid?
