Skip to main content

Authorization Numbers

Some payers require us to ask for a prior authorization number before submitting a claim. This process involves sending a request to the payer, and receiving a response through Fax with an authorization number, a date range range with its validity, and the number of times it can be used.

Authorization Number persistance

finance_authorization_numbers

NameTypeNullable
chart_iduuid (charts)No
authorized_servicestringNo
valid_fromdateNo
valid_todateYes
initial_usesintYes
remaining_usesintYes
codestringNo
authorization_typestringYes

Notes

service_type: is a Rails enum, with possible values encounter and outreach. authorization_type: Rails enum, with possible values post_service and pre_service. valid_to: can be null if the authorization code does not expire. initial_uses: can be null if the authorization code has unlimited uses.

Add new FK ref to finance_claims:

NameTypeNullable
finance_authorization_numbers_iduuid (finance_authorization_numbers)Yes

Usage

class Finance::AuthorizationNumber < ApplicationRecord
scope :valid_at, ->(date) { ... }
scope :usable_in, ->(claim) { ... }

def use_in(claim)
self.remaining_uses -= 1 if remaining_uses.present?
claim.authorization_number = self
save!
end
end

Related code: