Index: /ruby/branches/TRY-open_ehr_gem/lib/am/archetype/constraint_model/archetype_constraint.rb
===================================================================
--- /ruby/branches/TRY-open_ehr_gem/lib/am/archetype/constraint_model/archetype_constraint.rb	(revision 317)
+++ /ruby/branches/TRY-open_ehr_gem/lib/am/archetype/constraint_model/archetype_constraint.rb	(revision 318)
@@ -3,5 +3,5 @@
   module AM
     module Archetype
-      module Constraint_Model
+      module ConstraintModel
         class ARCHETYPE_CONSTRAINT
           
Index: /ruby/branches/TRY-open_ehr_gem/lib/am/archetype/constraint_model/primitive.rb
===================================================================
--- /ruby/branches/TRY-open_ehr_gem/lib/am/archetype/constraint_model/primitive.rb	(revision 317)
+++ /ruby/branches/TRY-open_ehr_gem/lib/am/archetype/constraint_model/primitive.rb	(revision 318)
@@ -2,5 +2,5 @@
   module AM
     module Archetype
-      module Constraint_Model
+      module ConstraintModel
 
         module Primitive
@@ -145,5 +145,5 @@
 
         end # of Primitive
-      end # of Constraint_Model
+      end # of ConstraintModel
     end # of Archetype
   end # of AM
Index: /ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb
===================================================================
--- /ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb	(revision 317)
+++ /ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb	(revision 318)
@@ -36,5 +36,5 @@
     module Archetype
       autoload :ARCHETYPE, "am/archetype/archetype.rb"
-      autoload :Constraint_Model, "am/archetype/constraint_model/archetype_constraint.rb"
+#      autoload :ConstraintModel, "am/archetype/constraint_model/archetype_constraint.rb"
       autoload :Ontology, "am/archetype/ontology.rb"
 
@@ -43,6 +43,8 @@
       end
 
-      module Constraint_Model
+      module ConstraintModel
         autoload :ARCHETYPE_CONSTRAINT, "am/archetype/constraint_model/archetype_constraint.rb"
+        autoload :CARDINALITY, "am/archetype/constraint_model/archetype_constraint.rb"
+        autoload :C_SINGLE_ATTRIBUTE, "am/archetype/constraint_model/archetype_constraint.rb"
         autoload :ARCHETYPE_SLOT, "am/archetype/constraint_model/archetype_constraint.rb"
         autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
Index: /ruby/trunk/lib/adl_parser/lib/adl_scanner.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 317)
+++ /ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 318)
@@ -276,4 +276,6 @@
                 @@logger.debug("DADLScanner#scan: COMMENT = #{$&} at #{@filename}:#{@lineno}")
                 ;
+              when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI
+                yield :V_URI, $&
               when /\A[a-z][a-zA-Z0-9_]*/
                 word = $&.dup
@@ -316,11 +318,4 @@
                       yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
                     end
-#                     adl_type = @adl_type.pop
-#                     if adl_type == :dadl
-#                       yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
-#                     else
-#                       @in_c_domain_type = false
-#                       yield :END_V_C_DOMAIN_TYPE_BLOCK, :END_V_C_DOMAIN_TYPE_BLOCK
-#                     end
                   else
                     adl_type = @adl_type.pop
@@ -382,4 +377,10 @@
                 @@logger.debug("DADLScanner#scan: Right_bracket_code at #{@filename}:#{@lineno}")
                 yield :Right_bracket_code, :Right_bracket_code
+              when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING
+                @@logger.debug("DADLScanner#scan: V_STRING, #{$1}")
+                yield :V_STRING, $1
+              when /\A"([^"]*)"/m #V_STRING
+                @@logger.debug("DADLScanner#scan: V_STRING, #{$1}")
+                yield :V_STRING, $1
               when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9](Z|[+-][0-9]{4})?/   #V_ISO8601_EXTENDED_DATE_TIME YYYY-MM-DDThh:mm:ss[,sss][Z|+/- -n-n-n-n-]-
                 @@logger.debug("DADLScanner#scan: V_ISO8601_EXTENDED_DATE_TIME")
@@ -393,10 +394,4 @@
               when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/   #V_GENERIC_TYPE_IDENTIFIER
                 yield :V_GENERIC_TYPE_IDENTIFIER, $&
-              when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING
-                @@logger.debug("DADLScanner#scan: V_STRING, #{$1}")
-                yield :V_STRING, $1
-              when /\A"([^"]*)"/m #V_STRING
-                @@logger.debug("DADLScanner#scan: V_STRING, #{$1}")
-                yield :V_STRING, $1
               when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ /   #V_REAL
                 yield :V_REAL, $&
@@ -404,6 +399,4 @@
                 @@logger.debug("DADLScanner#scan: V_INTEGER = #{$&}")
                 yield :V_INTEGER, $&
-              when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI
-                yield :V_URI, $&
               when /\A\S/ #UTF8CHAR
                 yield :UTF8CHAR, $&
@@ -601,8 +594,9 @@
               when /\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/
                 yield :V_ISO8601_TIME_CONSTRAINT_PATTERN, $&
-                #when /\AP([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?T([0-9]+[hH])?([0-9]+[mM])?([0-9]+[sS])?|P([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?/   #V_ISO8601_DURATION such as PnYnMnWnDTnnHnnMnnS
+#              when /\AP([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?T([0-9]+[hH])?([0-9]+[mM])?([0-9]+[sS])?|P([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?/   #V_ISO8601_DURATION such as PnYnMnWnDTnnHnnMnnS
+#                yield :V_ISO8601_DURATION, $&
               when /\AP([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?T([0-9]+[hH])?([0-9]+[mM])?([0-9]+[sS])?/   #V_ISO8601_DURATION such as PnYnMnWnDTnnHnnMnnS
                 yield :V_ISO8601_DURATION, $&
-              when /\AP[yY]?[mM]?[wW]?[dD]?T[hH]?[mM]?[sS]?/   #V_ISO8601_DURATION_CONSTRAINT_PATTERNo
+              when /\AP[yY]?[mM]?[wW]?[dD]?(T[hH]?[mM]?[sS]?)?/   #V_ISO8601_DURATION_CONSTRAINT_PATTERN
                 yield :V_ISO8601_DURATION_CONSTRAINT_PATTERN, $&
               when /\A[a-z][a-zA-Z0-9_]*/
Index: /ruby/trunk/lib/adl_parser/lib/parser.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 317)
+++ /ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 318)
@@ -27,5 +27,5 @@
     class Parser < Racc::Parser
 
-module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1282)
+module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1283)
 
 def assert_at(file,line, message = "")
@@ -155,5 +155,5 @@
    129,   462,   497,   577,   229,   476,    58,   137,    67,   213,
    381,   335,   330,   564,   152,   154,    25,    26,   529,   125,
-   127,   113,    72,   495,   189,  -373,    30,   516,   518,    36,
+   127,   113,    72,   495,   189,  -374,    30,   516,   518,    36,
    521,   523,   214,   520,   443,    36,    60,   230,   144,   152,
    154,   431,    48,    50,   274,   110,   435,    80,    83,    86,
@@ -178,5 +178,5 @@
     80,   385,   386,   237,   149,   150,   157,     1,   341,   248,
    261,   172,    22,   254,   338,   379,   258,   260,   145,   157,
-   117,   149,   150,   146,   157,   115,     4,   157,   119,  -372,
+   117,   149,   150,   146,   157,   115,     4,   157,   119,  -373,
     23,    80,    83,    86,   218,   247,    96,   269,   156,   391,
    218,   238,   570,   149,   150,   159,   218,    80,   385,   386,
@@ -221,5 +221,5 @@
    115,   117,   119,    80,    83,    86,   353,   354,    96,    80,
    385,   386,   113,   115,   117,   119,   389,    80,   385,   386,
-   272,   275,   276,  -102,   355,   356,   288,   175,   422,   423,
+   272,   275,   276,  -103,   355,   356,   288,   175,   422,   423,
     80,    83,    86,   193,   451,    96,   125,   127,   109,   113,
    115,   117,   119,   189,   122,   110,   363,   364,    80,    83,
@@ -237,5 +237,5 @@
    546,    56,   548,   113,   550,   115,   552,   117,   554,   119,
    267,   557,   558,   559,   560,   561,   562,   119,   119,   119,
-   119,   563,   249,   162,  -102,   568,   115,    53,    34,   172,
+   119,   563,   249,   162,  -103,   568,   115,    53,    34,   172,
    268,    31,   579,    28,   581,   582,   583,   584,   585,   586,
    587,   113,   590,   591,   592,    24,   595,   596,   269,    21,
