Module: QrdaGenerator::Export::EntryTemplateResolver
- Extended by:
- EntryTemplateResolver
- Included in:
- EntryTemplateResolver
- Defined in:
- lib/qrda_generator/export/entry_template_resolver.rb
Instance Method Summary collapse
- #hqmf_qrda_oid_map ⇒ Object
- #qrda_oid_exist?(oid) ⇒ Boolean
- #qrda_oid_for_hqmf_oid(hqmf_oid) ⇒ Object (also: #partial_for)
Instance Method Details
#hqmf_qrda_oid_map ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/qrda_generator/export/entry_template_resolver.rb', line 4 def hqmf_qrda_oid_map if @hqmf_qrda_oid_map.blank? template_id_file = File.('../hqmf-qrda-oids.json', __FILE__) @hqmf_qrda_oid_map = JSON.parse(File.read(template_id_file)) end @hqmf_qrda_oid_map end |
#qrda_oid_exist?(oid) ⇒ Boolean
12 13 14 |
# File 'lib/qrda_generator/export/entry_template_resolver.rb', line 12 def qrda_oid_exist?(oid) hqmf_qrda_oid_map.any? {|map_tuple| map_tuple['qrda_oid'] == oid} end |
#qrda_oid_for_hqmf_oid(hqmf_oid) ⇒ Object Also known as: partial_for
16 17 18 19 20 21 22 |
# File 'lib/qrda_generator/export/entry_template_resolver.rb', line 16 def qrda_oid_for_hqmf_oid(hqmf_oid) oid_tuple = hqmf_qrda_oid_map.find {|map_tuple| map_tuple['hqmf_oid'] == hqmf_oid } if oid_tuple.nil? puts "no qrda oid for #{hqmf_oid}" end oid_tuple['qrda_oid'] end |