Class: AquaIo::Api::Icd10

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

Overview

Returns an ICD-10 code.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Icd10

Returns a new instance of Icd10.



8
9
10
# File 'lib/aqua_io/api/icd10.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/icd10?q=:query’ GET

query - the search query string



50
51
52
53
54
55
# File 'lib/aqua_io/api/icd10.rb', line 50

def search_by_description(query, options = {})
  body = options.fetch(:query, {})
  body[:query] = query

  @client.get("codes/v1/icd10?q[description_cont]=#{query}", body, options)
end

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

Returns all codes whose name contains the search string.

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

query - the search query string



38
39
40
41
42
43
# File 'lib/aqua_io/api/icd10.rb', line 38

def search_by_name(query, options = {})
  body = options.fetch(:query, {})
  body[:query] = query

  @client.get("codes/v1/icd10?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/icd10?q=:query’ GET

query - the search query string



62
63
64
65
66
67
# File 'lib/aqua_io/api/icd10.rb', line 62

def search_by_name_or_description(query, options = {})
  body = options.fetch(:query, {})
  body[:query] = query

  @client.get("codes/v1/icd10?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. ‘R50-9’ for ‘R50.9’)

‘codes/v1/icd10/:code_name’ GET

code_name - name of code



26
27
28
29
30
31
# File 'lib/aqua_io/api/icd10.rb', line 26

def single_code(code_name, options = {})
  body = options.fetch(:query, {})
  body[:code_name] = code_name

  @client.get("codes/v1/icd10/#{code_name}", body, options)
end

#top_level_codes(options = {}) ⇒ Object

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

‘codes/v1/icd10’ GET



15
16
17
18
19
# File 'lib/aqua_io/api/icd10.rb', line 15

def top_level_codes(options = {})
  body = options.fetch(:query, {})

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