Index: ruby/trunk/lib/adl_parser/test/parser_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 116)
+++ ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 257)
@@ -1,9 +1,9 @@
-#require 'lib/parser.rb'
-require 'lib/adl_parser.rb'
-require 'test/unit'
+#require 'lib/adl_parser.rb'
+require File.dirname(__FILE__) + '/test_helper.rb'
 
 class ADLParserTest < Test::Unit::TestCase
   def setup
     @parser = ::OpenEHR::ADL::Parser.new
+    $DEBUG = false
   end
 
@@ -13,4 +13,11 @@
 
   def test_parse
+#    body_mass_index = File.read(File.dirname(__FILE__) + '/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl')
+    body_mass_index = File.read('test/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl')
+    assert_nothing_raised do
+      ast = @parser.parse(body_mass_index, 'openEHR-EHR-OBSERVATION.body_mass_index.v1.adl')
+      assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
+    end
+
     laboratory_request = File.read('test/adl/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl')
     assert_nothing_raised do
@@ -19,5 +26,4 @@
       assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, result.description
       assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, result.definition
-#      assert_equal '', result.definition
     end
 
@@ -61,86 +67,88 @@
       @parser.parse(exam_nervous_system, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
     end
+
     exam_generic = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic.v1.adl')
     assert_nothing_raised do
       @parser.parse(exam_generic, 'openEHR-EHR-CLUSTER.exam-generic.v1.adl')
     end
-    exam_generic_mass = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic_mass, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
-    end
-    exam_generic_lymphnode = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic_lymphnode, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
-    end
-    exam_generic_joint = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_generic_joint, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
-    end
-    exam_chest = File.read('test/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_chest, 'openEHR-EHR-CLUSTER.exam-chest.v1.adl')
-    end
-    exam_abdomen = File.read('test/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(exam_abdomen, 'openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
-    end
-    cluster_auscultation = File.read('test/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(cluster_auscultation, 'openEHR-EHR-CLUSTER.auscultation.v1.adl')
-    end
-    cluster_auscultation_chest = File.read('test/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(cluster_auscultation_chest, 'openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
-    end
-    vital_signs = File.read('test/adl/openEHR-EHR-SECTION.vital_signs.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(vital_signs, 'openEHR-EHR-SECTION.vital_signs.v1')
-    end
-    summary = File.read('test/adl/openEHR-EHR-SECTION.summary.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(summary, 'openEHR-EHR-SECTION.summary.v1.adl')
-    end
 
-    findings = File.read('test/adl/openEHR-EHR-SECTION.findings.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(findings, 'openEHR-EHR-SECTION.findings.v1.adl')
-    end
+#     exam_generic_mass = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic_mass, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl')
+#     end
+#     exam_generic_lymphnode = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic_lymphnode, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl')
+#     end
+#     exam_generic_joint = File.read('test/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_generic_joint, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl')
+#     end
+#     exam_chest = File.read('test/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_chest, 'openEHR-EHR-CLUSTER.exam-chest.v1.adl')
+#     end
+#     exam_abdomen = File.read('test/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(exam_abdomen, 'openEHR-EHR-CLUSTER.exam-abdomen.v1.adl')
+#     end
+#     cluster_auscultation = File.read('test/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(cluster_auscultation, 'openEHR-EHR-CLUSTER.auscultation.v1.adl')
+#     end
+#     cluster_auscultation_chest = File.read('test/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(cluster_auscultation_chest, 'openEHR-EHR-CLUSTER.auscultation-chest.v1.adl')
+#     end
+#     vital_signs = File.read('test/adl/openEHR-EHR-SECTION.vital_signs.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(vital_signs, 'openEHR-EHR-SECTION.vital_signs.v1')
+#     end
+#     summary = File.read('test/adl/openEHR-EHR-SECTION.summary.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(summary, 'openEHR-EHR-SECTION.summary.v1.adl')
+#     end
 
-    reason_for_encounter = File.read('test/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(reason_for_encounter, 'openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
-    end
+#     findings = File.read('test/adl/openEHR-EHR-SECTION.findings.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(findings, 'openEHR-EHR-SECTION.findings.v1.adl')
+#     end
 
-    imaging = File.read('test/adl/openEHR-EHR-ITEM_TREE.imaging.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(imaging, 'openEHR-EHR-ITEM_TREE.imaging.v1.adl')
-    end
-    instruction_referral = File.read('test/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(instruction_referral, 'openEHR-EHR-INSTRUCTION.referral.v1.adl')
-    end
-    instruction_medication = File.read('test/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(instruction_medication, 'openEHR-EHR-INSTRUCTION.medication.v1.adl')
-    end
-    action_referral = File.read('test/adl/openEHR-EHR-ACTION.referral.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(action_referral, 'openEHR-EHR-ACTION.referral.v1.adl')
-    end
+#     reason_for_encounter = File.read('test/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(reason_for_encounter, 'openEHR-EHR-SECTION.reason_for_encounter.v1.adl')
+#     end
 
-    dimensions_circumference = File.read('test/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl')
-    assert_nothing_raised do
-      @parser.parse(dimensions_circumference, 'openEHR-EHR-CLUSTER.dimensions.v1.adl')
-    end
+#     imaging = File.read('test/adl/openEHR-EHR-ITEM_TREE.imaging.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(imaging, 'openEHR-EHR-ITEM_TREE.imaging.v1.adl')
+#     end
+#     instruction_referral = File.read('test/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(instruction_referral, 'openEHR-EHR-INSTRUCTION.referral.v1.adl')
+#     end
+#     instruction_medication = File.read('test/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(instruction_medication, 'openEHR-EHR-INSTRUCTION.medication.v1.adl')
+#     end
+#     action_referral = File.read('test/adl/openEHR-EHR-ACTION.referral.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(action_referral, 'openEHR-EHR-ACTION.referral.v1.adl')
+#     end
 
-    discharge = File.read('test/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
-    assert_nothing_raised do
-      @parser.parse(discharge, 'openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
-    end
+#     dimensions_circumference = File.read('test/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl')
+#     assert_nothing_raised do
+#       @parser.parse(dimensions_circumference, 'openEHR-EHR-CLUSTER.dimensions.v1.adl')
+#     end
 
-    encounter = File.read('test/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
-    assert_nothing_raised do
-      @parser.parse(encounter, 'openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
-    end
+#     discharge = File.read('test/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
+#     assert_nothing_raised do
+#       @parser.parse(discharge, 'openEHR-EHR-COMPOSITION.discharge.v1draft.adl')
+#     end
+
+#     encounter = File.read('test/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
+#     assert_nothing_raised do
+#       @parser.parse(encounter, 'openEHR-EHR-COMPOSITION.encounter.v1draft.adl')
+#     end
 
 
