Read X12 EDI 835 remittance files as tables, losslessly, and write tables back into an 835
Maintainer(s):
javillegasna
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL oxedi FROM community;
LOAD oxedi;
Example
INSTALL oxedi FROM community;
LOAD oxedi;
-- Claims of one file, of several files, or of a glob
FROM read_835('remittance.835');
FROM read_835(['a.835', 'b.835'], filename := true);
FROM read_835('remits/*.835', table_name := 'services');
-- Findings of the parse (also for files that are not valid 835)
FROM read_835('remits/*.835', table_name := 'diagnostics', ignore_errors := true);
-- Text columns are VARCHAR; binary := true keeps the raw bytes
FROM read_835('remittance.835', binary := true);
-- Export to Parquet
COPY (SELECT * FROM read_835('remits/*.835', table_name := 'claims'))
TO 'claims.parquet';
-- Write tables back into an 835: one STRUCT column, a list of rows per table
COPY (SELECT {
'payments': (SELECT list(t ORDER BY t."row") FROM read_835('remittance.835', table_name := 'payments') t),
'claims': (SELECT list(t ORDER BY t."row") FROM read_835('remittance.835', table_name := 'claims') t),
'services': (SELECT list(t ORDER BY t."row") FROM read_835('remittance.835', table_name := 'services') t),
'adjustments': (SELECT list(t ORDER BY t."row") FROM read_835('remittance.835', table_name := 'adjustments') t),
'provider_adjustments': (SELECT list(t ORDER BY t."row") FROM read_835('remittance.835', table_name := 'provider_adjustments') t)
})
TO 'out.835' (FORMAT edi835, sender_id 'ACMEPAYER', receiver_id 'SUNRISECLINIC',
date DATE '2024-01-10', time TIME '09:00');
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| read_835 | table | NULL | NULL |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases | typed_value |
|---|---|---|---|---|---|
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |