Class: AquaIo::Api::Icd9

Inherits:
Object
  • Object
show all
Defined in:
lib/aqua_io/api/icd9.rb

Overview

Returns an ICD-9 code.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Icd9

Returns a new instance of Icd9.



8
9
10
# File 'lib/aqua_io/api/icd9.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#search_by_description(query, options = {}) ⇒ Object

Returns all codes whose description contains the search string.

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

query - the search query string



50
51
52
53
54
55
# 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 = {}) ⇒ Object

Returns all codes whose name contains the search string.

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

query - the search query string



38
39
40
41
42
43
# 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 = {}) ⇒ Object

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

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

query - the search query string



62
63
64
65
66
67
# 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 = {}) ⇒ Object

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



26
27
28
29
30
31
# 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 = {}) ⇒ Object

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



15
16
17
18
19
# 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