Index: ruby/trunk/lib/adl_parser/lib/adl_scanner.rb
===================================================================
--- ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 291)
+++ ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 307)
@@ -1,16 +1,16 @@
 require 'rubygems'
-require 'yaparc'
 require 'logger'
 require 'adl_parser.rb'
-require 'am.rb'
-require 'rm.rb'
+require 'open_ehr'
+#require 'am.rb'
+#require 'rm.rb'
 require 'util.rb'
 
 
-module OpenEHR
+module OpenEhr
   module ADL
     module Scanner
       LOGGER = Logger.new('log/scanner.log')
-      LOGGER.level = Logger::WARN
+      LOGGER.level = Logger::DEBUG
 
       class Base
@@ -33,5 +33,5 @@
         attr_accessor :adl_type, :lineno, :cadl_scanner, :dadl_scanner, :regex_scanner, :term_constraint_scanner
 
-        @@logger = OpenEHR::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')
+        @@logger = OpenEhr::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')
         RESERVED = {
           'archetype' => :SYM_ARCHETYPE,
@@ -85,5 +85,6 @@
               when /\A(\w+)-(\w+)-(\w+)\.(\w+)((?:-\w+)*)\.(v\w+)/   #V_ARCHETYPE_ID
                 object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6
-                archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
+                #archetype_id = OpenEhr::RM::Support::Identification::ArchetypeID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
+                archetype_id = OpenEhr::RM::Support::Identification::ArchetypeID.new(:concept_name => concept_name, :rm_name => rm_name, :rm_entity => rm_entity, :rm_originator => :rm_originator, :specialisation => specialisation, :version_id => version_id)
                 yield :V_ARCHETYPE_ID, archetype_id
               when /\A[a-z][a-zA-Z0-9_]*/
@@ -173,6 +174,6 @@
               when /\A\[([a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+)\]/ #V_QUALIFIED_TERM_CODE_REF form such as [ICD10AM(1998)::F23]
                 yield :V_QUALIFIED_TERM_CODE_REF, $1
-              when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
-                yield :V_LOCAL_TERM_CODE_REF, $&
+              when /\A\[([a-zA-Z0-9][a-zA-Z0-9._\-]*)\]/   #V_LOCAL_TERM_CODE_REF
+                yield :V_LOCAL_TERM_CODE_REF, $1
               when /\A\[/   # [
                 yield :Left_bracket_code, :Left_bracket_code
@@ -208,20 +209,20 @@
               data = $' # variable $' receives the string after the match
             when :dadl
-              dadl_scanner = OpenEHR::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
+              dadl_scanner = OpenEhr::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
               data = dadl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :cadl
-              cadl_scanner = OpenEHR::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
+              cadl_scanner = OpenEhr::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
               data = cadl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :regexp
-              regex_scanner = OpenEHR::ADL::Scanner::RegexScanner.new(@adl_type, @filename, @lineno)
+              regex_scanner = OpenEhr::ADL::Scanner::RegexScanner.new(@adl_type, @filename, @lineno)
               data = regex_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :term_constraint
-              term_constraint_scanner = OpenEHR::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
+              term_constraint_scanner = OpenEhr::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
               data = term_constraint_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -238,5 +239,6 @@
       # 
       class DADLScanner < Base
-        @@logger = OpenEHR::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')
+        attr_accessor :in_interval, :in_c_domain_type, :in_dblock
+        @@logger = OpenEhr::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')
         RESERVED = {
           'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
@@ -249,4 +251,5 @@
           @in_interval = false
           @in_c_domain_type = false
+          @in_dblock = true
         end
 
@@ -258,4 +261,5 @@
           until data.nil?  do
             @@logger.debug("#{@filename}:#{@lineno}: DADLScanner#scan:loop data = #{data.inspect}")
+            @@logger.debug("#{@filename}:#{@lineno}: DADLScanner#scan:loop self = \n#{self.to_yaml}")
             case @adl_type.last
             when :dadl
@@ -297,12 +301,16 @@
                 if @in_interval
                   yield :SYM_GT, :SYM_GT
+#                 elsif @in_dblock == true
+#                   @in_dblock = false
+#                   yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
                 elsif @in_c_domain_type == true
                   assert_at(__FILE__,__LINE__){@adl_type.last == :dadl}
                   adl_type = @adl_type.pop
-                  if @adl_type.last == :cadl
+                  if adl_type == :dadl
                     @in_c_domain_type = false
-                    yield :END_V_C_DOMAIN_TYPE_BLOCK, $&
+                    yield :END_V_C_DOMAIN_TYPE_BLOCK, :END_V_C_DOMAIN_TYPE_BLOCK
+#                    yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
                   else
-                    yield :SYM_END_DBLOCK, $&
+                    yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
                   end
                 elsif @in_c_domain_type == false
@@ -392,15 +400,15 @@
               data = $' # variable $' receives the string after the match
             when :adl
-              adl_scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
+              adl_scanner = OpenEhr::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
               data = adl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :cadl
-              cadl_scanner = OpenEHR::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
+              cadl_scanner = OpenEhr::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
               data = cadl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :regexp
-              regex_scanner = OpenEHR::ADL::Scanner::RegexScanner.new(@adl_type, @filename, @lineno)
+              regex_scanner = OpenEhr::ADL::Scanner::RegexScanner.new(@adl_type, @filename, @lineno)
               data = regex_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -408,5 +416,5 @@
             when :term_constraint
               @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
-              term_constraint_scanner = OpenEHR::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
+              term_constraint_scanner = OpenEhr::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
               data = term_constraint_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -423,5 +431,5 @@
       class CADLScanner < Base
 
-        @@logger = OpenEHR::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')        #Logger.new('log/scanner.log')
+        @@logger = OpenEhr::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')        #Logger.new('log/scanner.log')
         RESERVED = {
           'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
@@ -568,6 +576,6 @@
                 @adl_type.push(:term_constraint)
                 yield :START_TERM_CODE_CONSTRAINT, $1
-              when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
-                yield :V_LOCAL_TERM_CODE_REF, $&
+              when /\A\[([a-zA-Z0-9][a-zA-Z0-9._\-]*)\]/   #V_LOCAL_TERM_CODE_REF
+                yield :V_LOCAL_TERM_CODE_REF, $1
               when /\A\[/   # [
                 yield :Left_bracket_code, :Left_bracket_code
@@ -595,4 +603,8 @@
                   yield :V_ATTRIBUTE_IDENTIFIER, word #V_ATTRIBUTE_IDENTIFIER /\A[a-z][a-zA-Z0-9_]*/
                 end
+              when /\A([A-Z][a-zA-Z0-9_]*)[ \n]*\</ # V_C_DOMAIN_TYPE
+                @in_c_domain_type = true
+                @adl_type.push(:dadl)
+                yield  :START_V_C_DOMAIN_TYPE_BLOCK, $1
               when /\A[A-Z][a-zA-Z0-9_]*/
                 word = $&.dup
@@ -624,19 +636,20 @@
                 yield :UTF8CHAR, $&
               when /\A.+/ #
-                raise OpenEHR::ADL::Exception::CADLScanner::Base.new, "can't handle #{data.inspect}"
+                raise OpenEhr::ADL::Exception::CADLScanner::Base.new, "can't handle #{data.inspect}"
               end
               data = $' # variable $' receives the string after the match
             when :adl
-              adl_scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
+              adl_scanner = OpenEhr::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
               data = adl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :dadl
-              dadl_scanner = OpenEHR::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
+              dadl_scanner = OpenEhr::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
+              dadl_scanner.in_c_domain_type = @in_c_domain_type
               data = dadl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :regexp
-              regex_scanner = OpenEHR::ADL::Scanner::RegexScanner.new(@adl_type, @filename, @lineno)
+              regex_scanner = OpenEhr::ADL::Scanner::RegexScanner.new(@adl_type, @filename, @lineno)
               data = regex_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -644,10 +657,10 @@
             when :term_constraint
               @@logger.debug("Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
-              term_constraint_scanner = OpenEHR::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
+              term_constraint_scanner = OpenEhr::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
               data = term_constraint_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             else
-              raise OpenEHR::ADL::Exception::CADLScanner.new, "unexpected adl_type: #{@adl_type.last}"
+              raise OpenEhr::ADL::Exception::CADLScanner.new, "unexpected adl_type: #{@adl_type.last}"
             end
           end # of until
@@ -661,5 +674,5 @@
       class RegexScanner < Base
 
-        @@logger = OpenEHR::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')        #Logger.new('log/scanner.log')
+        @@logger = OpenEhr::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')        #Logger.new('log/scanner.log')
         
         def initialize(adl_type, filename, lineno = 1)
@@ -695,15 +708,15 @@
               data = $' # variable $' receives the string after the match
             when :adl
-              adl_scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
+              adl_scanner = OpenEhr::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
               data = adl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :dadl
-              dadl_scanner = OpenEHR::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
+              dadl_scanner = OpenEhr::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
               data = dadl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :cadl
-              cadl_scanner = OpenEHR::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
+              cadl_scanner = OpenEhr::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
               data = cadl_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -711,5 +724,5 @@
             when :term_constraint
               #@@logger.debug("#{__FILE__}:#{__LINE__}: scan_regexp: Entering scan_term_constraint at #{@filename}:#{@lineno}")
-              term_constraint_scanner = OpenEHR::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
+              term_constraint_scanner = OpenEhr::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename, @lineno)
               data = term_constraint_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -726,5 +739,5 @@
       # 
       class TermConstraintScanner < Base
-        @@logger = OpenEHR::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')        #Logger.new('log/scanner.log')
+        @@logger = OpenEhr::ADL::Scanner::LOGGER #Logger.new('log/scanner.log')        #Logger.new('log/scanner.log')
         def initialize(adl_type, filename, lineno = 1)
           super(adl_type, filename, lineno)
@@ -759,15 +772,15 @@
               data = $' # variable $' receives the string after the match
             when :adl
-              adl_scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
+              adl_scanner = OpenEhr::ADL::Scanner::ADLScanner.new(@adl_type, @filename, @lineno)
               data = adl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :dadl
-              dadl_scanner = OpenEHR::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
+              dadl_scanner = OpenEhr::ADL::Scanner::DADLScanner.new(@adl_type, @filename, @lineno)
               data = dadl_scanner.scan(data) do |sym, val|
                 yield sym, val
               end
             when :cadl
-              cadl_scanner = OpenEHR::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
+              cadl_scanner = OpenEhr::ADL::Scanner::CADLScanner.new(@adl_type, @filename, @lineno)
               data = cadl_scanner.scan(data) do |sym, val|
                 yield sym, val
@@ -794,5 +807,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/[ \t\n]*\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/)) do |match|
-#                 OpenEHR::LOG.info("START_TERM_CODE_CONSTRAINT: #{match}")
+#                 OpenEhr::LOG.info("START_TERM_CODE_CONSTRAINT: #{match}")
 #                 [:START_TERM_CODE_CONSTRAINT, match]
 #               end
@@ -807,5 +820,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/)) do |match|
-#                 OpenEHR::LOG.info("V_QUALIFIED_TERM_CODE_REF: #{match}")
+#                 OpenEhr::LOG.info("V_QUALIFIED_TERM_CODE_REF: #{match}")
 #                 [:V_QUALIFIED_TERM_CODE_REF, match]
 #               end
@@ -819,5 +832,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/)) do |match|
-#                 OpenEHR::LOG.info("V_TERM_CODE_REF: #{match}")
+#                 OpenEhr::LOG.info("V_TERM_CODE_REF: #{match}")
 #                 [:V_LOCAL_TERM_CODE_REF, match]
 #               end
