Index: ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.assumed_types.v1.adl
===================================================================
--- ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.assumed_types.v1.adl	(revision 319)
+++ ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.assumed_types.v1.adl	(revision 319)
@@ -0,0 +1,88 @@
+archetype (adl_version=1.4)
+	adl-test-ENTRY.assumed_types.v1
+
+concept
+	[at0000]	-- test entry
+language
+	original_language = <[ISO_639-1::en]>
+description
+	original_author = <
+		["name"] = <"Thomas Beale">
+	>
+	details = <
+		["en"] = <
+			language = <[ISO_639-1::en]>
+			purpose = <"test assumed types">
+			keywords = <"ADL", "assumed types", "test">
+			copyright = <"copyright (c) 2004 The openEHR Foundation">
+		>
+	>
+	lifecycle_state = <"draft">
+
+definition
+	ENTRY[at0000] matches {	-- test entry
+		string_attr1 matches {"something", "something else"; "something else"}
+		string_attr2 matches {/this|that|something else/; "this"}
+		string_attr3 matches {/cardio.*/; "cardiology examination"}
+		boolean_attr1 matches {True}
+		boolean_attr2 matches {False}
+		boolean_attr3 matches {True, False; True}
+		integer_attr1 matches {|55|}
+		integer_attr2 matches {10, 20, 30; 10}
+		integer_attr3 matches {|0..100|; 10}
+		integer_attr4 matches {|>10|; 11}
+		integer_attr5 matches {|<10|; 9}
+		integer_attr6 matches {|>=10|; 10}
+		integer_attr7 matches {|<=10|; 5}
+		integer_attr8 matches {|-10..-5|; -8}
+		integer_attr9 matches {|10|}
+		real_attr1 matches {|100.0|}
+		real_attr2 matches {10.0, 20.0, 30.0; 20.0}
+		real_attr3 matches {|0.0..100.0|; 20.4}
+		real_attr4 matches {|>=10.0|; 20.0}
+		real_attr5 matches {|<=10.0|; 9.5}
+		real_attr6 matches {|>=10.0|; 20.3}
+		real_attr7 matches {|<=10.0|; 8.0}
+		real_attr8 matches {|-10.0..-5.0|; -9.8}
+		real_attr9 matches {|10.0|}
+		date_attr1 matches {yyyy-mm-dd; 1995-03-17}
+		date_attr2 matches {yyyy-??-??; 1995-03-17}
+		date_attr3 matches {yyyy-mm-??; 1995-03-17}
+		date_attr4 matches {yyyy-??-XX; 1995-03}
+		date_attr5 matches {|1983-12-25|}
+		date_attr6 matches {|2000-01-01|}
+		time_attr1 matches {hh:mm:ss; 12:01:30}
+		time_attr2 matches {hh:mm:XX; 12:01}
+		time_attr3 matches {hh:??:XX; 12:00}
+		time_attr4 matches {hh:??:??; 12:00}
+		time_attr5 matches {|22:00:05,0|}
+		time_attr6 matches {|00:00:59,0|}
+		time_attr7 matches {|00:00:59,0|}
+		date_time_attr1 matches {yyyy-mm-ddThh:mm:ss; 1995-03-17T12:01:30}
+		date_time_attr2 matches {yyyy-mm-ddThh:mm:??; 1995-03-17T12:01}
+		date_time_attr3 matches {yyyy-mm-ddThh:mm:XX; 1995-03-17T12:01}
+		date_time_attr4 matches {yyyy-mm-ddThh:??:XX; 1995-03-17T12:01}
+		date_time_attr5 matches {yyyy-??-??T??:??:??; 1995-03-17T12:01}
+		date_time_attr6 matches {|1983-12-25T22:00:05,0|}
+		date_time_attr7 matches {|2000-01-01T00:00:59,0|}
+		date_time_attr8 matches {|2000-01-01T00:00:59,0|}
+		duration_attr1 matches {|PT0S|}
+		duration_attr2 matches {|P1D|}
+		duration_attr3 matches {|PT2H5M|}
+		duration_attr4 matches {|PT1H55M|}
+		duration_attr5 matches {|<=PT1H|; PT30M}
+		duration_attr6 matches {|PT1H30M|}
+	}
+
+ontology
+	terminologies_available = <"adl_test", ...>
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0000"] = <
+					description = <"test entry">
+					text = <"test entry">
+				>
+			>
+		>
+	>
Index: ruby/trunk/lib/adl_parser/test/parser_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 318)
+++ ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 319)
@@ -10,250 +10,258 @@
   end
 
-  must "openEHR-EHR-CLUSTER.exam-uterus.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterus.v1.adl")
+#   must "openEHR-EHR-CLUSTER.exam-uterus.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterus.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterus.v11')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-SECTION.summary.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-SECTION.summary.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+
+#   must "openEHR-EHR-ACTION.referral.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.referral.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-ACTION.referral.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.auscultation-chest.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation-chest.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.auscultation.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+
+#   must "openEHR-EHR-CLUSTER.exam-abdomen.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-abdomen.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-chest.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-chest.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-generic.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-COMPOSITION.discharge.v1draft.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.discharge.v1draft')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+
+#   must "openEHR-EHR-INSTRUCTION.medication.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.medication.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-INSTRUCTION.referral.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.referral.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.Laboratory_request.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+
+#   must "openEHR-EHR-OBSERVATION.apgar.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.apgar.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.apgar.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-SECTION.findings.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.findings.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-SECTION.findings.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-SECTION.reason_for_encounter.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-SECTION.reason_for_encounter.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+
+#   must "openEHR-EHR-SECTION.vital_signs.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.vital_signs.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-SECTION.vital_signs.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+
+# # C_DV_QUANTITY parse error
+#   must "openEHR-EHR-EVALUATION.adverse.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-EVALUATION.adverse.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-EVALUATION.adverse.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions-circumference.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.dimensions.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-fetus.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-fetus.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-fetus.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-ACTION.imaging.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.imaging.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-ACTION.imaging.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-COMPOSITION.encounter.v1draft.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.follow_up.v1draft')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+#   must "openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.medication-formulation.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
+  must "adl-test-ENTRY.assumed_types.v1.adl be properly parsed" do
+    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.assumed_types.v1.adl")
     assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterus.v11')
+      ast = @parser.parse(file, 'adl-test-ENTRY.assumed_types.v1')
       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
     end
   end
 
-  must "openEHR-EHR-SECTION.summary.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-SECTION.summary.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-
-  must "openEHR-EHR-ACTION.referral.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.referral.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-ACTION.referral.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.auscultation-chest.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation-chest.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.auscultation.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-
-  must "openEHR-EHR-CLUSTER.exam-abdomen.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-abdomen.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-chest.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-chest.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-generic.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-COMPOSITION.discharge.v1draft.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.discharge.v1draft')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-
-  must "openEHR-EHR-INSTRUCTION.medication.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.medication.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-INSTRUCTION.referral.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.referral.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.Laboratory_request.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-
-  must "openEHR-EHR-OBSERVATION.apgar.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.apgar.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.apgar.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-SECTION.findings.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.findings.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-SECTION.findings.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-SECTION.reason_for_encounter.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-SECTION.reason_for_encounter.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-
-  must "openEHR-EHR-SECTION.vital_signs.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.vital_signs.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-SECTION.vital_signs.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-
-# C_DV_QUANTITY parse error
-  must "openEHR-EHR-EVALUATION.adverse.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-EVALUATION.adverse.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-EVALUATION.adverse.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions-circumference.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.dimensions.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-fetus.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-fetus.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-fetus.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-ACTION.imaging.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.imaging.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-ACTION.imaging.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-COMPOSITION.encounter.v1draft.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.follow_up.v1draft')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
-  must "openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.medication-formulation.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
-
 end
Index: ruby/trunk/lib/adl_parser/test/remote_adl_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/remote_adl_test.rb	(revision 318)
+++ ruby/trunk/lib/adl_parser/test/remote_adl_test.rb	(revision 319)
@@ -3,11 +3,22 @@
 class RemoteADLTest < Test::Unit::TestCase
   def setup
-    @adls = []
-    dirs = ["cluster/", "composition/", "element/", "entry/", "section/", "structure/"]
-    dirs.each do |dir|
+    @ehr_adls = []
+    ehr_dirs = ["cluster", "composition", "element", "entry", "section", "structure"]
+    ehr_dirs.each do |dir|
       doc = Hpricot( open("http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}").read )
       (doc/:a).each do |link|
         if link[:href] =~ /.*\.adl\Z/
-          @adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}#{$~}"
+          @ehr_adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}/#{$~}"
+        end
+      end
+    end
+
+    @test_adls = []
+    test_dirs = ["basics","clinical_types","dadl","description","generic_types","language","non-conforming","paths","rm_checking","slots","specialisation","structure","terminology","unicode","validation"]
+    test_dirs.each do |dir|
+      doc = Hpricot( open("http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/#{dir}").read )
+      (doc/:a).each do |link|
+        if link[:href] =~ /.*\.adl\Z/
+          @test_adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/#{dir}/#{$~}"
         end
       end
@@ -16,7 +27,8 @@
   end
 
-  must "adls should properly parsed" do
+
+  must "test_adls should properly parsed" do
     assert_nothing_raised do
-      @adls.each do |adl|
+      @test_adls.each do |adl|
         puts "Processing #{adl}"
         open(adl) do |file|
@@ -27,3 +39,15 @@
   end
 
+#   must "ehr_adls should properly parsed" do
+#     assert_nothing_raised do
+#       @ehr_adls.each do |adl|
+#         puts "Processing #{adl}"
+#         open(adl) do |file|
+#           @parser.parse(file.read, adl)
+#         end
+#       end
+#     end
+#   end
+
+
 end
Index: ruby/trunk/lib/adl_parser/test/scanner_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/scanner_test.rb	(revision 318)
+++ ruby/trunk/lib/adl_parser/test/scanner_test.rb	(revision 319)
@@ -86,4 +86,9 @@
       assert_equal "PT1M",val
     end
+
+    @scanner.scan("P1D") do |sym, val|
+      assert_equal :V_ISO8601_DURATION,sym
+      assert_equal "PT1M",val
+    end
   end
 
