Sha256: 9ee20790114d058940620e7bb018d57a5acf256afd29e272414823fbc783e7ad

Contents?: true

Size: 923 Bytes

Versions: 27

Compression:

Stored size: 923 Bytes

Contents

module HealthDataStandards
  module Util
    # General helpers for working with codes and code systems
    class HQMFTemplateHelper
      
      def self.definition_for_template_id(template_id)
        template_id_map[template_id]
      end
      
      def self.template_id_map
        if @id_map.blank?
          template_id_file = File.expand_path('../hqmf_template_oid_map.json', __FILE__)
          @id_map = JSON.parse(File.read(template_id_file))  
        end
        @id_map
      end

      def self.template_id_by_definition_and_status(definition, status, negation=false)
        kv_pair = template_id_map.find {|k, v| v['definition'] == definition && 
                                               v['status'] == status && 
                                               v['negation'] == negation}
        if kv_pair
          kv_pair.first
        else
          nil
        end
      end
    end
  end
end


Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
health-data-standards-3.6.1 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.5.3 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.5.2 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.5.1 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.5.0 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.6 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.5 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.4 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.3 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.2 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.1 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.4.0 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.12 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.3.0 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.11 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.10 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.8 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.7 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.6 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.2.5 lib/health-data-standards/util/hqmf_template_helper.rb