Index: /ruby/trunk/lib/adl_parser/lib/parser.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 327)
+++ /ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 328)
@@ -14,9 +14,4 @@
 require 'rubygems'
 require 'open_ehr'
-#require 'adl_parser.rb'
-#require 'am.rb'
-#require 'rm.rb'
-#require 'rm/support/assumed_types.rb'
-#require 'assumed_library_types.rb'
 $DEBUG = true
 
@@ -27,5 +22,5 @@
     class Parser < Racc::Parser
 
-module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1368)
+module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1417)
 
 def assert_at(file,line, message = "")
@@ -63,5 +58,5 @@
 
 
-def parse(data, filename, lineno = 1, debug = false)
+def parse(data, filename = "", lineno = 1, debug = false)
   @yydebug = true
   @parsestring = data
@@ -1426,8 +1421,15 @@
 module_eval(<<'.,.,', 'parser.y', 128)
   def _reduce_19(val, _values, result)
-        if val[1][0][:attr_id] == "original_language"
-      result = {:arch_language => val[1][0][:object_block][:untyped_primitive_object_block]}
+        dadl_section = val[1]
+    @@logger.debug("#{__FILE__}:#{__LINE__}: arch_language::dadl_section = \n#{dadl_section.to_yaml}")
+    case dadl_section[:attr_id]
+    when "translations"
+      result = {:arch_language => dadl_section[:object_block][:untyped_primitive_object_block]}
+    when "original_language"
+      result = {:arch_language => dadl_section[:object_block][:untyped_primitive_object_block]}
+###     if val[1][:attr_id] == "original_language"
+###       result = {:arch_language => val[0][:object_block][:untyped_primitive_object_block]}
     else
-      raise OpenEhr::ADL::Exception::Parser::Error, "It should be 'original_language' at #{@filename}:#{@lineno} "
+      raise OpenEhr::ADL::Exception::Parser::Error, "It should be 'original_language, but was #{dadl_section[:attr_id]}' at #{@filename}:#{@lineno} "
     end
   
@@ -1440,42 +1442,43 @@
 # reduce 21 omitted
 
-module_eval(<<'.,.,', 'parser.y', 143)
+module_eval(<<'.,.,', 'parser.y', 150)
   def _reduce_22(val, _values, result)
         args = Hash.new
     val[1].each do |item|
-      @@logger.debug("#{__FILE__}:#{__LINE__}: arch_description: item[:object_block] = #{item[:object_block].to_yaml} at #{@filename}:#{@lineno}")
-      case item[:attr_id]
+      @@logger.debug("#{__FILE__}:#{__LINE__}: arch_description: item = #{item.to_yaml} at #{@filename}:#{@lineno}")
+      case item
       when "original_author"
         unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:original_author => item[:object_block][:untyped_multiple_attr_object_block]])
+          args.merge!(Hash[:original_author => item[:untyped_multiple_attr_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "details"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:details => item[:object_block][:untyped_multiple_attr_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:details => item[:untyped_multiple_attr_object_block]])
+          #args.merge!(Hash[:details => item[:object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "lifecycle_state"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:lifecycle_state => item[:object_block][:untyped_primitive_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:lifecycle_state => item[:untyped_primitive_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "other_contributors"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:other_contributors => item[:object_block][:untyped_multiple_attr_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:other_contributors => item[:untyped_multiple_attr_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "other_details"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:other_contributors => item[:object_block][:untyped_multiple_attr_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:other_contributors => item[:untyped_multiple_attr_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       else
-        raise OpenEhr::ADL::Exception::Parser::Error, "Unknown case #{item[:attr_id]} at #{@filename}:#{@lineno} "
+        raise OpenEhr::ADL::Exception::Parser::Error, "Unknown case #{item} at #{@filename}:#{@lineno} "
       end
     end
@@ -1489,5 +1492,5 @@
 # reduce 23 omitted
 
-module_eval(<<'.,.,', 'parser.y', 190)
+module_eval(<<'.,.,', 'parser.y', 198)
   def _reduce_24(val, _values, result)
         result = val[1]
@@ -1499,5 +1502,5 @@
 # reduce 25 omitted
 
-module_eval(<<'.,.,', 'parser.y', 198)
+module_eval(<<'.,.,', 'parser.y', 206)
   def _reduce_26(val, _values, result)
         assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT)}
@@ -1509,5 +1512,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 204)
+module_eval(<<'.,.,', 'parser.y', 212)
   def _reduce_27(val, _values, result)
         result = val[0]
@@ -1517,5 +1520,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 212)
+module_eval(<<'.,.,', 'parser.y', 220)
   def _reduce_28(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}:c_complx_object = \n c_complx_object_head = #{val[0].to_yaml}")
@@ -1530,5 +1533,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 222)
+module_eval(<<'.,.,', 'parser.y', 230)
   def _reduce_29(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
@@ -1542,5 +1545,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 234)
+module_eval(<<'.,.,', 'parser.y', 242)
   def _reduce_30(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object_head: c_complex_object_id => #{val[0]}, c_occurrences => #{val[1]}")
@@ -1551,5 +1554,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 240)
+module_eval(<<'.,.,', 'parser.y', 248)
   def _reduce_31(val, _values, result)
         result = {:type_identifier => val[0]}
@@ -1559,5 +1562,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 244)
+module_eval(<<'.,.,', 'parser.y', 252)
   def _reduce_32(val, _values, result)
         result = {:type_identifier => val[0], :local_term_code_ref => val[1]}
@@ -1569,5 +1572,5 @@
 # reduce 33 omitted
 
-module_eval(<<'.,.,', 'parser.y', 250)
+module_eval(<<'.,.,', 'parser.y', 258)
   def _reduce_34(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.new(:attributes => val[0])
@@ -1577,5 +1580,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 268)
+module_eval(<<'.,.,', 'parser.y', 276)
   def _reduce_35(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}")
@@ -1586,5 +1589,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 273)
+module_eval(<<'.,.,', 'parser.y', 281)
   def _reduce_36(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref|
@@ -1598,5 +1601,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 281)
+module_eval(<<'.,.,', 'parser.y', 289)
   def _reduce_37(val, _values, result)
         result = val[0]
@@ -1606,5 +1609,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 285)
+module_eval(<<'.,.,', 'parser.y', 293)
   def _reduce_38(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::CONSTRAINT_REF.create do |constraint_ref|
@@ -1616,5 +1619,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 291)
+module_eval(<<'.,.,', 'parser.y', 299)
   def _reduce_39(val, _values, result)
         result = val[0]
@@ -1624,5 +1627,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 295)
+module_eval(<<'.,.,', 'parser.y', 303)
   def _reduce_40(val, _values, result)
         result = val[0]
@@ -1632,5 +1635,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 299)
+module_eval(<<'.,.,', 'parser.y', 307)
   def _reduce_41(val, _values, result)
         result = val[0]
@@ -1640,5 +1643,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 303)
+module_eval(<<'.,.,', 'parser.y', 311)
   def _reduce_42(val, _values, result)
         result = val[0]
@@ -1652,5 +1655,5 @@
 # reduce 44 omitted
 
-module_eval(<<'.,.,', 'parser.y', 336)
+module_eval(<<'.,.,', 'parser.y', 344)
   def _reduce_45(val, _values, result)
         result = val[1]
@@ -1660,5 +1663,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 342)
+module_eval(<<'.,.,', 'parser.y', 350)
   def _reduce_46(val, _values, result)
         result = {:type_identifier => val[1], :c_occurrences => val[2], :absolute_path => val[3] }
@@ -1670,5 +1673,5 @@
 # reduce 47 omitted
 
-module_eval(<<'.,.,', 'parser.y', 349)
+module_eval(<<'.,.,', 'parser.y', 357)
   def _reduce_48(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::ARCHETYPE_SLOT.create do |archetype_slot|
@@ -1683,5 +1686,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 358)
+module_eval(<<'.,.,', 'parser.y', 366)
   def _reduce_49(val, _values, result)
         result = {:c_archetype_slot_id => val[0],:c_occurrences => val[1]}
@@ -1691,5 +1694,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 363)
+module_eval(<<'.,.,', 'parser.y', 371)
   def _reduce_50(val, _values, result)
         result = val[1]
@@ -1703,5 +1706,5 @@
 # reduce 52 omitted
 
-module_eval(<<'.,.,', 'parser.y', 371)
+module_eval(<<'.,.,', 'parser.y', 379)
   def _reduce_53(val, _values, result)
         assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_PRIMITIVE)}
@@ -1714,5 +1717,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 379)
+module_eval(<<'.,.,', 'parser.y', 387)
   def _reduce_54(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1727,5 +1730,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 388)
+module_eval(<<'.,.,', 'parser.y', 396)
   def _reduce_55(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1736,5 +1739,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 393)
+module_eval(<<'.,.,', 'parser.y', 401)
   def _reduce_56(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1745,5 +1748,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 398)
+module_eval(<<'.,.,', 'parser.y', 406)
   def _reduce_57(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1754,5 +1757,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 403)
+module_eval(<<'.,.,', 'parser.y', 411)
   def _reduce_58(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1763,5 +1766,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 408)
+module_eval(<<'.,.,', 'parser.y', 416)
   def _reduce_59(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1772,5 +1775,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 413)
+module_eval(<<'.,.,', 'parser.y', 421)
   def _reduce_60(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
@@ -1781,5 +1784,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 418)
+module_eval(<<'.,.,', 'parser.y', 426)
   def _reduce_61(val, _values, result)
         assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN)}
@@ -1793,5 +1796,5 @@
 # reduce 62 omitted
 
-module_eval(<<'.,.,', 'parser.y', 430)
+module_eval(<<'.,.,', 'parser.y', 438)
   def _reduce_63(val, _values, result)
         result = [val[0]]
@@ -1801,5 +1804,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 434)
+module_eval(<<'.,.,', 'parser.y', 442)
   def _reduce_64(val, _values, result)
         result = (val[0] << val[1])
@@ -1809,5 +1812,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 440)
+module_eval(<<'.,.,', 'parser.y', 448)
   def _reduce_65(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}:c_attribute: #{val[0]} matches #{val[3]}")
@@ -1821,5 +1824,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 448)
+module_eval(<<'.,.,', 'parser.y', 456)
   def _reduce_66(val, _values, result)
         @@logger.debug("c_attribute: #{val[0]} matches #{val[3]}}")
@@ -1831,5 +1834,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 455)
+module_eval(<<'.,.,', 'parser.y', 463)
   def _reduce_67(val, _values, result)
         @@logger.debug("c_attribute: #{val[0]} matches #{val[5]}}")
@@ -1841,5 +1844,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 461)
+module_eval(<<'.,.,', 'parser.y', 469)
   def _reduce_68(val, _values, result)
         assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
@@ -1850,5 +1853,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 468)
+module_eval(<<'.,.,', 'parser.y', 476)
   def _reduce_69(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
@@ -1863,5 +1866,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 477)
+module_eval(<<'.,.,', 'parser.y', 485)
   def _reduce_70(val, _values, result)
         assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY) }
@@ -1877,5 +1880,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 488)
+module_eval(<<'.,.,', 'parser.y', 496)
   def _reduce_71(val, _values, result)
         result = Array[val[0]]
@@ -1885,5 +1888,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 492)
+module_eval(<<'.,.,', 'parser.y', 500)
   def _reduce_72(val, _values, result)
         result = (val[0] << val[1])
@@ -1893,5 +1896,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 496)
+module_eval(<<'.,.,', 'parser.y', 504)
   def _reduce_73(val, _values, result)
         result = Array[val[0]]
@@ -1903,5 +1906,5 @@
 # reduce 74 omitted
 
-module_eval(<<'.,.,', 'parser.y', 502)
+module_eval(<<'.,.,', 'parser.y', 510)
   def _reduce_75(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_includes: assertions = #{val[1]}") 
@@ -1914,5 +1917,5 @@
 # reduce 76 omitted
 
-module_eval(<<'.,.,', 'parser.y', 511)
+module_eval(<<'.,.,', 'parser.y', 519)
   def _reduce_77(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_excludes: assertions = #{val[1]}") 
@@ -1939,8 +1942,39 @@
 # reduce 85 omitted
 
-module_eval(<<'.,.,', 'parser.y', 534)
+module_eval(<<'.,.,', 'parser.y', 542)
   def _reduce_86(val, _values, result)
         dadl_section = val[1]
-    result = OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
+    @@logger.debug("#{__FILE__}:#{__LINE__}: arch_ontology: dadl_section = #{val[1].to_yaml}") 
+    args = Hash.new
+    dadl_section.each do |item|
+      @@logger.debug("#{__FILE__}:#{__LINE__}: arch_description: item[:object_block] = #{item[:object_block].to_yaml} at #{@filename}:#{@lineno}")
+      case item[:attr_id]
+      when "terminologies_available"
+        unless item[:object_block][:type_identifier]
+          args.merge!(Hash[:terminologies_available => item[:object_block][:untyped_primitive_object_block]])
+          #args.merge!(Hash[:terminologies_available => item[:object_block]])
+        else
+          raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
+        end
+      when "term_definitions"
+        unless item[:object_block][:type_identifier]
+          args.merge!(Hash[:term_definitions => item[:object_block][:untyped_multiple_attr_object_block]])
+          #args.merge!(Hash[:term_definitions => item[:object_block]])
+        else
+          raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
+        end
+      when "term_binding"
+        unless item[:object_block][:type_identifier]
+          args.merge!(Hash[:term_binding => item[:object_block][:untyped_multiple_attr_object_block]])
+          #args.merge!(Hash[:term_binding => item[:object_block]])
+        else
+          raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
+        end
+      else
+        raise OpenEhr::ADL::Exception::Parser::Error, "Unknown case #{item[:attr_id]} at #{@filename}:#{@lineno} "
+      end
+    end
+
+    result = OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new(args)
   
     result
@@ -1952,7 +1986,7 @@
 # reduce 88 omitted
 
-module_eval(<<'.,.,', 'parser.y', 544)
+module_eval(<<'.,.,', 'parser.y', 583)
   def _reduce_89(val, _values, result)
-        #@@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section attr_vals = \n#{val[0].to_yaml}")
+        @@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section::attr_vals = \n#{val[0].to_yaml}")
     result = val[0]
   
@@ -1961,7 +1995,7 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 549)
+module_eval(<<'.,.,', 'parser.y', 588)
   def _reduce_90(val, _values, result)
-        #@@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section complex_object_block = \n#{val[0].to_yaml}")
+        #@@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section::complex_object_block = \n#{val[0].to_yaml}")
     result = val[0]
   
@@ -1970,31 +2004,32 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 556)
+module_eval(<<'.,.,', 'parser.y', 595)
   def _reduce_91(val, _values, result)
-        result = Array[val[0]]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 560)
+        attr_val = val[0]
+    result = Hash[attr_val[:attr_id] => attr_val[:object_block]]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 600)
   def _reduce_92(val, _values, result)
-        result = (val[0] << val[1])
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 564)
+        result = val[0].merge!(val[1])
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 604)
   def _reduce_93(val, _values, result)
-        result = (val[0] << val[2])
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 569)
+        result = val[0].merge!(val[2])
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 621)
   def _reduce_94(val, _values, result)
-        @@logger.debug("#{__FILE__}:#{__LINE__}:attr_val\n attr_id = #{val[0]}, object_block = #{val[1]}")
+        @@logger.debug("#{__FILE__}:#{__LINE__}:attr_val\n attr_id = #{val[0].to_yaml},\n object_block = #{val[2].to_yaml}")
     result = {:attr_id => val[0], :object_block => val[2]}
   
@@ -2003,5 +2038,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 575)
+module_eval(<<'.,.,', 'parser.y', 627)
   def _reduce_95(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}")
@@ -2014,5 +2049,5 @@
 # reduce 96 omitted
 
-module_eval(<<'.,.,', 'parser.y', 582)
+module_eval(<<'.,.,', 'parser.y', 634)
   def _reduce_97(val, _values, result)
         result = val[0]
@@ -2022,5 +2057,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 586)
+module_eval(<<'.,.,', 'parser.y', 638)
   def _reduce_98(val, _values, result)
         result = val[0]
@@ -2030,5 +2065,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 591)
+module_eval(<<'.,.,', 'parser.y', 643)
   def _reduce_99(val, _values, result)
         result = val[0]
@@ -2038,5 +2073,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 595)
+module_eval(<<'.,.,', 'parser.y', 647)
   def _reduce_100(val, _values, result)
         result = val[0]
@@ -2046,13 +2081,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 600)
+module_eval(<<'.,.,', 'parser.y', 652)
   def _reduce_101(val, _values, result)
-        result = {:untyped_multiple_attr_object_block => val[0]}
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 604)
+        @@logger.debug("#{__FILE__}:#{__LINE__}:multiple_attr_object_block::attr_val\n untyped_multiple_attr_object_block = #{val[0].to_yaml}")
+    result = {:untyped_multiple_attr_object_block => val[0]}
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 657)
   def _reduce_102(val, _values, result)
         result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]}
@@ -2062,13 +2098,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 609)
+module_eval(<<'.,.,', 'parser.y', 662)
   def _reduce_103(val, _values, result)
-        result = val[1]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 614)
+        @@logger.debug("#{__FILE__}:#{__LINE__}:untyped_multiple_attr_object_block::keyed_objects\n keyed_objects = #{val[1].to_yaml}")
+    result = val[1]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 668)
   def _reduce_104(val, _values, result)
         result = val[0]
@@ -2078,5 +2115,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 619)
+module_eval(<<'.,.,', 'parser.y', 673)
   def _reduce_105(val, _values, result)
         result = Array[val[0]]
@@ -2086,5 +2123,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 623)
+module_eval(<<'.,.,', 'parser.y', 677)
   def _reduce_106(val, _values, result)
         result = (val[0] << val[1])
@@ -2094,10 +2131,11 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 628)
+module_eval(<<'.,.,', 'parser.y', 682)
   def _reduce_107(val, _values, result)
         #@@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}")
     #result = {:object_key => val[0], :object_block => val[2]}
-    unless val[2][:type_identifier]
-      result = Hash[val[0] => val[2][:untyped_primitive_object_block]]
+    object_key,object_block = val[0],val[2]
+    unless object_block[:type_identifier]
+      result = Hash[val[0] => object_block[:untyped_primitive_object_block]]
     else
       raise OpenEhr::ADL::Exception::Parser::Error, "Missing type_identifier at #{@filename}:#{@lineno} "
@@ -2108,5 +2146,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 639)
+module_eval(<<'.,.,', 'parser.y', 694)
   def _reduce_108(val, _values, result)
         @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
@@ -2117,5 +2155,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 645)
+module_eval(<<'.,.,', 'parser.y', 700)
   def _reduce_109(val, _values, result)
         result = {:untyped_single_attr_object_block => val[0]}
@@ -2125,5 +2163,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 649)
+module_eval(<<'.,.,', 'parser.y', 704)
   def _reduce_110(val, _values, result)
         result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]}
@@ -2133,8 +2171,7 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 654)
+module_eval(<<'.,.,', 'parser.y', 709)
   def _reduce_111(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
-    #result = {:single_attr_object_complex_head => val[0]}
     result = []
   
@@ -2143,8 +2180,7 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 660)
+module_eval(<<'.,.,', 'parser.y', 714)
   def _reduce_112(val, _values, result)
-        @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
-    #result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]}
+        @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_single_attr_object_block::attr_vals = \n#{val[1].to_yaml} at #{@filename}:#{@lineno}")
     result = val[1]
   
@@ -2155,5 +2191,5 @@
 # reduce 113 omitted
 
-module_eval(<<'.,.,', 'parser.y', 667)
+module_eval(<<'.,.,', 'parser.y', 721)
   def _reduce_114(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2164,5 +2200,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 672)
+module_eval(<<'.,.,', 'parser.y', 726)
   def _reduce_115(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
@@ -2173,5 +2209,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 677)
+module_eval(<<'.,.,', 'parser.y', 731)
   def _reduce_116(val, _values, result)
         #@@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
@@ -2182,5 +2218,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 682)
+module_eval(<<'.,.,', 'parser.y', 736)
   def _reduce_117(val, _values, result)
         result = val[0]
@@ -2190,5 +2226,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 686)
+module_eval(<<'.,.,', 'parser.y', 740)
   def _reduce_118(val, _values, result)
         result = val[0]
@@ -2198,5 +2234,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 690)
+module_eval(<<'.,.,', 'parser.y', 744)
   def _reduce_119(val, _values, result)
         result = val[0]
@@ -2206,5 +2242,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 694)
+module_eval(<<'.,.,', 'parser.y', 748)
   def _reduce_120(val, _values, result)
         result = val[0]
@@ -2214,5 +2250,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 698)
+module_eval(<<'.,.,', 'parser.y', 752)
   def _reduce_121(val, _values, result)
         result = val[0]
@@ -2222,5 +2258,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 702)
+module_eval(<<'.,.,', 'parser.y', 756)
   def _reduce_122(val, _values, result)
         @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2231,5 +2267,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 707)
+module_eval(<<'.,.,', 'parser.y', 761)
   def _reduce_123(val, _values, result)
         @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2240,5 +2276,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 712)
+module_eval(<<'.,.,', 'parser.y', 766)
   def _reduce_124(val, _values, result)
         @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2249,5 +2285,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 717)
+module_eval(<<'.,.,', 'parser.y', 771)
   def _reduce_125(val, _values, result)
         @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2258,5 +2294,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 722)
+module_eval(<<'.,.,', 'parser.y', 776)
   def _reduce_126(val, _values, result)
         @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2267,5 +2303,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 727)
+module_eval(<<'.,.,', 'parser.y', 781)
   def _reduce_127(val, _values, result)
         @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2276,5 +2312,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 732)
+module_eval(<<'.,.,', 'parser.y', 786)
   def _reduce_128(val, _values, result)
         @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2285,5 +2321,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 737)
+module_eval(<<'.,.,', 'parser.y', 791)
   def _reduce_129(val, _values, result)
         @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2294,5 +2330,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 742)
+module_eval(<<'.,.,', 'parser.y', 796)
   def _reduce_130(val, _values, result)
         @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2303,5 +2339,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 747)
+module_eval(<<'.,.,', 'parser.y', 801)
   def _reduce_131(val, _values, result)
         @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2312,5 +2348,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 753)
+module_eval(<<'.,.,', 'parser.y', 807)
   def _reduce_132(val, _values, result)
         @@logger.debug("string_list_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2321,5 +2357,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 758)
+module_eval(<<'.,.,', 'parser.y', 812)
   def _reduce_133(val, _values, result)
         result = val[0]
@@ -2329,5 +2365,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 762)
+module_eval(<<'.,.,', 'parser.y', 816)
   def _reduce_134(val, _values, result)
         result = val[0]
@@ -2337,5 +2373,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 766)
+module_eval(<<'.,.,', 'parser.y', 820)
   def _reduce_135(val, _values, result)
         result = val[0]
@@ -2345,5 +2381,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 770)
+module_eval(<<'.,.,', 'parser.y', 824)
   def _reduce_136(val, _values, result)
         result = val[0]
@@ -2353,5 +2389,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 774)
+module_eval(<<'.,.,', 'parser.y', 828)
   def _reduce_137(val, _values, result)
         result = val[0]
@@ -2361,5 +2397,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 778)
+module_eval(<<'.,.,', 'parser.y', 832)
   def _reduce_138(val, _values, result)
         result = val[0]
@@ -2369,5 +2405,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 782)
+module_eval(<<'.,.,', 'parser.y', 836)
   def _reduce_139(val, _values, result)
         result = val[0]
@@ -2377,5 +2413,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 786)
+module_eval(<<'.,.,', 'parser.y', 840)
   def _reduce_140(val, _values, result)
         result = val[0]
@@ -2397,5 +2433,5 @@
 # reduce 146 omitted
 
-module_eval(<<'.,.,', 'parser.y', 798)
+module_eval(<<'.,.,', 'parser.y', 852)
   def _reduce_147(val, _values, result)
         @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2406,5 +2442,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 803)
+module_eval(<<'.,.,', 'parser.y', 857)
   def _reduce_148(val, _values, result)
         @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2415,5 +2451,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 809)
+module_eval(<<'.,.,', 'parser.y', 863)
   def _reduce_149(val, _values, result)
         @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2424,5 +2460,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 815)
+module_eval(<<'.,.,', 'parser.y', 869)
   def _reduce_150(val, _values, result)
         result = [val[0],val[2]]
@@ -2432,5 +2468,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 819)
+module_eval(<<'.,.,', 'parser.y', 873)
   def _reduce_151(val, _values, result)
         result = val[0] << val[2]
@@ -2440,5 +2476,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 823)
+module_eval(<<'.,.,', 'parser.y', 877)
   def _reduce_152(val, _values, result)
         result = val[0]
@@ -2448,5 +2484,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 828)
+module_eval(<<'.,.,', 'parser.y', 882)
   def _reduce_153(val, _values, result)
         begin
@@ -2461,5 +2497,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 837)
+module_eval(<<'.,.,', 'parser.y', 891)
   def _reduce_154(val, _values, result)
         begin
@@ -2474,5 +2510,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 846)
+module_eval(<<'.,.,', 'parser.y', 900)
   def _reduce_155(val, _values, result)
         begin
@@ -2511,5 +2547,5 @@
 # reduce 167 omitted
 
-module_eval(<<'.,.,', 'parser.y', 870)
+module_eval(<<'.,.,', 'parser.y', 924)
   def _reduce_168(val, _values, result)
         begin
@@ -2524,5 +2560,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 879)
+module_eval(<<'.,.,', 'parser.y', 933)
   def _reduce_169(val, _values, result)
         begin
@@ -2537,5 +2573,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 888)
+module_eval(<<'.,.,', 'parser.y', 942)
   def _reduce_170(val, _values, result)
         begin
@@ -2574,5 +2610,5 @@
 # reduce 182 omitted
 
-module_eval(<<'.,.,', 'parser.y', 913)
+module_eval(<<'.,.,', 'parser.y', 967)
   def _reduce_183(val, _values, result)
         result = true
@@ -2582,5 +2618,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 917)
+module_eval(<<'.,.,', 'parser.y', 971)
   def _reduce_184(val, _values, result)
         result = false
@@ -2604,5 +2640,5 @@
 # reduce 191 omitted
 
-module_eval(<<'.,.,', 'parser.y', 932)
+module_eval(<<'.,.,', 'parser.y', 986)
   def _reduce_192(val, _values, result)
         result = val[0]
@@ -2662,5 +2698,5 @@
 # reduce 217 omitted
 
-module_eval(<<'.,.,', 'parser.y', 967)
+module_eval(<<'.,.,', 'parser.y', 1021)
   def _reduce_218(val, _values, result)
         @@logger.debug("V_ISO8601_EXTENDED_DATE_TIME: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2695,5 +2731,5 @@
 # reduce 230 omitted
 
-module_eval(<<'.,.,', 'parser.y', 987)
+module_eval(<<'.,.,', 'parser.y', 1041)
   def _reduce_231(val, _values, result)
         @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2728,5 +2764,5 @@
 # reduce 243 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1007)
+module_eval(<<'.,.,', 'parser.y', 1061)
   def _reduce_244(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2743,5 +2779,5 @@
 # reduce 247 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1017)
+module_eval(<<'.,.,', 'parser.y', 1071)
   def _reduce_248(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2768,5 +2804,5 @@
 # reduce 256 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1040)
+module_eval(<<'.,.,', 'parser.y', 1094)
   def _reduce_257(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, boolean_node:  relative_path = #{val[0]}, regexp_body => #{val[3]} at #{@filename}") 
@@ -2833,5 +2869,5 @@
 # reduce 285 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1087)
+module_eval(<<'.,.,', 'parser.y', 1141)
   def _reduce_286(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, relative_path = #{val[0]}") 
@@ -2842,5 +2878,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1092)
+module_eval(<<'.,.,', 'parser.y', 1146)
   def _reduce_287(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, relative_path = #{val[0]}/#{val[2]}") 
@@ -2851,5 +2887,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1098)
+module_eval(<<'.,.,', 'parser.y', 1152)
   def _reduce_288(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -2860,5 +2896,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1103)
+module_eval(<<'.,.,', 'parser.y', 1157)
   def _reduce_289(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -2869,5 +2905,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1115)
+module_eval(<<'.,.,', 'parser.y', 1169)
   def _reduce_290(val, _values, result)
         result = Range.new(1,1)
@@ -2877,5 +2913,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1119)
+module_eval(<<'.,.,', 'parser.y', 1173)
   def _reduce_291(val, _values, result)
         result = val[3]
@@ -2885,5 +2921,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1124)
+module_eval(<<'.,.,', 'parser.y', 1178)
   def _reduce_292(val, _values, result)
         begin
@@ -2898,5 +2934,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1133)
+module_eval(<<'.,.,', 'parser.y', 1187)
   def _reduce_293(val, _values, result)
         begin
@@ -2912,5 +2948,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1144)
+module_eval(<<'.,.,', 'parser.y', 1198)
   def _reduce_294(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY.new
@@ -2920,5 +2956,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1149)
+module_eval(<<'.,.,', 'parser.y', 1203)
   def _reduce_295(val, _values, result)
         result = val[0]
@@ -2942,5 +2978,5 @@
 # reduce 302 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1161)
+module_eval(<<'.,.,', 'parser.y', 1215)
   def _reduce_303(val, _values, result)
         result = val[0]
@@ -2950,5 +2986,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1165)
+module_eval(<<'.,.,', 'parser.y', 1219)
   def _reduce_304(val, _values, result)
         result = val[0]
@@ -2960,5 +2996,5 @@
 # reduce 305 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1172)
+module_eval(<<'.,.,', 'parser.y', 1226)
   def _reduce_306(val, _values, result)
         case val[3]
@@ -2975,5 +3011,5 @@
 # reduce 307 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1183)
+module_eval(<<'.,.,', 'parser.y', 1237)
   def _reduce_308(val, _values, result)
         result = val[0]
@@ -2983,5 +3019,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1187)
+module_eval(<<'.,.,', 'parser.y', 1241)
   def _reduce_309(val, _values, result)
         result = OpenEhr::RM::Support::AssumedTypes::Interval.new(val[0], val[2])
@@ -3077,5 +3113,5 @@
 # reduce 352 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1253)
+module_eval(<<'.,.,', 'parser.y', 1307)
   def _reduce_353(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true)
@@ -3085,5 +3121,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1257)
+module_eval(<<'.,.,', 'parser.y', 1311)
   def _reduce_354(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false)
@@ -3093,5 +3129,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1261)
+module_eval(<<'.,.,', 'parser.y', 1315)
   def _reduce_355(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
@@ -3101,5 +3137,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1265)
+module_eval(<<'.,.,', 'parser.y', 1319)
   def _reduce_356(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
@@ -3109,5 +3145,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1270)
+module_eval(<<'.,.,', 'parser.y', 1324)
   def _reduce_357(val, _values, result)
         result = val[0]
@@ -3117,5 +3153,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1274)
+module_eval(<<'.,.,', 'parser.y', 1328)
   def _reduce_358(val, _values, result)
         result = val[0]
@@ -3126,5 +3162,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1279)
+module_eval(<<'.,.,', 'parser.y', 1333)
   def _reduce_359(val, _values, result)
         raise 'Not implemented yet'
@@ -3144,5 +3180,5 @@
 # reduce 364 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1291)
+module_eval(<<'.,.,', 'parser.y', 1345)
   def _reduce_365(val, _values, result)
         @in_interval = false
@@ -3153,5 +3189,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1298)
+module_eval(<<'.,.,', 'parser.y', 1352)
   def _reduce_366(val, _values, result)
           result = val[0]
@@ -3161,5 +3197,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1302)
+module_eval(<<'.,.,', 'parser.y', 1356)
   def _reduce_367(val, _values, result)
           result = val[0]
@@ -3169,5 +3205,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1308)
+module_eval(<<'.,.,', 'parser.y', 1362)
   def _reduce_368(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
@@ -3186,5 +3222,5 @@
 # reduce 371 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1324)
+module_eval(<<'.,.,', 'parser.y', 1378)
   def _reduce_372(val, _values, result)
           result = val[0]
@@ -3194,5 +3230,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1329)
+module_eval(<<'.,.,', 'parser.y', 1383)
   def _reduce_373(val, _values, result)
           result = val[0]
@@ -3202,5 +3238,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1333)
+module_eval(<<'.,.,', 'parser.y', 1387)
   def _reduce_374(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
@@ -3211,5 +3247,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1344)
+module_eval(<<'.,.,', 'parser.y', 1398)
   def _reduce_375(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new #val[0]
Index: /ruby/trunk/lib/adl_parser/lib/parser.y
===================================================================
--- /ruby/trunk/lib/adl_parser/lib/parser.y	(revision 327)
+++ /ruby/trunk/lib/adl_parser/lib/parser.y	(revision 328)
@@ -127,8 +127,15 @@
     | SYM_LANGUAGE dadl_section
   {
-    if val[1][0][:attr_id] == "original_language"
-      result = {:arch_language => val[1][0][:object_block][:untyped_primitive_object_block]}
+    dadl_section = val[1]
+    @@logger.debug("#{__FILE__}:#{__LINE__}: arch_language::dadl_section = \n#{dadl_section.to_yaml}")
+    case dadl_section[:attr_id]
+    when "translations"
+      result = {:arch_language => dadl_section[:object_block][:untyped_primitive_object_block]}
+    when "original_language"
+      result = {:arch_language => dadl_section[:object_block][:untyped_primitive_object_block]}
+###     if val[1][:attr_id] == "original_language"
+###       result = {:arch_language => val[0][:object_block][:untyped_primitive_object_block]}
     else
-      raise OpenEhr::ADL::Exception::Parser::Error, "It should be 'original_language' at #{@filename}:#{@lineno} "
+      raise OpenEhr::ADL::Exception::Parser::Error, "It should be 'original_language, but was #{dadl_section[:attr_id]}' at #{@filename}:#{@lineno} "
     end
   }
@@ -144,38 +151,39 @@
     args = Hash.new
     val[1].each do |item|
-      @@logger.debug("#{__FILE__}:#{__LINE__}: arch_description: item[:object_block] = #{item[:object_block].to_yaml} at #{@filename}:#{@lineno}")
-      case item[:attr_id]
+      @@logger.debug("#{__FILE__}:#{__LINE__}: arch_description: item = #{item.to_yaml} at #{@filename}:#{@lineno}")
+      case item
       when "original_author"
         unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:original_author => item[:object_block][:untyped_multiple_attr_object_block]])
+          args.merge!(Hash[:original_author => item[:untyped_multiple_attr_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "details"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:details => item[:object_block][:untyped_multiple_attr_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:details => item[:untyped_multiple_attr_object_block]])
+          #args.merge!(Hash[:details => item[:object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "lifecycle_state"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:lifecycle_state => item[:object_block][:untyped_primitive_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:lifecycle_state => item[:untyped_primitive_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "other_contributors"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:other_contributors => item[:object_block][:untyped_multiple_attr_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:other_contributors => item[:untyped_multiple_attr_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       when "other_details"
-        unless item[:object_block][:type_identifier]
-          args.merge!(Hash[:other_contributors => item[:object_block][:untyped_multiple_attr_object_block]])
+        unless item[:type_identifier]
+          args.merge!(Hash[:other_contributors => item[:untyped_multiple_attr_object_block]])
         else
           raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
         end
       else
-        raise OpenEhr::ADL::Exception::Parser::Error, "Unknown case #{item[:attr_id]} at #{@filename}:#{@lineno} "
+        raise OpenEhr::ADL::Exception::Parser::Error, "Unknown case #{item} at #{@filename}:#{@lineno} "
       end
     end
@@ -534,5 +542,36 @@
   { 
     dadl_section = val[1]
-    result = OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
+    @@logger.debug("#{__FILE__}:#{__LINE__}: arch_ontology: dadl_section = #{val[1].to_yaml}") 
+    args = Hash.new
+    dadl_section.each do |item|
+      @@logger.debug("#{__FILE__}:#{__LINE__}: arch_description: item[:object_block] = #{item[:object_block].to_yaml} at #{@filename}:#{@lineno}")
+      case item[:attr_id]
+      when "terminologies_available"
+        unless item[:object_block][:type_identifier]
+          args.merge!(Hash[:terminologies_available => item[:object_block][:untyped_primitive_object_block]])
+          #args.merge!(Hash[:terminologies_available => item[:object_block]])
+        else
+          raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
+        end
+      when "term_definitions"
+        unless item[:object_block][:type_identifier]
+          args.merge!(Hash[:term_definitions => item[:object_block][:untyped_multiple_attr_object_block]])
+          #args.merge!(Hash[:term_definitions => item[:object_block]])
+        else
+          raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
+        end
+      when "term_binding"
+        unless item[:object_block][:type_identifier]
+          args.merge!(Hash[:term_binding => item[:object_block][:untyped_multiple_attr_object_block]])
+          #args.merge!(Hash[:term_binding => item[:object_block]])
+        else
+          raise OpenEhr::ADL::Exception::Parser::Error, "Needless type_identifier at #{@filename}:#{@lineno} "
+        end
+      else
+        raise OpenEhr::ADL::Exception::Parser::Error, "Unknown case #{item[:attr_id]} at #{@filename}:#{@lineno} "
+      end
+    end
+
+    result = OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new(args)
   }
   | SYM_ONTOLOGY error
@@ -543,10 +582,10 @@
     |  attr_vals
   {
-    #@@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section attr_vals = \n#{val[0].to_yaml}")
+    @@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section::attr_vals = \n#{val[0].to_yaml}")
     result = val[0]
   }
   | complex_object_block
   {
-    #@@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section complex_object_block = \n#{val[0].to_yaml}")
+    #@@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section::complex_object_block = \n#{val[0].to_yaml}")
     result = val[0]
   }
@@ -555,18 +594,31 @@
 attr_vals: attr_val
   {
-    result = Array[val[0]]
+    attr_val = val[0]
+    result = Hash[attr_val[:attr_id] => attr_val[:object_block]]
   }
   | attr_vals attr_val
   {
-    result = (val[0] << val[1])
+    result = val[0].merge!(val[1])
   }
   | attr_vals Semicolon_code attr_val
   {
-    result = (val[0] << val[2])
-  }
+    result = val[0].merge!(val[2])
+  }
+### attr_vals: attr_val
+###   {
+###     result = Array[val[0]]
+###   }
+###   | attr_vals attr_val
+###   {
+###     result = (val[0] << val[1])
+###   }
+###   | attr_vals Semicolon_code attr_val
+###   {
+###     result = (val[0] << val[2])
+###   }
 
 attr_val: attr_id SYM_EQ object_block
   {
-    @@logger.debug("#{__FILE__}:#{__LINE__}:attr_val\n attr_id = #{val[0]}, object_block = #{val[1]}")
+    @@logger.debug("#{__FILE__}:#{__LINE__}:attr_val\n attr_id = #{val[0].to_yaml},\n object_block = #{val[2].to_yaml}")
     result = {:attr_id => val[0], :object_block => val[2]}
   }
@@ -599,4 +651,5 @@
 multiple_attr_object_block: untyped_multiple_attr_object_block
   { 
+    @@logger.debug("#{__FILE__}:#{__LINE__}:multiple_attr_object_block::attr_val\n untyped_multiple_attr_object_block = #{val[0].to_yaml}")
     result = {:untyped_multiple_attr_object_block => val[0]}
   }
@@ -608,4 +661,5 @@
 untyped_multiple_attr_object_block: multiple_attr_object_block_head keyed_objects SYM_END_DBLOCK
   { 
+    @@logger.debug("#{__FILE__}:#{__LINE__}:untyped_multiple_attr_object_block::keyed_objects\n keyed_objects = #{val[1].to_yaml}")
     result = val[1]
   }
@@ -629,6 +683,7 @@
     #@@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}")
     #result = {:object_key => val[0], :object_block => val[2]}
-    unless val[2][:type_identifier]
-      result = Hash[val[0] => val[2][:untyped_primitive_object_block]]
+    object_key,object_block = val[0],val[2]
+    unless object_block[:type_identifier]
+      result = Hash[val[0] => object_block[:untyped_primitive_object_block]]
     else
       raise OpenEhr::ADL::Exception::Parser::Error, "Missing type_identifier at #{@filename}:#{@lineno} "
@@ -654,14 +709,13 @@
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
-    #result = {:single_attr_object_complex_head => val[0]}
     result = []
   }
   | single_attr_object_complex_head attr_vals SYM_END_DBLOCK
   {
-    @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
-    #result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]}
+    @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_single_attr_object_block::attr_vals = \n#{val[1].to_yaml} at #{@filename}:#{@lineno}")
     result = val[1]
   }
 single_attr_object_complex_head: SYM_START_DBLOCK
