Insurance claims
Explanation of Benefits tables: each claim line with service dates, description, status and every amount in its own field, the totals line as a type of its own, and the remark codes explained below.
EXPLANATION OF BENEFITS Line No. Date of Service Service Description Claim Status Provider Charges Allowed Charges Copay Deductible Coinsurance Paid by Insurer What You Owe Remark Code 1 3/20/22-3/20/22 Medical care Paid $31.60 $2.15 $0.00 $0.00 $0.00 $2.15 $0.00 PDC 2 3/20/22-3/20/22 Medical care Paid $375.00 $118.12 $35.00 $0.00 $0.00 $83.12 $35.00 PDC Total $406.60 $120.27 $35.00 $0.00 $0.00 $85.27 $35.00 PDC Remark Code: PDC - Billed amount is higher than the maximum payment insurance allows. The payment is for the allowed amount.
insurance-healthcare.ymlspec
Date: $local: Digit: '[1-9]' TwoDigits: '\d{2}' Month: Single: { $fields: { digit: Digit }, $patterns: '#{digit}', $value: '0#{digit}' } Double: '0[1-9]|1[0-2]' Day: Single: { $fields: { digit: Digit }, $patterns: '#{digit}', $value: '0#{digit}' } Double: '0[1-9]|[12]\d|3[01]' Year: Short: { $fields: { digits: TwoDigits }, $patterns: '#{digits}', $value: '20#{digits}' } Long: '(19|20)\d{2}' $fields: { month: Month, day: Day, year: Year } $patterns: '#{month}/#{day}/#{year}' $value: '#{year}-#{month}-#{day}' Money: $local: Amount: $local: { Group: '\d{1,3}', Whole: '\d{4,}', Cents: '\d{1,2}' } $fields: groups: { $type: 'Group[]', $separator: ',' } whole: Whole cents: Cents $patterns: [ '#{groups}(\.#{cents})?', '#{whole}(\.#{cents})?' ] $value: '[#{groups}][#{whole}][.#{cents}]' $fields: { amount: Amount } Positive: $patterns: '\$ ?#{amount}' $value: '#{amount}' Negative: $patterns: [ '-\$ ?#{amount}', '\$ ?-#{amount}', '\(\$ ?#{amount}\)' ] $value: '-#{amount}' RemarkCode: {} StatementLine: $flags: [ CASE_INSENSITIVE ] $local: LineHeader: 'Line( No\.?| Number| #)?' DatesHeader: [ 'Dates? of Service', 'Service Dates?', 'Service Period', '^Dates?$', '^DOS$' ] DescriptionHeader: [ 'Service Description', 'Description( of Services?)?', '^Services?( Provided)?$', 'Procedure' ] StatusHeader: '(Claim )?Status' ChargesHeader: [ 'Provider Charges?', 'Billed( Amount| Charges?)?', 'Amount Billed', 'Total Charges?', '^Charges?$' ] AllowedHeader: [ 'Allowed( Amount| Charges?)?', 'Approved( Amount)?', 'Plan Allowance' ] CopayHeader: 'Co-?pay(ment)?s?' DeductibleHeader: 'Deductible' CoinsuranceHeader: 'Co-?insurance' PaidHeader: [ 'Paid by (Insurer|Plan|Insurance)', '(Plan|Insurer|Insurance) Paid', 'Amount Paid', 'Paid Amount' ] OwedHeader: [ 'You Owe', '(Patient|Member|Your) Responsibility', 'Patient Owes' ] RemarkHeader: [ 'Remarks?( Codes?)?', 'Reason Codes?' ] TotalLabel: [ 'Totals?', '(Claim|Grand|Statement) totals?' ] LineNumber: $patterns: '\d{1,3}' ServiceDates: Range: $fields: { start: Date, end: Date } $patterns: '#{start} ?(-|–|to|thru|through) ?#{end}' $value: { start: '#{start}', end: '#{end}' } Single: $fields: { date: Date } $patterns: '#{date}' $value: { start: '#{date}', end: '#{date}' } Description: $patterns: '[\p{L}\p{N}][^\n]*' Status: Paid: { $patterns: [ 'Paid', 'Processed', 'Approved' ], $value: 'paid' } PartiallyPaid: { $patterns: [ 'Partially paid', 'Partially approved', 'Paid in part' ], $value: 'partially paid' } Denied: { $patterns: [ 'Denied', 'Rejected', 'Not covered', 'Not paid', 'Declined' ], $value: 'denied' } Pending: { $patterns: [ 'Pending', 'In process', 'Processing', 'Under review' ], $value: 'pending' } Adjusted: { $patterns: [ 'Adjusted', 'Reprocessed' ], $value: 'adjusted' } $fields: line: LineNumber dates: ServiceDates description: Description status: Status provider_charges: Money allowed_charges: Money copay: Money deductible: Money coinsurance: Money paid_by_insurer: Money patient_owes: Money remark_codes: { $type: 'RemarkCode[]', $match: '[A-Z][A-Z0-9]{1,5}', $separator: ',? ' } $tables: $columns: line: LineHeader dates: DatesHeader description: DescriptionHeader status: StatusHeader provider_charges: ChargesHeader allowed_charges: AllowedHeader copay: CopayHeader deductible: DeductibleHeader coinsurance: CoinsuranceHeader paid_by_insurer: PaidHeader patient_owes: OwedHeader remark_codes: RemarkHeader Total: $fields: { line: TotalLabel, dates: TotalLabel, description: TotalLabel, status: TotalLabel } RemarkNote: $flags: [ MULTILINE ] $local: Label: '(?i:remark|reason)( (?i:codes?))?' Explanation: '[^\n]*[^\s]' $fields: code: { $type: RemarkCode, $match: '[A-Z][A-Z0-9]{1,5}' } explanation: Explanation $patterns: - '^${Label}:? #{code} ?(-|–|:) ?#{explanation}$' - '^#{code}( (-|–)|:) #{explanation}$'
$ texomy parse input.txt -m insurance-healthcareAbout this spec
Claim lines, statement totals and remark code explanations in Explanation of Benefits statements: service dates, description, claim status, provider charges, allowed charges, copay, deductible, coinsurance, insurer payment, what the patient owes and remark codes.
Package files
insurance-healthcare.ymlsamples/letter.txtsamples/variant.txttests/expected/letter.yamltests/expected/sample.yamltests/expected/variant.yamltests/insurance-healthcare.test.ymltests/values.test.ymltexomy.json
126 nodes from 4 top-level matches.
Run it yourself
Save the example from Studio to a folder, then in that folder:
texomy parse input.txt -m insurance-healthcaretexomy testMore examples
Invoices
Supplier, invoice number, dates, amounts, payment terms and order references, plus charge rows that take their section from the table caption.
Bank statements
Account, period and balance summary, and transactions read from a table whose Debit and Credit columns give each amount its sign.
Education
Student, identifier, institution and print date in any order, and each term with its courses, grades, credit hours and totals.
Logistics
Bills of lading: references, vehicles, sender and receiver with addresses, cargo lines with count, kind and mass, and the totals, in whatever order the document states them.
Resumes
Candidate name, headline and contacts, each job and degree with its own dates, courses, and skills grouped under their area.
Addresses
Address blocks and one-line addresses: recipient, street or post office box with building, suite or mail stop, city, state, postal code and country.
Write the spec once. Run it on everything.
Install the CLI, connect your agent, and turn your first sample into typed data in minutes.
brew install texomy/tap/texomy