Class: QRDA::Util::QRDATemplateHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/util/qrda_template_helper.rb

Overview

General helpers for working with codes and code systems

Class Method Summary collapse

Class Method Details

.definition_for_template_id(hqmf_template_id, qrda_version = "r5") ⇒ Object



6
7
8
# File 'lib/util/qrda_template_helper.rb', line 6

def self.definition_for_template_id(hqmf_template_id, qrda_version = "r5")
  template_id_map(qrda_version)[hqmf_template_id]
end

.template_id_map(version) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/util/qrda_template_helper.rb', line 10

def self.template_id_map(version)
  if @id_map.blank?
    @id_map = {
      'r5_1' => JSON.parse(File.read(File.expand_path('qrdar5_1_template_oid_map.json', __dir__)))
    }
  end
  @id_map[version]
end