@@ -831,5 +844,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/)) do |match|
-#                 OpenEHR::LOG.info("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
+#                 OpenEhr::LOG.info("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
 #                 [:ERR_V_QUALIFIED_TERM_CODE_REF, match]
 #               end
@@ -843,5 +856,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*/)) do |match|
-#                 OpenEHR::LOG.info("V_TYPE_IDENTIFIER: #{match}")
+#                 OpenEhr::LOG.info("V_TYPE_IDENTIFIER: #{match}")
 #                 [:V_TYPE_IDENTIFIER, match]
 #               end
@@ -855,5 +868,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/)) do |match|
-#                 OpenEHR::LOG.info("V_GENERIC_TYPE_IDENTIFIER: #{match}")
+#                 OpenEhr::LOG.info("V_GENERIC_TYPE_IDENTIFIER: #{match}")
 #                 [:V_GENERIC_TYPE_IDENTIFIER, match]
 #               end
@@ -868,5 +881,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\Aa[ct][0-9.]+/)) do |match|
-#                 OpenEHR::LOG.info("V_LOCAL_CODE: #{match}")
+#                 OpenEhr::LOG.info("V_LOCAL_CODE: #{match}")
 #                 [:V_LOCAL_CODE, match]
 #               end
@@ -880,5 +893,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A"([^"]*)"/m)) do |match|
-#                 OpenEHR::LOG.info("V_STRING: #{match}")
+#                 OpenEhr::LOG.info("V_STRING: #{match}")
 #                 [:V_STRING, match]
 #               end
