mindee 4.2.0 → 4.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6c09d5108c2470661075484f14849c7205cbef88d481427bcb612d36ede9835
4
- data.tar.gz: e7b6fa99499a9c3a3d82a9c87ab40dc07cbecd48a4f2d82200cfea2729f9d5cb
3
+ metadata.gz: 05c6fc0946b9d844042798b1b01160d5fbbdfa69f7b4a4e02ffb79e062680671
4
+ data.tar.gz: 23bfb847706e7c3d9bb15cd0acae3aa25d33c8fbbd126d8a6db0d55a00cb268c
5
5
  SHA512:
6
- metadata.gz: b97c068ddeefb0908e7d9753c0439c86393d1a04b13bf8f256c3dbc93399f213b0405375a036715906a8087eba3eb5126d8e69880c819ef4b0d5b7bf61459e88
7
- data.tar.gz: a15ff1b478675ec58dfd61d0f0483dcc7ab23df1fc02624e8133d5f636101e82f1eeb4f823ebe19a3a06ce70c4288270ebaca7029514e91f204298ad5843c924
6
+ metadata.gz: d693ccee678f81b71efaf221b6a5342e55e826458d345a9d5ae4f2d8644a729be6cd58b50e43481d12b5d8ed46afe02772acdc3c4b7f2fb9442de35e3d971b15
7
+ data.tar.gz: ee173692eff34f62deed6930e703d25996cdaf5910e5ff8a6ec6f771ad366af397122cb45f99a96755f0014a517b226c13f1c5a2af83588d1697f0599425a13f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v4.3.0 - 2025-04-08
4
+ ### Changes
5
+ * :sparkles: add support for Financial Document V1.12
6
+ * :sparkles: add support for Invoices V4.10
7
+ * :sparkles: add support for US Healthcare Cards V1.2
8
+
9
+
3
10
  ## v4.2.0 - 2025-03-28
4
11
  ### Changes