@@ -404,67 +404,67 @@
 
 racc_action_default = [
-  -375,    -2,  -375,  -375,    -6,  -375,   -13,    -4,  -375,    -5,
-    -7,  -375,    -1,  -375,  -375,   632,  -375,   -12,  -375,    -9,
-   -18,  -375,   -15,   -14,  -375,    -8,  -375,   -21,  -375,   -17,
-   -16,   -11,   -10,  -375,  -375,  -111,   -93,   -89,   -19,  -107,
-  -375,   -20,  -375,   -97,   -98,   -99,  -375,  -375,  -145,   -87,
-  -146,   -88,   -82,  -375,   -22,   -23,   -94,  -375,  -109,  -375,
-  -375,  -375,  -103,  -375,  -108,  -100,   -90,  -375,  -375,  -375,
-  -288,  -281,  -375,  -247,   -25,   -24,  -252,   -26,  -283,  -253,
-  -151,   -27,  -375,  -375,  -375,  -375,  -375,  -272,  -304,  -273,
-  -375,  -375,  -285,  -282,  -375,  -250,  -166,   -31,  -270,  -280,
-  -271,  -375,  -111,   -92,  -112,   -96,  -375,   -95,  -110,  -186,
-  -147,  -122,  -375,  -190,  -123,  -203,  -124,  -216,  -125,  -229,
-  -126,  -127,  -246,  -128,  -129,  -181,  -120,  -182,  -121,  -101,
-  -104,  -375,   -91,   -84,   -83,  -375,    -3,  -287,  -375,  -288,
-  -284,  -248,  -372,  -375,  -375,  -152,  -167,  -375,  -375,  -375,
-  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -153,
-  -168,   -30,  -375,  -255,  -254,  -375,  -258,  -375,  -375,  -375,
-  -375,  -375,   -32,  -375,  -375,  -147,  -144,  -133,  -122,  -115,
-  -134,  -123,  -135,  -124,  -136,  -125,  -137,  -126,  -375,  -242,
-  -138,  -127,  -116,  -375,  -139,  -128,  -117,  -140,  -118,  -141,
-  -130,  -119,  -142,  -131,  -143,  -132,  -121,  -113,  -106,  -105,
-   -85,   -86,  -375,  -375,  -375,  -286,  -375,  -262,  -375,  -277,
-  -278,  -263,  -274,  -264,  -275,  -260,  -259,  -276,  -261,  -306,
-  -375,  -251,  -249,  -266,  -267,  -268,  -265,  -279,  -269,  -375,
-  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,
-  -114,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,
-  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,
-  -375,  -342,  -321,  -315,  -346,  -327,  -333,  -312,  -375,  -322,
-  -318,   -54,  -328,  -324,   -55,  -334,  -330,   -56,  -374,  -341,
-  -336,  -311,   -57,  -343,  -317,   -58,  -339,  -323,  -347,   -59,
-  -352,  -349,  -329,  -310,   -60,  -356,  -353,  -335,  -316,  -309,
-   -61,  -375,  -289,   -63,  -375,  -375,   -33,   -62,   -34,  -375,
-  -375,  -148,  -150,  -184,  -169,  -171,  -375,  -375,  -188,  -183,
-  -185,  -192,  -189,  -187,  -205,  -193,  -191,  -218,  -206,  -204,
-  -231,  -219,  -217,  -180,  -375,  -375,  -375,  -375,  -375,  -375,
-  -375,  -202,  -375,  -215,  -375,  -228,  -375,  -375,  -375,  -375,
-  -375,  -375,  -375,  -241,  -375,  -375,  -375,  -375,  -375,  -375,
-  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -165,  -375,  -232,
-  -230,  -245,  -243,  -149,  -244,  -375,  -375,  -155,  -170,  -156,
-  -154,   -28,  -375,  -256,  -375,  -375,  -375,  -375,  -375,  -375,
-  -375,  -375,  -375,  -375,  -375,  -257,   -68,  -375,  -375,   -29,
-   -64,  -375,  -307,  -151,  -303,  -302,  -375,  -375,  -178,  -375,
-  -200,  -375,  -213,  -375,  -226,  -375,  -239,  -375,  -163,  -375,
-  -375,  -375,  -375,  -375,  -375,  -375,  -177,  -199,  -212,  -225,
-  -238,  -162,  -375,  -375,  -179,  -201,  -214,  -227,  -240,  -164,
-  -176,  -198,  -211,  -224,  -237,  -161,  -375,  -375,  -314,  -313,
-  -319,  -320,  -326,  -325,  -332,  -331,  -338,  -337,  -345,  -344,
-  -340,  -375,  -348,  -354,  -351,  -350,  -358,  -357,  -355,   -69,
-  -375,  -375,  -375,  -375,  -305,  -375,  -172,  -375,  -375,  -375,
-  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,  -375,
-  -194,  -375,  -207,  -375,  -220,  -375,  -233,  -375,  -375,  -157,
-  -375,  -375,  -375,  -375,  -375,  -375,   -43,  -304,  -375,   -53,
-   -44,  -375,  -309,  -375,   -31,   -72,   -70,   -36,   -37,  -371,
-   -38,  -359,   -39,  -362,   -40,  -375,  -365,   -41,  -366,   -42,
-  -368,  -375,   -35,  -375,  -308,  -174,  -173,  -375,  -195,  -375,
-  -208,  -375,  -221,  -375,  -234,  -375,  -375,  -158,  -196,  -209,
-  -222,  -235,  -159,  -375,  -291,  -375,   -49,  -375,   -67,  -304,
-  -375,   -52,   -50,  -375,  -375,   -44,   -71,   -65,  -375,  -369,
-  -375,   -66,  -175,  -197,  -210,  -223,  -236,  -160,  -294,  -375,
-  -375,  -290,   -45,   -47,  -375,  -364,   -51,  -363,  -375,  -361,
-  -360,  -367,  -370,   -73,  -375,  -293,  -292,   -46,  -375,   -75,
-  -295,  -296,  -297,   -74,   -77,  -375,   -80,  -375,  -375,  -375,
-  -375,  -375,   -78,  -375,   -48,   -76,  -298,  -299,  -300,  -301,
+  -376,    -2,  -376,  -376,    -6,  -376,   -13,    -4,  -376,    -5,
+    -7,  -376,    -1,  -376,  -376,   632,  -376,   -12,  -376,    -9,
+   -18,  -376,   -15,   -14,  -376,    -8,  -376,   -21,   -87,   -17,
+   -16,   -11,   -10,  -376,   -87,  -112,   -94,   -90,   -19,  -108,
+  -376,   -20,  -376,   -98,   -99,  -100,  -376,  -376,  -146,   -88,
+  -147,   -89,   -82,  -376,   -22,   -23,   -95,  -376,  -110,  -376,
+  -376,  -376,  -104,  -376,  -109,  -101,   -91,  -376,  -376,  -376,
+  -289,  -282,  -376,  -248,   -25,   -24,  -253,   -26,  -284,  -254,
+  -152,   -27,  -376,  -376,  -376,  -376,  -376,  -273,  -305,  -274,
+  -376,  -376,  -286,  -283,  -376,  -251,  -167,   -31,  -271,  -281,
+  -272,  -376,  -112,   -93,  -113,   -97,  -376,   -96,  -111,  -187,
+  -148,  -123,  -376,  -191,  -124,  -204,  -125,  -217,  -126,  -230,
+  -127,  -128,  -247,  -129,  -130,  -182,  -121,  -183,  -122,  -102,
+  -105,  -376,   -92,   -84,   -83,   -87,    -3,  -288,  -376,  -289,
+  -285,  -249,  -373,  -376,  -376,  -153,  -168,  -376,  -376,  -376,
+  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -154,
+  -169,   -30,  -376,  -256,  -255,  -376,  -259,  -376,  -376,  -376,
+  -376,  -376,   -32,  -376,  -376,  -148,  -145,  -134,  -123,  -116,
+  -135,  -124,  -136,  -125,  -137,  -126,  -138,  -127,  -376,  -243,
+  -139,  -128,  -117,  -376,  -140,  -129,  -118,  -141,  -119,  -142,
+  -131,  -120,  -143,  -132,  -144,  -133,  -122,  -114,  -107,  -106,
+   -85,   -86,  -376,  -376,  -376,  -287,  -376,  -263,  -376,  -278,
+  -279,  -264,  -275,  -265,  -276,  -261,  -260,  -277,  -262,  -307,
+  -376,  -252,  -250,  -267,  -268,  -269,  -266,  -280,  -270,  -376,
+  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,
+  -115,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,
+  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,
+  -376,  -343,  -322,  -316,  -347,  -328,  -334,  -313,  -376,  -323,
+  -319,   -54,  -329,  -325,   -55,  -335,  -331,   -56,  -375,  -342,
+  -337,  -312,   -57,  -344,  -318,   -58,  -340,  -324,  -348,   -59,
+  -353,  -350,  -330,  -311,   -60,  -357,  -354,  -336,  -317,  -310,
+   -61,  -376,  -290,   -63,  -376,  -376,   -33,   -62,   -34,  -376,
+  -376,  -149,  -151,  -185,  -170,  -172,  -376,  -376,  -189,  -184,
+  -186,  -193,  -190,  -188,  -206,  -194,  -192,  -219,  -207,  -205,
+  -232,  -220,  -218,  -181,  -376,  -376,  -376,  -376,  -376,  -376,
+  -376,  -203,  -376,  -216,  -376,  -229,  -376,  -376,  -376,  -376,
+  -376,  -376,  -376,  -242,  -376,  -376,  -376,  -376,  -376,  -376,
+  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -166,  -376,  -233,
+  -231,  -246,  -244,  -150,  -245,  -376,  -376,  -156,  -171,  -157,
+  -155,   -28,  -376,  -257,  -376,  -376,  -376,  -376,  -376,  -376,
+  -376,  -376,  -376,  -376,  -376,  -258,   -68,  -376,  -376,   -29,
+   -64,  -376,  -308,  -152,  -304,  -303,  -376,  -376,  -179,  -376,
+  -201,  -376,  -214,  -376,  -227,  -376,  -240,  -376,  -164,  -376,
+  -376,  -376,  -376,  -376,  -376,  -376,  -178,  -200,  -213,  -226,
+  -239,  -163,  -376,  -376,  -180,  -202,  -215,  -228,  -241,  -165,
+  -177,  -199,  -212,  -225,  -238,  -162,  -376,  -376,  -315,  -314,
+  -320,  -321,  -327,  -326,  -333,  -332,  -339,  -338,  -346,  -345,
+  -341,  -376,  -349,  -355,  -352,  -351,  -359,  -358,  -356,   -69,
+  -376,  -376,  -376,  -376,  -306,  -376,  -173,  -376,  -376,  -376,
+  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,
+  -195,  -376,  -208,  -376,  -221,  -376,  -234,  -376,  -376,  -158,
+  -376,  -376,  -376,  -376,  -376,  -376,   -43,  -305,   -87,   -53,
+   -44,  -376,  -310,  -376,   -31,   -72,   -70,   -36,   -37,  -372,
+   -38,  -360,   -39,  -363,   -40,  -376,  -366,   -41,  -367,   -42,
+  -369,  -376,   -35,  -376,  -309,  -175,  -174,  -376,  -196,  -376,
+  -209,  -376,  -222,  -376,  -235,  -376,  -376,  -159,  -197,  -210,
+  -223,  -236,  -160,  -376,  -292,  -376,   -49,  -376,   -67,  -305,
+  -376,   -52,   -50,  -376,  -376,   -44,   -71,   -65,  -376,  -370,
+  -376,   -66,  -176,  -198,  -211,  -224,  -237,  -161,  -295,  -376,
+  -376,  -291,   -45,   -47,  -376,  -365,   -51,  -364,  -376,  -362,
+  -361,  -368,  -371,   -73,  -376,  -294,  -293,   -46,  -376,   -75,
+  -296,  -297,  -298,   -74,   -77,  -376,   -80,  -376,  -376,  -376,
+  -376,  -376,   -78,  -376,   -48,   -76,  -299,  -300,  -301,  -302,
    -81,   -79 ]
 
@@ -707,38 +707,38 @@
   2, 105, :_reduce_85,
   2, 105, :_reduce_none,
-  1, 110, :_reduce_87,
+  0, 110, :_reduce_none,
   1, 110, :_reduce_88,
-  1, 152, :_reduce_89,
-  2, 152, :_reduce_90,
-  3, 152, :_reduce_91,
-  3, 154, :_reduce_92,
-  1, 155, :_reduce_93,
+  1, 110, :_reduce_89,
+  1, 152, :_reduce_90,
+  2, 152, :_reduce_91,
+  3, 152, :_reduce_92,
+  3, 154, :_reduce_93,
+  1, 155, :_reduce_94,
   2, 155, :_reduce_none,
-  1, 156, :_reduce_95,
   1, 156, :_reduce_96,
-  1, 153, :_reduce_97,
+  1, 156, :_reduce_97,
   1, 153, :_reduce_98,
