daisybill_api 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +6 -6
  3. data/lib/daisybill_api.rb +5 -5
  4. data/lib/daisybill_api/configuration.rb +3 -3
  5. data/lib/daisybill_api/data.rb +2 -2
  6. data/lib/daisybill_api/data/client.rb +18 -12
  7. data/lib/daisybill_api/data/url.rb +2 -2
  8. data/lib/daisybill_api/ext.rb +5 -5
  9. data/lib/daisybill_api/ext/associations.rb +1 -0
  10. data/lib/daisybill_api/ext/attributes.rb +2 -2
  11. data/lib/daisybill_api/ext/attributes/type_castings.rb +10 -4
  12. data/lib/daisybill_api/ext/crud.rb +12 -11
  13. data/lib/daisybill_api/ext/crud/create.rb +2 -2
  14. data/lib/daisybill_api/ext/crud/update.rb +1 -1
  15. data/lib/daisybill_api/ext/crud/write_off.rb +11 -0
  16. data/lib/daisybill_api/ext/links.rb +3 -3
  17. data/lib/daisybill_api/ext/links/link.rb +2 -2
  18. data/lib/daisybill_api/models.rb +31 -26
  19. data/lib/daisybill_api/models/attachment.rb +3 -2
  20. data/lib/daisybill_api/models/base.rb +1 -1
  21. data/lib/daisybill_api/models/bill.rb +23 -10
  22. data/lib/daisybill_api/models/bill_mailing_address.rb +16 -0
  23. data/lib/daisybill_api/models/bill_payment.rb +6 -5
  24. data/lib/daisybill_api/models/bill_submission.rb +2 -2
  25. data/lib/daisybill_api/models/billing_provider.rb +10 -10
  26. data/lib/daisybill_api/models/claim_adjustment_reason.rb +11 -0
  27. data/lib/daisybill_api/models/claims_administrator.rb +2 -1
  28. data/lib/daisybill_api/models/contact.rb +19 -11
  29. data/lib/daisybill_api/models/error_report.rb +30 -0
  30. data/lib/daisybill_api/models/injury.rb +1 -0
  31. data/lib/daisybill_api/models/paper_eor.rb +6 -3
  32. data/lib/daisybill_api/models/patient.rb +4 -3
  33. data/lib/daisybill_api/models/payer.rb +3 -1
  34. data/lib/daisybill_api/models/pharmacy_bill.rb +20 -8
  35. data/lib/daisybill_api/models/place_of_service.rb +4 -3
  36. data/lib/daisybill_api/models/prescribing_provider.rb +2 -2
  37. data/lib/daisybill_api/models/referring_provider.rb +2 -2
  38. data/lib/daisybill_api/models/remittance.rb +3 -3
  39. data/lib/daisybill_api/models/rendering_provider.rb +2 -2
  40. data/lib/daisybill_api/models/request_for_second_review.rb +3 -3
  41. data/lib/daisybill_api/models/service_line_item_payment.rb +14 -0
  42. data/lib/daisybill_api/models/task.rb +26 -0
  43. data/lib/daisybill_api/models/user.rb +16 -0
  44. data/lib/daisybill_api/version.rb +1 -1
  45. data/spec/daisybill_api/configuration_spec.rb +3 -3
  46. data/spec/daisybill_api/data/client_spec.rb +44 -38
  47. data/spec/daisybill_api/data/rest_client/payload_spec.rb +6 -6
  48. data/spec/daisybill_api/data/url_spec.rb +6 -6
  49. data/spec/daisybill_api/ext/attributes/attribute_spec.rb +32 -32
  50. data/spec/daisybill_api/ext/attributes/type_castings_spec.rb +22 -18
  51. data/spec/daisybill_api/ext/links/link_spec.rb +15 -15
  52. data/spec/daisybill_api/ext/pageable_collection_spec.rb +1 -1
  53. data/spec/daisybill_api/models/address_spec.rb +1 -1
  54. data/spec/daisybill_api/models/attachment_spec.rb +3 -3
  55. data/spec/daisybill_api/models/bill_mailing_address_spec.rb +6 -0
  56. data/spec/daisybill_api/models/bill_payment_spec.rb +5 -3
  57. data/spec/daisybill_api/models/bill_spec.rb +6 -4
  58. data/spec/daisybill_api/models/bill_submission_spec.rb +2 -2
  59. data/spec/daisybill_api/models/billing_provider_spec.rb +2 -2
  60. data/spec/daisybill_api/models/claim_number_verification_spec.rb +1 -1
  61. data/spec/daisybill_api/models/claims_administrator_spec.rb +3 -2
  62. data/spec/daisybill_api/models/contact_spec.rb +29 -3
  63. data/spec/daisybill_api/models/disputed_service_spec.rb +1 -1
  64. data/spec/daisybill_api/models/employer_spec.rb +1 -1
  65. data/spec/daisybill_api/models/error_report_spec.rb +10 -0
  66. data/spec/daisybill_api/models/injury_spec.rb +2 -1
  67. data/spec/daisybill_api/models/paper_eor_spec.rb +4 -3
  68. data/spec/daisybill_api/models/patient_spec.rb +4 -4
  69. data/spec/daisybill_api/models/payer_spec.rb +3 -2
  70. data/spec/daisybill_api/models/{pharamcy_bill_spec.rb → pharmacy_bill_spec.rb} +7 -6
  71. data/spec/daisybill_api/models/place_of_service_spec.rb +5 -5
  72. data/spec/daisybill_api/models/prescribing_provider_spec.rb +2 -2
  73. data/spec/daisybill_api/models/referring_provider_spec.rb +2 -2
  74. data/spec/daisybill_api/models/remittance_spec.rb +2 -2
  75. data/spec/daisybill_api/models/rendering_provider_spec.rb +2 -2
  76. data/spec/daisybill_api/models/request_for_second_review_spec.rb +2 -2
  77. data/spec/daisybill_api/models/service_line_item_payment_spec.rb +6 -0
  78. data/spec/daisybill_api/models/service_line_item_spec.rb +1 -1
  79. data/spec/daisybill_api/models/task_spec.rb +19 -0
  80. data/spec/daisybill_api/models/user_spec.rb +14 -0
  81. data/spec/daisybill_api_spec.rb +10 -10
  82. metadata +21 -4
