Sha256: 73e2ca86947c6fa9a860c1ba936c48901ee539b6eceea00468e59df5c070769a

Contents?: true

Size: 884 Bytes

Versions: 11

Compression:

Stored size: 884 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)
        pairs = template_id_map.select {|k, v| v['definition'] == definition && 
                                               v['status'] == status && 
                                               v['negation'] == negation}
        pairs.keys.first if pairs.present?
      end
    end
  end
end


Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
health-data-standards-3.0.6 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.0.5 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.0.4 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-3.0.3 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.2.1 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.2.0 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.1.4 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.1.3 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.1.2 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.1.1 lib/health-data-standards/util/hqmf_template_helper.rb
health-data-standards-2.1.0 lib/health-data-standards/util/hqmf_template_helper.rb