mindee 4.2.0 → 4.4.0

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/CHANGELOG.md +16 -0
  4. data/docs/code_samples/workflow_execution.txt +1 -1
  5. data/docs/code_samples/workflow_polling.txt +36 -0
  6. data/docs/global_products/financial_document_v1.md +22 -4
  7. data/docs/global_products/invoices_v4.md +22 -4
  8. data/docs/localized_products/us_healthcare_cards_v1.md +17 -1
  9. data/lib/mindee/client.rb +13 -13
  10. data/lib/mindee/http/endpoint.rb +37 -47
  11. data/lib/mindee/http/response_validation.rb +1 -1
  12. data/lib/mindee/parsing/common/api_response.rb +1 -1
  13. data/lib/mindee/parsing/common/document.rb +1 -1
  14. data/lib/mindee/parsing/common/extras/extras.rb +4 -1
  15. data/lib/mindee/parsing/common/extras/rag_extra.rb +24 -0
  16. data/lib/mindee/parsing/common/extras.rb +1 -0
  17. data/lib/mindee/parsing/common/inference.rb +3 -0
  18. data/lib/mindee/parsing/standard/tax_field.rb +9 -9
  19. data/lib/mindee/pdf/pdf_extractor.rb +1 -1
  20. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb +2 -2
  21. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +9 -1
  22. data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +2 -2
  23. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
  24. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rb +2 -2
  25. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +2 -2
  26. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rb +2 -2
  27. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb +2 -2
  28. data/lib/mindee/product/fr/payslip/payslip_v2_salary_details.rb +2 -2
  29. data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rb +2 -2
  30. data/lib/mindee/product/fr/payslip/payslip_v3_salary_details.rb +2 -2
  31. data/lib/mindee/product/invoice/invoice_v4_document.rb +9 -1
  32. data/lib/mindee/product/invoice/invoice_v4_line_items.rb +2 -2
  33. data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
  34. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb +2 -2
  35. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb +2 -2
  36. data/lib/mindee/product/receipt/receipt_v5_line_items.rb +2 -2
  37. data/lib/mindee/product/resume/resume_v1_certificates.rb +2 -2
  38. data/lib/mindee/product/resume/resume_v1_educations.rb +2 -2
  39. data/lib/mindee/product/resume/resume_v1_languages.rb +2 -2
  40. data/lib/mindee/product/resume/resume_v1_professional_experiences.rb +2 -2
  41. data/lib/mindee/product/resume/resume_v1_social_networks_urls.rb +2 -2
  42. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +2 -2
  43. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +4 -4
  44. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +8 -3
  45. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
  46. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rb +2 -2
  47. data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rb +2 -2
  48. data/lib/mindee/version.rb +1 -1
  49. data/mindee.gemspec +1 -1
  50. data/sig/custom/net_http.rbs +3 -0
  51. data/sig/mindee/client.rbs +4 -2
  52. data/sig/mindee/http/endpoint.rbs +9 -8
  53. data/sig/mindee/http/response_validation.rbs +3 -3
  54. data/sig/mindee/parsing/common/api_response.rbs +1 -1
  55. data/sig/mindee/parsing/common/extras/full_text_ocr_extra.rbs +2 -2
  56. data/sig/mindee/parsing/common/extras/rag_extra.rbs +15 -0
  57. data/sig/mindee/product/financial_document/financial_document_v1_document.rbs +1 -0
  58. data/sig/mindee/product/invoice/invoice_v4_document.rbs +1 -0
  59. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +1 -0
  60. metadata +7 -4
@@ -46,14 +46,14 @@ module Mindee
46
46
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
47
47
  end.join
48
48
  out_str = String.new
49
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
49
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
50
50
  out_str << ' | Description '
51
51
  out_str << ' | Gross Weight'
52
52
  out_str << ' | Measurement'
53
53
  out_str << ' | Measurement Unit'
54
54
  out_str << ' | Quantity'
55
55
  out_str << ' | Weight Unit'
56
- out_str << (" |\n#{self.class.line_items_separator('=')}")
56
+ out_str << " |\n#{self.class.line_items_separator('=')}"
57
57
  out_str + lines
58
58
  end
59
59
  end
@@ -6,7 +6,7 @@ require_relative 'financial_document_v1_line_items'
6
6
  module Mindee
7
7
  module Product
8
8
  module FinancialDocument
9
- # Financial Document API version 1.11 document data.
9
+ # Financial Document API version 1.12 document data.
10
10
  class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # The customer's address used for billing.
@@ -37,6 +37,9 @@ module Mindee
37
37
  # RECEIPT if it is a receipt.
38
38
  # @return [Mindee::Parsing::Standard::ClassificationField]
39
39
  attr_reader :document_type
40
+ # Document type extended.
41
+ # @return [Mindee::Parsing::Standard::ClassificationField]
42
+ attr_reader :document_type_extended
40
43
  # The date on which the payment is due.
41
44
  # @return [Mindee::Parsing::Standard::DateField]
42
45
  attr_reader :due_date
@@ -144,6 +147,10 @@ module Mindee
144
147
  prediction['document_type'],
145
148
  page_id
146
149
  )
150
+ @document_type_extended = Parsing::Standard::ClassificationField.new(
151
+ prediction['document_type_extended'],
152
+ page_id
153
+ )
147
154
  @due_date = Parsing::Standard::DateField.new(
148
155
  prediction['due_date'],
149
156
  page_id
@@ -262,6 +269,7 @@ module Mindee
262
269
  out_str << "\n:Shipping Address: #{@shipping_address}".rstrip
263
270
  out_str << "\n:Billing Address: #{@billing_address}".rstrip
264
271
  out_str << "\n:Document Type: #{@document_type}".rstrip
272
+ out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip
265
273
  out_str << "\n:Purchase Subcategory: #{@subcategory}".rstrip
266
274
  out_str << "\n:Purchase Category: #{@category}".rstrip
267
275
  out_str << "\n:Total Tax: #{@total_tax}".rstrip
@@ -44,7 +44,7 @@ module Mindee
44
44
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
45
45
  end.join
46
46
  out_str = String.new
47
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
47
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
48
48
  out_str << ' | Description '
49
49
  out_str << ' | Product code'
50
50
  out_str << ' | Quantity'
@@ -53,7 +53,7 @@ module Mindee
53
53
  out_str << ' | Total Amount'
54
54
  out_str << ' | Unit of measure'
55
55
  out_str << ' | Unit Price'
56
- out_str << (" |\n#{self.class.line_items_separator('=')}")
56
+ out_str << " |\n#{self.class.line_items_separator('=')}"
57
57
  out_str + lines
58
58
  end
59
59
  end
@@ -6,7 +6,7 @@ require_relative 'financial_document_v1_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module FinancialDocument
9
- # Financial Document API version 1.11 page data.
9
+ # Financial Document API version 1.12 page data.
10
10
  class FinancialDocumentV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -40,11 +40,11 @@ module Mindee
40
40
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
41
41
  end.join
42
42
  out_str = String.new
43
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
43
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
44
44
  out_str << ' | Amount '
45
45
  out_str << ' | Date '
46
46
  out_str << ' | Description '
47
- out_str << (" |\n#{self.class.line_items_separator('=')}")
47
+ out_str << " |\n#{self.class.line_items_separator('=')}"
48
48
  out_str + lines
49
49
  end
50
50
  end
@@ -50,7 +50,7 @@ module Mindee
50
50
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
51
51
  end.join
52
52
  out_str = String.new
53
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
53
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
54
54
  out_str << ' | Consumption'
55
55
  out_str << ' | Description '
56
56
  out_str << ' | End Date '
@@ -59,7 +59,7 @@ module Mindee
59
59
  out_str << ' | Total '
60
60
  out_str << ' | Unit of Measure'
61
61
  out_str << ' | Unit Price'
62
- out_str << (" |\n#{self.class.line_items_separator('=')}")
62
+ out_str << " |\n#{self.class.line_items_separator('=')}"
63
63
  out_str + lines
64
64
  end
65
65
  end
@@ -48,14 +48,14 @@ module Mindee
48
48
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
49
49
  end.join
50
50
  out_str = String.new
51
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
51
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
52
52
  out_str << ' | Description '
53
53
  out_str << ' | End Date '
54
54
  out_str << ' | Start Date'
55
55
  out_str << ' | Tax Rate'
56
56
  out_str << ' | Total '
57
57
  out_str << ' | Unit Price'
58
- out_str << (" |\n#{self.class.line_items_separator('=')}")
58
+ out_str << " |\n#{self.class.line_items_separator('=')}"
59
59
  out_str + lines
60
60
  end
61
61
  end
@@ -48,14 +48,14 @@ module Mindee
48
48
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
49
49
  end.join
50
50
  out_str = String.new
51
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
51
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
52
52
  out_str << ' | Description '
53
53
  out_str << ' | End Date '
54
54
  out_str << ' | Start Date'
55
55
  out_str << ' | Tax Rate'
56
56
  out_str << ' | Total '
57
57
  out_str << ' | Unit Price'
58
- out_str << (" |\n#{self.class.line_items_separator('=')}")
58
+ out_str << " |\n#{self.class.line_items_separator('=')}"
59
59
  out_str + lines
60
60
  end
61
61
  end
@@ -48,12 +48,12 @@ module Mindee
48
48
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
49
49
  end.join
50
50
  out_str = String.new
51
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
51
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
52
52
  out_str << ' | Amount '
53
53
  out_str << ' | Base '
54
54
  out_str << ' | Description '
55
55
  out_str << ' | Rate '
56
- out_str << (" |\n#{self.class.line_items_separator('=')}")
56
+ out_str << " |\n#{self.class.line_items_separator('=')}"
57
57
  out_str + lines
58
58
  end
59
59
  end
@@ -49,13 +49,13 @@ module Mindee
49
49
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
50
50
  end.join
51
51
  out_str = String.new
52
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
52
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
53
53
  out_str << ' | Accrued '
54
54
  out_str << ' | Period'
55
55
  out_str << ' | Type '
56
56
  out_str << ' | Remaining'
57
57
  out_str << ' | Used '
58
- out_str << (" |\n#{self.class.line_items_separator('=')}")
58
+ out_str << " |\n#{self.class.line_items_separator('=')}"
59
59
  out_str + lines
60
60
  end
61
61
  end
@@ -49,13 +49,13 @@ module Mindee
49
49
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
50
50
  end.join
51
51
  out_str = String.new
52
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
52
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
53
53
  out_str << ' | Amount '
54
54
  out_str << ' | Base '
55
55
  out_str << ' | Description '
56
56
  out_str << ' | Number'
57
57
  out_str << ' | Rate '
58
- out_str << (" |\n#{self.class.line_items_separator('=')}")
58
+ out_str << " |\n#{self.class.line_items_separator('=')}"
59
59
  out_str + lines
60
60
  end
61
61
  end
@@ -6,7 +6,7 @@ require_relative 'invoice_v4_line_items'
6
6
  module Mindee
7
7
  module Product
8
8
  module Invoice
9
- # Invoice API version 4.9 document data.
9
+ # Invoice API version 4.10 document data.
10
10
  class InvoiceV4Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # The customer billing address.
@@ -30,6 +30,9 @@ module Mindee
30
30
  # Document type: INVOICE or CREDIT NOTE.
31
31
  # @return [Mindee::Parsing::Standard::ClassificationField]
32
32
  attr_reader :document_type
33
+ # Document type extended.
34
+ # @return [Mindee::Parsing::Standard::ClassificationField]
35
+ attr_reader :document_type_extended
33
36
  # The date on which the payment is due.
34
37
  # @return [Mindee::Parsing::Standard::DateField]
35
38
  attr_reader :due_date
@@ -117,6 +120,10 @@ module Mindee
117
120
  prediction['document_type'],
118
121
  page_id
119
122
  )
