class AquaIo::Api::Icd9

Returns an ICD-9 code.

Public Class Methods

new(client) click to toggle source
# File lib/aqua_io/api/icd9.rb, line 8
def initialize(client)
  @client = client
end

Public Instance Methods

search_by_description(query, options = {}) click to toggle source

Returns all codes whose description contains the search string.

codes/v1/icd9?q=:query’ GET

query - the search query string

# File lib/aqua_io/api/icd9.rb, line 50
def search_by_description(query, options = {})
  body = options.fetch(:query, {})
  body[:query] = query

  @client.get("codes/v1/icd9?q[description_cont]=#{query}", body, options)
end
search_by_name(query, options = {}) click to toggle source

Returns all codes whose name contains the search string.

codes/v1/icd9?q=:query’ GET

query - the search query string

# File lib/aqua_io/api/icd9.rb, line 38
def search_by_name(query, options = {})
  body = options.fetch(:query, {})
  body[:query] = query

  @client.get("codes/v1/icd9?q[name_cont]=#{query}", body, options)
end
search_by_name_or_description(query, options = {}) click to toggle source

Returns all codes whose name or description contains the search string.

codes/v1/icd9?q=:query’ GET

query - the search query string

# File lib/aqua_io/api/icd9.rb, line 62
def search_by_name_or_description(query, options = {})
  body = options.fetch(:query, {})
  body[:query] = query

  @client.get("codes/v1/icd9?q[name_or_description_cont]=#{query}", body, options)
end
single_code(code_name, options = {}) click to toggle source

Returns a single code matching the name, if any exists. Replace periods with hypens (e.g. ‘066-4’ for ‘066.4’)

‘codes/v1/icd9/:code_name’ GET

code_name - name of code

# File lib/aqua_io/api/icd9.rb, line 26
def single_code(code_name, options = {})
  body = options.fetch(:query, {})
  body[:code_name] = code_name

  @client.get("codes/v1/icd9/#{code_name}", body, options)
end
top_level_codes(options = {}) click to toggle source

Returns all top-level ICD-9 codes. Useful for helping a user navigate down the ICD-9 hierarchy to find a code.

‘codes/v1/icd9’ GET

# File lib/aqua_io/api/icd9.rb, line 15
def top_level_codes(options = {})
  body = options.fetch(:query, {})

  @client.get("codes/v1/icd9", body, options)
end