Class: OpenEHR::Parser::OPTParser
- Defined in:
- lib/openehr/parser/opt_parser.rb
Constant Summary collapse
- TEMPLATE_LANGUAGE_CODE_PATH =
'/template/language/code_string'- TEMPLATE_LANGUAGE_TERM_ID_PATH =
'/template/language/terminology_id/value'- TEMPLATE_ID_PATH =
'/template/template_id/value'- UID_PATH =
'/template/uid/value'- CONCEPT_PATH =
'/template/concept'- DESC_ORIGINAL_AUTHOR_PATH =
'/template/description/original_author'- DESC_LIFECYCLE_STATE_PATH =
'/template/description/lifecycle_state'- DESC_DETAILS_LANGUAGE_TERM_ID_PATH =
'/template/description/details/language/terminology_id/value'- DESC_DETAILS_LANGUAGE_CODE_PATH =
'/template/description/details/language/code_string'- DESC_DETAILS_PURPOSE_PATH =
'/template/description/details/purpose'- DESC_DETAILS_KEYWORDS_PATH =
'/template/description/details/keywords'- DESC_DETAILS_USE_PATH =
'/template/description/details/use'- DESC_DETAILS_MISUSE_PATH =
'/template/description/details/misuse'- DESC_DETAILS_COPYRIGHT_PATH =
'/template/description/details/copyright'- DESC_OTHER_DETAILS_PATH =
'/template/description/other_details'- DEFINITION_PATH =
'/template/definition'- OCCURRENCE_PATH =
'/occurrences'
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from OpenEHR::Parser::Base
Instance Method Details
#parse ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/openehr/parser/opt_parser.rb', line 35 def parse @opt = Nokogiri::XML::Document.parse(File.open(@filename)) @opt.remove_namespaces! uid = build_uid defs = definition # Create operational template with archetype-compatible parameters OpenEHR::AM::Template::OperationalTemplate.new( uid: uid, concept: concept, original_language: language, description: description, template_id: template_id, archetype_id: template_id, # Use template_id as archetype_id for compatibility definition: defs, ontology: (@component_terminologies || {})[defs.archetype_id.value] || create_template_ontology, component_terminologies: @component_terminologies || {}, terminology_extracts: @component_terminologies || {}, adl_version: "1.4" ) end |