class HealthDataStandards::Util::CodeSystemHelper

General helpers for working with codes and code systems

Constants

CODE_SYSTEMS
CODE_SYSTEM_ALIASES
OID_ALIASES

Some old OID are still around in data, this hash maps retired OID values to the new value

Public Class Methods

code_system_for(oid) click to toggle source

Returns the name of a code system given an oid @param [String] oid of a code system @return [String] the name of the code system as described in the measure definition JSON

# File lib/health-data-standards/util/code_system_helper.rb, line 56
def self.code_system_for(oid)
  oid = OID_ALIASES[oid] if OID_ALIASES[oid]
  CODE_SYSTEMS[oid] || "Unknown"
end
code_systems() click to toggle source

Returns the whole map of OIDs to code systems @terurn [Hash] oids as keys, code system names as values

# File lib/health-data-standards/util/code_system_helper.rb, line 71
def self.code_systems
  CODE_SYSTEMS
end
oid_for_code_system(code_system) click to toggle source

Returns the oid for a code system given a codesystem name @param [String] the name of the code system @return [String] the oid of the code system

# File lib/health-data-standards/util/code_system_helper.rb, line 64
def self.oid_for_code_system(code_system)
  code_system = CODE_SYSTEM_ALIASES[code_system] if CODE_SYSTEM_ALIASES[code_system]
  CODE_SYSTEMS.invert[code_system]
end