123
+ @document_type_extended = Parsing::Standard::ClassificationField.new(
124
+ prediction['document_type_extended'],
125
+ page_id
126
+ )
120
127
  @due_date = Parsing::Standard::DateField.new(
121
128
  prediction['due_date'],
122
129
  page_id
@@ -222,6 +229,7 @@ module Mindee
222
229
  out_str << "\n:Shipping Address: #{@shipping_address}".rstrip
223
230
  out_str << "\n:Billing Address: #{@billing_address}".rstrip
224
231
  out_str << "\n:Document Type: #{@document_type}".rstrip
232
+ out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip
225
233
  out_str << "\n:Line Items:"
226
234
  out_str << line_items
227
235
  out_str[1..].to_s
@@ -44,7 +44,7 @@ module Mindee
44
44
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
45
45
  end.join
46
46
  out_str = String.new
47
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
47
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
48
48
  out_str << ' | Description '
49
49
  out_str << ' | Product code'
50
50
  out_str << ' | Quantity'
@@ -53,7 +53,7 @@ module Mindee
53
53
  out_str << ' | Total Amount'
54
54
  out_str << ' | Unit of measure'
55
55
  out_str << ' | Unit Price'
56
- out_str << (" |\n#{self.class.line_items_separator('=')}")
56
+ out_str << " |\n#{self.class.line_items_separator('=')}"
57
57
  out_str + lines
58
58
  end
59
59
  end
@@ -6,7 +6,7 @@ require_relative 'invoice_v4_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module Invoice
9
- # Invoice API version 4.9 page data.
9
+ # Invoice API version 4.10 page data.
10
10
  class InvoiceV4Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -37,9 +37,9 @@ module Mindee
37
37
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
38
38
  end.join
39
39
  out_str = String.new
40
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
40
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
41
41
  out_str << ' | Page Indexes '
42
- out_str << (" |\n#{self.class.line_items_separator('=')}")
42
+ out_str << " |\n#{self.class.line_items_separator('=')}"
43
43
  out_str + lines
44
44
  end
45
45
  end
@@ -53,13 +53,13 @@ module Mindee
53
53
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
54
54
  end.join
55
55
  out_str = String.new
56
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
56
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
57
57
  out_str << ' | Daily Value'
58
58
  out_str << ' | Name '
59
59
  out_str << ' | Per 100g'
60
60
  out_str << ' | Per Serving'
61
61
  out_str << ' | Unit'
62
- out_str << (" |\n#{self.class.line_items_separator('=')}")
62
+ out_str << " |\n#{self.class.line_items_separator('=')}"
63
63
  out_str + lines
64
64
  end
65
65
  end
@@ -40,12 +40,12 @@ module Mindee
40
40
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
41
41
  end.join
42
42
  out_str = String.new
43
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
43
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
44
44
  out_str << ' | Description '
45
45
  out_str << ' | Quantity'
46
46
  out_str << ' | Total Amount'
47
47
  out_str << ' | Unit Price'
48
- out_str << (" |\n#{self.class.line_items_separator('=')}")
48
+ out_str << " |\n#{self.class.line_items_separator('=')}"
49
49
  out_str + lines
50
50
  end
51
51
  end
@@ -44,12 +44,12 @@ module Mindee
44
44
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
45
45
  end.join
46
46
  out_str = String.new
47
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
47
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
48
48
  out_str << ' | Grade '
49
49
  out_str << ' | Name '
50
50
  out_str << ' | Provider '
51
51
  out_str << ' | Year'
52
- out_str << (" |\n#{self.class.line_items_separator('=')}")
52
+ out_str << " |\n#{self.class.line_items_separator('=')}"
53
53
  out_str + lines
54
54
  end
55
55
  end
@@ -47,7 +47,7 @@ module Mindee
47
47
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
48
48
  end.join
49
49
  out_str = String.new
50
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
50
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
51
51
  out_str << ' | Domain '
52
52
  out_str << ' | Degree '
53
53
  out_str << ' | End Month'
@@ -55,7 +55,7 @@ module Mindee
55
55
  out_str << ' | School '
56
56
  out_str << ' | Start Month'
57
57
  out_str << ' | Start Year'
58
- out_str << (" |\n#{self.class.line_items_separator('=')}")
58
+ out_str << " |\n#{self.class.line_items_separator('=')}"
59
59
  out_str + lines
60
60
  end
61
61
  end
@@ -42,10 +42,10 @@ module Mindee
42
42
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
43
43
  end.join
44
44
  out_str = String.new
45
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
45
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
46
46
  out_str << ' | Language'
47
47
  out_str << ' | Level '
48
- out_str << (" |\n#{self.class.line_items_separator('=')}")
48
+ out_str << " |\n#{self.class.line_items_separator('=')}"
49
49
  out_str + lines
50
50
  end
51
51
  end
@@ -49,7 +49,7 @@ module Mindee
49
49
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
50
50
  end.join
51
51
  out_str = String.new
52
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
52
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
53
53
  out_str << ' | Contract Type '
54
54
  out_str << ' | Department'
55
55
  out_str << ' | Description '
@@ -59,7 +59,7 @@ module Mindee
59
59
  out_str << ' | Role '
60
60
  out_str << ' | Start Month'
61
61
  out_str << ' | Start Year'
62
- out_str << (" |\n#{self.class.line_items_separator('=')}")
62
+ out_str << " |\n#{self.class.line_items_separator('=')}"
63
63
  out_str + lines
64
64
  end
65
65
  end
@@ -42,10 +42,10 @@ module Mindee
42
42
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
43
43
  end.join
44
44
  out_str = String.new
45
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
45
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
46
46
  out_str << ' | Name '
47
47
  out_str << ' | URL '
48
- out_str << (" |\n#{self.class.line_items_separator('=')}")
48
+ out_str << " |\n#{self.class.line_items_separator('=')}"
49
49
  out_str + lines
50
50
  end
51
51
  end
@@ -39,7 +39,7 @@ module Mindee
39
39
  printable = {}
40
40
  printable[:service_fees] =
41
41
  @service_fees.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@service_fees)
42
- printable[:service_name] = format_for_display(@service_name, nil)
42
+ printable[:service_name] = format_for_display(@service_name, 20)
43
43
  printable
44
44
  end
45
45
 
@@ -48,7 +48,7 @@ module Mindee
48
48
  printable = table_printable_values
49
49
  out_str = String.new
50
50
  out_str << format('| %- 13s', printable[:service_fees])
51
- out_str << format('| %- 13s', printable[:service_name])
51
+ out_str << format('| %- 21s', printable[:service_name])
52
52
  out_str << '|'
53
53
  end
54
54
 
@@ -27,7 +27,7 @@ module Mindee
27
27
  def self.line_items_separator(char)
28
28
  out_str = String.new
29
29
  out_str << "+#{char * 14}"
30
- out_str << "+#{char * 14}"
30
+ out_str << "+#{char * 22}"
31
31
  out_str
32
32
  end
33
33
 
@@ -39,10 +39,10 @@ module Mindee
39
39
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
40
40
  end.join
41
41
  out_str = String.new
42
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
42
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
43
43
  out_str << ' | Service Fees'
44
- out_str << ' | Service Name'
45
- out_str << (" |\n#{self.class.line_items_separator('=')}")
44
+ out_str << ' | Service Name '
45
+ out_str << " |\n#{self.class.line_items_separator('=')}"
46
46
  out_str + lines
