Skip to content

✨ add support for Findoc V1.12, Invoices V4.10, US Healthcare Cards V1.2 #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions docs/global_products/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Ruby Client Library supports the [Financial Document API](https://platform.m
> | Specification | Details |
> | ------------------------------ | -------------------------------------------------- |
> | Endpoint Name | `financial_document` |
> | Recommended Version | `v1.11` |
> | Recommended Version | `v1.12` |
> | Supports Polling/Webhooks | ✔️ Yes |
> | Support Synchronous HTTP Calls | ✔️ Yes |
> | Geography | 🌐 Global |
Expand Down Expand Up @@ -93,7 +93,7 @@ puts result.document
########
Document
########
:Mindee ID: f469a24d-3875-4a83-ad43-e0d5aa9da604
:Mindee ID: a80ac0ee-26f6-4e2e-988a-960b240d5ba7
:Filename: default_sample.jpg

Inference
Expand All @@ -118,7 +118,7 @@ Prediction
+---------------+--------+----------+---------------+
| Base | Code | Rate (%) | Amount |
+===============+========+==========+===============+
| | | 5.00 | 9.75 |
| 195.00 | | 5.00 | 9.75 |
+---------------+--------+----------+---------------+
:Supplier Payment Details:
:Supplier Name: JOHN SMITH
Expand Down Expand Up @@ -170,7 +170,7 @@ Page 0
+---------------+--------+----------+---------------+
| Base | Code | Rate (%) | Amount |
+===============+========+==========+===============+
| | | 5.00 | 9.75 |
| 195.00 | | 5.00 | 9.75 |
+---------------+--------+----------+---------------+
:Supplier Payment Details:
:Supplier Name: JOHN SMITH
Expand Down Expand Up @@ -382,6 +382,24 @@ puts result.document.inference.prediction.document_number.value
puts result.document.inference.prediction.document_type.value
```

## Document Type Extended
**document_type_extended** ([ClassificationField](#classification-field)): Document type extended.

#### Possible values include:
- 'CREDIT NOTE'
- 'INVOICE'
- 'OTHER'
- 'OTHER_FINANCIAL'
- 'PAYSLIP'
- 'PURCHASE ORDER'
- 'QUOTE'
- 'RECEIPT'
- 'STATEMENT'

```rb
puts result.document.inference.prediction.document_type_extended.value
```

## Due Date
**due_date** ([DateField](#date-field)): The date on which the payment is due.

Expand Down
26 changes: 22 additions & 4 deletions docs/global_products/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Ruby Client Library supports the [Invoice API](https://platform.mindee.com/m
> | Specification | Details |
> | ------------------------------ | -------------------------------------------------- |
> | Endpoint Name | `invoices` |
> | Recommended Version | `v4.9` |
> | Recommended Version | `v4.10` |
> | Supports Polling/Webhooks | ✔️ Yes |
> | Support Synchronous HTTP Calls | ✔️ Yes |
> | Geography | 🌐 Global |
Expand Down Expand Up @@ -93,7 +93,7 @@ puts result.document
########
Document
########
:Mindee ID: 86b1833f-138b-4a01-8387-860204b0e631
:Mindee ID: b55db8f9-ae3b-4f05-b2f1-ec0ced5e5b70
:Filename: default_sample.jpg

Inference
Expand All @@ -117,7 +117,7 @@ Prediction
+---------------+--------+----------+---------------+
| Base | Code | Rate (%) | Amount |
+===============+========+==========+===============+
| | | 8.00 | 193.20 |
| 2145.00 | | 8.00 | 193.20 |
+---------------+--------+----------+---------------+
:Supplier Payment Details:
:Supplier Name: TURNPIKE DESIGNS
Expand Down Expand Up @@ -163,7 +163,7 @@ Page 0
+---------------+--------+----------+---------------+
| Base | Code | Rate (%) | Amount |
+===============+========+==========+===============+
| | | 8.00 | 193.20 |
| 2145.00 | | 8.00 | 193.20 |
+---------------+--------+----------+---------------+
:Supplier Payment Details:
:Supplier Name: TURNPIKE DESIGNS
Expand Down Expand Up @@ -344,6 +344,24 @@ puts result.document.inference.prediction.date.value
puts result.document.inference.prediction.document_type.value
```