@@ -2,7 +2,7 @@ module DaisybillApi
2
2
  module Models
3
3
  class Attachment < DaisybillApi::Models::Base
4
4
  rest_actions :index, :create, :update, :show, :destroy
5
- path_prefix '/bills', :bill_id
5
+ path_prefix "/bills", :bill_id
6
6
 
7
7
  attributes(
8
8
  id: :integer,
@@ -10,6 +10,7 @@ module DaisybillApi
10
10
  inactive: :boolean,
11
11
  review_status: :string,
12
12
  review_errors: [:string],
13
+ review_warnings: [:string],
13
14
  document_file_name: :string,
14
15
  document_content_type: :string,
15
16
  document_file_size: :integer,
@@ -21,7 +22,7 @@ module DaisybillApi
21
22
  document: :attachment
22
23
  )
23
24
 
24
- link :bill, class: 'Bill'
25
+ link :bill, class: "Bill"
25
26
  end
26
27
  end
27
28
  end
@@ -1,4 +1,4 @@
1
- require 'active_model'
1
+ require "active_model"
2
2
 
3
3
  module DaisybillApi
4
4
  module Models
@@ -1,8 +1,8 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class Bill < DaisybillApi::Models::Base
4
- path_prefix '/injuries', :injury_id
5
- rest_actions :index, :show, :create, :update, :destroy
4
+ path_prefix "/injuries", :injury_id
5
+ rest_actions :index, :show, :create, :update, :destroy, :write_off
6
6
 
7
7
  attributes(
8
8
  id: :integer,
@@ -14,6 +14,7 @@ module DaisybillApi
14
14
  write_off_cents: :integer,
15
15
  review_status: :string,
16
16
  review_errors: [:string],
17
+ review_warnings: [:string],
17
18
  readonly: true,
18
19
  )
19
20
 
@@ -28,15 +29,27 @@ module DaisybillApi
28
29
  service_line_items: [DaisybillApi::Models::ServiceLineItem]
29
30
  )
30
31
 
31
- link :injury, class: 'Injury'
32
- link :place_of_service, class: 'PlaceOfService'
33
- link :rendering_provider, class: 'RenderingProvider'
34
- link :referring_provider, class: 'ReferringProvider'
35
- link :supervising_provider, class: 'RenderingProvider'
32
+ link :injury, class: "Injury"
33
+ link :place_of_service, class: "PlaceOfService"
34
+ link :rendering_provider, class: "RenderingProvider"
35
+ link :referring_provider, class: "ReferringProvider"
36
+ link :supervising_provider, class: "RenderingProvider"
36
37
 
37
- has_many :attachments, class: 'Attachment'
38
- has_many :bill_payments, class: 'BillPayment'
39
- has_many :bill_submissions, class: 'BillSubmission'
38
+ has_many :attachments, class: "Attachment"
39
+ has_many :bill_payments, class: "BillPayment"
40
+ has_many :bill_submissions, class: "BillSubmission"
41
+ has_many :error_reports, class: "ErrorReport"
42
+ has_many :tasks, class: "Task"
43
+
44
+ def write_off
45
+ @written_off = send_data :post, write_off_path
46
+ end
47
+
48
+ private
49
+
50
+ def write_off_path
51
+ "#{show_path}/write_off"
52
+ end
40
53
  end
41
54
  end
42
55
  end
@@ -0,0 +1,16 @@
1
+ module DaisybillApi
2
+ module Models
3
+ class BillMailingAddress < DaisybillApi::Models::Base
4
+ rest_actions :index
5
+
6
+ attributes(
7
+ name: :string,
8
+ submission_type: :string,
9
+ company: :string,
10
+ bill_treatment_types: [:string],
11
+ address: DaisybillApi::Models::Address,
12
+ readonly: true
13
+ )
14
+ end
15
+ end
16
+ end
@@ -1,8 +1,8 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class BillPayment < DaisybillApi::Models::Base
4
- rest_actions :index
5
- path_prefix '/bills', :bill_id
4
+ rest_actions :index, :show
5
+ path_prefix "/bills", :bill_id
6
6
 
7
7
  attributes(
8
8
  id: :integer,
@@ -10,6 +10,8 @@ module DaisybillApi
10
10
  check_number: :string,
11
11
  check_effective_date: :date,
12
12
  payment_source: :string,
13
+ claim_adjustment_reasons: [DaisybillApi::Models::ClaimAdjustmentReason],
14
+ service_line_item_payments: [DaisybillApi::Models::ServiceLineItemPayment],
13
15
  readonly: true
14
16
  )
15
17
 
@@ -19,9 +21,8 @@ module DaisybillApi
19
21
  payment_amount_cents: :integer
20
22
  )
21
23
 
22
- link :bill_submission, class: 'BillSubmission'
23
- link :bill, class: 'Bill'
24
+ link :bill_submission, class: "BillSubmission"
25
+ link :bill, class: "Bill"
24
26
  end
25
27
  end
26
28
  end
27
-
@@ -2,7 +2,7 @@ module DaisybillApi
2
2
  module Models
3
3
  class BillSubmission < DaisybillApi::Models::Base
4
4
  rest_actions :index, :show, :create
5
- path_prefix '/bills', :bill_id
5
+ path_prefix "/bills", :bill_id
6
6
 
7
7
  attributes(
8
8
  comment: :string,
@@ -17,7 +17,7 @@ module DaisybillApi
17
17
  readonly: true
18
18
  )
19
19
 
20
- link :bill, class: 'Bill'
20
+ link :bill, class: "Bill"
21
21
  end
22
22
  end
23
23
  end
@@ -16,16 +16,16 @@ module DaisybillApi
16
16
  readonly: true
17
17
  )
18
18
 
19
- has_many :patients, class: 'Patient'
20
- has_many :rendering_providers, class: 'RenderingProvider'
21
- has_many :referring_providers, class: 'ReferringProvider'
22
- has_many :prescribing_providers, class: 'PrescribingProvider'
23
- has_many :places_of_service, class: 'PlaceOfService'
24
- has_many :remittances, class: 'Remittance'
25
- has_many :attachments, class: 'Attachment', set_path: true, collection_key: 'billing_provider_attachments'
26
- has_many :bills, class: 'Bill', set_path: true
27
- has_many :pharmacy_bills, class: 'PharmacyBill', set_path: true
28
- has_many :injuries, class: 'Injury', set_path: true
19
+ has_many :patients, class: "Patient"
20
+ has_many :rendering_providers, class: "RenderingProvider"
21
+ has_many :referring_providers, class: "ReferringProvider"
22
+ has_many :prescribing_providers, class: "PrescribingProvider"
23
+ has_many :places_of_service, class: "PlaceOfService"
24
+ has_many :remittances, class: "Remittance"
25
+ has_many :attachments, class: "Attachment", set_path: true, collection_key: "billing_provider_attachments"
26
+ has_many :bills, class: "Bill", set_path: true
27
+ has_many :pharmacy_bills, class: "PharmacyBill", set_path: true
28
+ has_many :injuries, class: "Injury", set_path: true
29
29
  end
30
30
  end
31
31
  end
