mindee 4.4.0 → 4.5.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/bin/mindee.rb +1 -1
  4. data/docs/global_products/expense_receipts_v5.md +13 -1
  5. data/docs/global_products/financial_document_v1.md +19 -5
  6. data/docs/global_products/international_id_v2.md +1 -1
  7. data/docs/global_products/invoice_splitter_v1.md +1 -1
  8. data/docs/global_products/invoices_v4.md +52 -3
  9. data/docs/localized_products/energy_bill_fra_v1.md +18 -18
  10. data/docs/localized_products/ind_passport_v1.md +2 -2
  11. data/docs/localized_products/us_healthcare_cards_v1.md +32 -23
  12. data/docs/localized_products/us_mail_v3.md +1 -35
  13. data/lib/mindee/client.rb +2 -3
  14. data/lib/mindee/http/endpoint.rb +3 -0
  15. data/lib/mindee/http/workflow_endpoint.rb +1 -0
  16. data/lib/mindee/parsing/common/inference.rb +1 -1
  17. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +3 -3
  18. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
  19. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +1 -1
  20. data/lib/mindee/product/international_id/international_id_v2_document.rb +1 -1
  21. data/lib/mindee/product/international_id/international_id_v2_page.rb +1 -1
  22. data/lib/mindee/product/invoice/invoice_v4_document.rb +17 -1
  23. data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
  24. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +1 -1
  25. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +1 -1
  26. data/lib/mindee/product/receipt/receipt_v5_document.rb +1 -1
  27. data/lib/mindee/product/receipt/receipt_v5_page.rb +1 -1
  28. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +3 -3
  29. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +1 -1
  30. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +11 -3
  31. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
  32. data/lib/mindee/version.rb +1 -1
  33. data/sig/custom/net_http.rbs +1 -0
  34. data/sig/mindee/product/invoice/invoice_v4_document.rbs +2 -0
  35. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +1 -0
  36. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9a2e1c98c3971454ebfaefe6902121bfab6e577f693e36a525739eb2dfbeeb9
4
- data.tar.gz: 7f35351f0f647a165c82f512395e8883647e96165968869bf3904f4c2bf6b4ab
3
+ metadata.gz: 32670ffa1c3f59d5dfb573f0543ef36e80e79341acacdcb5722249425e775fa9
4
+ data.tar.gz: 6e3c47dad7eeacae2b6d06277deda1e2e9e90903e83883263021e306920e99f0
5
5
  SHA512:
6
- metadata.gz: '072284cd8bb18b6190b870aa014fb278744a6db35d1210ca57dbddb1d78c71a2675f2675a7ce581b83cbb1fdcd88cdeb6dedd6892c2402b43cf3f711425f9e46'
7
- data.tar.gz: 4bad8302b9bef1496fc47e5f04cb301dd3c81a99dff5800ffbc1aaf3ef4bf1f5a6493f4908178b337e7f25596b7f9ce2946d47d7526b38065ccfbd7ac045624a
6
+ metadata.gz: 6324e2e4f0b75435fcb5baade6dbad8fb693de5cc74fff3171f53598d791486a4043826bea965ee79c58cf3988d0d69c449240f3607ec2a201c79b14f0dcdb2d
7
+ data.tar.gz: 6394379b7ea271aba332256587ba406b03c3230a8647fed74d57ef474436e9b0b729be902cc60d7ee8be1ae9913f2173673c62c8f7e31383802c25bffd2d112a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v4.5.0 - 2025-05-27
4
+ ### Changes
5
+ * :sparkles: add support for Financial Document v1.14
6
+ * :sparkles: add support for US Healthcare Cards v1.3
7
+ * :sparkles: add support for Invoice v4.11
8
+ ### Fixes
9
+ * :recycle: switch to 'Transfer-Encoding: chunked' to prevent Net::HTTP from writing temporary files
10
+
11
+
12
+ ## v4.4.1 - 2025-05-13
13
+ ### Fixes
14
+ * :bug: fix bad option in CLI
15
+ * :bug: don't open the PDF unless needed
16
+
17
+
3
18
  ## v4.4.0 - 2025-04-23
4
19
  ### Changes
5
20
  * :sparkles: add support for workflow polling
data/bin/mindee.rb CHANGED
@@ -99,7 +99,7 @@ else
99
99
  end
100
100
 
101
101
  if options[:cut_pages].nil? || !options[:cut_pages].is_a?(Integer) || options[:cut_pages] < 0
102
- page_options = options[:cut_pages].nil?
102
+ page_options = nil
103
103
  else