+
 primitive_object_block: untyped_primitive_object_block
   {
@@ -1356,9 +1410,4 @@
 require 'rubygems'
 require 'open_ehr'
-#require 'adl_parser.rb'
-#require 'am.rb'
-#require 'rm.rb'
-#require 'rm/support/assumed_types.rb'
-#require 'assumed_library_types.rb'
 $DEBUG = true
 
@@ -1401,5 +1450,5 @@
 
 
-def parse(data, filename, lineno = 1, debug = false)
+def parse(data, filename = "", lineno = 1, debug = false)
   @yydebug = true
   @parsestring = data
Index: /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl
===================================================================
--- /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl	(revision 328)
+++ /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl	(revision 328)
@@ -0,0 +1,673 @@
+archetype (adl_version=1.4)
+	openEHR-EHR-OBSERVATION.blood_pressure.v1
+
+concept
+	[at0000]	-- Blood pressure
+language
+	original_language = <[ISO_639-1::en]>
+	translations = <
+		["de"] = <
+			language = <[ISO_639-1::de]>
+			author = <
+				["name"] = <"Sebastian Garde, Jasmin Buck">
+	        	["organisation"] = <"Central Queensland University, University of Heidelberg">
+			>
+		>
+	>
+description
+	original_author = <
+		["name"] = <"Sam Heard">
+		["organisation"] = <"Ocean Informatics">
+		["date"] = <"22/03/2006">
+		["email"] = <"sam.heard@oceaninformatics.biz">
+	>
+	details = <
+		["de"] = <
+			language = <[ISO_639-1::de]>
+			purpose = <"Dient der Dokumentation des systemischen Blutdrucks einer Person. Die Messung zeichnet den systolischen und diastolischen Blutdruck auf geeignete Art und Weise auf, sodass das Resultat der Messung als charakteristisch für den tatsächlichen systemischen Blutdruck angesehen werden kann.">
+			use = <"Alle Blutdruckmessungen werden unter Zuhilfenahme dieses Archetypen dokumentiert. Der Archetyp beinhaltet ein umfassendes Status-Modell z.B. bei Durchführung von Belastungs-EKGs und Kipptischuntersuchungen.">
+			misuse = <"Nicht zu Benutzen zur Dokumentation des intravaskulären Drucks.">
+		>
+		["en"] = <
+			language = <[ISO_639-1::en]>
+			purpose = <"To record the systemic blood pressure of a person. The measurement records the systolic and the diastolic pressure by some means suitable for the result to be seen as a surrogate for the general and systemic blood pressure.">
+			use = <"All blood pressure measurements are recorded using this archetype. There is a rich state model for use with exercise ECGs and Tilt Table measurements.">
+			keywords = <"observations", "blood pressure", "measurement">
+			misuse = <"Not to be used for intravascular pressure.">
+		>
+	>
+	lifecycle_state = <"AuthorDraft">
+	other_contributors = <>
+
+definition
+	OBSERVATION[at0000] matches {	-- Blood pressure
+		data matches {
+			HISTORY[at0001] matches {	-- history
+				events cardinality matches {1..*; unordered} matches {
+					EVENT[at0006] occurrences matches {0..*} matches {	-- any event
+						data matches {
+							ITEM_LIST[at0003] matches {	-- blood pressure
+								items cardinality matches {0..*; ordered} matches {
+									ELEMENT[at0004] occurrences matches {0..1} matches {	-- systolic
+										value matches {
+											C_DV_QUANTITY <
+												property = <[openehr::125]>
+												list = <
+													["1"] = <
+														units = <"mm[Hg]">
+														magnitude = <|0.0..<1000.0|>
+														precision = <|0|>
+													>
+												>
+											>
+										}
+									}
+									ELEMENT[at0005] occurrences matches {0..1} matches {	-- diastolic
+										value matches {
+											C_DV_QUANTITY <
+												property = <[openehr::125]>
+												list = <
+													["1"] = <
+														units = <"mm[Hg]">
+														magnitude = <|0.0..<1000.0|>
+														precision = <|0|>
+													>
+												>
+											>
+										}
+									}
+									ELEMENT[at1006] occurrences matches {0..1} matches {	-- mean arterial pressure
+										value matches {
+											C_DV_QUANTITY <
+												property = <[openehr::125]>
+												list = <
+													["1"] = <
+														units = <"mm[Hg]">
+														magnitude = <|0.0..750.0|>
+														precision = <|1|>
+													>
+												>
+											>
+										}
+									}
+									ELEMENT[at1007] occurrences matches {0..1} matches {	-- pulse pressure
+										value matches {
+											C_DV_QUANTITY <
+												property = <[openehr::125]>
+												list = <
+													["1"] = <
+														units = <"mm[Hg]">
+														magnitude = <|0.0..750.0|>
+														precision = <|0|>
+													>
+												>
+											>
+										}
+									}
+									ELEMENT[at0033] occurrences matches {0..1} matches {	-- Comment
+										value matches {
+											DV_TEXT matches {*}
+										}
+									}
+								}
+							}
+						}
+						state matches {
+							ITEM_LIST[at0007] matches {	-- state structure
+								items cardinality matches {0..*; ordered} matches {
+									ELEMENT[at0008] occurrences matches {0..1} matches {	-- Position
+										value matches {
+											DV_CODED_TEXT matches {
+												defining_code matches {
+													[local::
+													at1000, 	-- Standing
+													at1001, 	-- Sitting
+													at1002, 	-- Reclining
+													at1003; 	-- Lying
+													at1001]	-- assumed value
+												}
+											}
+										}
+									}
+									ELEMENT[at0009] occurrences matches {0..1} matches {	-- Exertion level
+										value matches {
+											C_DV_QUANTITY <
+												property = <[openehr::130]>
+												list = <
+													["1"] = <
+														units = <"J/min">
+														magnitude = <|0.0..1000.0|>
+													>
+												>
+												assumed_value = <
+													magnitude = <0.0>
+													units = <"J/min">
+													precision = <-1>
+												>
+											>
+										}
+									}
+									ELEMENT[at0010] occurrences matches {0..1} matches {	-- Exercise
+										value matches {
+											DV_CODED_TEXT matches {
+												defining_code matches {
+													[local::
+													at0022, 	-- At rest
+													at0023, 	-- Post-exercise
+													at0024; 	-- During exercise
+													at0022]	-- assumed value
+												}
+											}
+										}
+									}
+									ELEMENT[at1005] occurrences matches {0..1} matches {	-- Tilt
+										value matches {
+											C_DV_QUANTITY <
+												property = <[openehr::497]>
+												list = <
+													["1"] = <
+														units = <"°">
+														magnitude = <|-90.0..90.0|>
+														precision = <|0|>
+													>
+												>
+												assumed_value = <
+													magnitude = <0.0>
+													units = <"°">
+													precision = <0>
+												>
+											>
+										}
+									}
+								}
+							}
+						}
+					}
+					POINT_EVENT[at0002] occurrences matches {0..1} matches {	-- baseline reading
+						offset matches {
+							DV_DURATION matches {
+								value matches {|PT0S|}
+							}
+						}
+						data matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/data[at0003]
+						}
+						state matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/state[at0007]
+						}
+					}
+					POINT_EVENT[at0029] occurrences matches {0..1} matches {	-- 5 minute reading
+						offset matches {
+							DV_DURATION matches {
+								value matches {|PT5M|}
+							}
+						}
+						data matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/data[at0003]
+						}
+						state matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/state[at0007]
+						}
+					}
+					POINT_EVENT[at0030] occurrences matches {0..1} matches {	-- 10 minute reading
+						offset matches {
+							DV_DURATION matches {
+								value matches {|PT10M|}
+							}
+						}
+						data matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/data[at0003]
+						}
+						state matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/state[at0007]
+						}
+					}
+					INTERVAL_EVENT[at0031] occurrences matches {0..*} matches {	-- Postural change
+						math_function matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {[openehr::147]}
+							}
+						}
+						data matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/data[at0003]
+						}
+						state matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/state[at0007]
+						}
+					}
+					INTERVAL_EVENT[at1004] occurrences matches {0..*} matches {	-- Paradox
+						math_function matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {[openehr::149]}
+							}
+						}
+						data matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/data[at0003]
+						}
+						state matches {
+							use_node ITEM_LIST /data[at0001]/events[at0006]/state[at0007]
+						}
+					}
+				}
+			}
+		}
+		protocol matches {
+			ITEM_LIST[at0011] matches {	-- list structure
+				items cardinality matches {0..*; ordered} matches {
+					ELEMENT[at0013] occurrences matches {0..1} matches {	-- Cuff size
+						value matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {
+									[local::
+									at0015, 	-- Adult
+									at0016, 	-- Wide adult
+									at0017, 	-- Paediatric
+									at1008, 	-- Thigh
+									at1009]	-- Neonatal
+								}
+							}
+						}
+					}
+					ELEMENT[at0012] occurrences matches {0..1} matches {	-- Instrument
+						value matches {
+							DV_TEXT matches {*}
+						}
+					}
+					ELEMENT[at0014] occurrences matches {0..1} matches {	-- Location of measurement
+						value matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {
+									[local::
+									at0025, 	-- Right arm
+									at0026, 	-- Left arm
+									at0027, 	-- Right leg
+									at0028, 	-- Left leg
+									at0032]	-- Intra-arterial
+								}
+							}
+						}
+					}
+					ELEMENT[at1010] occurrences matches {0..1} matches {	-- Korotkoff sounds
+						value matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {
+									[local::
+									at1011, 	-- Fourth sound
+									at1012]	-- Fifth sound
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+ontology
+	terminologies_available = <"SNOMED-CT", ...>
+	term_definitions = <
+		["de"] = <
+			items = <
+				["at0000"] = <
+					description = <"Die Messung des systemischen arteriellen Blutdrucks, die als geeignet angesehen wird, den tatsächlichen systemischen Blutdruck zu repräsentieren.">
+					text = <"Blutdruckmessung">
+				>
+				["at0001"] = <
+					description = <"Historie">
+					text = <"Historie">
+				>
+				["at0002"] = <
+					description = <"Basismessung">
+					text = <"Basismessung">
+				>
+				["at0003"] = <
+					description = <"*@ internal @(en)">
+					text = <"Blutdruck">
+				>
+				["at0004"] = <
+					description = <"Der höchste arterielle Blutdruck eines Zyklus - gemessen in der systolischen oder Kontraktionsphase des Herzens.">
+					text = <"systolisch">
+				>
+				["at0005"] = <
+					description = <"Der minimale systemische arterielle Blutdruck eines Zyklus - gemessen in der diastolischen oder Entspannungsphase des Herzens.">
+					text = <"diastolisch">
+				>
+				["at0006"] = <
+					description = <"anderes unbestimmtes Ereignis">
+					text = <"unbestimmtes Ereignis">
+				>
+				["at0007"] = <
+					description = <"*@ internal @(en)">
+					text = <"*state structure(en)">
+				>
+				["at0008"] = <
+					description = <"Die Position des Patienten zum Zeitpunkt der Blutdruckmessung">
+					text = <"Position">
+				>
+				["at0009"] = <
+					description = <"Das Anstrengungsniveau zum Zeitpunkt der Messung">
+					text = <"Anstrengungsniveau">
+				>
+				["at0010"] = <
+					description = <"Die Beschreibung, ob und wann eine Leibesübung durchgeführt wurde bzw. eine körperliche Belastung bestand.">
+					text = <"körperliche Belastung">
+				>
+				["at0011"] = <
+					description = <"Listenstruktur">
+					text = <"Listenstruktur">
+				>
+				["at0012"] = <
+					description = <"Das Instrument, das zur Blutdruckmessung benutzt wird">
+					text = <"Instrument">
+				>
+				["at0013"] = <
+					description = <"Die Größe der Manschette des benutzten Sphygmomanometers">
+					text = <"Manschettengröße">
+				>
+				["at0014"] = <
+					description = <"Ort der Blutdruckmessung">
+					text = <"Ort der Messung">
+				>
+				["at0015"] = <
+					description = <"Eine normale Manschette für Erwachsene">
+					text = <"Erwachsener">
+				>
+				["at0016"] = <
+					description = <"Eine Manschette für Erwachsene mit dickeren Armen">
+					text = <"Erwachsener (weit)">
+				>
+				["at0017"] = <
+					description = <"Eine Manschette geeignet für ein Kind mit dünnen Armen">
+					text = <"Pädiatrisch">
+				>
+				["at0022"] = <
+					description = <"Die Person ist in Ruhe und nicht in der Erholungsphase von einer Anstrengung">
+					text = <"In Ruhe">
+				>
+				["at0023"] = <
+					description = <"Die Messung wird unmittelbar nach einer Leibesübung/körperlicher Belastung durchgeführt">
+					text = <"Nach Leibesübung/körperlicher Belastung">
+				>
+				["at0024"] = <
+					description = <"Die Messung wird während einer Leibesübung/körperlicher Belastung durchgeführt">
+					text = <"Während Leibesübung/körperlicher Belastung">
+				>
+				["at0025"] = <
+					description = <"Der rechte Arm der Person">
+					text = <"Rechter Arm">
+				>
+				["at0026"] = <
+					description = <"Der linke Arm der Person">
+					text = <"Linker Arm">
+				>
+				["at0027"] = <
+					description = <"Rechtes Bein des Patienten">
+					text = <"Rechtes Bein">
+				>
+				["at0028"] = <
+					description = <"Linkes Bein des Patienten">
+					text = <"Linkes Bein">
+				>
+				["at0029"] = <
+					description = <"Blutdruckmessung nach 5 Minuten Ruhepause">
+					text = <"5-Minuten-Messung">
+				>
+				["at0030"] = <
+					description = <"Blutdruckmessung nach 10 Minuten Ruhepause">
+					text = <"10-Minuten-Messung">
+				>
+				["at0031"] = <
+					description = <"Die Differenz zwischen stehendem und sitzendem/liegendem Blutdruck">
+					text = <"posturale Änderung">
+				>
+				["at0032"] = <
+					description = <"Blutdruckmessung durch intra-arterielle (invasive) Messung">
+					text = <"Intra-arteriell">
+				>
+				["at0033"] = <
+					description = <"Kommentar zur Blutdruckmessung">
+					text = <"Kommentar">
+				>
+				["at1000"] = <
+					description = <"Stehend zum Zeitpunkt der Blutdruckmessung">
+					text = <"Stehend">
+				>
+				["at1001"] = <
+					description = <"Sitzend zum Zeitpunkt der Blutdruckmessung">
+					text = <"Sitzend">
+				>
+				["at1002"] = <
+					description = <"Patient 45 Grad zurückgelehnt zum Zeitpunkt der Blutdruckmessung">
+					text = <"Zurückgelehnt">
+				>
+				["at1003"] = <
+					description = <"Patient flach liegend zum Zeitpunkt der Blutdruckmessung">
+					text = <"Liegend">
+				>
+				["at1004"] = <
+					description = <"Variation des Blutdrucks bei Atmung">
+					text = <"Paradox">
+				>
+				["at1005"] = <
+					description = <"Die Neigung der Oberfläche auf der der Patient liegt (Kipptischuntersuchungen)">
+					text = <"Neigung">
+				>
+				["at1006"] = <
+					description = <"Der mittlere arterielle Druck, abgekürzt MAD oder MAP (von englisch: mean arterial pressure), liegt zwischen dem systolischen und dem diastolischen Blutdruckwert. Er kann genau berechnet werden, indem die Fläche unter der arteriellen Druckkurve gemittelt wird. Kann auch nach folgender Formel berechnet werden: (2XSBD + DBD) dividiert durch 3.">
+					text = <"mittlerer arterieller Druck">
+				>
+				["at1007"] = <
+					description = <"Der Abstand zwischen dem systolischen und dem diastolischen Blutdruckwert. Beschreibt die Druckwelle, die mit jedem Herzschlag durch das Blutgefäßsystem läuft.">
+					text = <"Pulsdruck">
+				>
+				["at1008"] = <
+					description = <"Eine Manschette für den Oberschenkel eines Erwachsenen">
+					text = <"Oberschenkel">
+				>
+				["at1009"] = <
+					description = <"Eine Manschette benutzt für Neugeborene">
+					text = <"Neonatal">
+				>
+			    ["at1010"] = <
+					description = <"Korotkoff Geräusch, das zur Betimmung des diastolischen Blutdrucks benuzt wurde">
+					text = <"Korotkoff Geräusche">
+				>
+				["at1011"] = <
+					description = <"*">
+					text = <"Viertes Geräusch">
+				>
+				["at1012"] = <
+					description = <"*">
+					text = <"Fünftes Geräusch">
+				>
+			>
+		>
+		["en"] = <
+			items = <
+				["at0000"] = <
+					description = <"the measurement by any means (invasive or non-invasive) of systemic arterial blood pressure which is deemed to represent the actual systemic blood pressure">
+					text = <"Blood pressure">
+				>
+				["at0001"] = <
+					description = <"history Structural node">
+					text = <"history">
+				>
+				["at0002"] = <
+					description = <"baseline event in event history">
+					text = <"baseline reading">
+				>
+				["at0003"] = <
+					description = <"@ internal @">
+					text = <"blood pressure">
+				>
+				["at0004"] = <
+					description = <"the peak systemic arterial blood pressure over one cycle - measured in systolic or contraction phase of the heart cycle">
+					text = <"systolic">
+				>
+				["at0005"] = <
+					description = <"the minimum systemic arterial blood pressure over one cycle - measured in the diastolic or relaxation phase">
+					text = <"diastolic">
+				>
+				["at0006"] = <
+					description = <"other event in event history">
+					text = <"any event">
+				>
+				["at0007"] = <
+					description = <"@ internal @">
+					text = <"state structure">
+				>
+				["at0008"] = <
+					description = <"The position of the patient at the time of measuring blood pressure">
+					text = <"Position">
+				>
+				["at0009"] = <
+					description = <"The level of exertion at the time of taking the measurement">
+					text = <"Exertion level">
+				>
+				["at0010"] = <
+					description = <"The classification of the exercise level">
+					text = <"Exercise">
+				>
+				["at0011"] = <
+					description = <"list structure">
+					text = <"list structure">
+				>
+				["at0012"] = <
+					description = <"the instrument used to measure the blood pressure">
+					text = <"Instrument">
+				>
+				["at0013"] = <
+					description = <"the size of the cuff if a sphygmomanometer is used">
+					text = <"Cuff size">
+				>
+				["at0014"] = <
+					description = <"The site of the measurement of the blood pressure">
+					text = <"Location of measurement">
+				>
+				["at0015"] = <
+					description = <"A cuff that is standard for an adult">
+					text = <"Adult">
+				>
+				["at0016"] = <
+					description = <"A cuff for adults with larger arms">
+					text = <"Wide adult">
+				>
+				["at0017"] = <
+					description = <"A cuff that is appropriate for a child or thin arm">
+					text = <"Paediatric">
+				>
+				["at0022"] = <
+					description = <"The person is at rest and not in the recovery phase from exersion">
+					text = <"At rest">
+				>
+				["at0023"] = <
+					description = <"Measurement is taken immediately after exercise">
+					text = <"Post-exercise">
+				>
+				["at0024"] = <
+					description = <"The measurement is taken during exercise">
+					text = <"During exercise">
+				>
+				["at0025"] = <
+					description = <"The right arm of the person">
+					text = <"Right arm">
+				>
+				["at0026"] = <
+					description = <"The left arm of the person">
+					text = <"Left arm">
+				>
+				["at0027"] = <
+					description = <"The right leg of the patient">
+					text = <"Right leg">
+				>
+				["at0028"] = <
+					description = <"The left leg of the person">
+					text = <"Left leg">
+				>
+				["at0029"] = <
+					description = <"Blood pressure reading after 5 minutes rest">
+					text = <"5 minute reading">
+				>
+				["at0030"] = <
+					description = <"Blood pressure reading after 10 minutes rest">
+					text = <"10 minute reading">
+				>
+				["at0031"] = <
+					description = <"The difference between standing and sitting/lying blood pressure">
+					text = <"Postural change">
+				>
+				["at0032"] = <
+					description = <"Blood pressure monitored via an intra-arterial line">
+					text = <"Intra-arterial">
+				>
+				["at0033"] = <
+					description = <"Comment on blood pressure reading">
+					text = <"Comment">
+				>
+				["at1000"] = <
+					description = <"Standing at the time of blood pressure measurement">
+					text = <"Standing">
+				>
+				["at1001"] = <
+					description = <"Sitting on bed or chair at the time of blood pressure measurement">
+					text = <"Sitting">
+				>
+				["at1002"] = <
+					description = <"Person reclining at 45 degrees at the time of blood pressure measurement">
+					text = <"Reclining">
+				>
+				["at1003"] = <
+					description = <"Patient lying flat at the time of blood pressure measurement">
+					text = <"Lying">
+				>
+				["at1004"] = <
+					description = <"Variation in blood pressure with respiration">
+					text = <"Paradox">
+				>
+				["at1005"] = <
+					description = <"The tilt of the surface on which the person is lying">
+					text = <"Tilt">
+				>
+				["at1006"] = <
+					description = <"(MAP) The average arterial pressure that occurs over the entire course of the heart contraction and relaxation cycle - calculated by (2XSBP + DBP) divided by 3.">
+					text = <"mean arterial pressure">
+				>
+				["at1007"] = <
+					description = <"The variation in pressure over one contraction cycle">
+					text = <"pulse pressure">
+				>
+				["at1008"] = <
+					description = <"A cuff used for an adult thigh">
+					text = <"Thigh">
+				>
+				["at1009"] = <
+					description = <"A cuff used for a new born">
+					text = <"Neonatal">
+				>
+				["at1010"] = <
+					description = <"Record which Korotkoff sound is used for determining Diastolic pressure">
+					text = <"Korotkoff sounds">
+				>
+				["at1011"] = <
+					description = <"*">
+					text = <"Fourth sound">
+				>
+				["at1012"] = <
+					description = <"*">
+					text = <"Fifth sound">
+				>
+			>
+		>
+	>
+	term_binding = <
+		["SNOMED-CT"] = <
+			items = <
+				["at0000"] = <[SNOMED-CT(2003)::163020007]>
+				["at0003"] = <[SNOMED-CT(2003)::364090009]>
+				["at0004"] = <[SNOMED-CT(2003)::163030003]>
+				["at0005"] = <[SNOMED-CT(2003)::163031004]>
+				["at0012"] = <[SNOMED-CT(2003)::57134006]>
+				["at0013"] = <[SNOMED-CT(2003)::246153002]>
+			>
+		>
+	>