@@ -0,0 +1,11 @@
1
+ module DaisybillApi
2
+ module Models
3
+ class ClaimAdjustmentReason < DaisybillApi::Models::Base
4
+ attributes(
5
+ code: :string,
6
+ amount_cents: :integer,
7
+ description: :string
8
+ )
9
+ end
10
+ end
11
+ end
@@ -10,7 +10,8 @@ module DaisybillApi
10
10
  readonly: true
11
11
  )
12
12
 
13
- has_many :payers, class: 'Payer'
13
+ has_many :payers, class: "Payer"
14
+ has_many :bill_mailing_addresses, class: "BillMailingAddress", set_path: true
14
15
  end
15
16
  end
16
17
  end
@@ -1,19 +1,27 @@
1
1
  module DaisybillApi
2
2
  module Models
3
- class Contact
4
- include DaisybillApi::Ext::Attributes
3
+ class Contact < DaisybillApi::Models::Base
4
+ path_prefix "/injuries", :injury_id
5
+ rest_actions :index, :show, :create, :update
5
6
 
6
7
  attributes(
7
- id: :integer,
8
- first_name: :string,
9
- last_name: :string,
10
- company: :string,
11
- role: :string,
12
- telephone: :string,
13
- email: :string,
14
- fax: :string,
15
- address: DaisybillApi::Models::Address
8
+ id: :integer,
9
+ role: :string,
10
+ readonly: true
16
11
  )
12
+
13
+ attributes(
14
+ first_name: :string,
15
+ last_name: :string,
16
+ company: :string,
17
+ telephone: :string,
18
+ email: :string,
19
+ fax: :string,
20
+ type: :string,
21
+ address: DaisybillApi::Models::Address
22
+ )
23
+
24
+ link :injury, class: "Injury"
17
25
  end
18
26
  end
19
27
  end
@@ -0,0 +1,30 @@
1
+ module DaisybillApi
2
+ module Models
3
+ class ErrorReport < DaisybillApi::Models::Base
4
+ path_prefix "/bills", :bill_id
5
+ rest_actions :index, :show, :create
6
+
7
+ attributes(
8
+ id: :integer,
9
+ error_type: :string,
10
+ comment: :string,
11
+ name: :string,
12
+ telephone: :string,
13
+ role: :string,
14
+ call_reference_number: :string,
15
+ readonly: true
16
+ )
17
+
18
+ attributes(
19
+ error_type: :string,
20
+ comment: :string,
21
+ name: :string,
22
+ telephone: :string,
23
+ role: :string,
24
+ call_reference_number: :string,
25
+ )
26
+
27
+ link :bill, class: "Bill"
28
+ end
29
+ end
30
+ end
@@ -10,6 +10,7 @@ module DaisybillApi
10
10
  payer: DaisybillApi::Models::Payer,
11
11
  review_status: :string,
12
12
  review_errors: [:string],
13
+ review_warnings: [:string],
13
14
  diagnosis_codes: [:string],
14
15
  contacts: [DaisybillApi::Models::Contact],
15
16
  readonly: true
@@ -1,12 +1,15 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class PaperEor < DaisybillApi::Models::Base
4
- path_prefix '/remittances', :remittance_id
4
+ path_prefix "/remittances", :remittance_id
5
5
  rest_actions :index
6
6
 
7
- attributes id: :integer, readonly: true
7
+ attributes id: :integer,
8
+ review_errors: [:string],
9
+ review_warnings: [:string],
10
+ readonly: true
8
11
 
9
- link :remittance, class: 'Remittance'
12
+ link :remittance, class: "Remittance"
10
13
  end
11
14
  end
12
15
  end
@@ -1,13 +1,14 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class Patient < DaisybillApi::Models::Base
4
- path_prefix '/billing_providers', :billing_provider_id
4
+ path_prefix "/billing_providers", :billing_provider_id
5
5
  rest_actions :index, :show, :create, :update, :destroy, :search
6
6
 
7
7
  attributes(
8
8
  id: :integer,
9
9
  review_status: :string,
10
10
  review_errors: [:string],
11
+ review_warnings: [:string],
11
12
  readonly: true
12
13
  )
13
14
  attributes(
@@ -23,9 +24,9 @@ module DaisybillApi
23
24
  address: DaisybillApi::Models::Address
24
25
  )
25
26
 
26
- has_many :injuries, class: 'Injury'
27
+ has_many :injuries, class: "Injury"
27
28
 
28
- link :billing_provider, class: 'BillingProvider'
29
+ link :billing_provider, class: "BillingProvider"
29
30
  end
30
31
  end
31
32
  end
