Class: OpenEHR::Parser::XMLArchetypeParser

Inherits:
Base
  • Object
show all
Includes:
XMLConstraintParsing, XMLDomainTypeParsing, XMLPrimitiveParsing
Defined in:
lib/openehr/parser/xml_archetype_parser.rb

Overview

Reads the canonical openEHR ITS-XML archetype shape that XMLSerializer (lib/openehr/serializer/xml_serializer.rb) emits - see that file's header comment for how that shape was established as ground truth. Mirrors ADLParser#archetype's construction pattern (a small constructor-argument method per Archetype.new keyword) and shares the same constraint-tree readers as OPTParser via the 3 modules extracted in B3 (xml_constraint_parsing/xml_primitive_parsing/xml_domain_type_parsing).

Instance Attribute Summary

Attributes inherited from Base

#filename

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenEHR::Parser::Base

Instance Method Details

#parseObject



21
22
23
24
25
26
27
# File 'lib/openehr/parser/xml_archetype_parser.rb', line 21

def parse
  archetype
rescue OpenEHR::Parser::ParseError
  raise
rescue StandardError => e
  raise OpenEHR::Parser::ParseError, "invalid XML archetype (#{@filename}): #{e.class}: #{e.message}"
end