Index: /ruby/trunk/adl_parser/lib/parser.y
===================================================================
--- /ruby/trunk/adl_parser/lib/parser.y	(revision 23)
+++ /ruby/trunk/adl_parser/lib/parser.y	(revision 24)
@@ -48,17 +48,44 @@
 
 arch_identification: arch_head V_ARCHETYPE_ID
+  { 
+    result = {:arch_head => val[0], :archetype_id => val[1] }
+  }
   | SYM_ARCHETYPE error
+  { 
+    raise
+  }
 
 arch_head: SYM_ARCHETYPE
+  { 
+    result = {:arch_meta_data => nil }
+  }
   | SYM_ARCHETYPE arch_meta_data
+  { 
+    result = {:arch_meta_data => val[1] }
+  }
 
 arch_meta_data: Left_parenthesis_code arch_meta_data_items Right_parenthesis_code
+  { 
+    result = {:arch_meta_data_items => val[1] }
+  }
 
 arch_meta_data_items: arch_meta_data_item
+  { 
+    result = Array[val[0]]
+  }
   | arch_meta_data_items Semicolon_code arch_meta_data_item
-#  | arch_meta_data_items ';' arch_meta_data_item
+  { 
+    result = (val[0] << val[2])
+  }
+
 
 arch_meta_data_item: SYM_ADL_VERSION SYM_EQ V_VERSION_STRING
+  { 
+    result = {:adl_version => val[2] }
+  }
   | SYM_IS_CONTROLLED
+  { 
+    result = val[0]
+  }
 
 # Define specialization in which its constraints are narrower than those of the parent.
Index: /ruby/trunk/models/am/archetype/archetype.rb
===================================================================
--- /ruby/trunk/models/am/archetype/archetype.rb	(revision 23)
+++ /ruby/trunk/models/am/archetype/archetype.rb	(revision 24)
@@ -7,37 +7,37 @@
 #        include OpenEHR::RM::Support::Terminology::OpenEHR_Code_Set_Identifier
         include OpenEHR::RM::Support::Terminology
-        CURRENT_ADL_VERSION = "2.0"
+        CURRENT_ADL_VERSION = "1.4"
       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
 
-        attr_reader :adl_version, :id, :parent_id
-        attr_reader :concept, :definition, :ontology
-        attr_accessor :description,:original_language
+        attr_reader :id, :parent_id,:concept, :definition, :ontology
+        attr_accessor :adl_version,:description,:original_language
         attr_accessor :revision_history, :translation
 
         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 = 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]
+#          @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)
+          super
+        end
+
+        def self.create(args ={}, &block)
+          archetype = new(args)
+          if block_given?
+            yield archetype
+          end
+          return archetype
         end
 
Index: /ruby/trunk/models/rm/common/resource.rb
===================================================================
--- /ruby/trunk/models/rm/common/resource.rb	(revision 23)
+++ /ruby/trunk/models/rm/common/resource.rb	(revision 24)
@@ -4,40 +4,41 @@
     module Common
       module Resource
-        class Authored_Resource
-          attr_reader :is_controled
-          attr_reader :revision_history, :translations
+        class AUTHORED_RESOURCE
+          attr_reader :is_controled,:revision_history, :translations
           attr_accessor :description, :original_language
-          def initialize(original_language, translations,
-                         description, revision_history = nil)
-            if original_language == nil
-              raise Exception.new("original language nil")
+
+          def initialize(args = { })
+            @original_language = args[:original_language] if args[:original_language]
+            @translations = args[:translations] if args[:translations]
+            @revision_history = args[:revision_history] ? args[:revision_history] : nil
+
+            unless @revision_history
+              @is_controled = false
+            else
+              @is_controled = true
             end
-            if translations == nil
-              raise Exception.new("translation empty")
-            end
-            if revision_history == nil
-              is_controled = false
-            else
-              is_controled = true
-            end
-            @original_language = original_language
-            @translations = translations
-            @description = description
-            @revision_history = revision_history
+
+            @original_language = args[:original_language] if args[:original_language]
+            @translations = args[:translations] if args[:translations]
+            @description = args[:description] if args[:description]
           end
+
           def current_version
             @revision_history.most_recent_revision
           end
+
           def language_available
             languages = Set.new
-            if translations != nil
-              languages << translations.keys
+            if @translations != nil
+              languages << @translations.keys
             end
-            languages << original_language.code_string
+            languages << @original_language.code_string
           end
         end
-        class Translation_Details
+
+        class TRANSLATION_DETAILS
           attr_accessor :language, :author, :accreditation
           attr_accessor :other_details, :terminology_service
+
           def initialize(language, author, accreditation, other_details,
                          terminology_service)
Index: /ruby/trunk/models/tests/test_archetype_model.rb
===================================================================
--- /ruby/trunk/models/tests/test_archetype_model.rb	(revision 23)
+++ /ruby/trunk/models/tests/test_archetype_model.rb	(revision 24)
@@ -18,4 +18,12 @@
     assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM, @archetype_description_item
     assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
+  end
+
+  def test_create
+    archetype_instance = OpenEHR::AM::Archetype::ARCHETYPE.create() do |archetype|
+      archetype.adl_version = '1.4'
+    end
+
+    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, archetype_instance
   end
 end
Index: /ruby/trunk/models/tests/test_reference_model.rb
===================================================================
--- /ruby/trunk/models/tests/test_reference_model.rb	(revision 23)
+++ /ruby/trunk/models/tests/test_reference_model.rb	(revision 24)
@@ -5,6 +5,8 @@
 class ReferenceModelTest < Test::Unit::TestCase
   def setup
-    @authored_resource = OpenEHR::RM::Common::Resource::Authored_Resource.new("ja","en","test")
-    @translation_details = OpenEHR::RM::Common::Resource::Translation_Details.new(nil,nil,nil,nil,nil)
+    @authored_resource = OpenEHR::RM::Common::Resource::AUTHORED_RESOURCE.new(:original_language => "ja",
+                                                                              :translations => "en",
+                                                                              :description => "test")
+    @translation_details = OpenEHR::RM::Common::Resource::TRANSLATION_DETAILS.new(nil,nil,nil,nil,nil)
 #    @openehr_definitions = OpenEHR::RM::Support::Definition::OpenEHR_Definitions.new
     @dv_boolean = OpenEHR::RM::Data_Types::Basic::DV_Boolean.new("TRUE")
@@ -19,6 +21,6 @@
   
   def test_init
-    assert_instance_of OpenEHR::RM::Common::Resource::Authored_Resource, @authored_resource
-    assert_instance_of OpenEHR::RM::Common::Resource::Translation_Details, @translation_details
+    assert_instance_of OpenEHR::RM::Common::Resource::AUTHORED_RESOURCE, @authored_resource
+    assert_instance_of OpenEHR::RM::Common::Resource::TRANSLATION_DETAILS, @translation_details
     assert_instance_of OpenEHR::RM::Data_Types::Basic::DV_Boolean, @dv_boolean
     assert_instance_of OpenEHR::RM::Data_Types::Basic::DV_State, @dv_state