@@ -892,5 +905,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+/)) do |match|
-#                 OpenEHR::LOG.info("V_REAL: #{match}")
+#                 OpenEhr::LOG.info("V_REAL: #{match}")
 #                 [:V_REAL, match]
 #               end
@@ -907,5 +920,5 @@
 #                                 Yaparc::Alt.new(Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?T([0-9]+|[hH])?([0-9]+|[mM])?([0-9]+|[sS])?/),
 #                                                 Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?/))) do |match|
-#                 OpenEHR::LOG.info("V_ISO8601_DURATION: #{match}")
+#                 OpenEhr::LOG.info("V_ISO8601_DURATION: #{match}")
 #                 [:V_ISO8601_DURATION, match]
 #               end
@@ -931,14 +944,14 @@
 #             @parser = lambda do |input|
 #               Yaparc::Alt.new(Reserved.new,
-#                               OpenEHR::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEHR::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
-#                               OpenEHR::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEHR::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
-#                               OpenEHR::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
-#                               OpenEHR::ADL::Scanner::Common::V_STRING.new,
-#                               OpenEHR::ADL::Scanner::Common::V_LOCAL_CODE.new,
-#                               OpenEHR::ADL::Scanner::Common::V_REAL.new,
-#                               OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
-#                               #OpenEHR::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
+#                               OpenEhr::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
+#                               OpenEhr::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
+#                               OpenEhr::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
+#                               OpenEhr::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
+#                               OpenEhr::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
+#                               OpenEhr::ADL::Scanner::Common::V_STRING.new,
+#                               OpenEhr::ADL::Scanner::Common::V_LOCAL_CODE.new,
+#                               OpenEhr::ADL::Scanner::Common::V_REAL.new,
+#                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
+#                               #OpenEhr::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
 #                               )
 #             end