5
12
  * :coffin: remove support for US W9
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Financial Document API](https://platform.m
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `financial_document` |
15
- > | Recommended Version | `v1.11` |
15
+ > | Recommended Version | `v1.12` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ✔️ Yes |
18
18
  > | Geography | 🌐 Global |
@@ -93,7 +93,7 @@ puts result.document
93
93
  ########
94
94
  Document
95
95
  ########
96
- :Mindee ID: f469a24d-3875-4a83-ad43-e0d5aa9da604
96
+ :Mindee ID: a80ac0ee-26f6-4e2e-988a-960b240d5ba7
97
97
  :Filename: default_sample.jpg
98
98
 
99
99
  Inference
@@ -118,7 +118,7 @@ Prediction
118
118
  +---------------+--------+----------+---------------+
119
119
  | Base | Code | Rate (%) | Amount |
120
120
  +===============+========+==========+===============+
121
- | | | 5.00 | 9.75 |
121
+ | 195.00 | | 5.00 | 9.75 |
122
122
  +---------------+--------+----------+---------------+
123
123
  :Supplier Payment Details:
124
124
  :Supplier Name: JOHN SMITH
@@ -170,7 +170,7 @@ Page 0
170
170
  +---------------+--------+----------+---------------+
171
171
  | Base | Code | Rate (%) | Amount |
172
172
  +===============+========+==========+===============+
173
- | | | 5.00 | 9.75 |
173
+ | 195.00 | | 5.00 | 9.75 |
174
174
  +---------------+--------+----------+---------------+
175
175
  :Supplier Payment Details:
176
176
  :Supplier Name: JOHN SMITH
@@ -382,6 +382,24 @@ puts result.document.inference.prediction.document_number.value
382
382
  puts result.document.inference.prediction.document_type.value
383
383
  ```
384
384
 
385
+ ## Document Type Extended
386
+ **document_type_extended** ([ClassificationField](#classification-field)): Document type extended.
387
+
388
+ #### Possible values include:
389
+ - 'CREDIT NOTE'
390
+ - 'INVOICE'
391
+ - 'OTHER'
392
+ - 'OTHER_FINANCIAL'
393
+ - 'PAYSLIP'
394
+ - 'PURCHASE ORDER'
395
+ - 'QUOTE'
396
+ - 'RECEIPT'
397
+ - 'STATEMENT'
398
+
399
+ ```rb
400
+ puts result.document.inference.prediction.document_type_extended.value
401
+ ```
402
+
385
403
  ## Due Date
386
404
  **due_date** ([DateField](#date-field)): The date on which the payment is due.
387
405
 
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Invoice API](https://platform.mindee.com/m
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `invoices` |
15
- > | Recommended Version | `v4.9` |
15
+ > | Recommended Version | `v4.10` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ✔️ Yes |
18
18
  > | Geography | 🌐 Global |
@@ -93,7 +93,7 @@ puts result.document
93
93
  ########
94
94
  Document
95
95
  ########
96
- :Mindee ID: 86b1833f-138b-4a01-8387-860204b0e631
96
+ :Mindee ID: b55db8f9-ae3b-4f05-b2f1-ec0ced5e5b70
97
97
  :Filename: default_sample.jpg
98
98
 
99
99
  Inference
@@ -117,7 +117,7 @@ Prediction
117
117
  +---------------+--------+----------+---------------+
118
118
  | Base | Code | Rate (%) | Amount |
119
119
  +===============+========+==========+===============+
120
- | | | 8.00 | 193.20 |
120
+ | 2145.00 | | 8.00 | 193.20 |
121
121
  +---------------+--------+----------+---------------+
122
122
  :Supplier Payment Details:
123
123
  :Supplier Name: TURNPIKE DESIGNS
@@ -163,7 +163,7 @@ Page 0
163
163
  +---------------+--------+----------+---------------+
164
164
  | Base | Code | Rate (%) | Amount |
165
165
  +===============+========+==========+===============+
166
- | | | 8.00 | 193.20 |
166
+ | 2145.00 | | 8.00 | 193.20 |
167
167
  +---------------+--------+----------+---------------+
168
168
  :Supplier Payment Details:
169
169
  :Supplier Name: TURNPIKE DESIGNS
@@ -344,6 +344,24 @@ puts result.document.inference.prediction.date.value
344
344
  puts result.document.inference.prediction.document_type.value
345
345
  ```
346
346
 
347
+ ## Document Type Extended
348
+ **document_type_extended** ([ClassificationField](#classification-field)): Document type extended.
349
+
350
+ #### Possible values include:
351
+ - 'CREDIT NOTE'
352
+ - 'INVOICE'
353
+ - 'OTHER'
354
+ - 'OTHER_FINANCIAL'
355
+ - 'PAYSLIP'
356
+ - 'PURCHASE ORDER'
357
+ - 'QUOTE'
358
+ - 'RECEIPT'
359
+ - 'STATEMENT'
360
+
361
+ ```rb
362
+ puts result.document.inference.prediction.document_type_extended.value
363
+ ```
364
+
347
365
  ## Due Date
348
366
  **due_date** ([DateField](#date-field)): The date on which the payment is due.
349
367
 
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Healthcare Card API](https://platform.mind
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `us_healthcare_cards` |
15
- > | Recommended Version | `v1.1` |
15
+ > | Recommended Version | `v1.2` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ❌ No |
18
18
  > | Geography | 🇺🇸 United States |
@@ -138,6 +138,15 @@ A `HealthcareCardV1Copay` implements the following attributes:
138
138
  * `service_fees` (Float): The price of service.
139
139
  * `service_name` (String): The name of service of the copay.
140
140
 
141
+ #### Possible values include:
142
+ - primary_care
143
+ - emergency_room
144
+ - urgent_care
145
+ - specialist
146
+ - office_visit
147
+ - prescription
148
+
149
+
141
150
  # Attributes
142
151
  The following fields are extracted for Healthcare Card V1:
143
152
 
@@ -222,6 +231,13 @@ puts result.document.inference.prediction.rx_bin.value
222
231
  puts result.document.inference.prediction.rx_grp.value
223
232
  ```
224
233
 
234
+ ## RX ID
235
+ **rx_id** ([StringField](#string-field)): The ID number for prescription drug coverage.
236
+
237
+ ```rb
238
+ puts result.document.inference.prediction.rx_id.value
239
+ ```
240
+
225
241
  ## RX PCN
226
242
  **rx_pcn** ([StringField](#string-field)): The PCN number for prescription drug coverage.
227
243
 
@@ -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
@@ -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)
@@ -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
@@ -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)
@@ -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
 
@@ -41,7 +41,7 @@ module Mindee
41
41
  out_str = String.new
42
42
  out_str << ("\n#{self.class.line_items_separator('-')}\n ")
43
43
  out_str << ' | Service Fees'
44
- out_str << ' | Service Name'
44
+ out_str << ' | Service Name '
45
45
  out_str << (" |\n#{self.class.line_items_separator('=')}")
46
46
  out_str + lines
47
47
  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)
@@ -3,7 +3,7 @@
3
3
  # Mindee
4
4
  module Mindee
5
5
  # Current version.
6
- VERSION = '4.2.0'
6
+ VERSION = '4.3.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [Symbol, Hash[Symbol | String, Regexp], Nil?]
@@ -14,6 +14,7 @@ module Mindee
14
14
  def date: -> (Parsing::Standard::DateField)
15
15
  def document_number: -> (Parsing::Standard::StringField)
16
16
  def document_type: -> (Parsing::Standard::ClassificationField)
17
+ def document_type_extended: -> (Parsing::Standard::ClassificationField)
17
18
  def due_date: -> (Parsing::Standard::DateField)
18
19
  def invoice_number: -> (Parsing::Standard::StringField)
19
20
  def line_items: -> (Product::FinancialDocument::FinancialDocumentV1LineItems)
@@ -12,6 +12,7 @@ module Mindee
12
12
  def customer_name: -> (Parsing::Standard::StringField)
13
13
  def date: -> (Parsing::Standard::DateField)
14
14
  def document_type: -> (Parsing::Standard::ClassificationField)
15
+ def document_type_extended: -> (Parsing::Standard::ClassificationField)
15
16
  def due_date: -> (Parsing::Standard::DateField)
16
17
  def invoice_number: -> (Parsing::Standard::StringField)
17
18
  def line_items: -> (Product::Invoice::InvoiceV4LineItems)
@@ -17,6 +17,7 @@ module Mindee
17
17
  def payer_id: -> (Parsing::Standard::StringField)
18
18
  def rx_bin: -> (Parsing::Standard::StringField)
19
19
  def rx_grp: -> (Parsing::Standard::StringField)
20
+ def rx_id: -> (Parsing::Standard::StringField)
20
21
  def rx_pcn: -> (Parsing::Standard::StringField)
21
22
  def copays_separator: (String) -> String
22
23
  def copays_to_s: -> String
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindee
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindee, SA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-28 00:00:00.000000000 Z
11
+ date: 2025-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64