@@ -1,7 +1,7 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class Payer < DaisybillApi::Models::Base
4
- path_prefix '/claims_administrators', :claims_administrator_id
4
+ path_prefix "/claims_administrators", :claims_administrator_id
5
5
  rest_actions :index, :show
6
6
 
7
7
  attributes(
@@ -11,6 +11,8 @@ module DaisybillApi
11
11
  main: :boolean,
12
12
  readonly: true
13
13
  )
14
+
15
+ has_many :bill_mailing_addresses, class: "BillMailingAddress", set_path: true
14
16
  end
15
17
  end
16
18
  end
@@ -1,8 +1,8 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class PharmacyBill < DaisybillApi::Models::Base
4
- path_prefix '/injuries', :injury_id
5
- rest_actions :index, :show, :create, :update, :destroy
4
+ path_prefix "/injuries", :injury_id
5
+ rest_actions :index, :show, :create, :update, :destroy, :write_off
6
6
 
7
7
  attributes(
8
8
  id: :integer,
@@ -13,6 +13,7 @@ module DaisybillApi
13
13
  balance_due_cents: :integer,
14
14
  review_status: :string,
15
15
  review_errors: [:string],
16
+ review_warnings: [:string],
16
17
  readonly: true
17
18
  )
18
19
 
@@ -27,19 +28,30 @@ module DaisybillApi
27
28
  unit_of_measurement: :string,
28
29
  authorization_number: :string,
29
30
  compound_name: :string,
31
+ practice_bill_id: :string,
30
32
  dosage_form: :integer,
31
33
  route_of_administration: :integer,
32
34
  number_of_containers: :integer,
33
35
  service_line_items: [DaisybillApi::Models::ServiceLineItem]
34
36
  )
35
37
 
36
- link :injury, class: 'Injury'
37
- link :place_of_service, class: 'PlaceOfService'
38
- link :prescribing_provider, class: 'PrescribingProvider'
38
+ link :injury, class: "Injury"
39
+ link :place_of_service, class: "PlaceOfService"
40
+ link :prescribing_provider, class: "PrescribingProvider"
39
41
 
40
- has_many :attachments, class: 'Attachment'
41
- has_many :bill_payments, class: 'BillPayment'
42
- has_many :bill_submissions, class: 'BillSubmission'
42
+ has_many :attachments, class: "Attachment", set_path: true, use_path_prefix: true
43
+ has_many :bill_payments, class: "BillPayment", set_path: true, use_path_prefix: true
44
+ has_many :bill_submissions, class: "BillSubmission", set_path: true, use_path_prefix: true
45
+
46
+ def write_off
47
+ @written_off = send_data :post, write_off_path
48
+ end
49
+
50
+ private
51
+
52
+ def write_off_path
53
+ "#{show_path}/write_off"
54
+ end
43
55
  end
44
56
  end
45
57
  end
@@ -2,10 +2,10 @@ module DaisybillApi
2
2
  module Models
3
3
  class PlaceOfService < DaisybillApi::Models::Base
4
4
  def self.plural_key
5
- 'places_of_service'
5
+ "places_of_service"
6
6
  end
7
7
 
8
- path_prefix '/billing_providers', :billing_provider_id
8
+ path_prefix "/billing_providers", :billing_provider_id
9
9
  rest_actions :index, :show, :create, :update
10
10
 
11
11
  attribute :id, :integer, readonly: true
@@ -18,11 +18,12 @@ module DaisybillApi
18
18
  active: :boolean,
19
19
  authorization_telephone_number: :string,
20
20
  authorization_fax_number: :string,
21
+ telephone: :string,
21
22
  place_of_service_type_code: :string,
22
23
  address: DaisybillApi::Models::Address
23
24
  )
24
25
 
25
- link :billing_provider, class: 'BillingProvider'
26
+ link :billing_provider, class: "BillingProvider"
26
27
  end
27
28
  end
28
29
  end
@@ -1,7 +1,7 @@
1
1
  module DaisybillApi
2
2
  module Models
3
3
  class PrescribingProvider < DaisybillApi::Models::Base
4
- path_prefix '/billing_providers', :billing_provider_id
4
+ path_prefix "/billing_providers", :billing_provider_id
5
5
  rest_actions :index, :show, :create, :update
6
6
 
7
7
  attribute :id, :integer, readonly: true
@@ -14,7 +14,7 @@ module DaisybillApi
14
14
  address: DaisybillApi::Models::Address
15
15
  )
16
16
 
17
- link :billing_provider, class: 'BillingProvider'
17
+ link :billing_provider, class: "BillingProvider"
18
18
  end
19
19
  end
20
20
  end