-  1, 159, :_reduce_99,
-  2, 159, :_reduce_100,
-  3, 160, :_reduce_101,
-  1, 161, :_reduce_102,
-  1, 162, :_reduce_103,
-  2, 162, :_reduce_104,
-  3, 163, :_reduce_105,
-  3, 164, :_reduce_106,
-  1, 158, :_reduce_107,
-  2, 158, :_reduce_108,
-  2, 166, :_reduce_109,
-  3, 166, :_reduce_110,
+  1, 153, :_reduce_99,
+  1, 159, :_reduce_100,
+  2, 159, :_reduce_101,
+  3, 160, :_reduce_102,
+  1, 161, :_reduce_103,
+  1, 162, :_reduce_104,
+  2, 162, :_reduce_105,
+  3, 163, :_reduce_106,
+  3, 164, :_reduce_107,
+  1, 158, :_reduce_108,
+  2, 158, :_reduce_109,
+  2, 166, :_reduce_110,
+  3, 166, :_reduce_111,
   1, 167, :_reduce_none,
-  1, 157, :_reduce_112,
-  2, 157, :_reduce_113,
-  3, 168, :_reduce_114,
-  1, 169, :_reduce_115,
+  1, 157, :_reduce_113,
+  2, 157, :_reduce_114,
+  3, 168, :_reduce_115,
   1, 169, :_reduce_116,
   1, 169, :_reduce_117,
   1, 169, :_reduce_118,
   1, 169, :_reduce_119,
-  1, 165, :_reduce_120,
+  1, 169, :_reduce_120,
   1, 165, :_reduce_121,
   1, 165, :_reduce_122,
@@ -750,5 +750,5 @@
   1, 165, :_reduce_128,
   1, 165, :_reduce_129,
-  1, 170, :_reduce_130,
+  1, 165, :_reduce_130,
   1, 170, :_reduce_131,
   1, 170, :_reduce_132,
@@ -759,4 +759,5 @@
   1, 170, :_reduce_137,
   1, 170, :_reduce_138,
+  1, 170, :_reduce_139,
   1, 171, :_reduce_none,
   1, 171, :_reduce_none,
@@ -765,13 +766,13 @@
   1, 171, :_reduce_none,
   1, 171, :_reduce_none,
-  1, 118, :_reduce_145,
   1, 118, :_reduce_146,
-  1, 174, :_reduce_147,
-  3, 184, :_reduce_148,
+  1, 118, :_reduce_147,
+  1, 174, :_reduce_148,
   3, 184, :_reduce_149,
   3, 184, :_reduce_150,
-  1, 175, :_reduce_151,
-  2, 175, :_reduce_152,
+  3, 184, :_reduce_151,
+  1, 175, :_reduce_152,
   2, 175, :_reduce_153,
+  2, 175, :_reduce_154,
   3, 185, :_reduce_none,
   3, 185, :_reduce_none,
@@ -786,7 +787,7 @@
   4, 193, :_reduce_none,
   3, 193, :_reduce_none,
-  1, 176, :_reduce_166,
-  2, 176, :_reduce_167,
+  1, 176, :_reduce_167,
   2, 176, :_reduce_168,
+  2, 176, :_reduce_169,
   3, 186, :_reduce_none,
   3, 186, :_reduce_none,
@@ -801,6 +802,6 @@
   4, 194, :_reduce_none,
   3, 194, :_reduce_none,
-  1, 177, :_reduce_181,
   1, 177, :_reduce_182,
+  1, 177, :_reduce_183,
   3, 187, :_reduce_none,
   3, 187, :_reduce_none,
@@ -810,5 +811,5 @@
   3, 188, :_reduce_none,
   3, 188, :_reduce_none,
-  1, 179, :_reduce_190,
+  1, 179, :_reduce_191,
   3, 189, :_reduce_none,
   3, 189, :_reduce_none,
@@ -849,5 +850,5 @@
   4, 197, :_reduce_none,
   3, 197, :_reduce_none,
-  1, 182, :_reduce_229,
+  1, 182, :_reduce_230,
   3, 192, :_reduce_none,
   3, 192, :_reduce_none,
@@ -862,9 +863,9 @@
   4, 198, :_reduce_none,
   3, 198, :_reduce_none,
-  1, 172, :_reduce_242,
+  1, 172, :_reduce_243,
   3, 173, :_reduce_none,
   3, 173, :_reduce_none,
   3, 173, :_reduce_none,
-  1, 183, :_reduce_246,
+  1, 183, :_reduce_247,
   1, 113, :_reduce_none,
   2, 113, :_reduce_none,
@@ -907,11 +908,11 @@
   1, 202, :_reduce_none,
   3, 202, :_reduce_none,
-  2, 206, :_reduce_287,
-  1, 206, :_reduce_288,
-  0, 146, :_reduce_289,
-  5, 146, :_reduce_290,
-  1, 207, :_reduce_291,
-  3, 207, :_reduce_292,
-  5, 147, :_reduce_293,
+  2, 206, :_reduce_288,
+  1, 206, :_reduce_289,
+  0, 146, :_reduce_290,
+  5, 146, :_reduce_291,
+  1, 207, :_reduce_292,
+  3, 207, :_reduce_293,
+  5, 147, :_reduce_294,
   1, 208, :_reduce_none,
   3, 208, :_reduce_none,
@@ -922,11 +923,11 @@
   5, 208, :_reduce_none,
   5, 208, :_reduce_none,
-  1, 210, :_reduce_302,
   1, 210, :_reduce_303,
+  1, 210, :_reduce_304,
   0, 117, :_reduce_none,
-  5, 117, :_reduce_305,
+  5, 117, :_reduce_306,
   2, 117, :_reduce_none,
-  1, 209, :_reduce_307,
-  3, 209, :_reduce_308,
+  1, 209, :_reduce_308,
+  3, 209, :_reduce_309,
   1, 211, :_reduce_none,
   1, 211, :_reduce_none,
@@ -972,11 +973,11 @@
   3, 141, :_reduce_none,
   3, 141, :_reduce_none,
-  1, 219, :_reduce_352,
   1, 219, :_reduce_353,
-  3, 219, :_reduce_354,
+  1, 219, :_reduce_354,
   3, 219, :_reduce_355,
-  1, 142, :_reduce_356,
-  3, 142, :_reduce_357,
+  3, 219, :_reduce_356,
+  1, 142, :_reduce_357,
   3, 142, :_reduce_358,
+  3, 142, :_reduce_359,
   1, 126, :_reduce_none,
   3, 126, :_reduce_none,
@@ -984,17 +985,17 @@
   1, 220, :_reduce_none,
   3, 220, :_reduce_none,
-  3, 221, :_reduce_364,
-  1, 125, :_reduce_365,
+  3, 221, :_reduce_365,
   1, 125, :_reduce_366,
-  3, 222, :_reduce_367,
+  1, 125, :_reduce_367,
+  3, 222, :_reduce_368,
   0, 223, :_reduce_none,
   1, 223, :_reduce_none,
   2, 223, :_reduce_none,
-  1, 124, :_reduce_371,
-  1, 150, :_reduce_372,
+  1, 124, :_reduce_372,
   1, 150, :_reduce_373,
-  1, 217, :_reduce_374 ]
-
-racc_reduce_n = 375
+  1, 150, :_reduce_374,
+  1, 217, :_reduce_375 ]
+
+racc_reduce_n = 376
 
 racc_shift_n = 632
@@ -1362,5 +1363,5 @@
   def _reduce_3(val, _values, result)
         assert_at(__FILE__,__LINE__) do
-      val[4].instance_of?(OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION) and val[5].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT) and val[7].instance_of?(OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY) 
+      val[4].instance_of?(OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION) and val[5].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT) and val[7].instance_of?(OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY) 
     end
     
@@ -1524,5 +1525,5 @@
 module_eval(<<'.,.,', 'parser.y', 155)
   def _reduce_26(val, _values, result)
-        assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)}
+        assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT)}
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -1542,5 +1543,5 @@
 module_eval(<<'.,.,', 'parser.y', 168)
   def _reduce_28(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
+        result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
       c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
       c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
@@ -1554,5 +1555,5 @@
 module_eval(<<'.,.,', 'parser.y', 176)
   def _reduce_29(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
+        result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
       c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
       c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
@@ -1592,5 +1593,5 @@
 module_eval(<<'.,.,', 'parser.y', 202)
   def _reduce_34(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => val[0])
+        result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.new(:attributes => val[0])
   
     result
@@ -1609,5 +1610,5 @@
 module_eval(<<'.,.,', 'parser.y', 225)
   def _reduce_36(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref|
+        result = OpenEhr::AM::Archetype::ConstraintModel::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref|
       archetype_internal_ref.target_path = val[0][:absolute_path]
       archetype_internal_ref.rm_type_name = val[0][:type_identifier]
@@ -1629,5 +1630,5 @@
 module_eval(<<'.,.,', 'parser.y', 237)
   def _reduce_38(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::CONSTRAINT_REF.create do |constraint_ref|
+        result = OpenEhr::AM::Archetype::ConstraintModel::CONSTRAINT_REF.create do |constraint_ref|
       constraint_ref.reference = val[0]
     end
@@ -1693,5 +1694,5 @@
 module_eval(<<'.,.,', 'parser.y', 301)
   def _reduce_48(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.create do |archetype_slot|
+        result = OpenEhr::AM::Archetype::ConstraintModel::ARCHETYPE_SLOT.create do |archetype_slot|
       archetype_slot.includes = val[3]
       archetype_slot.excludes = val[4]
@@ -1726,6 +1727,6 @@
 module_eval(<<'.,.,', 'parser.y', 323)
   def _reduce_53(val, _values, result)
-        assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)}
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.create do |c_primitive_object|
+        assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_PRIMITIVE)}
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_PRIMITIVE_OBJECT.create do |c_primitive_object|
       c_primitive_object.item = val[0]
     end
@@ -1738,5 +1739,5 @@
   def _reduce_54(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.create do |c_integer|
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_INTEGER.create do |c_integer|
       c_integer.list
       c_integer.range
@@ -1751,5 +1752,5 @@
   def _reduce_55(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_REAL.new
   
     result
@@ -1760,5 +1761,5 @@
   def _reduce_56(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DATE.new
   
     result
@@ -1769,5 +1770,5 @@
   def _reduce_57(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_TIME.new
   
     result
@@ -1778,5 +1779,5 @@
   def _reduce_58(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DATE_TIME.new
   
     result
@@ -1787,5 +1788,5 @@
   def _reduce_59(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new
   
     result
@@ -1796,5 +1797,5 @@
   def _reduce_60(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_STRING.new
   
     result
@@ -1804,5 +1805,5 @@
 module_eval(<<'.,.,', 'parser.y', 370)
   def _reduce_61(val, _values, result)
-        assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)}
+        assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN)}
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -1832,5 +1833,5 @@
 module_eval(<<'.,.,', 'parser.y', 392)
   def _reduce_65(val, _values, result)
-        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
+        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
     c_attribute = val[0]
     c_attribute.children = val[3]
@@ -1843,5 +1844,5 @@
 module_eval(<<'.,.,', 'parser.y', 399)
   def _reduce_66(val, _values, result)
-        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
+        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
     result = val[0]
   
@@ -1852,5 +1853,5 @@
 module_eval(<<'.,.,', 'parser.y', 404)
   def _reduce_67(val, _values, result)
-        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
+        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
     result = val[0]
   
@@ -1862,5 +1863,5 @@
   def _reduce_68(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new(
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_SINGLE_ATTRIBUTE.new(
                                                                               :rm_attribute_name => val[0],
                                                                               :existence => val[1]
@@ -1874,7 +1875,7 @@
 module_eval(<<'.,.,', 'parser.y', 420)
   def _reduce_69(val, _values, result)
-        assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY) }
+        assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY) }
     @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}") 
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_MULTIPLE_ATTRIBUTE.new(
                                                                                 :rm_attribute_name => val[0],
                                                                                 :existence => val[1],
@@ -1957,6 +1958,8 @@
 # reduce 86 omitted
 
-module_eval(<<'.,.,', 'parser.y', 484)
-  def _reduce_87(val, _values, result)
+# reduce 87 omitted
+
+module_eval(<<'.,.,', 'parser.y', 485)
+  def _reduce_88(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section attr_vals = \n#{val[0].to_yaml}")
     result = val[0]
@@ -1966,6 +1969,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 489)
-  def _reduce_88(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 490)
+  def _reduce_89(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section complex_object_block = \n#{val[0].to_yaml}")
     result = val[0]
@@ -1975,6 +1978,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 496)
-  def _reduce_89(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 497)
+  def _reduce_90(val, _values, result)
         result = Array[val[0]]
   
@@ -1983,6 +1986,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 500)
-  def _reduce_90(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 501)
+  def _reduce_91(val, _values, result)
         result = (val[0] << val[1])
   
@@ -1991,6 +1994,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 504)
-  def _reduce_91(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 505)
+  def _reduce_92(val, _values, result)
         result = (val[0] << val[2])
   
@@ -1999,6 +2002,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 509)
-  def _reduce_92(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 510)
+  def _reduce_93(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}:attr_val\n attr_id = #{val[0]}, object_block = #{val[1]}")
     result = {:attr_id => val[0], :object_block => val[2]}
@@ -2008,6 +2011,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 515)
-  def _reduce_93(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 516)
+  def _reduce_94(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}")
     result = val[0]
@@ -2017,15 +2020,7 @@
 .,.,
 
-# reduce 94 omitted
-
-module_eval(<<'.,.,', 'parser.y', 522)
-  def _reduce_95(val, _values, result)
-        result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 526)
+# reduce 95 omitted
+
+module_eval(<<'.,.,', 'parser.y', 523)
   def _reduce_96(val, _values, result)
         result = val[0]
@@ -2035,5 +2030,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 531)
+module_eval(<<'.,.,', 'parser.y', 527)
   def _reduce_97(val, _values, result)
         result = val[0]
@@ -2043,5 +2038,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 535)
+module_eval(<<'.,.,', 'parser.y', 532)
   def _reduce_98(val, _values, result)
         result = val[0]
@@ -2051,6 +2046,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 540)
+module_eval(<<'.,.,', 'parser.y', 536)
   def _reduce_99(val, _values, result)
+        result = val[0]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 541)
+  def _reduce_100(val, _values, result)
         result = {:untyped_multiple_attr_object_block => val[0]}
   
@@ -2059,6 +2062,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 544)
-  def _reduce_100(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 545)
+  def _reduce_101(val, _values, result)
         result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]}
   
@@ -2067,6 +2070,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 549)
-  def _reduce_101(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 550)
+  def _reduce_102(val, _values, result)
         result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]}
   
@@ -2075,6 +2078,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 554)
-  def _reduce_102(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 555)
+  def _reduce_103(val, _values, result)
         result = val[0]
   
@@ -2083,6 +2086,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 559)
-  def _reduce_103(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 560)
+  def _reduce_104(val, _values, result)
         result = Array[val[0]]
   
@@ -2091,6 +2094,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 563)
-  def _reduce_104(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 564)
+  def _reduce_105(val, _values, result)
         result = (val[0] << val[1])
   
@@ -2099,6 +2102,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 568)
-  def _reduce_105(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 569)
+  def _reduce_106(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}")
     result = {:object_key => val[0], :object_block => val[2]}
@@ -2108,6 +2111,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 574)
-  def _reduce_106(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 575)
+  def _reduce_107(val, _values, result)
         @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
     result = val[1]
@@ -2117,6 +2120,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 580)
-  def _reduce_107(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 581)
+  def _reduce_108(val, _values, result)
         result = {:untyped_single_attr_object_block => val[0]}
   
@@ -2125,6 +2128,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 584)
-  def _reduce_108(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 585)
+  def _reduce_109(val, _values, result)
         result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]}
   
@@ -2133,6 +2136,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 589)
-  def _reduce_109(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 590)
+  def _reduce_110(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]}
@@ -2142,6 +2145,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 594)
-  def _reduce_110(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 595)
+  def _reduce_111(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]}
@@ -2151,8 +2154,8 @@
 .,.,
 
-# reduce 111 omitted
-
-module_eval(<<'.,.,', 'parser.y', 600)
-  def _reduce_112(val, _values, result)
+# reduce 112 omitted
+
+module_eval(<<'.,.,', 'parser.y', 601)
+  def _reduce_113(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
     result = {:untyped_primitive_object_block => val[0]}
@@ -2162,6 +2165,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 605)
-  def _reduce_113(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 606)
+  def _reduce_114(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
     result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]}
@@ -2171,6 +2174,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 610)
-  def _reduce_114(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 611)
+  def _reduce_115(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
     result = val[1]
@@ -2180,13 +2183,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 615)
-  def _reduce_115(val, _values, result)
-        result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 619)
+module_eval(<<'.,.,', 'parser.y', 616)
   def _reduce_116(val, _values, result)
         result = val[0]
@@ -2196,5 +2191,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 623)
+module_eval(<<'.,.,', 'parser.y', 620)
   def _reduce_117(val, _values, result)
         result = val[0]
@@ -2204,5 +2199,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 627)
+module_eval(<<'.,.,', 'parser.y', 624)
   def _reduce_118(val, _values, result)
         result = val[0]
@@ -2212,5 +2207,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 631)
+module_eval(<<'.,.,', 'parser.y', 628)
   def _reduce_119(val, _values, result)
         result = val[0]
@@ -2220,6 +2215,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 635)
+module_eval(<<'.,.,', 'parser.y', 632)
   def _reduce_120(val, _values, result)
+        result = val[0]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 636)
+  def _reduce_121(val, _values, result)
         @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2229,6 +2232,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 640)
-  def _reduce_121(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 641)
+  def _reduce_122(val, _values, result)
         @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2238,6 +2241,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 645)
-  def _reduce_122(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 646)
+  def _reduce_123(val, _values, result)
         @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2247,6 +2250,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 650)
-  def _reduce_123(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 651)
+  def _reduce_124(val, _values, result)
         @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2256,6 +2259,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 655)
-  def _reduce_124(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 656)
+  def _reduce_125(val, _values, result)
         @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2265,6 +2268,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 660)
-  def _reduce_125(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 661)
+  def _reduce_126(val, _values, result)
         @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2274,6 +2277,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 665)
-  def _reduce_126(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 666)
+  def _reduce_127(val, _values, result)
         @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2283,6 +2286,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 670)
-  def _reduce_127(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 671)
+  def _reduce_128(val, _values, result)
         @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2292,6 +2295,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 675)
-  def _reduce_128(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 676)
+  def _reduce_129(val, _values, result)
         @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2301,6 +2304,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 680)
-  def _reduce_129(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 681)
+  def _reduce_130(val, _values, result)
         @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2310,6 +2313,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 686)
-  def _reduce_130(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 687)
+  def _reduce_131(val, _values, result)
         @@logger.debug("string_list_value: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2319,13 +2322,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 691)
-  def _reduce_131(val, _values, result)
-        result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 695)
+module_eval(<<'.,.,', 'parser.y', 692)
   def _reduce_132(val, _values, result)
         result = val[0]
@@ -2335,5 +2330,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 699)
+module_eval(<<'.,.,', 'parser.y', 696)
   def _reduce_133(val, _values, result)
         result = val[0]
@@ -2343,5 +2338,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 703)
+module_eval(<<'.,.,', 'parser.y', 700)
   def _reduce_134(val, _values, result)
         result = val[0]
@@ -2351,5 +2346,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 707)
+module_eval(<<'.,.,', 'parser.y', 704)
   def _reduce_135(val, _values, result)
         result = val[0]
@@ -2359,5 +2354,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 711)
+module_eval(<<'.,.,', 'parser.y', 708)
   def _reduce_136(val, _values, result)
         result = val[0]
@@ -2367,5 +2362,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 715)
+module_eval(<<'.,.,', 'parser.y', 712)
   def _reduce_137(val, _values, result)
         result = val[0]
@@ -2375,5 +2370,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 719)
+module_eval(<<'.,.,', 'parser.y', 716)
   def _reduce_138(val, _values, result)
         result = val[0]
@@ -2383,5 +2378,11 @@
 .,.,
 
-# reduce 139 omitted
+module_eval(<<'.,.,', 'parser.y', 720)
+  def _reduce_139(val, _values, result)
+        result = val[0]
+  
+    result
+  end
+.,.,
 
 # reduce 140 omitted
@@ -2395,6 +2396,8 @@
 # reduce 144 omitted
 
-module_eval(<<'.,.,', 'parser.y', 731)
-  def _reduce_145(val, _values, result)
+# reduce 145 omitted
+
+module_eval(<<'.,.,', 'parser.y', 732)
+  def _reduce_146(val, _values, result)
         @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2404,6 +2407,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 736)
-  def _reduce_146(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 737)
+  def _reduce_147(val, _values, result)
         @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2413,6 +2416,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 742)
-  def _reduce_147(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 743)
+  def _reduce_148(val, _values, result)
         @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2422,6 +2425,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 748)
-  def _reduce_148(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 749)
+  def _reduce_149(val, _values, result)
         result = [val[0],val[2]]
   
@@ -2430,6 +2433,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 752)
-  def _reduce_149(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 753)
+  def _reduce_150(val, _values, result)
         result = val[0] << val[2]
   
@@ -2438,6 +2441,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 756)
-  def _reduce_150(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 757)
+  def _reduce_151(val, _values, result)
         result = val[0]
   
@@ -2446,18 +2449,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 761)
-  def _reduce_151(val, _values, result)
-        begin
-      integer = Integer(val[0])
-    rescue
-      raise
-    end
-    result = integer
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 770)
+module_eval(<<'.,.,', 'parser.y', 762)
   def _reduce_152(val, _values, result)
         begin
@@ -2472,5 +2462,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 779)
+module_eval(<<'.,.,', 'parser.y', 771)
   def _reduce_153(val, _values, result)
         begin
