mindee 4.4.1 → 4.6.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 +4 -4
- data/CHANGELOG.md +13 -0
- data/docs/global_products/expense_receipts_v5.md +13 -1
- data/docs/global_products/financial_document_v1.md +38 -9
- data/docs/global_products/international_id_v2.md +1 -1
- data/docs/global_products/invoice_splitter_v1.md +1 -1
- data/docs/global_products/invoices_v4.md +71 -7
- data/docs/localized_products/energy_bill_fra_v1.md +18 -18
- data/docs/localized_products/ind_passport_v1.md +2 -2
- data/docs/localized_products/us_healthcare_cards_v1.md +32 -23
- data/docs/localized_products/us_mail_v3.md +1 -35
- data/lib/mindee/http/endpoint.rb +3 -0
- data/lib/mindee/http/workflow_endpoint.rb +1 -0
- data/lib/mindee/parsing/common/inference.rb +2 -2
- data/lib/mindee/parsing/standard/address_field.rb +49 -0
- data/lib/mindee/parsing/standard.rb +1 -0
- data/lib/mindee/parsing/universal/universal_object_field.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +11 -11
- data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +1 -1
- data/lib/mindee/product/international_id/international_id_v2_document.rb +1 -1
- data/lib/mindee/product/international_id/international_id_v2_page.rb +1 -1
- data/lib/mindee/product/invoice/invoice_v4_document.rb +25 -9
- data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +1 -1
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +1 -1
- data/lib/mindee/product/receipt/receipt_v5_document.rb +1 -1
- data/lib/mindee/product/receipt/receipt_v5_page.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +3 -3
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +11 -3
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
- data/lib/mindee/version.rb +1 -1
- data/mindee.gemspec +1 -1
- data/sig/custom/net_http.rbs +1 -0
- data/sig/mindee/parsing/standard/address_field.rbs +18 -0
- data/sig/mindee/product/financial_document/financial_document_v1_document.rbs +4 -4
- data/sig/mindee/product/invoice/invoice_v4_document.rbs +6 -4
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +1 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c37efc128220eca42a9c5af127911697d47bd4179166d9faec47f04988221d4d
|
4
|
+
data.tar.gz: da2158c80baa262b083baf4696a5d5f2d6b4226999713262419a4c98165cbd80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5c02591130934ad5dcd7e6a87a22e753f4a3cf7bed31a0913c9f4296cc5ed4f741d085267a59d171d6e7146b34542878ae03ca920060ec9ef2e113c9bbd6f74
|
7
|
+
data.tar.gz: 6ba9a4dee2c426885452d19805bfd1582ecf76f0902c420d32cc6c7521085e50a2eb5c8ec7368a820612ae425ae37bdf53487df486d29275a534c87cfbc93f3f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v4.6.0 - 2025-06-03
|
4
|
+
### Changes
|
5
|
+
* :sparkles: add support for address fields
|
6
|
+
|
7
|
+
|
8
|
+
## v4.5.0 - 2025-05-27
|
9
|
+
### Changes
|
10
|
+
* :sparkles: add support for Financial Document v1.14
|
11
|
+
* :sparkles: add support for US Healthcare Cards v1.3
|
12
|
+
* :sparkles: add support for Invoice v4.11
|
13
|
+
### Fixes
|
14
|
+
* :recycle: switch to 'Transfer-Encoding: chunked' to prevent Net::HTTP from writing temporary files
|
15
|
+
|
3
16
|
|
4
17
|
## v4.4.1 - 2025-05-13
|
5
18
|
### Fixes
|
@@ -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.
|
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.
|
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:
|
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.
|
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
|
@@ -222,6 +224,21 @@ A typical `Field` object will have the following attributes:
|
|
222
224
|
Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
|
223
225
|
|
224
226
|
|
227
|
+
### AddressField
|
228
|
+
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:
|
229
|
+
|
230
|
+
* **street_number** (`String`): String representation of the street number. Can be `nil`.
|
231
|
+
* **street_name** (`String`): Name of the street. Can be `nil`.
|
232
|
+
* **po_box** (`String`): String representation of the PO Box number. Can be `nil`.
|
233
|
+
* **address_complement** (`String`): Address complement. Can be `nil`.
|
234
|
+
* **city** (`String`): City name. Can be `nil`.
|
235
|
+
* **postal_code** (`String`): String representation of the postal code. Can be `nil`.
|
236
|
+
* **state** (`String`): State name. Can be `nil`.
|
237
|
+
* **country** (`String`): Country name. Can be `nil`.
|
238
|
+
|
239
|
+
Note: The `value` field of an AddressField should be a concatenation of the rest of the values.
|
240
|
+
|
241
|
+
|
225
242
|
### Amount Field
|
226
243
|
The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`).
|
227
244
|
|
@@ -302,14 +319,14 @@ A `FinancialDocumentV1LineItem` implements the following attributes:
|
|
302
319
|
The following fields are extracted for Financial Document V1:
|
303
320
|
|
304
321
|
## Billing Address
|
305
|
-
**billing_address** ([
|
322
|
+
**billing_address** ([AddressField](#address-field)): The customer's address used for billing.
|
306
323
|
|
307
324
|
```rb
|
308
325
|
puts result.document.inference.prediction.billing_address.value
|
309
326
|
```
|
310
327
|
|
311
328
|
## Purchase Category
|
312
|
-
**category** ([ClassificationField](#classification-field)): The purchase category
|
329
|
+
**category** ([ClassificationField](#classification-field)): The purchase category.
|
313
330
|
|
314
331
|
#### Possible values include:
|
315
332
|
- 'toll'
|
@@ -320,13 +337,16 @@ puts result.document.inference.prediction.billing_address.value
|
|
320
337
|
- 'gasoline'
|
321
338
|
- 'telecom'
|
322
339
|
- 'miscellaneous'
|
340
|
+
- 'software'
|
341
|
+
- 'shopping'
|
342
|
+
- 'energy'
|
323
343
|
|
324
344
|
```rb
|
325
345
|
puts result.document.inference.prediction.category.value
|
326
346
|
```
|
327
347
|
|
328
348
|
## Customer Address
|
329
|
-
**customer_address** ([
|
349
|
+
**customer_address** ([AddressField](#address-field)): The address of the customer.
|
330
350
|
|
331
351
|
```rb
|
332
352
|
puts result.document.inference.prediction.customer_address.value
|
@@ -461,14 +481,14 @@ end
|
|
461
481
|
```
|
462
482
|
|
463
483
|
## Shipping Address
|
464
|
-
**shipping_address** ([
|
484
|
+
**shipping_address** ([AddressField](#address-field)): The customer's address used for shipping.
|
465
485
|
|
466
486
|
```rb
|
467
487
|
puts result.document.inference.prediction.shipping_address.value
|
468
488
|
```
|
469
489
|
|
470
490
|
## Purchase Subcategory
|
471
|
-
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport
|
491
|
+
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport, food and shooping.
|
472
492
|
|
473
493
|
#### Possible values include:
|
474
494
|
- 'plane'
|
@@ -476,6 +496,15 @@ puts result.document.inference.prediction.shipping_address.value
|
|
476
496
|
- 'train'
|
477
497
|
- 'restaurant'
|
478
498
|
- 'shopping'
|
499
|
+
- 'other'
|
500
|
+
- 'groceries'
|
501
|
+
- 'cultural'
|
502
|
+
- 'electronics'
|
503
|
+
- 'office_supplies'
|
504
|
+
- 'micromobility'
|
505
|
+
- 'car_rental'
|
506
|
+
- 'public'
|
507
|
+
- 'delivery'
|
479
508
|
- nil
|
480
509
|
|
481
510
|
```rb
|
@@ -483,7 +512,7 @@ puts result.document.inference.prediction.subcategory.value
|
|
483
512
|
```
|
484
513
|
|
485
514
|
## Supplier Address
|
486
|
-
**supplier_address** ([
|
515
|
+
**supplier_address** ([AddressField](#address-field)): The address of the supplier or merchant.
|
487
516
|
|
488
517
|
```rb
|
489
518
|
puts result.document.inference.prediction.supplier_address.value
|
@@ -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.
|
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.
|
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.
|
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:
|
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.
|
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 |
|
@@ -210,6 +216,21 @@ A typical `Field` object will have the following attributes:
|
|
210
216
|
Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
|
211
217
|
|
212
218
|
|
219
|
+
### AddressField
|
220
|
+
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:
|
221
|
+
|
222
|
+
* **street_number** (`String`): String representation of the street number. Can be `nil`.
|
223
|
+
* **street_name** (`String`): Name of the street. Can be `nil`.
|
224
|
+
* **po_box** (`String`): String representation of the PO Box number. Can be `nil`.
|
225
|
+
* **address_complement** (`String`): Address complement. Can be `nil`.
|
226
|
+
* **city** (`String`): City name. Can be `nil`.
|
227
|
+
* **postal_code** (`String`): String representation of the postal code. Can be `nil`.
|
228
|
+
* **state** (`String`): State name. Can be `nil`.
|
229
|
+
* **country** (`String`): Country name. Can be `nil`.
|
230
|
+
|
231
|
+
Note: The `value` field of an AddressField should be a concatenation of the rest of the values.
|
232
|
+
|
233
|
+
|
213
234
|
### Amount Field
|
214
235
|
The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`).
|
215
236
|
|
@@ -290,14 +311,33 @@ A `InvoiceV4LineItem` implements the following attributes:
|
|
290
311
|
The following fields are extracted for Invoice V4:
|
291
312
|
|
292
313
|
## Billing Address
|
293
|
-
**billing_address** ([
|
314
|
+
**billing_address** ([AddressField](#address-field)): The customer billing address.
|
294
315
|
|
295
316
|
```rb
|
296
317
|
puts result.document.inference.prediction.billing_address.value
|
297
318
|
```
|
298
319
|
|
320
|
+
## Purchase Category
|
321
|
+
**category** ([ClassificationField](#classification-field)): The purchase category.
|
322
|
+
|
323
|
+
#### Possible values include:
|
324
|
+
- 'toll'
|
325
|
+
- 'food'
|
326
|
+
- 'parking'
|
327
|
+
- 'transport'
|
328
|
+
- 'accommodation'
|
329
|
+
- 'telecom'
|
330
|
+
- 'miscellaneous'
|
331
|
+
- 'software'
|
332
|
+
- 'shopping'
|
333
|
+
- 'energy'
|
334
|
+
|
335
|
+
```rb
|
336
|
+
puts result.document.inference.prediction.category.value
|
337
|
+
```
|
338
|
+
|
299
339
|
## Customer Address
|
300
|
-
**customer_address** ([
|
340
|
+
**customer_address** ([AddressField](#address-field)): The address of the customer.
|
301
341
|
|
302
342
|
```rb
|
303
343
|
puts result.document.inference.prediction.customer_address.value
|
@@ -416,14 +456,38 @@ end
|
|
416
456
|
```
|
417
457
|
|
418
458
|
## Shipping Address
|
419
|
-
**shipping_address** ([
|
459
|
+
**shipping_address** ([AddressField](#address-field)): Customer's delivery address.
|
420
460
|
|
421
461
|
```rb
|
422
462
|
puts result.document.inference.prediction.shipping_address.value
|
423
463
|
```
|
424
464
|
|
465
|
+
## Purchase Subcategory
|
466
|
+
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport, food and shopping.
|
467
|
+
|
468
|
+
#### Possible values include:
|
469
|
+
- 'plane'
|
470
|
+
- 'taxi'
|
471
|
+
- 'train'
|
472
|
+
- 'restaurant'
|
473
|
+
- 'shopping'
|
474
|
+
- 'other'
|
475
|
+
- 'groceries'
|
476
|
+
- 'cultural'
|
477
|
+
- 'electronics'
|
478
|
+
- 'office_supplies'
|
479
|
+
- 'micromobility'
|
480
|
+
- 'car_rental'
|
481
|
+
- 'public'
|
482
|
+
- 'delivery'
|
483
|
+
- nil
|
484
|
+
|
485
|
+
```rb
|
486
|
+
puts result.document.inference.prediction.subcategory.value
|
487
|
+
```
|
488
|
+
|
425
489
|
## Supplier Address
|
426
|
-
**supplier_address** ([
|
490
|
+
**supplier_address** ([AddressField](#address-field)): The address of the supplier or merchant.
|
427
491
|
|
428
492
|
```rb
|
429
493
|
puts result.document.inference.prediction.supplier_address.value
|
@@ -63,18 +63,18 @@ puts result.document
|
|
63
63
|
########
|
64
64
|
Document
|
65
65
|
########
|
66
|
-
:Mindee ID:
|
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.
|
72
|
-
:Rotation applied:
|
71
|
+
:Product: mindee/energy_bill_fra v1.2
|
72
|
+
:Rotation applied: Yes
|
73
73
|
|
74
74
|
Prediction
|
75
75
|
==========
|
76
|
-
:Invoice Number:
|
77
|
-
:Contract ID:
|
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
|
85
|
+
:Address: TSA 12345, 12345 DEMOCITY CEDEX
|
86
86
|
:Name: EDF
|
87
87
|
:Energy Consumer:
|
88
|
-
:Address:
|
89
|
-
:Name:
|
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
|
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 |
|
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
|
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
|
110
|
+
| Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 28.56 | 0.006545 |
|
111
111
|
+--------------------------------------+------------+------------+----------+-----------+------------+
|
112
|
-
|
|
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
|
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.
|
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.
|
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:
|
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.
|
72
|
-
:Rotation applied:
|
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
|
-
:
|
90
|
-
|
91
|
-
| Service Fees | Service Name
|
92
|
-
|
93
|
-
| 20.00 |
|
94
|
-
|
95
|
-
| 300.00 |
|
96
|
-
|
97
|
-
| 75.00 |
|
98
|
-
|
99
|
-
| 30.00 | specialist
|
100
|
-
|
101
|
-
:Enrollment Date:
|
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
|
-
###
|
134
|
-
|
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
|
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
|
-
##
|
161
|
-
**copays** (Array<[HealthcareCardV1Copay](#copays-field)>):
|
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
|
-
|
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
|

|
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/http/endpoint.rb
CHANGED
@@ -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]
|
@@ -53,7 +53,7 @@ module Mindee
|
|
53
53
|
out_str << "\n:Product: #{@product.name} v#{@product.version}"
|
54
54
|
out_str << "\n:Rotation applied: #{is_rotation_applied}"
|
55
55
|
out_str << "\n\nPrediction\n=========="
|
56
|
-
out_str << "\n#{
|
56
|
+
out_str << "\n#{"#{@prediction}\n" if @prediction.to_s.size.positive?}"
|
57
57
|
if @pages.any? { |page| !page.prediction.nil? }
|
58
58
|
out_str << "\nPage Predictions\n================\n\n"
|
59
59
|
out_str << @pages.map(&:to_s).join("\n\n")
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'string_field'
|
4
|
+
|
5
|
+
module Mindee
|
6
|
+
module Parsing
|
7
|
+
module Standard
|
8
|
+
# Represents physical-address information.
|
9
|
+
class AddressField < Mindee::Parsing::Standard::StringField
|
10
|
+
# Street number
|
11
|
+
# @return [String, nil]
|
12
|
+
attr_reader :street_number
|
13
|
+
# Street name
|
14
|
+
# @return [String, nil]
|
15
|
+
attr_reader :street_name
|
16
|
+
# PO Box number
|
17
|
+
# @return [String, nil]
|
18
|
+
attr_reader :po_box
|
19
|
+
# Address complement
|
20
|
+
# @return [String, nil]
|
21
|
+
attr_reader :address_complement
|
22
|
+
# City name.
|
23
|
+
# @return [String, nil]
|
24
|
+
attr_reader :city
|
25
|
+
# Postal or ZIP code.
|
26
|
+
# @return [String, nil]
|
27
|
+
attr_reader :postal_code
|
28
|
+
# State, province or region.
|
29
|
+
# @return [String, nil]
|
30
|
+
attr_reader :state
|
31
|
+
# Country.
|
32
|
+
# @return [String, nil]
|
33
|
+
attr_reader :country
|
34
|
+
|
35
|
+
def initialize(prediction, page_id = nil, reconstructed: false)
|
36
|
+
super
|
37
|
+
@street_number = prediction['street_number']
|
38
|
+
@street_name = prediction['street_name']
|
39
|
+
@po_box = prediction['po_box']
|
40
|
+
@address_complement = prediction['address_complement']
|
41
|
+
@city = prediction['city']
|
42
|
+
@postal_code = prediction['postal_code']
|
43
|
+
@state = prediction['state']
|
44
|
+
@country = prediction['country']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -6,17 +6,17 @@ 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.
|
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
|
-
# @return [Mindee::Parsing::Standard::
|
13
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
14
14
|
attr_reader :billing_address
|
15
|
-
# The purchase category
|
15
|
+
# The purchase category.
|
16
16
|
# @return [Mindee::Parsing::Standard::ClassificationField]
|
17
17
|
attr_reader :category
|
18
18
|
# The address of the customer.
|
19
|
-
# @return [Mindee::Parsing::Standard::
|
19
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
20
20
|
attr_reader :customer_address
|
21
21
|
# List of company registration numbers associated to the customer.
|
22
22
|
# @return [Array<Mindee::Parsing::Standard::CompanyRegistrationField>]
|
@@ -65,13 +65,13 @@ module Mindee
|
|
65
65
|
# @return [Array<Mindee::Parsing::Standard::StringField>]
|
66
66
|
attr_reader :reference_numbers
|
67
67
|
# The customer's address used for shipping.
|
68
|
-
# @return [Mindee::Parsing::Standard::
|
68
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
69
69
|
attr_reader :shipping_address
|
70
|
-
# The purchase subcategory for transport
|
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.
|
74
|
-
# @return [Mindee::Parsing::Standard::
|
74
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
75
75
|
attr_reader :supplier_address
|
76
76
|
# List of company registration numbers associated to the supplier.
|
77
77
|
# @return [Array<Mindee::Parsing::Standard::CompanyRegistrationField>]
|
@@ -114,7 +114,7 @@ module Mindee
|
|
114
114
|
# @param page_id [Integer, nil]
|
115
115
|
def initialize(prediction, page_id)
|
116
116
|
super
|
117
|
-
@billing_address = Parsing::Standard::
|
117
|
+
@billing_address = Parsing::Standard::AddressField.new(
|
118
118
|
prediction['billing_address'],
|
119
119
|
page_id
|
120
120
|
)
|
@@ -122,7 +122,7 @@ module Mindee
|
|
122
122
|
prediction['category'],
|
123
123
|
page_id
|
124
124
|
)
|
125
|
-
@customer_address = Parsing::Standard::
|
125
|
+
@customer_address = Parsing::Standard::AddressField.new(
|
126
126
|
prediction['customer_address'],
|
127
127
|
page_id
|
128
128
|
)
|
@@ -182,7 +182,7 @@ module Mindee
|
|
182
182
|
prediction['reference_numbers'].each do |item|
|
183
183
|
@reference_numbers.push(Parsing::Standard::StringField.new(item, page_id))
|
184
184
|
end
|
185
|
-
@shipping_address = Parsing::Standard::
|
185
|
+
@shipping_address = Parsing::Standard::AddressField.new(
|
186
186
|
prediction['shipping_address'],
|
187
187
|
page_id
|
188
188
|
)
|
@@ -190,7 +190,7 @@ module Mindee
|
|
190
190
|
prediction['subcategory'],
|
191
191
|
page_id
|
192
192
|
)
|
193
|
-
@supplier_address = Parsing::Standard::
|
193
|
+
@supplier_address = Parsing::Standard::AddressField.new(
|
194
194
|
prediction['supplier_address'],
|
195
195
|
page_id
|
196
196
|
)
|
@@ -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.
|
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.
|
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.
|
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,14 +6,17 @@ require_relative 'invoice_v4_line_items'
|
|
6
6
|
module Mindee
|
7
7
|
module Product
|
8
8
|
module Invoice
|
9
|
-
# Invoice API version 4.
|
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
|
-
# @return [Mindee::Parsing::Standard::
|
13
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
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
|
-
# @return [Mindee::Parsing::Standard::
|
19
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
17
20
|
attr_reader :customer_address
|
18
21
|
# List of company registration numbers associated to the customer.
|
19
22
|
# @return [Array<Mindee::Parsing::Standard::CompanyRegistrationField>]
|
@@ -55,10 +58,13 @@ module Mindee
|
|
55
58
|
# @return [Array<Mindee::Parsing::Standard::StringField>]
|
56
59
|
attr_reader :reference_numbers
|
57
60
|
# Customer's delivery address.
|
58
|
-
# @return [Mindee::Parsing::Standard::
|
61
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
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
|
-
# @return [Mindee::Parsing::Standard::
|
67
|
+
# @return [Mindee::Parsing::Standard::AddressField]
|
62
68
|
attr_reader :supplier_address
|
63
69
|
# List of company registration numbers associated to the supplier.
|
64
70
|
# @return [Array<Mindee::Parsing::Standard::CompanyRegistrationField>]
|
@@ -95,11 +101,15 @@ module Mindee
|
|
95
101
|
# @param page_id [Integer, nil]
|
96
102
|
def initialize(prediction, page_id)
|
97
103
|
super
|
98
|
-
@billing_address = Parsing::Standard::
|
104
|
+
@billing_address = Parsing::Standard::AddressField.new(
|
99
105
|
prediction['billing_address'],
|
100
106
|
page_id
|
101
107
|
)
|
102
|
-
@
|
108
|
+
@category = Parsing::Standard::ClassificationField.new(
|
109
|
+
prediction['category'],
|
110
|
+
page_id
|
111
|
+
)
|
112
|
+
@customer_address = Parsing::Standard::AddressField.new(
|
103
113
|
prediction['customer_address'],
|
104
114
|
page_id
|
105
115
|
)
|
@@ -149,11 +159,15 @@ module Mindee
|
|
149
159
|
prediction['reference_numbers'].each do |item|
|
150
160
|
@reference_numbers.push(Parsing::Standard::StringField.new(item, page_id))
|
151
161
|
end
|
152
|
-
@shipping_address = Parsing::Standard::
|
162
|
+
@shipping_address = Parsing::Standard::AddressField.new(
|
153
163
|
prediction['shipping_address'],
|
154
164
|
page_id
|
155
165
|
)
|
156
|
-
@
|
166
|
+
@subcategory = Parsing::Standard::ClassificationField.new(
|
167
|
+
prediction['subcategory'],
|
168
|
+
page_id
|
169
|
+
)
|
170
|
+
@supplier_address = Parsing::Standard::AddressField.new(
|
157
171
|
prediction['supplier_address'],
|
158
172
|
page_id
|
159
173
|
)
|
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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
|
-
#
|
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
|
15
|
+
# The name of the service.
|
16
16
|
# @return [String]
|
17
17
|
attr_reader :service_name
|
18
18
|
|
@@ -7,13 +7,13 @@ module Mindee
|
|
7
7
|
module Product
|
8
8
|
module US
|
9
9
|
module HealthcareCard
|
10
|
-
# Healthcare Card API version 1.
|
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
|
-
#
|
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:
|
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.
|
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)
|
data/lib/mindee/version.rb
CHANGED
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.
|
40
|
+
spec.add_development_dependency 'rubocop', '~> 1.76'
|
41
41
|
spec.add_development_dependency 'steep', '~> 1.7'
|
42
42
|
spec.add_development_dependency 'yard', '~> 0.9'
|
43
43
|
end
|
data/sig/custom/net_http.rbs
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# lib/mindee/parsing/standard/address_field.rb
|
2
|
+
module Mindee
|
3
|
+
module Parsing
|
4
|
+
module Standard
|
5
|
+
class AddressField < StringField
|
6
|
+
def street_number: -> String
|
7
|
+
def street_name: -> String
|
8
|
+
def po_box: -> String
|
9
|
+
def address_complement: -> String
|
10
|
+
def city: -> String
|
11
|
+
def postal_code: -> String
|
12
|
+
def state: -> String
|
13
|
+
def country: -> String
|
14
|
+
def initialize: (Hash[Symbol | String, untyped], ?Integer?, ?reconstructed: bool) -> void
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -5,9 +5,9 @@ module Mindee
|
|
5
5
|
module FinancialDocument
|
6
6
|
class FinancialDocumentV1Document < Parsing::Common::Prediction
|
7
7
|
def initialize: (Hash[Symbol | String, untyped], Integer?) -> void
|
8
|
-
def billing_address: -> (Parsing::Standard::
|
8
|
+
def billing_address: -> (Parsing::Standard::AddressField)
|
9
9
|
def category: -> (Parsing::Standard::ClassificationField)
|
10
|
-
def customer_address: -> (Parsing::Standard::
|
10
|
+
def customer_address: -> (Parsing::Standard::AddressField)
|
11
11
|
def customer_company_registrations: -> (Array[Parsing::Standard::CompanyRegistrationField])
|
12
12
|
def customer_id: -> (Parsing::Standard::StringField)
|
13
13
|
def customer_name: -> (Parsing::Standard::StringField)
|
@@ -23,9 +23,9 @@ module Mindee
|
|
23
23
|
def po_number: -> (Parsing::Standard::StringField)
|
24
24
|
def receipt_number: -> (Parsing::Standard::StringField)
|
25
25
|
def reference_numbers: -> (Array[Parsing::Standard::StringField])
|
26
|
-
def shipping_address: -> (Parsing::Standard::
|
26
|
+
def shipping_address: -> (Parsing::Standard::AddressField)
|
27
27
|
def subcategory: -> (Parsing::Standard::ClassificationField)
|
28
|
-
def supplier_address: -> (Parsing::Standard::
|
28
|
+
def supplier_address: -> (Parsing::Standard::AddressField)
|
29
29
|
def supplier_company_registrations: -> (Array[Parsing::Standard::CompanyRegistrationField])
|
30
30
|
def supplier_email: -> (Parsing::Standard::StringField)
|
31
31
|
def supplier_name: -> (Parsing::Standard::StringField)
|
@@ -5,8 +5,9 @@ module Mindee
|
|
5
5
|
module Invoice
|
6
6
|
class InvoiceV4Document < Parsing::Common::Prediction
|
7
7
|
def initialize: (Hash[Symbol | String, untyped], Integer?) -> void
|
8
|
-
def billing_address: -> (Parsing::Standard::
|
9
|
-
def
|
8
|
+
def billing_address: -> (Parsing::Standard::AddressField)
|
9
|
+
def category: -> (Parsing::Standard::ClassificationField)
|
10
|
+
def customer_address: -> (Parsing::Standard::AddressField)
|
10
11
|
def customer_company_registrations: -> (Array[Parsing::Standard::CompanyRegistrationField])
|
11
12
|
def customer_id: -> (Parsing::Standard::StringField)
|
12
13
|
def customer_name: -> (Parsing::Standard::StringField)
|
@@ -20,8 +21,9 @@ module Mindee
|
|
20
21
|
def payment_date: -> (Parsing::Standard::DateField)
|
21
22
|
def po_number: -> (Parsing::Standard::StringField)
|
22
23
|
def reference_numbers: -> (Array[Parsing::Standard::StringField])
|
23
|
-
def shipping_address: -> (Parsing::Standard::
|
24
|
-
def
|
24
|
+
def shipping_address: -> (Parsing::Standard::AddressField)
|
25
|
+
def subcategory: -> (Parsing::Standard::ClassificationField)
|
26
|
+
def supplier_address: -> (Parsing::Standard::AddressField)
|
25
27
|
def supplier_company_registrations: -> (Array[Parsing::Standard::CompanyRegistrationField])
|
26
28
|
def supplier_email: -> (Parsing::Standard::StringField)
|
27
29
|
def supplier_name: -> (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
|
+
version: 4.6.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-
|
11
|
+
date: 2025-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -148,14 +148,14 @@ dependencies:
|
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '1.
|
151
|
+
version: '1.76'
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '1.
|
158
|
+
version: '1.76'
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: steep
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -341,6 +341,7 @@ files:
|
|
341
341
|
- lib/mindee/parsing/common/workflow_response.rb
|
342
342
|
- lib/mindee/parsing/standard.rb
|
343
343
|
- lib/mindee/parsing/standard/abstract_field.rb
|
344
|
+
- lib/mindee/parsing/standard/address_field.rb
|
344
345
|
- lib/mindee/parsing/standard/amount_field.rb
|
345
346
|
- lib/mindee/parsing/standard/base_field.rb
|
346
347
|
- lib/mindee/parsing/standard/boolean_field.rb
|
@@ -588,6 +589,7 @@ files:
|
|
588
589
|
- sig/mindee/parsing/common/product.rbs
|
589
590
|
- sig/mindee/parsing/common/workflow_response.rbs
|
590
591
|
- sig/mindee/parsing/standard/abstract_field.rbs
|
592
|
+
- sig/mindee/parsing/standard/address_field.rbs
|
591
593
|
- sig/mindee/parsing/standard/amount_field.rbs
|
592
594
|
- sig/mindee/parsing/standard/base_field.rbs
|
593
595
|
- sig/mindee/parsing/standard/boolean_field.rbs
|