@@ -952,5 +965,5 @@
 #           def initialize
 #             @parser = lambda do |input|
-#               reserved_parsers = OpenEHR::ADL::Scanner::DADL::RESERVED.map do |keyword| 
+#               reserved_parsers = OpenEhr::ADL::Scanner::DADL::RESERVED.map do |keyword| 
 #                 Yaparc::Tokenize.new(
 #                                      Yaparc::Literal.new(keyword[0],false)
@@ -958,9 +971,9 @@
 #               end
 #               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
-#                                 OpenEHR::LOG.info("Reserved: #{match}")
-#                                 [OpenEHR::ADL::Scanner::DADL::RESERVED[match], OpenEHR::ADL::Scanner::DADL::RESERVED[match]]
+#                                 OpenEhr::LOG.info("Reserved: #{match}")
+#                                 [OpenEhr::ADL::Scanner::DADL::RESERVED[match], OpenEhr::ADL::Scanner::DADL::RESERVED[match]]
 #                               end,
 #                               Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
-#                                 OpenEHR::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
+#                                 OpenEhr::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
 #                                 [:V_ATTRIBUTE_IDENTIFIER, match]
 #                               end)
@@ -1007,5 +1020,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X][T\t][hH?X][hH?X]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
-#                 OpenEHR::LOG.info("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
+#                 OpenEhr::LOG.info("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
 #                 [:V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, match]
 #               end
@@ -1020,5 +1033,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/)) do |match|
-#                 OpenEHR::LOG.info("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
+#                 OpenEhr::LOG.info("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
 #                 [:V_ISO8601_DATE_CONSTRAINT_PATTERN, match]
 #               end
@@ -1033,5 +1046,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
-#                 OpenEHR::LOG.info("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
+#                 OpenEhr::LOG.info("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
 #                 [:V_ISO8601_TIME_CONSTRAINT_PATTERN, match]
 #               end
@@ -1047,5 +1060,5 @@
 #               Yaparc::Apply.new(Yaparc::Alt.new(Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?T[hH]?[mM]?[sS]?/),
 #                                                 Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?/))) do |match|
-#                 OpenEHR::LOG.info("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
+#                 OpenEhr::LOG.info("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
 #                 [:V_ISO8601_DURATION_CONSTRAINT_PATTERN, match]
 #               end
@@ -1060,5 +1073,5 @@
 #             @parser = lambda do |input|
 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*[ \n]*\</)) do |match|
-#                 OpenEHR::LOG.info("V_C_DOMAIN_TYPE: #{match}")
+#                 OpenEhr::LOG.info("V_C_DOMAIN_TYPE: #{match}")
 #                 [:START_V_C_DOMAIN_TYPE_BLOCK, match]
 #               end
@@ -1077,18 +1090,18 @@
 #                               V_ISO8601_DATE_CONSTRAINT_PATTERN.new,
 #                               V_ISO8601_TIME_CONSTRAINT_PATTERN.new,
-#                               OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new,
+#                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new,
 #                               V_C_DOMAIN_TYPE.new,
 #                               V_ISO8601_DURATION_CONSTRAINT_PATTERN.new,
 #                               Reserved.new,
-#                               OpenEHR::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEHR::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
-#                               OpenEHR::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEHR::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
-#                               OpenEHR::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
-#                               OpenEHR::ADL::Scanner::Common::V_STRING.new,
-#                               OpenEHR::ADL::Scanner::Common::V_LOCAL_CODE.new,
-#                               OpenEHR::ADL::Scanner::Common::V_REAL.new,
-#                               OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
-#                               #OpenEHR::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
+#                               OpenEhr::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
+#                               OpenEhr::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
+#                               OpenEhr::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
+#                               OpenEhr::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
+#                               OpenEhr::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
+#                               OpenEhr::ADL::Scanner::Common::V_STRING.new,
+#                               OpenEhr::ADL::Scanner::Common::V_LOCAL_CODE.new,
+#                               OpenEhr::ADL::Scanner::Common::V_REAL.new,
+#                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
+#                               #OpenEhr::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
 #                               )
 #             end
@@ -1107,9 +1120,9 @@
 #               end
 #               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
-#                                 OpenEHR::LOG.info("Reserved: #{match}")
-#                                 [OpenEHR::ADL::Scanner::CADL::RESERVED[match], OpenEHR::ADL::Scanner::CADL::RESERVED[match]]
+#                                 OpenEhr::LOG.info("Reserved: #{match}")
+#                                 [OpenEhr::ADL::Scanner::CADL::RESERVED[match], OpenEhr::ADL::Scanner::CADL::RESERVED[match]]
 #                               end,
 #                               Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
-#                                 OpenEHR::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
+#                                 OpenEhr::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
 #                                 [:V_ATTRIBUTE_IDENTIFIER, match]
 #                               end)