@@ -2479,4 +2469,17 @@
       raise
     end
+    result = integer
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 780)
+  def _reduce_154(val, _values, result)
+        begin
+      integer = Integer(val[0])
+    rescue
+      raise
+    end
     result = - integer
   
@@ -2485,6 +2488,4 @@
 .,.,
 
-# reduce 154 omitted
-
 # reduce 155 omitted
 
@@ -2509,6 +2510,8 @@
 # reduce 165 omitted
 
-module_eval(<<'.,.,', 'parser.y', 805)
-  def _reduce_166(val, _values, result)
+# reduce 166 omitted
+
+module_eval(<<'.,.,', 'parser.y', 806)
+  def _reduce_167(val, _values, result)
         begin
       real = Float(val[0])
@@ -2522,6 +2525,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 814)
-  def _reduce_167(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 815)
+  def _reduce_168(val, _values, result)
         begin
       real = Float(val[1])
@@ -2535,6 +2538,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 823)
-  def _reduce_168(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 824)
+  def _reduce_169(val, _values, result)
         begin
       real = Float(val[1])
@@ -2548,6 +2551,4 @@
 .,.,
 
-# reduce 169 omitted
-
 # reduce 170 omitted
 
@@ -2572,6 +2573,8 @@
 # reduce 180 omitted
 
-module_eval(<<'.,.,', 'parser.y', 848)
-  def _reduce_181(val, _values, result)
+# reduce 181 omitted
+
+module_eval(<<'.,.,', 'parser.y', 849)
+  def _reduce_182(val, _values, result)
         result = true
   
@@ -2580,6 +2583,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 852)
-  def _reduce_182(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 853)
+  def _reduce_183(val, _values, result)
         result = false
   
@@ -2588,6 +2591,4 @@
 .,.,
 
-# reduce 183 omitted
-
 # reduce 184 omitted
 
@@ -2602,6 +2603,8 @@
 # reduce 189 omitted
 
-module_eval(<<'.,.,', 'parser.y', 867)
-  def _reduce_190(val, _values, result)
+# reduce 190 omitted
+
+module_eval(<<'.,.,', 'parser.y', 868)
+  def _reduce_191(val, _values, result)
         result = val[0]
   
@@ -2610,6 +2613,4 @@
 .,.,
 
-# reduce 191 omitted
-
 # reduce 192 omitted
 
@@ -2686,6 +2687,8 @@
 # reduce 228 omitted
 
-module_eval(<<'.,.,', 'parser.y', 918)
-  def _reduce_229(val, _values, result)
+# reduce 229 omitted
+
+module_eval(<<'.,.,', 'parser.y', 919)
+  def _reduce_230(val, _values, result)
         @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2695,6 +2698,4 @@
 .,.,
 
-# reduce 230 omitted
-
 # reduce 231 omitted
 
@@ -2719,6 +2720,8 @@
 # reduce 241 omitted
 
-module_eval(<<'.,.,', 'parser.y', 938)
-  def _reduce_242(val, _values, result)
+# reduce 242 omitted
+
+module_eval(<<'.,.,', 'parser.y', 939)
+  def _reduce_243(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2728,12 +2731,12 @@
 .,.,
 
-# reduce 243 omitted
-
 # reduce 244 omitted
 
 # reduce 245 omitted
 
-module_eval(<<'.,.,', 'parser.y', 948)
-  def _reduce_246(val, _values, result)
+# reduce 246 omitted
+
+module_eval(<<'.,.,', 'parser.y', 949)
+  def _reduce_247(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -2743,6 +2746,4 @@
 .,.,
 
-# reduce 247 omitted
-
 # reduce 248 omitted
 
@@ -2823,13 +2824,7 @@
 # reduce 286 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1018)
-  def _reduce_287(val, _values, result)
-        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1022)
+# reduce 287 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1019)
   def _reduce_288(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -2839,6 +2834,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1033)
+module_eval(<<'.,.,', 'parser.y', 1023)
   def _reduce_289(val, _values, result)
+        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1034)
+  def _reduce_290(val, _values, result)
         result = Range.new(1,1)
   
@@ -2847,6 +2850,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1037)
-  def _reduce_290(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 1038)
+  def _reduce_291(val, _values, result)
         result = val[3]
   
@@ -2855,6 +2858,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1042)
-  def _reduce_291(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 1043)
+  def _reduce_292(val, _values, result)
         begin
       integer = Integer(val[0])
@@ -2868,6 +2871,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1051)
-  def _reduce_292(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 1052)
+  def _reduce_293(val, _values, result)
         begin
       from_integer = Integer(val[0])
@@ -2882,13 +2885,11 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1062)
-  def _reduce_293(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY.new
-  
-    result
-  end
-.,.,
-
-# reduce 294 omitted
+module_eval(<<'.,.,', 'parser.y', 1063)
+  def _reduce_294(val, _values, result)
+        result = OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY.new
+  
+    result
+  end
+.,.,
 
 # reduce 295 omitted
@@ -2906,13 +2907,7 @@
 # reduce 301 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1076)
-  def _reduce_302(val, _values, result)
-        result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1080)
+# reduce 302 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1077)
   def _reduce_303(val, _values, result)
         result = val[0]
@@ -2922,8 +2917,16 @@
 .,.,
 
-# reduce 304 omitted
-
-module_eval(<<'.,.,', 'parser.y', 1087)
-  def _reduce_305(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 1081)
+  def _reduce_304(val, _values, result)
+        result = val[0]
+  
+    result
+  end
+.,.,
+
+# reduce 305 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1088)
+  def _reduce_306(val, _values, result)
         case val[3]
     when OpenEhr::RM::Support::AssumedTypes::Interval
@@ -2937,8 +2940,8 @@
 .,.,
 
-# reduce 306 omitted
-
-module_eval(<<'.,.,', 'parser.y', 1098)
-  def _reduce_307(val, _values, result)
+# reduce 307 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1099)
+  def _reduce_308(val, _values, result)
         result = val[0]
   
@@ -2947,6 +2950,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1102)
-  def _reduce_308(val, _values, result)
+module_eval(<<'.,.,', 'parser.y', 1103)
+  def _reduce_309(val, _values, result)
         result = OpenEhr::RM::Support::AssumedTypes::Interval.new(val[0], val[2])
   
@@ -2955,6 +2958,4 @@
 .,.,
 
-# reduce 309 omitted
-
 # reduce 310 omitted
 
@@ -3041,38 +3042,40 @@
 # reduce 351 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1168)
-  def _reduce_352(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true)
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1172)
+# reduce 352 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1169)
   def _reduce_353(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false)
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1176)
+        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true)
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1173)
   def _reduce_354(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1180)
+        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false)
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1177)
   def _reduce_355(val, _values, result)
-        result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1185)
+        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1181)
   def _reduce_356(val, _values, result)
+        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1186)
+  def _reduce_357(val, _values, result)
         result = val[0]
   
@@ -3081,13 +3084,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1189)
-  def _reduce_357(val, _values, result)
-        raise 'Not implemented yet'
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1193)
+module_eval(<<'.,.,', 'parser.y', 1190)
   def _reduce_358(val, _values, result)
         raise 'Not implemented yet'
@@ -3097,5 +3092,11 @@
 .,.,
 
-# reduce 359 omitted
+module_eval(<<'.,.,', 'parser.y', 1194)
+  def _reduce_359(val, _values, result)
+        raise 'Not implemented yet'
+  
+    result
+  end
+.,.,
 
 # reduce 360 omitted
@@ -3107,6 +3108,8 @@
 # reduce 363 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1205)
-  def _reduce_364(val, _values, result)
+# reduce 364 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1206)
+  def _reduce_365(val, _values, result)
         @in_interval = false
     @@logger.debug("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}") 
@@ -3116,13 +3119,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1212)
-  def _reduce_365(val, _values, result)
-          result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1216)
+module_eval(<<'.,.,', 'parser.y', 1213)
   def _reduce_366(val, _values, result)
           result = val[0]
@@ -3132,6 +3127,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1222)
+module_eval(<<'.,.,', 'parser.y', 1217)
   def _reduce_367(val, _values, result)
+          result = val[0]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1223)
+  def _reduce_368(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
     @@logger.debug("#{__FILE__}:#{__LINE__}, term_code_body = #{val[1]}")
@@ -3143,19 +3146,11 @@
 .,.,
 
-# reduce 368 omitted
-
 # reduce 369 omitted
 
 # reduce 370 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1238)
-  def _reduce_371(val, _values, result)
-          result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 1243)
+# reduce 371 omitted
+
+module_eval(<<'.,.,', 'parser.y', 1239)
   def _reduce_372(val, _values, result)
           result = val[0]
@@ -3165,6 +3160,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1247)
+module_eval(<<'.,.,', 'parser.y', 1244)
   def _reduce_373(val, _values, result)
+          result = val[0]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 1248)
+  def _reduce_374(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
       result = val[0]
@@ -3174,7 +3177,7 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1258)
-  def _reduce_374(val, _values, result)
-        result = val[0]
+module_eval(<<'.,.,', 'parser.y', 1259)
+  def _reduce_375(val, _values, result)
+        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new #val[0]
   
     result
Index: /ruby/trunk/lib/adl_parser/lib/parser.y
===================================================================
--- /ruby/trunk/lib/adl_parser/lib/parser.y	(revision 317)
+++ /ruby/trunk/lib/adl_parser/lib/parser.y	(revision 318)
@@ -36,5 +36,5 @@
   { 
     assert_at(__FILE__,__LINE__) do
-      val[4].instance_of?(OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION) and val[5].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT) and val[7].instance_of?(OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY) 
+      val[4].instance_of?(OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION) and val[5].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT) and val[7].instance_of?(OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY) 
     end
     
@@ -154,5 +154,5 @@
 cadl_section: c_complex_object
   {
-    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)}
+    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT)}
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -167,5 +167,5 @@
 c_complex_object: c_complx_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
       c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
       c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
@@ -175,5 +175,5 @@
     | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
       c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
       c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
@@ -201,5 +201,5 @@
   | c_attributes
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => val[0])
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_COMPLEX_OBJECT.new(:attributes => val[0])
   }
 
