Index: ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb	(revision 262)
+++ ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb	(revision 264)
@@ -53,5 +53,4 @@
           
           def initialize(args = {})
-            super(args)
             if args[:value].nil?
               self.rm_originator = args[:rm_originator]
@@ -62,5 +61,5 @@
               self.specialisation = args[:specialisation]
             else
-              self.value = args[:value]
+              super(args)
             end
           end
@@ -84,5 +83,9 @@
 
           def domain_concept
-            return @concept_name + '-' + @specialisation
+            if @specialisation.nil?
+              return @concept_name
+            else
+              return @concept_name + '-' + @specialisation
+            end
           end
 
@@ -131,4 +134,5 @@
             @specialisation = specialisation
           end
+
           def version_id=(version_id)
             raise ArgumentError, "version_id not valid" if version_id.nil? or version_id.empty?
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/support/identification/archetype_id_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/support/identification/archetype_id_spec.rb	(revision 262)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/support/identification/archetype_id_spec.rb	(revision 264)
@@ -42,3 +42,106 @@
     @archetype_id.version_id.should == 'v2'
   end
+
+  it 'should raise ArgumentError with wrong id format' do
+    lambda {
+      ArchetypeID.new(:value =>'wrong-format')
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with nil concept name' do
+    lambda {
+      @archetype_id.concept_name = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with wrong domain concept format' do
+    lambda {
+      @archetype_id.domain_concept = '0123'
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with empty rm_entity' do
+    lambda {
+      @archetype_id.rm_entity = ''
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with nil rm_entity' do
+    lambda {
+      @archetype_id.rm_entity = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with empty rm_originator' do
+    lambda {
+      @archetype_id.rm_originator = ''
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with nil rm_originator' do
+    lambda {
+      @archetype_id.rm_originator = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with empty specialisation' do
+    lambda {
+      @archetype_id.specialisation = ''
+    }.should raise_error ArgumentError
+  end
+
+  it 'should not raise ArgumentError with nil specialisation' do
+    lambda {
+      @archetype_id.specialisation = nil
+    }.should_not raise_error ArgumentError
+  end
+
+  describe 'another constructor' do
+    before(:each) do
+      @archetype_id = ArchetypeID.new(:rm_originator => 'openEHR',
+                                      :rm_name => 'EHR',
+                                      :rm_entity => 'EVALUATION',
+                                      :concept_name => 'clinical_synopsis',
+                                      :version_id => 'v1')
+    end
+
+    it 'should be an instance of ArchetypeID' do
+      @archetype_id.should be_an_instance_of ArchetypeID
+    end
+
+    it 'domain_concept should be clinical_synopsis' do
+      @archetype_id.domain_concept.should == 'clinical_synopsis'
+    end
+  end
+
+  describe 'domain concept' do
+    before(:each) do
+      @archetype_id.domain_concept = 'progress_note-naturopathy'
+    end
+
+    it 'concept_name should be progress note' do
+      @archetype_id.concept_name.should == 'progress_note'
+    end
+
+    it 'specialisation should be naturopathy' do
+      @archetype_id.specialisation === 'naturopathy'
+    end
+
+    it 'should raise ArgumentError empty domain concept' do
+      lambda {
+        @archetype_id.domain_concept = ''
+      }.should raise_error ArgumentError
+    end
+
+    it 'should raise ArgumentError nil domain concept' do
+      lambda {
+        @archetype_id.domain_concept = nil
+      }.should raise_error ArgumentError
+    end
+
+    it 's specialisation may be empty' do
+      @archetype_id.domain_concept = 'clinical_synopsis'
+      @archetype_id.concept_name.should == 'clinical_synopsis'
+    end
+  end
 end