47
47
  end
48
48
  end
@@ -7,7 +7,7 @@ module Mindee
7
7
  module Product
8
8
  module US
9
9
  module HealthcareCard
10
- # Healthcare Card API version 1.1 document data.
10
+ # Healthcare Card API version 1.2 document data.
11
11
  class HealthcareCardV1Document < Mindee::Parsing::Common::Prediction
12
12
  include Mindee::Parsing::Standard
13
13
  # The name of the company that provides the healthcare plan.
@@ -43,6 +43,9 @@ module Mindee
43
43
  # The group number for prescription drug coverage.
44
44
  # @return [Mindee::Parsing::Standard::StringField]
45
45
  attr_reader :rx_grp
46
+ # The ID number for prescription drug coverage.
47
+ # @return [Mindee::Parsing::Standard::StringField]
48
+ attr_reader :rx_id
46
49
  # The PCN number for prescription drug coverage.
47
50
  # @return [Mindee::Parsing::Standard::StringField]
48
51
  attr_reader :rx_pcn
@@ -92,6 +95,7 @@ module Mindee
92
95
  prediction['rx_grp'],
93
96
  page_id
94
97
  )
98
+ @rx_id = Parsing::Standard::StringField.new(prediction['rx_id'], page_id)
95
99
  @rx_pcn = Parsing::Standard::StringField.new(
96
100
  prediction['rx_pcn'],
97
101
  page_id
@@ -111,6 +115,7 @@ module Mindee
111
115
  out_str << "\n:Group Number: #{@group_number}".rstrip
112
116
  out_str << "\n:Payer ID: #{@payer_id}".rstrip
113
117
  out_str << "\n:RX BIN: #{@rx_bin}".rstrip
118
+ out_str << "\n:RX ID: #{@rx_id}".rstrip
114
119
  out_str << "\n:RX GRP: #{@rx_grp}".rstrip
115
120
  out_str << "\n:RX PCN: #{@rx_pcn}".rstrip
116
121
  out_str << "\n:copays:"
@@ -127,7 +132,7 @@ module Mindee
127
132
  out_str = String.new
128
133
  out_str << ' '
129
134
  out_str << "+#{char * 14}"
130
- out_str << "+#{char * 14}"
135
+ out_str << "+#{char * 22}"
131
136
  out_str << '+'
132
137
  out_str
133
138
  end
@@ -141,7 +146,7 @@ module Mindee
141
146
  out_str << "\n#{copays_separator('-')}"
142
147
  out_str << "\n |"
143
148
  out_str << ' Service Fees |'
144
- out_str << ' Service Name |'
149
+ out_str << ' Service Name |'
145
150
  out_str << "\n#{copays_separator('=')}"
146
151
  out_str << "\n #{line_items}"
147
152
  out_str << "\n#{copays_separator('-')}"
@@ -7,7 +7,7 @@ module Mindee
7
7
  module Product
8
8
  module US
9
9
  module HealthcareCard
10
- # Healthcare Card API version 1.1 page data.
10
+ # Healthcare Card API version 1.2 page data.
11
11
  class HealthcareCardV1Page < Mindee::Parsing::Common::Page
12
12
  # @param prediction [Hash]
13
13
  def initialize(prediction)
@@ -45,7 +45,7 @@ module Mindee
45
45
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
46
46
  end.join
47
47
  out_str = String.new
48
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
48
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
49
49
  out_str << ' | City '
50
50
  out_str << ' | Complete Address '
51
51
  out_str << ' | Is Address Change'
@@ -53,7 +53,7 @@ module Mindee
53
53
  out_str << ' | Private Mailbox Number'
54
54
  out_str << ' | State'
55
55
  out_str << ' | Street '
56
- out_str << (" |\n#{self.class.line_items_separator('=')}")
56
+ out_str << " |\n#{self.class.line_items_separator('=')}"
57
57
  out_str + lines
58
58
  end
59
59
  end
@@ -46,7 +46,7 @@ module Mindee
46
46
  "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
47
47
  end.join
48
48
  out_str = String.new
49
- out_str << ("\n#{self.class.line_items_separator('-')}\n ")
49
+ out_str << "\n#{self.class.line_items_separator('-')}\n "
50
50
  out_str << ' | City '
51
51
  out_str << ' | Complete Address '
52
52
  out_str << ' | Is Address Change'
@@ -55,7 +55,7 @@ module Mindee
55
55
  out_str << ' | State'
56
56
  out_str << ' | Street '
57
57
  out_str << ' | Unit '
58
- out_str << (" |\n#{self.class.line_items_separator('=')}")
58
+ out_str << " |\n#{self.class.line_items_separator('=')}"
59
59
  out_str + lines
60
60
  end
61
61
  end
@@ -3,7 +3,7 @@
3
3
  # Mindee
4
4
  module Mindee
5
5
  # Current version.
6
- VERSION = '4.2.0'
6
+ VERSION = '4.4.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [Symbol, Hash[Symbol | String, Regexp], Nil?]
data/mindee.gemspec CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'rake', '~> 13.2'
38
38
  spec.add_development_dependency 'rbs', '~> 3.6'
39
39
  spec.add_development_dependency 'rspec', '~> 3.13'
40
- spec.add_development_dependency 'rubocop', '~> 1.70'
40
+ spec.add_development_dependency 'rubocop', '~> 1.75'
41
41
  spec.add_development_dependency 'steep', '~> 1.7'
42
42
  spec.add_development_dependency 'yard', '~> 0.9'
43
43
  end
@@ -29,6 +29,9 @@ module Net
29
29
  class HTTPResponse
30
30
  def self.body: -> untyped
31
31
  def body: -> untyped
32
+ def []: (untyped) -> untyped
33
+ def key?: (untyped) -> bool
34
+ def code: -> String
32
35
  end
33
36
 
34
37
  class HTTPRedirection
@@ -17,6 +17,8 @@ module Mindee
17
17
  attr_accessor close_file: bool
18
18
  attr_accessor page_options: PageOptions
19
19
  attr_accessor cropper: bool
20
+ attr_accessor rag: bool
21
+ attr_accessor workflow_id: String | nil
20
22
  attr_accessor initial_delay_sec: Integer | Float
21
23
  attr_accessor delay_sec: Integer | Float
22
24
  attr_accessor max_retries: Integer
@@ -36,7 +38,7 @@ module Mindee
36
38
  end
37
39
 
38
40
  class Client
39
- def initialize: (api_key: String) -> void
41
+ def initialize: (?api_key: String) -> void
40
42
  def logger: () -> untyped
41
43
  def parse: (Input::Source::LocalInputSource | Input::Source::URLInputSource, untyped, ?endpoint: (HTTP::Endpoint?), options: ParseOptions | Hash[Symbol | String, untyped]) -> Parsing::Common::ApiResponse
42
44
  def parse_sync: (Input::Source::LocalInputSource | Input::Source::URLInputSource, untyped, HTTP::Endpoint, ParseOptions) -> Parsing::Common::ApiResponse
@@ -57,7 +59,7 @@ module Mindee
57
59
  def process_pdf_if_required: (Input::Source::LocalInputSource, ParseOptions | WorkflowOptions) -> void
58
60
  def initialize_endpoint: (singleton(Parsing::Common::Inference), ?endpoint_name: String, ?account_name: String, ?version: String) -> HTTP::Endpoint
59
61
  def validate_async_params: (Integer | Float, Integer | Float, Integer) -> void
60
- def fix_endpoint_name: (singleton(Parsing::Common::Inference), String?) -> String?
62
+ def fix_endpoint_name: (singleton(Parsing::Common::Inference), String?) -> String
61
63
  def fix_account_name: (String) -> String
62
64
  def fix_version: (singleton(Parsing::Common::Inference), String) -> String
63
65
  end
@@ -13,14 +13,15 @@ module Mindee
13
13
  def api_key: -> String?
14
14
  def request_timeout: -> Integer
15
15
  def url_root: -> String
16
- def initialize: (untyped, untyped, untyped, ?api_key: String) -> String
17
- def predict: (untyped, untyped, untyped, untyped, untyped) -> [untyped, untyped]
18
- def predict_async: (untyped, untyped, untyped, untyped, untyped) -> [untyped, untyped]
19
- def parse_async: (untyped) -> [untyped, untyped]
20
- def predict_req_post: (untyped, ?all_words: false, ?full_text: false, ?close_file: true, ?cropper: false) -> untyped
21
- def document_queue_req_get: (untyped, untyped, untyped, untyped, untyped) -> untyped
22
- def document_queue_req: (untyped) -> untyped
23
- def check_api_key: -> nil
16
+ def base_url: -> String
17
+ def initialize: (String, String, String | nil, ?api_key: String) -> String
18
+ def predict: (Input::Source::LocalInputSource | Input::Source::URLInputSource, ParseOptions) -> [Net::HTTPResponse, Hash[Symbol, untyped]]
19
+ def predict_async: (Input::Source::LocalInputSource | Input::Source::URLInputSource, ParseOptions) -> [Net::HTTPResponse, Hash[Symbol, untyped]]
20
+ def parse_async: (String) -> [Net::HTTPResponse, Hash[Symbol, untyped]]
21
+ def predict_req_post: (Input::Source::LocalInputSource | Input::Source::URLInputSource, ParseOptions) -> Net::HTTPResponse
22
+ def document_queue_req_post: (Input::Source::LocalInputSource | Input::Source::URLInputSource, ParseOptions) -> Net::HTTPResponse
23
+ def document_queue_req_get: (untyped) -> Net::HTTPResponse
24
+ def check_api_key: -> void
24
25
  end
25
26
  end
26
27
  end