@@ -224,5 +224,5 @@
   | archetype_internal_ref
   {
-    result = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref|
+    result = OpenEhr::AM::Archetype::ConstraintModel::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref|
       archetype_internal_ref.target_path = val[0][:absolute_path]
       archetype_internal_ref.rm_type_name = val[0][:type_identifier]
@@ -236,5 +236,5 @@
   | constraint_ref
   {
-    result = OpenEhr::AM::Archetype::Constraint_Model::CONSTRAINT_REF.create do |constraint_ref|
+    result = OpenEhr::AM::Archetype::ConstraintModel::CONSTRAINT_REF.create do |constraint_ref|
       constraint_ref.reference = val[0]
     end
@@ -300,5 +300,5 @@
 archetype_slot: c_archetype_slot_head SYM_MATCHES SYM_START_CBLOCK c_includes c_excludes SYM_END_CBLOCK
   {
-    result = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.create do |archetype_slot|
+    result = OpenEhr::AM::Archetype::ConstraintModel::ARCHETYPE_SLOT.create do |archetype_slot|
       archetype_slot.includes = val[3]
       archetype_slot.excludes = val[4]
@@ -322,6 +322,6 @@
 c_primitive_object: c_primitive
   {
-    assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)}
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.create do |c_primitive_object|
+    assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_PRIMITIVE)}
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_PRIMITIVE_OBJECT.create do |c_primitive_object|
       c_primitive_object.item = val[0]
     end
@@ -331,5 +331,5 @@
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.create do |c_integer|
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_INTEGER.create do |c_integer|
       c_integer.list
       c_integer.range
@@ -340,34 +340,34 @@
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_REAL.new
   }
   | c_date
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DATE.new
   }
   | c_time
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_TIME.new
   }
   | c_date_time
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DATE_TIME.new
   }
   | c_duration
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new
   }
   | c_string
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_STRING.new
   }
   | c_boolean
   {
-    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)}
+    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN)}
     @@logger.debug("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")
     result = val[0]
@@ -391,5 +391,5 @@
 c_attribute: c_attr_head SYM_MATCHES SYM_START_CBLOCK c_attr_values SYM_END_CBLOCK
   { 
-    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
+    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
     c_attribute = val[0]
     c_attribute.children = val[3]
@@ -398,10 +398,10 @@
   | c_attr_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi
   { 
-    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
+    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
     result = val[0]
   }
   | c_attr_head SYM_MATCHES SYM_START_CBLOCK error SYM_END_CBLOCK
   { 
-    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
+    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEhr::AM::Archetype::ConstraintModel::C_ATTRIBUTE)}
     result = val[0]
   }
@@ -411,5 +411,5 @@
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new(
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_SINGLE_ATTRIBUTE.new(
                                                                               :rm_attribute_name => val[0],
                                                                               :existence => val[1]
@@ -419,7 +419,7 @@
   | V_ATTRIBUTE_IDENTIFIER c_existence c_cardinality
   {
-    assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY) }
+    assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY) }
     @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}") 
-    result = OpenEhr::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(
+    result = OpenEhr::AM::Archetype::ConstraintModel::C_MULTIPLE_ATTRIBUTE.new(
                                                                                 :rm_attribute_name => val[0],
                                                                                 :existence => val[1],
@@ -481,5 +481,6 @@
 
 ### dADL section
-dadl_section: attr_vals
+dadl_section: # no dadl section
+    |  attr_vals
   {
     @@logger.debug("#{__FILE__}:#{__LINE__}:dadl_section attr_vals = \n#{val[0].to_yaml}")
@@ -1061,5 +1062,5 @@
 c_cardinality: SYM_CARDINALITY SYM_MATCHES SYM_START_CBLOCK cardinality_spec SYM_END_CBLOCK
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY.new
+    result = OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY.new
   }
 
@@ -1167,17 +1168,17 @@
 c_boolean_spec: SYM_TRUE
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true)
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true)
   }
   | SYM_FALSE
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false)
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false)
   }
   | SYM_TRUE Comma_code SYM_FALSE
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
   }
   | SYM_FALSE Comma_code SYM_TRUE
   { 
-    result = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
   }
 
@@ -1256,6 +1257,6 @@
 
 duration_pattern: V_ISO8601_DURATION_CONSTRAINT_PATTERN
-  { 
-    result = val[0]
+  {
+    result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new #val[0]
   }
 
Index: /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-CLUSTER.exam-uterus.v1.adl
===================================================================
--- /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-CLUSTER.exam-uterus.v1.adl	(revision 318)
+++ /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-CLUSTER.exam-uterus.v1.adl	(revision 318)
@@ -0,0 +1,293 @@
+archetype (adl_version=1.4)
+	openEHR-EHR-CLUSTER.exam-uterus.v1
+specialize
+	openEHR-EHR-CLUSTER.exam.v1
+
+concept
+	[at0000.1]	-- Examination of the uterus
+language
+	original_language = <[ISO_639-1::en]>
+description
+	original_author = <
+		["name"] = <"Sam Heard">
+		["organisation"] = <"Ocean Informatics">
+		["date"] = <"08/04/2007">
+		["email"] = <"sam.heard@oceaninformatics.biz">
+	>
+	details = <
+		["en"] = <
+			language = <[ISO_639-1::en]>
+			purpose = <"A cluster for recording findings on physical examination of the uterus.">
+			use = <"">
+			keywords = <"examination", "physical", "uterus", "pregnancy">
+			misuse = <"">
+		>
+	>
+	lifecycle_state = <"Initial">
+	other_contributors = <>
+
+definition
+	CLUSTER[at0000.1] matches {	-- Examination of the uterus
+		items cardinality matches {0..*; unordered} matches {
+			CLUSTER[at0004] occurrences matches {0..1} matches {	-- Normal statements
+				items cardinality matches {0..*; unordered} matches {
+					ELEMENT[at0005] occurrences matches {0..*} matches {	-- Normal statement
+						value matches {
+							DV_TEXT matches {*}
+						}
+					}
+				}
+			}
+			ELEMENT[at0002] occurrences matches {0..1} matches {	-- Clinical description
+				value matches {
+					DV_TEXT matches {*}
+				}
+			}
+			CLUSTER[at0008] occurrences matches {0..1} matches {	-- Findings
+				items cardinality matches {0..*; unordered} matches {
+					allow_archetype CLUSTER occurrences matches {0..*} matches {
+						include
+							archetype_id/value matches {/palpation\.v1draft/}
+							archetype_id/value matches {/inspection\.v1draft/}
+						exclude
+							archetype_id/value matches {/.*/}
+					}
+					ELEMENT[at0.24] occurrences matches {0..1} matches {	-- Position
+						value matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {
+									[local::
+									at0.26, 	-- Anteverted
+									at0.27]	-- Retroverted
+								}
+							}
+						}
+					}
+					CLUSTER[at0.1] occurrences matches {0..1} matches {	-- Size
+						items cardinality matches {0..*; unordered} matches {
+							ELEMENT[at0.2] occurrences matches {0..1} matches {	-- Fundal height
+								value matches {
+									C_DV_QUANTITY <
+										property = <[openehr::122]>
+										list = <
+											["1"] = <
+												units = <"cm">
+												magnitude = <|0.0..100.0|>
+												precision = <|1|>
+											>
+										>
+									>
+								}
+							}
+							allow_archetype CLUSTER occurrences matches {0..1} matches {
+								include
+									archetype_id/value matches {/dimensions\.v1/}
+									archetype_id/value matches {/size\.v1draft/}
+							}
+							ELEMENT[at0.3] occurrences matches {0..1} matches {	-- Weeks of gestation
+								value matches {
+									DV_DURATION matches {
+										value matches {PW}
+									}
+								}
+							}
+							ELEMENT[at0.20] occurrences matches {0..1} matches {	-- Relative to anatomical markers
+								value matches {
+									DV_CODED_TEXT matches {
+										defining_code matches {
+											[local::
+											at0.21, 	-- At symphisis pubis
+											at0.22, 	-- At umbilicus
+											at0.23]	-- At xiphisternum
+										}
+									}
+								}
+							}
+						}
+					}
+					ELEMENT[at0.4] occurrences matches {0..1} matches {	-- Assessment of liquor volume
+						value matches {
+							-3|[local::at0.5], 	-- Markedly reduced
+							-2|[local::at0.6], 	-- Reduced
+							-1|[local::at0.7], 	-- Slightly reduced
+							0|[local::at0.8], 	-- Normal
+							1|[local::at0.9], 	-- Slightly increased
+							2|[local::at0.10], 	-- Increased
+							3|[local::at0.11]  	-- Markedly increased
+						}
+					}
+					ELEMENT[at0.12] occurrences matches {0..1} matches {	-- Number of fetuses
+						value matches {
+							DV_COUNT matches {
+								magnitude matches {|>=0|}
+							}
+						}
+					}
+					CLUSTER[at0.18] occurrences matches {0..1} matches {	-- Fetus
+						items cardinality matches {1..*; unordered} matches {
+							allow_archetype CLUSTER occurrences matches {0..*} matches {
+								include
+									archetype_id/value matches {/exam-fetus\.v1/}
+							}
+						}
+					}
+					CLUSTER[at0003] occurrences matches {0..1} matches {	-- Detail
+						items cardinality matches {0..*; unordered} matches {
+							allow_archetype CLUSTER occurrences matches {0..1} matches {
+								include
+									archetype_id/value matches {/exam-generic\.v1/}
+							}
+						}
+					}
+				}
+			}
+			ELEMENT[at0006] occurrences matches {0..*} matches {	-- Image
+				value matches {
+					DV_MULTIMEDIA matches {
+						media_type matches {
+							[openEHR::
+							426, 
+							427, 
+							429]
+						}
+					}
+				}
+			}
+		}
+	}
+
+ontology
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0.1"] = <
+					description = <"Information about the size of the object for examination">
+					text = <"Size">
+				>
+				["at0.10"] = <
+					description = <"The amount of liquor is definitely increased">
+					text = <"Increased">
+				>
+				["at0.11"] = <
+					description = <"The amount of liquor is greatly increased compared to normal for gestation">
+					text = <"Markedly increased">
+				>
+				["at0.12"] = <
+					description = <"The number of foetuses that are in the uterus">
+					text = <"Number of fetuses">
+				>
+				["at0.18"] = <
+					description = <"Information about one or more foetuses">
+					text = <"Fetus">
+				>
+				["at0.19"] = <
+					description = <"An optional identifier of the fetus">
+					text = <"Identifier">
+				>
+				["at0.2"] = <
+					description = <"The height of the uterine fundus measured from the symphysis pubis">
+					text = <"Fundal height">
+				>
+				["at0.20"] = <
+					description = <"Relative size of uterus related to anatomy of person">
+					text = <"Relative to anatomical markers">
+				>
+				["at0.21"] = <
+					description = <"*">
+					text = <"At symphisis pubis">
+				>
+				["at0.22"] = <
+					description = <"*">
+					text = <"At umbilicus">
+				>
+				["at0.23"] = <
+					description = <"*">
+					text = <"At xiphisternum">
+				>
+				["at0.24"] = <
+					description = <"Position of uterus">
+					text = <"Position">
+				>
+				["at0.25"] = <
+					description = <"Position of uterus">
+					text = <"Position">
+				>
+				["at0.26"] = <
+					description = <"Uterine fundus is tipped forward">
+					text = <"Anteverted">
+				>
+				["at0.27"] = <
+					description = <"Uterine fundus is tipped backward">
+					text = <"Retroverted">
+				>
+				["at0.28"] = <
+					description = <"*">
+					text = <"New element">
+				>
+				["at0.3"] = <
+					description = <"The size in terms of weeks of pregnancy">
+					text = <"Weeks of gestation">
+				>
+				["at0.4"] = <
+					description = <"The relative amount of liquor present in the uterus">
+					text = <"Assessment of liquor volume">
+				>
+				["at0.5"] = <
+					description = <"The amount of liquor is much less than expected">
+					text = <"Markedly reduced">
+				>
+				["at0.6"] = <
+					description = <"The amount of liquor is definitely reduced">
+					text = <"Reduced">
+				>
+				["at0.7"] = <
+					description = <"The amount of liquor is slightly reduced">
+					text = <"Slightly reduced">
+				>
+				["at0.8"] = <
+					description = <"The amount of liquor is normal for gestation">
+					text = <"Normal">
+				>
+				["at0.9"] = <
+					description = <"The amount of liquor is slightly increased">
+					text = <"Slightly increased">
+				>
+				["at0000"] = <
+					description = <"Generic examination cluster for describing a finding on physical examination">
+					text = <"Examination">
+				>
+				["at0000.1"] = <
+					description = <"For recording findings of the uterus including when pregnant">
+					text = <"Examination of the uterus">
+				>
+				["at0001"] = <
+					description = <"The object of the examination">
+					text = <"Object">
+				>
+				["at0002"] = <
+					description = <"Textural description of the part examined">
+					text = <"Clinical description">
+				>
+				["at0003"] = <
+					description = <"More focused examination findings">
+					text = <"Detail">
+				>
+				["at0004"] = <
+					description = <"A group of statements about the normality of the examination">
+					text = <"Normal statements">
+				>
+				["at0005"] = <
+					description = <"A specific statement of normality">
+					text = <"Normal statement">
+				>
+				["at0006"] = <
+					description = <"Drawing or image of the area examined">
+					text = <"Image">
+				>
+				["at0008"] = <
+					description = <"Clinical findings">
+					text = <"Findings">
+				>
+			>
+		>
+	>
Index: /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl
===================================================================
--- /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl	(revision 317)
+++ /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl	(revision 318)
@@ -10,5 +10,5 @@
 		["name"] = <"Thomas Beale">
 		["organisation"] = <"Ocean Informatics">
