Class: Verity::Resources::Policies
- Inherits:
-
Object
- Object
- Verity::Resources::Policies
- Defined in:
- lib/verity/resources/policies.rb
Instance Method Summary collapse
- #changes(since: nil, policy_id: nil, change_type: nil, cursor: nil, limit: 50) ⇒ Object
- #compare(procedure_codes:, policy_type: nil, jurisdictions: nil, idempotency_key: nil) ⇒ Object
- #get(policy_id, include: nil) ⇒ Object
-
#initialize(client) ⇒ Policies
constructor
A new instance of Policies.
- #list(q: nil, mode: 'keyword', policy_type: nil, jurisdiction: nil, payer: nil, status: 'active', icd10: nil, format: nil, cursor: nil, limit: 50, include: nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Policies
Returns a new instance of Policies.
6 7 8 |
# File 'lib/verity/resources/policies.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#changes(since: nil, policy_id: nil, change_type: nil, cursor: nil, limit: 50) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/verity/resources/policies.rb', line 45 def changes(since: nil, policy_id: nil, change_type: nil, cursor: nil, limit: 50) params = {} params[:since] = since if since params[:policy_id] = policy_id if policy_id params[:change_type] = change_type if change_type params[:cursor] = cursor if cursor params[:limit] = limit if limit @client.request(:get, '/policies/changes', params: params) end |
#compare(procedure_codes:, policy_type: nil, jurisdictions: nil, idempotency_key: nil) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/verity/resources/policies.rb', line 34 def compare(procedure_codes:, policy_type: nil, jurisdictions: nil, idempotency_key: nil) body = { procedure_codes: procedure_codes } body[:policy_type] = policy_type if policy_type body[:jurisdictions] = jurisdictions if jurisdictions headers = {} headers['X-Idempotency-Key'] = idempotency_key if idempotency_key @client.request(:post, '/policies/compare', body: body, headers: headers) end |
#get(policy_id, include: nil) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/verity/resources/policies.rb', line 27 def get(policy_id, include: nil) params = {} params[:include] = Array(include).join(',') if include @client.request(:get, "/policies/#{policy_id}", params: params) end |
#list(q: nil, mode: 'keyword', policy_type: nil, jurisdiction: nil, payer: nil, status: 'active', icd10: nil, format: nil, cursor: nil, limit: 50, include: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/verity/resources/policies.rb', line 10 def list(q: nil, mode: 'keyword', policy_type: nil, jurisdiction: nil, payer: nil, status: 'active', icd10: nil, format: nil, cursor: nil, limit: 50, include: nil) params = {} params[:q] = q if q params[:mode] = mode if mode params[:policy_type] = policy_type if policy_type params[:jurisdiction] = jurisdiction if jurisdiction params[:payer] = payer if payer params[:status] = status if status params[:icd10] = icd10 if icd10 params[:format] = format if format params[:cursor] = cursor if cursor params[:limit] = limit if limit params[:include] = Array(include).join(',') if include @client.request(:get, '/policies', params: params) end |