## Document Type Extended
**document_type_extended** ([ClassificationField](#classification-field)): Document type extended.

#### Possible values include:
- 'CREDIT NOTE'
- 'INVOICE'
- 'OTHER'
- 'OTHER_FINANCIAL'
- 'PAYSLIP'
- 'PURCHASE ORDER'
- 'QUOTE'
- 'RECEIPT'
- 'STATEMENT'

```rb
puts result.document.inference.prediction.document_type_extended.value
```

## Due Date
**due_date** ([DateField](#date-field)): The date on which the payment is due.

Expand Down
18 changes: 17 additions & 1 deletion docs/localized_products/us_healthcare_cards_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Ruby Client Library supports the [Healthcare Card API](https://platform.mind
> | Specification | Details |
> | ------------------------------ | -------------------------------------------------- |
> | Endpoint Name | `us_healthcare_cards` |
> | Recommended Version | `v1.1` |
> | Recommended Version | `v1.2` |
> | Supports Polling/Webhooks | ✔️ Yes |
> | Support Synchronous HTTP Calls | ❌ No |
> | Geography | 🇺🇸 United States |
Expand Down Expand Up @@ -138,6 +138,15 @@ A `HealthcareCardV1Copay` implements the following attributes:
* `service_fees` (Float): The price of service.
* `service_name` (String): The name of service of the copay.

#### Possible values include:
- primary_care
- emergency_room
- urgent_care
- specialist
- office_visit
- prescription


# Attributes
The following fields are extracted for Healthcare Card V1:

Expand Down Expand Up @@ -222,6 +231,13 @@ puts result.document.inference.prediction.rx_bin.value
puts result.document.inference.prediction.rx_grp.value
```

## RX ID
**rx_id** ([StringField](#string-field)): The ID number for prescription drug coverage.

```rb
puts result.document.inference.prediction.rx_id.value
```

## RX PCN
**rx_pcn** ([StringField](#string-field)): The PCN number for prescription drug coverage.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Mindee
module Product
module FinancialDocument
# Financial Document API version 1.11 document data.
# Financial Document API version 1.12 document data.
class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction
include Mindee::Parsing::Standard
# The customer's address used for billing.
Expand Down Expand Up @@ -37,6 +37,9 @@ class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction
# RECEIPT if it is a receipt.
# @return [Mindee::Parsing::Standard::ClassificationField]
attr_reader :document_type
# Document type extended.
# @return [Mindee::Parsing::Standard::ClassificationField]
attr_reader :document_type_extended
# The date on which the payment is due.
# @return [Mindee::Parsing::Standard::DateField]
attr_reader :due_date
Expand Down Expand Up @@ -144,6 +147,10 @@ def initialize(prediction, page_id)
prediction['document_type'],
page_id
)
@document_type_extended = Parsing::Standard::ClassificationField.new(
prediction['document_type_extended'],
page_id
)
@due_date = Parsing::Standard::DateField.new(
prediction['due_date'],
page_id
Expand Down Expand Up @@ -262,6 +269,7 @@ def to_s
out_str << "\n:Shipping Address: #{@shipping_address}".rstrip
out_str << "\n:Billing Address: #{@billing_address}".rstrip
out_str << "\n:Document Type: #{@document_type}".rstrip
out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip
out_str << "\n:Purchase Subcategory: #{@subcategory}".rstrip
out_str << "\n:Purchase Category: #{@category}".rstrip
out_str << "\n:Total Tax: #{@total_tax}".rstrip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Mindee
module Product
module FinancialDocument
# Financial Document API version 1.11 page data.
# Financial Document API version 1.12 page data.
class FinancialDocumentV1Page < Mindee::Parsing::Common::Page
# @param prediction [Hash]
def initialize(prediction)
Expand Down
10 changes: 9 additions & 1 deletion lib/mindee/product/invoice/invoice_v4_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Mindee
module Product
module Invoice
# Invoice API version 4.9 document data.
# Invoice API version 4.10 document data.
class InvoiceV4Document < Mindee::Parsing::Common::Prediction
include Mindee::Parsing::Standard
# The customer billing address.
Expand All @@ -30,6 +30,9 @@ class InvoiceV4Document < Mindee::Parsing::Common::Prediction
# Document type: INVOICE or CREDIT NOTE.
# @return [Mindee::Parsing::Standard::ClassificationField]
attr_reader :document_type
# Document type extended.
# @return [Mindee::Parsing::Standard::ClassificationField]
attr_reader :document_type_extended
# The date on which the payment is due.
# @return [Mindee::Parsing::Standard::DateField]
attr_reader :due_date
Expand Down Expand Up @@ -117,6 +120,10 @@ def initialize(prediction, page_id)
prediction['document_type'],
page_id
)
@document_type_extended = Parsing::Standard::ClassificationField.new(
prediction['document_type_extended'],
page_id
)
@due_date = Parsing::Standard::DateField.new(
prediction['due_date'],
page_id
Expand Down Expand Up @@ -222,6 +229,7 @@ def to_s
out_str << "\n:Shipping Address: #{@shipping_address}".rstrip
out_str << "\n:Billing Address: #{@billing_address}".rstrip
out_str << "\n:Document Type: #{@document_type}".rstrip
out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip
out_str << "\n:Line Items:"
out_str << line_items
out_str[1..].to_s
Expand Down
2 changes: 1 addition & 1 deletion lib/mindee/product/invoice/invoice_v4_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Mindee
module Product
module Invoice
# Invoice API version 4.9 page data.
# Invoice API version 4.10 page data.
class InvoiceV4Page < Mindee::Parsing::Common::Page
# @param prediction [Hash]
def initialize(prediction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def table_printable_values
printable = {}
printable[:service_fees] =
@service_fees.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@service_fees)
printable[:service_name] = format_for_display(@service_name, nil)
printable[:service_name] = format_for_display(@service_name, 20)
printable
end

Expand All @@ -48,7 +48,7 @@ def to_table_line
printable = table_printable_values
out_str = String.new
out_str << format('| %- 13s', printable[:service_fees])
out_str << format('| %- 13s', printable[:service_name])
out_str << format('| %- 21s', printable[:service_name])
out_str << '|'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(prediction, page_id)
def self.line_items_separator(char)
out_str = String.new
out_str << "+#{char * 14}"
out_str << "+#{char * 14}"
out_str << "+#{char * 22}"
out_str
end

Expand All @@ -41,7 +41,7 @@ def to_s
out_str = String.new
out_str << ("\n#{self.class.line_items_separator('-')}\n ")
out_str << ' | Service Fees'
out_str << ' | Service Name'
out_str << ' | Service Name '
out_str << (" |\n#{self.class.line_items_separator('=')}")
out_str + lines
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Mindee
module Product
module US
module HealthcareCard
# Healthcare Card API version 1.1 document data.
# Healthcare Card API version 1.2 document data.
class HealthcareCardV1Document < Mindee::Parsing::Common::Prediction
include Mindee::Parsing::Standard
# The name of the company that provides the healthcare plan.
Expand Down Expand Up @@ -43,6 +43,9 @@ class HealthcareCardV1Document < Mindee::Parsing::Common::Prediction
# The group number for prescription drug coverage.
# @return [Mindee::Parsing::Standard::StringField]
attr_reader :rx_grp
# The ID number for prescription drug coverage.
# @return [Mindee::Parsing::Standard::StringField]
attr_reader :rx_id
# The PCN number for prescription drug coverage.
# @return [Mindee::Parsing::Standard::StringField]
attr_reader :rx_pcn
Expand Down Expand Up @@ -92,6 +95,7 @@ def initialize(prediction, page_id)
prediction['rx_grp'],
page_id
)
@rx_id = Parsing::Standard::StringField.new(prediction['rx_id'], page_id)
@rx_pcn = Parsing::Standard::StringField.new(
prediction['rx_pcn'],
page_id
Expand All @@ -111,6 +115,7 @@ def to_s
out_str << "\n:Group Number: #{@group_number}".rstrip
out_str << "\n:Payer ID: #{@payer_id}".rstrip
out_str << "\n:RX BIN: #{@rx_bin}".rstrip
out_str << "\n:RX ID: #{@rx_id}".rstrip
out_str << "\n:RX GRP: #{@rx_grp}".rstrip
out_str << "\n:RX PCN: #{@rx_pcn}".rstrip
out_str << "\n:copays:"
Expand All @@ -127,7 +132,7 @@ def copays_separator(char)
out_str = String.new
out_str << ' '
out_str << "+#{char * 14}"
out_str << "+#{char * 14}"
out_str << "+#{char * 22}"
out_str << '+'
out_str
end
Expand All @@ -141,7 +146,7 @@ def copays_to_s
out_str << "\n#{copays_separator('-')}"
out_str << "\n |"
out_str << ' Service Fees |'
out_str << ' Service Name |'
out_str << ' Service Name |'
out_str << "\n#{copays_separator('=')}"
out_str << "\n #{line_items}"
out_str << "\n#{copays_separator('-')}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Mindee
module Product
module US
module HealthcareCard
# Healthcare Card API version 1.1 page data.
# Healthcare Card API version 1.2 page data.
class HealthcareCardV1Page < Mindee::Parsing::Common::Page
# @param prediction [Hash]
def initialize(prediction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module Mindee
def date: -> (Parsing::Standard::DateField)
def document_number: -> (Parsing::Standard::StringField)
def document_type: -> (Parsing::Standard::ClassificationField)
def document_type_extended: -> (Parsing::Standard::ClassificationField)
def due_date: -> (Parsing::Standard::DateField)
def invoice_number: -> (Parsing::Standard::StringField)
def line_items: -> (Product::FinancialDocument::FinancialDocumentV1LineItems)
Expand Down
1 change: 1 addition & 0 deletions sig/mindee/product/invoice/invoice_v4_document.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Mindee
def customer_name: -> (Parsing::Standard::StringField)
def date: -> (Parsing::Standard::DateField)
def document_type: -> (Parsing::Standard::ClassificationField)
def document_type_extended: -> (Parsing::Standard::ClassificationField)
def due_date: -> (Parsing::Standard::DateField)
def invoice_number: -> (Parsing::Standard::StringField)
def line_items: -> (Product::Invoice::InvoiceV4LineItems)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Mindee
def payer_id: -> (Parsing::Standard::StringField)
def rx_bin: -> (Parsing::Standard::StringField)
def rx_grp: -> (Parsing::Standard::StringField)
def rx_id: -> (Parsing::Standard::StringField)
def rx_pcn: -> (Parsing::Standard::StringField)
def copays_separator: (String) -> String
def copays_to_s: -> String
Expand Down
2 changes: 1 addition & 1 deletion spec/data
Loading