104
104
  page_options = Mindee::PageOptions.new(params: {
105
105
  page_indexes: (0..options[:cut_pages].to_i).to_a,
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Receipt API](https://platform.mindee.com/m
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `expense_receipts` |
15
- > | Recommended Version | `v5.3` |
15
+ > | Recommended Version | `v5.4` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ✔️ Yes |
18
18
  > | Geography | 🌐 Global |
@@ -264,6 +264,9 @@ The following fields are extracted for Receipt V5:
264
264
  - 'gasoline'
265
265
  - 'telecom'
266
266
  - 'miscellaneous'
267
+ - 'software'
268
+ - 'shopping'
269
+ - 'energy'
267
270
 
268
271
  ```rb
269
272
  puts result.document.inference.prediction.category.value
@@ -319,6 +322,15 @@ puts result.document.inference.prediction.receipt_number.value
319
322
  - 'train'
320
323
  - 'restaurant'
321
324
  - 'shopping'
325
+ - 'other'
326
+ - 'groceries'
327
+ - 'cultural'
328
+ - 'electronics'
329
+ - 'office_supplies'
330
+ - 'micromobility'
331
+ - 'car_rental'
332
+ - 'public'
333
+ - 'delivery'
322
334
  - nil
323
335
 
324
336
  ```rb
@@ -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.12` |
15
+ > | Recommended Version | `v1.14` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ✔️ Yes |
18
18
  > | Geography | 🌐 Global |
@@ -93,12 +93,12 @@ puts result.document
93
93
  ########
94
94
  Document
95
95
  ########
96
- :Mindee ID: a80ac0ee-26f6-4e2e-988a-960b240d5ba7
96
+ :Mindee ID: 6dd26385-719b-4527-bf6f-87d9da619de5
97
97
  :Filename: default_sample.jpg
98
98
 
99
99
  Inference
100
100
  #########
101
- :Product: mindee/financial_document v1.11
101
+ :Product: mindee/financial_document v1.14
102
102
  :Rotation applied: Yes
103
103
 
104
104
  Prediction
@@ -134,6 +134,7 @@ Prediction
134
134
  :Shipping Address: 2019 Redbud Drive New York, NY 10011
135
135
  :Billing Address: 4312 Wood Road New York, NY 10031
136
136
  :Document Type: INVOICE
137
+ :Document Type Extended: INVOICE
137
138
  :Purchase Subcategory:
138
139
  :Purchase Category: miscellaneous
139
140
  :Total Tax: 9.75
@@ -186,6 +187,7 @@ Page 0
186
187
  :Shipping Address: 2019 Redbud Drive New York, NY 10011
187
188
  :Billing Address: 4312 Wood Road New York, NY 10031
188
189
  :Document Type: INVOICE
190
+ :Document Type Extended: INVOICE
189
191
  :Purchase Subcategory:
190
192
  :Purchase Category: miscellaneous
191
193
  :Total Tax: 9.75
@@ -309,7 +311,7 @@ puts result.document.inference.prediction.billing_address.value
309
311
  ```
310
312
 
311
313
  ## Purchase Category
312
- **category** ([ClassificationField](#classification-field)): The purchase category, only for receipts.
314
+ **category** ([ClassificationField](#classification-field)): The purchase category.
313
315
 
314
316
  #### Possible values include:
315
317
  - 'toll'
@@ -320,6 +322,9 @@ puts result.document.inference.prediction.billing_address.value
320
322
  - 'gasoline'
321
323
  - 'telecom'
322
324
  - 'miscellaneous'
325
+ - 'software'
326
+ - 'shopping'
327
+ - 'energy'
323
328
 
324
329
  ```rb
325
330
  puts result.document.inference.prediction.category.value
@@ -468,7 +473,7 @@ puts result.document.inference.prediction.shipping_address.value
468
473
  ```
469
474
 
470
475
  ## Purchase Subcategory
471
- **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport and food, only for receipts.
476
+ **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport, food and shooping.
472
477
 
473
478
  #### Possible values include:
474
479
  - 'plane'
@@ -476,6 +481,15 @@ puts result.document.inference.prediction.shipping_address.value
476
481
  - 'train'
477
482
  - 'restaurant'
478
483
  - 'shopping'
484
+ - 'other'
485
+ - 'groceries'
486
+ - 'cultural'
487
+ - 'electronics'
488
+ - 'office_supplies'
489
+ - 'micromobility'
490
+ - 'car_rental'
491
+ - 'public'
492
+ - 'delivery'
479
493
  - nil
480
494
 
481
495
  ```rb
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [International ID API](https://platform.min
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `international_id` |
15
- > | Recommended Version | `v2.1` |
15
+ > | Recommended Version | `v2.2` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ❌ No |
18
18
  > | Geography | 🌐 Global |
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Invoice Splitter API](https://platform.min
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `invoice_splitter` |
15
- > | Recommended Version | `v1.2` |
15
+ > | Recommended Version | `v1.4` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ❌ No |
18
18
  > | Geography | 🌐 Global |
@@ -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.10` |
15
+ > | Recommended Version | `v4.11` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ✔️ Yes |
18
18
  > | Geography | 🌐 Global |
@@ -93,12 +93,12 @@ puts result.document
93
93
  ########
94
94
  Document
95
95
  ########
96
- :Mindee ID: b55db8f9-ae3b-4f05-b2f1-ec0ced5e5b70
96
+ :Mindee ID: 744748d5-9051-461c-b70c-bbf81f5ff943
97
97
  :Filename: default_sample.jpg
98
98
 
99
99
  Inference
100
100
  #########
101
- :Product: mindee/invoices v4.9
101
+ :Product: mindee/invoices v4.11
102
102
  :Rotation applied: Yes
103
103
 
104
104
  Prediction
@@ -133,6 +133,9 @@ Prediction
133
133
  :Shipping Address:
134
134
  :Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
135
135
  :Document Type: INVOICE
136
+ :Document Type Extended: INVOICE
137
+ :Purchase Subcategory:
138
+ :Purchase Category: miscellaneous
136
139
  :Line Items:
137
140
  +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
138
141
  | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
@@ -179,6 +182,9 @@ Page 0
179
182
  :Shipping Address:
180
183
  :Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
181
184
  :Document Type: INVOICE
185
+ :Document Type Extended: INVOICE
186
+ :Purchase Subcategory:
187
+ :Purchase Category: miscellaneous
182
188
  :Line Items:
183
189
  +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
184
190
  | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
@@ -296,6 +302,25 @@ The following fields are extracted for Invoice V4:
296
302
  puts result.document.inference.prediction.billing_address.value
297
303
  ```
298
304
 
305
+ ## Purchase Category
306
+ **category** ([ClassificationField](#classification-field)): The purchase category.
307
+
308
+ #### Possible values include:
309
+ - 'toll'
310
+ - 'food'
311
+ - 'parking'
312
+ - 'transport'
313
+ - 'accommodation'
314
+ - 'telecom'
315
+ - 'miscellaneous'
316
+ - 'software'
317
+ - 'shopping'
318
+ - 'energy'
319
+
320
+ ```rb
321
+ puts result.document.inference.prediction.category.value
322
+ ```
323
+
299
324
  ## Customer Address
300
325
  **customer_address** ([StringField](#string-field)): The address of the customer.
301
326
 
@@ -422,6 +447,30 @@ end
422
447
  puts result.document.inference.prediction.shipping_address.value
423
448
  ```
424
449
 
450
+ ## Purchase Subcategory
451
+ **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport, food and shopping.
452
+
453
+ #### Possible values include:
454
+ - 'plane'
455
+ - 'taxi'
456
+ - 'train'
457
+ - 'restaurant'
458
+ - 'shopping'
459
+ - 'other'
460
+ - 'groceries'
461
+ - 'cultural'
462
+ - 'electronics'
463
+ - 'office_supplies'
464
+ - 'micromobility'
465
+ - 'car_rental'
466
+ - 'public'
467
+ - 'delivery'
468
+ - nil
469
+
470
+ ```rb
471
+ puts result.document.inference.prediction.subcategory.value
472
+ ```
473
+
425
474
  ## Supplier Address
426
475
  **supplier_address** ([StringField](#string-field)): The address of the supplier or merchant.
427
476
 
@@ -63,18 +63,18 @@ puts result.document
63
63
  ########
64
64
  Document
65
65
  ########
66
- :Mindee ID: 17f0ccef-e3fe-4a28-838d-d704489d6ce7
66
+ :Mindee ID: ff1f2ca8-4d29-44d8-a564-599a982a4ef7
67
67
  :Filename: default_sample.pdf
68
68
 
69
69
  Inference
70
70
  #########
71
- :Product: mindee/energy_bill_fra v1.0
72
- :Rotation applied: No
71
+ :Product: mindee/energy_bill_fra v1.2
72
+ :Rotation applied: Yes
73
73
 
74
74
  Prediction
75
75
  ==========
76
- :Invoice Number: 10123590373
77
- :Contract ID: 1234567890
76
+ :Invoice Number: 1234567890
77
+ :Contract ID: 9876543210
78
78
  :Delivery Point: 98765432109876
79
79
  :Invoice Date: 2021-01-29
80
80
  :Due Date: 2021-02-15
@@ -82,11 +82,11 @@ Prediction
82
82
  :Total Taxes: 238.82
83
83
  :Total Amount: 1479.85
84
84
  :Energy Supplier:
85
- :Address: TSA 12345, 12345 DEMOCITY CEDEX, 75001 PARIS
85
+ :Address: TSA 12345, 12345 DEMOCITY CEDEX
86
86
  :Name: EDF
87
87
  :Energy Consumer:
88
- :Address: 12 AVENUE DES RÊVES, RDC A 123 COUR FAUSSE A, 75000 PARIS
89
- :Name: John Doe
88
+ :Address: 123 RUE DE L'IMAGINAIRE, 75001 PARIS
89
+ :Name: JOHN DOE
90
90
  :Subscription:
91
91
  +--------------------------------------+------------+------------+----------+-----------+------------+
92
92
  | Description | End Date | Start Date | Tax Rate | Total | Unit Price |
@@ -94,27 +94,27 @@ Prediction
94
94
  | Abonnement électricité | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 |
95
95
  +--------------------------------------+------------+------------+----------+-----------+------------+
96
96
  :Energy Usage:
97
- +--------------------------------------+------------+------------+----------+-----------+------------+
98
- | Description | End Date | Start Date | Tax Rate | Total | Unit Price |
99
- +======================================+============+============+==========+===========+============+
100
- | Consommation (HT) | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | 10.47 |
101
- +--------------------------------------+------------+------------+----------+-----------+------------+
97
+ +-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+
98
+ | Consumption | Description | End Date | Start Date | Tax Rate | Total | Unit of Measure | Unit Price |
99
+ +=============+======================================+============+============+==========+===========+=================+============+
100
+ | 8581.00 | Consommation électricité | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | kWh | 0.1047 |
101
+ +-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+
102
102
  :Taxes and Contributions:
103
103
  +--------------------------------------+------------+------------+----------+-----------+------------+
104
104
  | Description | End Date | Start Date | Tax Rate | Total | Unit Price |
105
105
  +======================================+============+============+==========+===========+============+
106
- | Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 2.25 |
106
+ | Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 0.0225 |
107
107
  +--------------------------------------+------------+------------+----------+-----------+------------+
108
- | Départementale sur la Conso Final... | 2020-12-31 | 2020-11-28 | 20.00 | 13.98 | 0.3315 |
108
+ | Taxe Départementale sur la Conso ... | 2021-01-27 | 2020-11-28 | 20.00 | 13.98 | 0.003315 |
109
109
  +--------------------------------------+------------+------------+----------+-----------+------------+
110
- | Communale sur la Conso Finale Ele... | 2021-01-27 | 2021-01-01 | 20.00 | 28.56 | 0.6545 |
110
+ | Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 28.56 | 0.006545 |
111
111
  +--------------------------------------+------------+------------+----------+-----------+------------+
112
- | Contribution Tarifaire d'Achemine... | 2020-12-31 | 2020-11-28 | 20.00 | 27.96 | 0.663 |
112
+ | Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 27.96 | 0.00663 |
113
113
  +--------------------------------------+------------+------------+----------+-----------+------------+
114
114
  :Meter Details:
115
115
  :Meter Number: 620
116
116
  :Meter Type: electricity
117
- :Unit of Measure: kWh
117
+ :Unit of Power: 36kVA
118
118
  ```
119
119
 
120
120
  # Field Types
@@ -68,7 +68,7 @@ Document
68
68
 
69
69
  Inference
70
70
  #########
71
- :Product: mindee/ind_passport v1.0
71
+ :Product: mindee/ind_passport v1.2
72
72
  :Rotation applied: Yes
73
73
 
74
74
  Prediction
@@ -91,10 +91,10 @@ Prediction
91
91
  :Name of Mother:
92
92
  :Old Passport Date of Issue:
93
93
  :Old Passport Number:
94
+ :Old Passport Place of Issue:
94
95
  :Address Line 1:
95
96
  :Address Line 2:
96
97
  :Address Line 3:
97
- :Old Passport Place of Issue:
98
98
  :File Number:
99
99
  ```
100
100
 
@@ -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.2` |
15
+ > | Recommended Version | `v1.3` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ❌ No |
18
18
  > | Geography | 🇺🇸 United States |
@@ -63,17 +63,18 @@ puts result.document
63
63
  ########
64
64
  Document
65
65
  ########
66
- :Mindee ID: 0ced9f49-00c0-4a1d-8221-4a1538813a95
66
+ :Mindee ID: 5e917fc8-5c13-42b2-967f-954f4eed9959
67
67
  :Filename: default_sample.jpg
68
68
 
69
69
  Inference
70
70
  #########
71
- :Product: mindee/us_healthcare_cards v1.0
72
- :Rotation applied: No
71
+ :Product: mindee/us_healthcare_cards v1.3
72
+ :Rotation applied: Yes
73
73
 
74
74
  Prediction
75
75
  ==========
76
76
  :Company Name: UnitedHealthcare
77
+ :Plan Name: Choice Plus
77
78
  :Member Name: SUBSCRIBER SMITH
78
79
  :Member ID: 123456789
79
80
  :Issuer 80840:
@@ -84,21 +85,22 @@ Prediction
84
85
  :Group Number: 98765
85
86
  :Payer ID: 87726
86
87
  :RX BIN: 610279
88
+ :RX ID:
87
89
  :RX GRP: UHEALTH
88
90
  :RX PCN: 9999
89
- :copays:
90
- +--------------+--------------+
91
- | Service Fees | Service Name |
92
- +==============+==============+
93
- | 20.00 | office visit |
94
- +--------------+--------------+
95
- | 300.00 | emergency |
96
- +--------------+--------------+
97
- | 75.00 | urgent care |
98
- +--------------+--------------+
99
- | 30.00 | specialist |
100
- +--------------+--------------+
101
- :Enrollment Date: 2023-09-13
91
+ :Copays:
92
+ +--------------+----------------------+
93
+ | Service Fees | Service Name |
94
+ +==============+======================+
95
+ | 20.00 | office_visit |
96
+ +--------------+----------------------+
97
+ | 300.00 | emergency_room |
98
+ +--------------+----------------------+
99
+ | 75.00 | urgent_care |
100
+ +--------------+----------------------+
101
+ | 30.00 | specialist |
102
+ +--------------+----------------------+
103
+ :Enrollment Date:
102
104
  ```
103
105
 
104
106
  # Field Types
@@ -130,13 +132,13 @@ The text field `StringField` only has one constraint: it's **value** is a `Strin
130
132
  ## Specific Fields
131
133
  Fields which are specific to this product; they are not used in any other product.
132
134
 
133
- ### copays Field
134
- Is a fixed amount for a covered service.
135
+ ### Copays Field
136
+ Copayments for covered services.
135
137
 
136
138
  A `HealthcareCardV1Copay` implements the following attributes:
137
139
 
138
- * `service_fees` (Float): The price of service.
139
- * `service_name` (String): The name of service of the copay.
140
+ * `service_fees` (Float): The price of the service.
141
+ * `service_name` (String): The name of the service.
140
142
 
141
143
  #### Possible values include:
142
144
  - primary_care
@@ -157,8 +159,8 @@ The following fields are extracted for Healthcare Card V1:
157
159
  puts result.document.inference.prediction.company_name.value
158
160
  ```
159
161
 
160
- ## copays
161
- **copays** (Array<[HealthcareCardV1Copay](#copays-field)>): Is a fixed amount for a covered service.
162
+ ## Copays
163
+ **copays** (Array<[HealthcareCardV1Copay](#copays-field)>): Copayments for covered services.
162
164
 
163
165
  ```rb
164
166
  result.document.inference.prediction.copays do |copays_elem|
@@ -217,6 +219,13 @@ puts result.document.inference.prediction.member_name.value
217
219
  puts result.document.inference.prediction.payer_id.value
218
220
  ```
219
221
 
222
+ ## Plan Name
223
+ **plan_name** ([StringField](#string-field)): The name of the healthcare plan.
224
+
225
+ ```rb
226
+ puts result.document.inference.prediction.plan_name.value
227
+ ```
228
+
220
229
  ## RX BIN
221
230
  **rx_bin** ([StringField](#string-field)): The BIN number for prescription drug coverage.
222
231
 
@@ -26,8 +26,7 @@ The Ruby Client Library supports the [US Mail API](https://platform.mindee.com/m
26
26
  > | Polling Attempts Before Timeout | `max_retries` | 80 retries |
27
27
 
28
28
 
29
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg),
30
- we are going to illustrate how to extract the data that we want using the Ruby Client Library.
29
+ The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg) can be used for testing purposes.
31
30
  ![US Mail sample](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg?raw=true)
32
31
 
33
32
  # Quick-Start
@@ -57,39 +56,6 @@ puts result.document
57
56
  # Print the document-level parsed data
58
57
  # puts result.document.inference.prediction
59
58
  ```
60
-
61
- **Output (RST):**
62
- ```rst
63
- ########
64
- Document
65
- ########
66
- :Mindee ID: f9c36f59-977d-4ddc-9f2d-31c294c456ac
67
- :Filename: default_sample.jpg
68
-
69
- Inference
70
- #########
71
- :Product: mindee/us_mail v3.0
72
- :Rotation applied: Yes
73
-
74
- Prediction
75
- ==========
76
- :Sender Name: company zed
77
- :Sender Address:
78
- :City: Dallas
79
- :Complete Address: 54321 Elm Street, Dallas, Texas 54321
80
- :Postal Code: 54321
81
- :State: TX
82
- :Street: 54321 Elm Street
83
- :Recipient Names: Jane Doe
84
- :Recipient Addresses:
85
- +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+-----------------+
86
- | City | Complete Address | Is Address Change | Postal Code | Private Mailbox Number | State | Street | Unit |
87
- +=================+=====================================+===================+=============+========================+=======+===========================+=================+
88
- | Detroit | 1234 Market Street PMB 4321, Det... | False | 12345 | 4321 | MI | 1234 Market Street | |
89
- +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+-----------------+
90
- :Return to Sender: False
91
- ```
92
-
93
59
  # Field Types
94
60
  ## Standard Fields
95
61
  These fields are generic and used in several products.
data/lib/mindee/client.rb CHANGED
@@ -323,8 +323,7 @@ module Mindee
323
323
  def execute_workflow(input_source, workflow_id, options: {})
324
324
  opts = options.is_a?(WorkflowOptions) ? options : WorkflowOptions.new(params: options)
325
325
  if opts.respond_to?(:page_options) && input_source.is_a?(Input::Source::LocalInputSource)
326
- process_pdf_if_required(input_source,
327
- opts)
326
+ process_pdf_if_required(input_source, opts)
328
327
  end
329
328
 
330
329
  workflow_endpoint = Mindee::HTTP::WorkflowEndpoint.new(workflow_id, api_key: @api_key)
@@ -496,7 +495,7 @@ module Mindee
496
495
  # @param opts [ParseOptions]
497
496
  def process_pdf_if_required(input_source, opts)
498
497
  return unless input_source.is_a?(Mindee::Input::Source::LocalInputSource) &&
499
- opts.page_options &&
498
+ opts.page_options.on_min_pages &&
500
499
  input_source.pdf?
501
500
 
502
501
  input_source.process_pdf(opts.page_options)
@@ -128,6 +128,8 @@ module Mindee
128
128
  form_data.push ['include_mvision', 'true'] if opts.all_words
129
129
 
130
130
  req.set_form(form_data, 'multipart/form-data')
131
+ req['Transfer-Encoding'] = 'chunked'
132
+
131
133
  Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: @request_timeout) do |http|
132
134
  return http.request(req)
133
135
  end
@@ -163,6 +165,7 @@ module Mindee
163
165
  form_data.push ['include_mvision', 'true'] if opts.all_words
164
166
 
165
167
  req.set_form(form_data, 'multipart/form-data')
168
+ req['Transfer-Encoding'] = 'chunked'
166
169
 
167
170
  Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: @request_timeout) do |http|
168
171
  return http.request(req)
@@ -69,6 +69,7 @@ module Mindee
69
69
  form_data.push ['priority', opts.priority.to_s] if opts.priority
70
70
 
71
71
  req.set_form(form_data, 'multipart/form-data')
72
+ req['Transfer-Encoding'] = 'chunked'
72
73
 
73
74
  response = nil
74
75
  Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: @request_timeout) do |http|
@@ -42,7 +42,7 @@ module Mindee
42
42
  @is_rotation_applied = raw_prediction['is_rotation_applied']
43
43
  @product = Product.new(raw_prediction['product'])
44
44
  @pages = [] # : Array[Page]
45
- @extras = Extras::Extras.new(raw_prediction['extras'])
45
+ @extras = Extras::Extras.new(raw_prediction['extras']) if raw_prediction.include?('extras')
46
46
  end
47
47
 
48
48
  # @return [String]
@@ -6,13 +6,13 @@ 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.12 document data.
9
+ # Financial Document API version 1.14 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.
13
13
  # @return [Mindee::Parsing::Standard::StringField]
14
14
  attr_reader :billing_address
15
- # The purchase category, only for receipts.
15
+ # The purchase category.
16
16
  # @return [Mindee::Parsing::Standard::ClassificationField]
17
17
  attr_reader :category
18
18
  # The address of the customer.
@@ -67,7 +67,7 @@ module Mindee
67
67
  # The customer's address used for shipping.
68
68
  # @return [Mindee::Parsing::Standard::StringField]
69
69
  attr_reader :shipping_address
70
- # The purchase subcategory for transport and food, only for receipts.
70
+ # The purchase subcategory for transport, food and shooping.
71
71
  # @return [Mindee::Parsing::Standard::ClassificationField]
72
72
  attr_reader :subcategory
73
73
  # The address of the supplier or merchant.
@@ -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.12 page data.
9
+ # Financial Document API version 1.14 page data.
10
10
  class FinancialDocumentV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -192,10 +192,10 @@ module Mindee
192
192
  out_str << "\n:Name of Mother: #{@name_of_mother}".rstrip
193
193
  out_str << "\n:Old Passport Date of Issue: #{@old_passport_date_of_issue}".rstrip
194
194
  out_str << "\n:Old Passport Number: #{@old_passport_number}".rstrip
195
+ out_str << "\n:Old Passport Place of Issue: #{@old_passport_place_of_issue}".rstrip
195
196
  out_str << "\n:Address Line 1: #{@address1}".rstrip
196
197
  out_str << "\n:Address Line 2: #{@address2}".rstrip
197
198
  out_str << "\n:Address Line 3: #{@address3}".rstrip
198
- out_str << "\n:Old Passport Place of Issue: #{@old_passport_place_of_issue}".rstrip
199
199
  out_str << "\n:File Number: #{@file_number}".rstrip
200
200
  out_str[1..].to_s
201
201
  end
@@ -5,7 +5,7 @@ require_relative '../../parsing'
5
5
  module Mindee
6
6
  module Product
7
7
  module InternationalId
8
- # International ID API version 2.1 document data.
8
+ # International ID API version 2.2 document data.
9
9
  class InternationalIdV2Document < Mindee::Parsing::Common::Prediction
10
10
  include Mindee::Parsing::Standard
11
11
  # The physical address of the document holder.
@@ -6,7 +6,7 @@ require_relative 'international_id_v2_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module InternationalId
9
- # International ID API version 2.1 page data.
9
+ # International ID API version 2.2 page data.
10
10
  class InternationalIdV2Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -6,12 +6,15 @@ require_relative 'invoice_v4_line_items'
6
6
  module Mindee
7
7
  module Product
8
8
  module Invoice
9
- # Invoice API version 4.10 document data.
9
+ # Invoice API version 4.11 document data.
10
10
  class InvoiceV4Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # The customer billing address.
13
13
  # @return [Mindee::Parsing::Standard::StringField]
14
14
  attr_reader :billing_address
15
+ # The purchase category.
16
+ # @return [Mindee::Parsing::Standard::ClassificationField]
17
+ attr_reader :category
15
18
  # The address of the customer.
16
19
  # @return [Mindee::Parsing::Standard::StringField]
17
20
  attr_reader :customer_address
@@ -57,6 +60,9 @@ module Mindee
57
60
  # Customer's delivery address.
58
61
  # @return [Mindee::Parsing::Standard::StringField]
59
62
  attr_reader :shipping_address
63
+ # The purchase subcategory for transport, food and shopping.
64
+ # @return [Mindee::Parsing::Standard::ClassificationField]
65
+ attr_reader :subcategory
60
66
  # The address of the supplier or merchant.
61
67
  # @return [Mindee::Parsing::Standard::StringField]
62
68
  attr_reader :supplier_address
@@ -99,6 +105,10 @@ module Mindee
99
105
  prediction['billing_address'],
100
106
  page_id
101
107
  )
108
+ @category = Parsing::Standard::ClassificationField.new(
109
+ prediction['category'],
110
+ page_id
111
+ )
102
112
  @customer_address = Parsing::Standard::StringField.new(
103
113
  prediction['customer_address'],
104
114
  page_id
@@ -153,6 +163,10 @@ module Mindee
153
163
  prediction['shipping_address'],
154
164
  page_id
155
165
  )
166
+ @subcategory = Parsing::Standard::ClassificationField.new(
167
+ prediction['subcategory'],
168
+ page_id
169
+ )
156
170
  @supplier_address = Parsing::Standard::StringField.new(
157
171
  prediction['supplier_address'],
158
172
  page_id
@@ -230,6 +244,8 @@ module Mindee
230
244
  out_str << "\n:Billing Address: #{@billing_address}".rstrip
231
245
  out_str << "\n:Document Type: #{@document_type}".rstrip
232
246
  out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip
247
+ out_str << "\n:Purchase Subcategory: #{@subcategory}".rstrip
248
+ out_str << "\n:Purchase Category: #{@category}".rstrip
233
249
  out_str << "\n:Line Items:"
234
250
  out_str << line_items
235
251
  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.10 page data.
9
+ # Invoice API version 4.11 page data.
10
10
  class InvoiceV4Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -6,7 +6,7 @@ require_relative 'invoice_splitter_v1_invoice_page_groups'
6
6
  module Mindee
7
7
  module Product
8
8
  module InvoiceSplitter
9
- # Invoice Splitter API version 1.2 document data.
9
+ # Invoice Splitter API version 1.4 document data.
10
10
  class InvoiceSplitterV1Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # List of page groups. Each group represents a single invoice within a multi-invoice document.
@@ -6,7 +6,7 @@ require_relative 'invoice_splitter_v1_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module InvoiceSplitter
9
- # Invoice Splitter API version 1.2 page data.
9
+ # Invoice Splitter API version 1.4 page data.
10
10
  class InvoiceSplitterV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -6,7 +6,7 @@ require_relative 'receipt_v5_line_items'
6
6
  module Mindee
7
7
  module Product
8
8
  module Receipt
9
- # Receipt API version 5.3 document data.
9
+ # Receipt API version 5.4 document data.
10
10
  class ReceiptV5Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # The purchase category of the receipt.
@@ -6,7 +6,7 @@ require_relative 'receipt_v5_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module Receipt
9
- # Receipt API version 5.3 page data.
9
+ # Receipt API version 5.4 page data.
10
10
  class ReceiptV5Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -6,13 +6,13 @@ module Mindee
6
6
  module Product
7
7
  module US
8
8
  module HealthcareCard
9
- # Is a fixed amount for a covered service.
9
+ # Copayments for covered services.
10
10
  class HealthcareCardV1Copay < Mindee::Parsing::Standard::FeatureField
11
11
  include Mindee::Parsing::Standard
12
- # The price of service.
12
+ # The price of the service.
13
13
  # @return [Float]
14
14
  attr_reader :service_fees
15
- # The name of service of the copay.
15
+ # The name of the service.
16
16
  # @return [String]
17
17
  attr_reader :service_name
18
18
 
@@ -6,7 +6,7 @@ module Mindee
6
6
  module Product
7
7
  module US
8
8
  module HealthcareCard
9
- # Is a fixed amount for a covered service.
9
+ # Copayments for covered services.
10
10
  class HealthcareCardV1Copays < Array
11
11
  # Entries.
12
12
  # @return [Array<HealthcareCardV1Copay>]
@@ -7,13 +7,13 @@ module Mindee
7
7
  module Product
8
8
  module US
9
9
  module HealthcareCard
10
- # Healthcare Card API version 1.2 document data.
10
+ # Healthcare Card API version 1.3 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.
14
14
  # @return [Mindee::Parsing::Standard::StringField]
15
15
  attr_reader :company_name
16
- # Is a fixed amount for a covered service.
16
+ # Copayments for covered services.
17
17
  # @return [Mindee::Product::US::HealthcareCard::HealthcareCardV1Copays]
18
18
  attr_reader :copays
19
19
  # The list of dependents covered by the healthcare plan.
@@ -37,6 +37,9 @@ module Mindee
37
37
  # The unique identifier for the payer in the healthcare system.
38
38
  # @return [Mindee::Parsing::Standard::StringField]
39
39
  attr_reader :payer_id
40
+ # The name of the healthcare plan.
41
+ # @return [Mindee::Parsing::Standard::StringField]
42
+ attr_reader :plan_name
40
43
  # The BIN number for prescription drug coverage.
41
44
  # @return [Mindee::Parsing::Standard::StringField]
42
45
  attr_reader :rx_bin
@@ -87,6 +90,10 @@ module Mindee
87
90
  prediction['payer_id'],
88
91
  page_id
89
92
  )
93
+ @plan_name = Parsing::Standard::StringField.new(
94
+ prediction['plan_name'],
95
+ page_id
96
+ )
90
97
  @rx_bin = Parsing::Standard::StringField.new(
91
98
  prediction['rx_bin'],
92
99
  page_id
@@ -108,6 +115,7 @@ module Mindee
108
115
  copays = copays_to_s
109
116
  out_str = String.new
110
117
  out_str << "\n:Company Name: #{@company_name}".rstrip
118
+ out_str << "\n:Plan Name: #{@plan_name}".rstrip
111
119
  out_str << "\n:Member Name: #{@member_name}".rstrip
112
120
  out_str << "\n:Member ID: #{@member_id}".rstrip
113
121
  out_str << "\n:Issuer 80840: #{@issuer80840}".rstrip
@@ -118,7 +126,7 @@ module Mindee
118
126
  out_str << "\n:RX ID: #{@rx_id}".rstrip
119
127
  out_str << "\n:RX GRP: #{@rx_grp}".rstrip
120
128
  out_str << "\n:RX PCN: #{@rx_pcn}".rstrip
121
- out_str << "\n:copays:"
129
+ out_str << "\n:Copays:"
122
130
  out_str << copays
123
131
  out_str << "\n:Enrollment Date: #{@enrollment_date}".rstrip
124
132
  out_str[1..].to_s
@@ -7,7 +7,7 @@ module Mindee
7
7
  module Product
8
8
  module US
9
9
  module HealthcareCard
10
- # Healthcare Card API version 1.2 page data.
10
+ # Healthcare Card API version 1.3 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.4.0'
6
+ VERSION = '4.5.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [Symbol, Hash[Symbol | String, Regexp], Nil?]
@@ -15,6 +15,7 @@ module Net
15
15
  def initialize: (untyped, Hash[String, String]?) -> void
16
16
  def set_form: (untyped, String?) -> void
17
17
  def new: (untyped, untyped) -> void
18
+ def []=: (?untyped, ?untyped) -> bool
18
19
  end
19
20
 
20
21
  # Stub for the HTTP GET request class.
@@ -6,6 +6,7 @@ module Mindee
6
6
  class InvoiceV4Document < Parsing::Common::Prediction
7
7
  def initialize: (Hash[Symbol | String, untyped], Integer?) -> void
8
8
  def billing_address: -> (Parsing::Standard::StringField)
9
+ def category: -> (Parsing::Standard::ClassificationField)
9
10
  def customer_address: -> (Parsing::Standard::StringField)
10
11
  def customer_company_registrations: -> (Array[Parsing::Standard::CompanyRegistrationField])
11
12
  def customer_id: -> (Parsing::Standard::StringField)
@@ -21,6 +22,7 @@ module Mindee
21
22
  def po_number: -> (Parsing::Standard::StringField)
22
23
  def reference_numbers: -> (Array[Parsing::Standard::StringField])
23
24
  def shipping_address: -> (Parsing::Standard::StringField)
25
+ def subcategory: -> (Parsing::Standard::ClassificationField)
24
26
  def supplier_address: -> (Parsing::Standard::StringField)
25
27
  def supplier_company_registrations: -> (Array[Parsing::Standard::CompanyRegistrationField])
26
28
  def supplier_email: -> (Parsing::Standard::StringField)
@@ -15,6 +15,7 @@ module Mindee
15
15
  def member_id: -> (Parsing::Standard::StringField)
16
16
  def member_name: -> (Parsing::Standard::StringField)
17
17
  def payer_id: -> (Parsing::Standard::StringField)
18
+ def plan_name: -> (Parsing::Standard::StringField)
18
19
  def rx_bin: -> (Parsing::Standard::StringField)
19
20
  def rx_grp: -> (Parsing::Standard::StringField)
20
21
  def rx_id: -> (Parsing::Standard::StringField)
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.4.0
4
+ version: 4.5.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-04-24 00:00:00.000000000 Z
11
+ date: 2025-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64