-		["date"] = <"10/10/2005">
+		["date"] = <"2005-10-10">
 	>
 	details = <
Index: /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl
===================================================================
--- /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl	(revision 318)
+++ /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl	(revision 318)
@@ -0,0 +1,94 @@
+archetype (adl_version=1.4)
+	openEHR-EHR-ITEM_TREE.follow_up.v1draft
+
+concept
+	[at0000]	-- Follow up details
+language
+	original_language = <[ISO_639-1::en]>
+description
+	original_author = <
+		["name"] = <"unknown">
+	>
+	details = <
+		["en"] = <
+			language = <[ISO_639-1::en]>
+			purpose = <"">
+			use = <"">
+			misuse = <"">
+		>
+	>
+	lifecycle_state = <"0">
+	other_contributors = <>
+
+definition
+	ITEM_TREE[at0000] occurrences matches {0..*} matches {	-- Follow up details
+		items cardinality matches {1..*; unordered} matches {
+			ELEMENT[at0002] occurrences matches {0..1} matches {	-- Service
+				value matches {
+					DV_CODED_TEXT matches {
+						defining_code matches {[ac0001]}		-- A named service
+					}
+				}
+			}
+			ELEMENT[at0004] occurrences matches {0..1} matches {	-- Details
+				value matches {
+					DV_TEXT matches {*}
+				}
+			}
+			ELEMENT[at0003] occurrences matches {0..1} matches {	-- Appointment date and time
+				value matches {
+					DV_DATE_TIME matches {
+						value matches {yyyy-mm-ddTHH:MM:SS}
+					}
+				}
+			}
+		}
+	}
+
+ontology
+	terminologies_available = <"SNOMED-CT", ...>
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0000"] = <
+					description = <"Information about follow up">
+					text = <"Follow up details">
+				>
+				["at0002"] = <
+					description = <"The name of a service">
+					text = <"Service">
+				>
+				["at0003"] = <
+					description = <"The current active appointment date and time">
+					text = <"Appointment date and time">
+				>
+				["at0004"] = <
+					description = <"Details of the service">
+					text = <"Details">
+				>
+			>
+		>
+	>
+	constraint_definitions = <
+		["en"] = <
+			items = <
+				["ac0001"] = <
+					description = <"A service or professional group who will provide the follow-up">
+					text = <"A named service">
+				>
+			>
+		>
+	>
+	term_binding = <
+		["SNOMED-CT"] = <
+			items = <
+			>
+		>
+	>
+	constraint_binding = <
+		["SNOMED-CT"] = <
+			items = <
+				["ac0001"] = <http://openEHR.org/Services>
+			>
+		>
+	>
Index: /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl
===================================================================
--- /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl	(revision 318)
+++ /ruby/trunk/lib/adl_parser/test/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl	(revision 318)
@@ -0,0 +1,457 @@
+archetype (adl_version=1.4)
+	openEHR-EHR-ITEM_TREE.medication-formulation.v1
+specialize
+	openEHR-EHR-ITEM_TREE.medication.v1
+
+concept
+	[at0000.1]	-- Medication description involving a formulation
+language
+	original_language = <[ISO_639-1::en]>
+description
+	original_author = <
+		["name"] = <"Sam Heard">
+		["organisation"] = <"Ocean Informatics">
+		["date"] = <"12/03/2006">
+		["email"] = <"sam.heard@oceaninformatics.biz">
+	>
+	details = <
+		["en"] = <
+			language = <[ISO_639-1::en]>
+			purpose = <"Specifies the description of a formulation with more than one ingredient as part of an INSTRUCTION or ACTION recording. This will usually be in response to a medication order or prescription, but may be self administered or supplied by a pharmacy.">
+			use = <"For use with INSTRUCTION.medication and ACTION.medication to describe the formulation">
+			keywords = <"medication", "description", "formulation">
+			misuse = <"">
+		>
+	>
+	lifecycle_state = <"AuthorDraft">
+	other_contributors = <>
+
+definition
+	ITEM_TREE[at0000.1] occurrences matches {0..*} matches {	-- Medication description involving a formulation
+		items cardinality matches {0..*; ordered} matches {
+			ELEMENT[at0001.1] matches {	-- Name of formulation
+				value matches {
+					DV_TEXT matches {*}
+				}
+			}
+			CLUSTER[at0.32] occurrences matches {0..1} matches {	-- Ingredients
+				items cardinality matches {0..*; unordered} matches {
+					CLUSTER[at0.33] occurrences matches {1..*} matches {	-- Ingredient
+						items cardinality matches {0..*; unordered} matches {
+							ELEMENT[at0.34] occurrences matches {0..1} matches {	-- Name of ingredient
+								value matches {
+									DV_CODED_TEXT matches {
+										defining_code matches {[local::]}
+									}
+								}
+							}
+							ELEMENT[at0.35] occurrences matches {0..1} matches {	-- Quantity
+								value matches {
+									C_DV_QUANTITY <
+									>
+								}
+							}
+						}
+					}
+				}
+			}
+			ELEMENT[at0002] occurrences matches {0..1} matches {	-- Administration instructions
+				value matches {
+					DV_TEXT matches {*}
+				}
+			}
+			ELEMENT[at0003] occurrences matches {0..1} matches {	-- Strength per dose unit
+				value matches {
+					C_DV_QUANTITY <
+					>
+				}
+			}
+			ELEMENT[at0004] occurrences matches {0..1} matches {	-- Form
+				value matches {
+					DV_CODED_TEXT matches {
+						defining_code matches {[ac0000]}		-- Any term that 'is_a' form of medication
+					}
+				}
+			}
+			ELEMENT[at0005] occurrences matches {0..1} matches {	-- Dose
+				value matches {
+					DV_COUNT matches {
+						magnitude matches {|>=1|}
+					}
+					DV_INTERVAL<DV_COUNT> matches {
+						upper matches {
+							DV_COUNT matches {*}
+						}
+						lower matches {
+							DV_COUNT matches {
+								magnitude matches {|>=1|}
+							}
+						}
+					}
+				}
+			}
+			ELEMENT[at0006] occurrences matches {0..1} matches {	-- Dose unit
+				value matches {
+					DV_CODED_TEXT matches {
+						defining_code matches {[ac0001]}		-- any term that 'is a' Dose unit for this form
+					}
+				}
+			}
+			ELEMENT[at0007] occurrences matches {0..1} matches {	-- Dose duration
+				value matches {
+					C_DV_QUANTITY <
+					>
+				}
+			}
+			ELEMENT[at0008] occurrences matches {0..1} matches {	-- Route
+				value matches {
+					DV_CODED_TEXT matches {
+						defining_code matches {[ac0002]}		-- Any term that 'is_a' route of administration
+					}
+				}
+			}
+			ELEMENT[at0009] occurrences matches {0..1} matches {	-- Is long term
+				value matches {
+					DV_BOOLEAN matches {
+						value matches {True, False}
+					}
+				}
+			}
+			CLUSTER[at0010] occurrences matches {0..1} matches {	-- Indications
+				items cardinality matches {0..*; unordered} matches {
+					ELEMENT[at0011] occurrences matches {0..*} matches {	-- Indication
+						value matches {
+							DV_TEXT matches {*}
+							DV_URI matches {*}
+						}
+					}
+				}
+			}
+			ELEMENT[at0012] occurrences matches {0..1} matches {	-- Generic name
+				name matches {
+					DV_CODED_TEXT matches {
+						defining_code matches {[ac0003]}		-- =Generic name OR Brand name
+					}
+				}
+				value matches {
+					DV_TEXT matches {*}
+				}
+			}
+			CLUSTER[at0013] occurrences matches {0..1} matches {	-- Safety limits
+				items cardinality matches {1..4; ordered} matches {
+					ELEMENT[at0014] occurrences matches {0..1} matches {	-- Maximum dose unit frequency
+						value matches {
+							C_DV_QUANTITY <
+							>
+						}
+					}
+					ELEMENT[at0015] occurrences matches {0..1} matches {	-- Dosage per kg body weight
+						value matches {
+							DV_INTERVAL<DV_QUANTITY> matches {
+								upper matches {
+									C_DV_QUANTITY <
+										property = <[openehr::0]>
+									>
+								}
+								lower matches {
+									C_DV_QUANTITY <
+										property = <[openehr::0]>
+									>
+								}
+							}
+						}
+					}
+					ELEMENT[at0016] occurrences matches {0..1} matches {	-- Minimum dose interval
+						value matches {
+							C_DV_QUANTITY <
+							>
+						}
+					}
+					ELEMENT[at0017] occurrences matches {0..1} matches {	-- Maximum dose interval
+						value matches {
+							C_DV_QUANTITY <
+							>
+						}
+					}
+				}
+			}
+			CLUSTER[at0018] occurrences matches {0..1} matches {	-- Administration information
+				items cardinality matches {0..*; unordered} matches {
+					ELEMENT[at0019] occurrences matches {0..1} matches {	-- Date (time) of first administration
+						value matches {
+							DV_DATE_TIME matches {
+								value matches {yyyy-??-??T??:??:??}
+							}
+						}
+					}
+					ELEMENT[at0020] occurrences matches {0..1} matches {	-- Batch number
+						value matches {
+							DV_TEXT matches {*}
+						}
+					}
+					ELEMENT[at0021] occurrences matches {0..1} matches {	-- Site of administration
+						value matches {
+							DV_CODED_TEXT matches {
+								defining_code matches {[local::]}
+							}
+						}
+					}
+					ELEMENT[at0022] occurrences matches {0..1} matches {	-- Sequence number
+						value matches {
+							DV_COUNT matches {*}
+						}
+					}
+					ELEMENT[at0032] occurrences matches {0..1} matches {	-- Date (time) of last administration
+						value matches {
+							DV_DATE_TIME matches {
+								value matches {yyyy-??-??T??:??:??}
+							}
+						}
+					}
+				}
+			}
+			CLUSTER[at0023] occurrences matches {0..1} matches {	-- Dispensing information
+				items cardinality matches {0..*; unordered} matches {
+					ELEMENT[at0024] occurrences matches {0..1} matches {	-- Quantity to be dispensed
+						value matches {
+							C_DV_QUANTITY <
+							>
+							DV_COUNT matches {
+								magnitude matches {|>0|; 1}
+							}
+							DV_TEXT matches {*}
+						}
+					}
+					ELEMENT[at0025] occurrences matches {0..1} matches {	-- Number of authorised repeat dispensing
+						value matches {
+							DV_COUNT matches {
+								magnitude matches {|>=0|}
+							}
+						}
+					}
+					ELEMENT[at0026] occurrences matches {0..1} matches {	-- Dispensed product
+						value matches {
+							DV_TEXT matches {*}
+						}
+					}
+					ELEMENT[at0027] occurrences matches {0..1} matches {	-- Brand substitution allowed
+						value matches {
+							DV_BOOLEAN matches {
+								value matches {True, False}
+							}
+						}
+					}
+					ELEMENT[at0028] occurrences matches {0..1} matches {	-- Authority approval number
+						value matches {
+							DV_TEXT matches {*}
+						}
+					}
+					ELEMENT[at0029] occurrences matches {0..1} matches {	-- Patient counselled on CMI
+						value matches {
+							DV_BOOLEAN matches {
+								value matches {True, False}
+							}
+						}
+					}
+					ELEMENT[at0030] occurrences matches {0..1} matches {	-- Deferred supply
+						value matches {
+							DV_BOOLEAN matches {
+								value matches {True, False}
+							}
+						}
+					}
+					ELEMENT[at0031] occurrences matches {0..1} matches {	-- Reason for deferred supply
+						value matches {
+							DV_TEXT matches {*}
+						}
+					}
+				}
+			}
+		}
+	}
+
+ontology
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0.32"] = <
+					description = <"Ingredients in the formulation">
+					text = <"Ingredients">
+				>
+				["at0.33"] = <
+					description = <"An ingredient in a formulation">
+					text = <"Ingredient">
+				>
+				["at0.34"] = <
+					description = <"The name of one ingredient used in the formulation - may be coded">
+					text = <"Name of ingredient">
+				>
+				["at0.35"] = <
+					description = <"The quantity of the ingredient added to the formulation">
+					text = <"Quantity">
+				>
+				["at0000"] = <
+					description = <"The description of a medication for recording as part of an ACTION or INSTRUCTION">
+					text = <"Medication description">
+				>
+				["at0000.1"] = <
+					description = <"A recording of the details of the formulation as part of an ACTION or INSTRUCTION">
+					text = <"Medication description involving a formulation">
+				>
+				["at0001"] = <
+					description = <"The name of the intervention - which may be coded">
+					text = <"Name of medication">
+				>
+				["at0001.1"] = <
+					description = <"The name of the formulation - which may be coded">
+					text = <"Name of formulation">
+				>
+				["at0002"] = <
+					description = <"Detailed instructions about how to administer this medication">
+					text = <"Administration instructions">
+				>
+				["at0003"] = <
+					description = <"The strength of the medication">
+					text = <"Strength per dose unit">
+				>
+				["at0004"] = <
+					description = <"The form of the medication">
+					text = <"Form">
+				>
+				["at0005"] = <
+					description = <"The number of dose units to be taken at any time">
+					text = <"Dose">
+				>
+				["at0006"] = <
+					description = <"The dose unit that is given for this type of medication">
+					text = <"Dose unit">
+				>
+				["at0007"] = <
+					description = <"The time over which an individual dose is to be administered">
+					text = <"Dose duration">
+				>
+				["at0008"] = <
+					description = <"The route of administration">
+					text = <"Route">
+				>
+				["at0009"] = <
+					description = <"Included and set to true if this medication is to be used continuously or repeatedly over a significant period of time.">
+					text = <"Is long term">
+				>
+				["at0010"] = <
+					description = <"Indications including related problems and diagnoses, abnormal test results etc">
+					text = <"Indications">
+				>
+				["at0011"] = <
+					description = <"The indication for the intervention">
+					text = <"Indication">
+				>
+				["at0012"] = <
+					description = <"The generic name of the drug which is an alternative name to the name of medication">
+					text = <"Generic name">
+				>
+				["at0013"] = <
+					description = <"*">
+					text = <"Safety limits">
+				>
+				["at0014"] = <
+					description = <"The maximum number of dose units to be taken in a particular time">
+					text = <"Maximum dose unit frequency">
+				>
+				["at0015"] = <
+					description = <"The dose per kg of body weight">
+					text = <"Dosage per kg body weight">
+				>
+				["at0016"] = <
+					description = <"The minimum safe interval between doses">
+					text = <"Minimum dose interval">
+				>
+				["at0017"] = <
+					description = <"The maximum safe interval between doses">
+					text = <"Maximum dose interval">
+				>
+				["at0018"] = <
+					description = <"Information relating to the administration of the medication order">
+					text = <"Administration information">
+				>
+				["at0019"] = <
+					description = <"The date and time (if required) the medication is/was first administered">
+					text = <"Date (time) of first administration">
+				>
+				["at0020"] = <
+					description = <"Manufacturer's identification number">
+					text = <"Batch number">
+				>
+				["at0021"] = <
+					description = <"The site of administration e.g. outer thigh if intramuscular, via PEG if patient is nil orally">
+					text = <"Site of administration">
+				>
+				["at0022"] = <
+					description = <"The dose number or sequence">
+					text = <"Sequence number">
+				>
+				["at0023"] = <
+					description = <"Data relating to dispensing">
+					text = <"Dispensing information">
+				>
+				["at0024"] = <
+					description = <"The total quantity to be dispensed">
+					text = <"Quantity to be dispensed">
+				>
+				["at0025"] = <
+					description = <"The number of times this quantity of medication may be dispensed before a further prescription is required">
+					text = <"Number of authorised repeat dispensing">
+				>
+				["at0026"] = <
+					description = <"The name of the product dispensed">
+					text = <"Dispensed product">
+				>
+				["at0027"] = <
+					description = <"True if an alternative brand may be substituted when dispensing">
+					text = <"Brand substitution allowed">
+				>
+				["at0028"] = <
+					description = <"*">
+					text = <"Authority approval number">
+				>
+				["at0029"] = <
+					description = <"Dispenser counselled the patient with regard to the Consumer Medicines Information">
+					text = <"Patient counselled on CMI">
+				>
+				["at0030"] = <
+					description = <"True if the supply of the medication has been deferred">
+					text = <"Deferred supply">
+				>
+				["at0031"] = <
+					description = <"Information relating to the reason for deferred supply">
+					text = <"Reason for deferred supply">
+				>
+				["at0032"] = <
+					description = <"The date and time (if required) the medication is  to be administered for the last time">
+					text = <"Date (time) of last administration">
+				>
+			>
+		>
+	>
+	constraint_definitions = <
+		["en"] = <
+			items = <
+				["ac0000"] = <
+					description = <"Terms such as tablet, inhaler, liquid....">
+					text = <"Any term that 'is_a' form of medication">
+				>
+				["ac0001"] = <
+					description = <"A set of terms that describes the dose units for medication - which allow the dose to be expressed as a number">
+					text = <"any term that 'is a' Dose unit for this form">
+				>
+				["ac0002"] = <
+					description = <"The route by which the medication is administered">
+					text = <"Any term that 'is_a' route of administration">
+				>
+				["ac0003"] = <
+					description = <"*">
+					text = <"=Generic name OR Brand name">
+				>
+			>
+		>
+	>
Index: /ruby/trunk/lib/adl_parser/test/parser_test.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 317)
+++ /ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 318)
@@ -10,4 +10,12 @@
   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")
