Sha256: 50daffd5ae22b967adcd599b272f554146b17142ffe8393851501367fb805507

Contents?: true

Size: 870 Bytes

Versions: 6

Compression:

Stored size: 870 Bytes

Contents

module HealthDataStandards
  module Export
    module QRDA
      module EntryTemplateResolver
        def hqmf_qrda_oid_map
          if @hqmf_qrda_oid_map.blank?
            template_id_file = File.expand_path('../hqmf-qrda-oids.json', __FILE__)
            @hqmf_qrda_oid_map = JSON.parse(File.read(template_id_file))  
          end
          @hqmf_qrda_oid_map
        end

        def qrda_oid_exist?(oid)
          hqmf_qrda_oid_map.any? {|map_tuple| map_tuple['qrda_oid'] == oid}
        end

        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

        alias :partial_for :qrda_oid_for_hqmf_oid

        extend self
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
health-data-standards-3.1.1 lib/health-data-standards/export/qrda/entry_template_resolver.rb
health-data-standards-3.1.0 lib/health-data-standards/export/qrda/entry_template_resolver.rb
health-data-standards-3.0.6 lib/health-data-standards/export/qrda/entry_template_resolver.rb
health-data-standards-3.0.5 lib/health-data-standards/export/qrda/entry_template_resolver.rb
health-data-standards-3.0.4 lib/health-data-standards/export/qrda/entry_template_resolver.rb
health-data-standards-3.0.3 lib/health-data-standards/export/qrda/entry_template_resolver.rb