VerityVerity

Ruby SDK

Official Verity SDK for Ruby with resource-oriented API clients

The Verity Ruby SDK provides resource-oriented access to Medicare coverage intelligence, medical code lookup, policies, coverage criteria, prior authorization checks, spending data, and webhooks.

The Ruby SDK is not published to RubyGems yet. Install from source until the first package release is cut.

Installation

git clone https://github.com/backworkai/verity-ruby.git
cd verity-ruby
bundle install

Requires Ruby 2.7+.

Quick Start

require 'verity'

client = Verity::Client.new(api_key: 'vrt_live_YOUR_API_KEY')

health = client.health
puts health.dig('data', 'status')

Get your API key from the Developer Console.

Authentication

client = Verity::Client.new(
  api_key: ENV.fetch('VERITY_API_KEY'),
  base_url: 'https://verity.backworkai.com/api/v1'
)

Common Use Cases

Look Up a Medical Code

result = client.codes.lookup('76942', include: ['rvu', 'policies'])

data = result['data']
puts "#{data['code']}: #{data['description']}"
puts "Policies: #{data['policies']&.length || 0}"

Search Policies

result = client.policies.list(
  q: 'ultrasound guidance',
  mode: 'keyword',
  policy_type: 'LCD',
  jurisdiction: 'JM',
  limit: 10
)

result['data'].each do |policy|
  puts "#{policy['policy_id']}: #{policy['title']}"
end

Check Prior Authorization

result = client.prior_auth.check(
  procedure_codes: ['27447'],
  diagnosis_codes: ['M17.11'],
  state: 'TX',
  payer: 'Medicare'
)

data = result['data']
puts "PA required: #{data['pa_required']}"
puts "Reason: #{data['reason']}"

Resources

Last updated on

On this page