+    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")
@@ -108,11 +116,4 @@
   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-INSTRUCTION.medication.v1.adl be properly parsed" do
@@ -232,3 +233,27 @@
   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 317)
+++ /ruby/trunk/lib/adl_parser/test/remote_adl_test.rb	(revision 318)
@@ -2,8 +2,6 @@
 
 class RemoteADLTest < Test::Unit::TestCase
-  #http://www.openehr.org/wsvn/knowledge/archetypes/dev/adl/openehr/
   def setup
     @adls = []
-    doc = Hpricot( open("http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/").read )
     dirs = ["cluster/", "composition/", "element/", "entry/", "section/", "structure/"]
     dirs.each do |dir|
Index: /ruby/trunk/lib/adl_parser/test/scanner_test.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/test/scanner_test.rb	(revision 317)
+++ /ruby/trunk/lib/adl_parser/test/scanner_test.rb	(revision 318)
@@ -98,4 +98,11 @@
     end
   end
+
+  must "assert CADLScanner scanner scan V_ISO8601_DURATION_CONSTRAINT_PATTERN" do
+    @scanner.scan("PW") do |sym, val|
+      assert_equal :V_ISO8601_DURATION_CONSTRAINT_PATTERN,sym
+      assert_equal "PW",val
+    end
+  end
 end
 
@@ -124,4 +131,10 @@
       assert_equal "string",val
     end
+
+    @scanner.scan("\"2005-10-10\"") do |sym, val|
+      assert_equal :V_STRING,sym
+      assert_equal "2005-10-10",val
+    end
+
     @scanner.scan("\"1605E211E9BFB4093A72CCE7A9792FF9\"") do |sym, val|
       assert_equal :V_STRING,sym
@@ -129,3 +142,10 @@
     end
   end
+
+  must "assert DADLScanner scanner scan V_URI" do
+    @scanner.scan("http://openEHR.org/Services") do |sym, val|
+      assert_equal :V_URI,sym
+      assert_equal "http://openEHR.org/Services",val
+    end
+  end
 end
