This project provides a robust Electronic Data Interchange (EDI) parser and processor specifically designed for healthcare X12 formats. It supports multiple transaction sets including 835 (Payment/Remittance Advice), 999 (Implementation Acknowledgment), 270/271 (Eligibility), 276/277 (Claim Status), 278 (Health Care Services Review), 837P/I/D (Claims), and 820 (Health Insurance Exchange Related Payments).
π Current Status: See VALIDATION_REPORT.md for comprehensive testing results and current system validation
π Implementation Details: See AmazonQ.md for detailed development history and technical architecture
| Transaction Set | Status | Description |
|---|---|---|
| EDI835 (Payment/Remittance Advice) | β Complete | Fully functional with minor formatting differences in output (missing empty fields in SVC segments) |
| EDI270 (Health Care Eligibility Benefit Inquiry) | β Complete | Fully functional with line breaks in generated output, all segments correctly processed |
| EDI271 (Health Care Eligibility Benefit Response) | β Complete | Fully functional with line breaks in generated output, all segments correctly processed including LS/LE |
| EDI999 (Implementation Acknowledgment) | β Complete | Fully functional with special CTX segment handling for both standard and special formats |
| EDI276/277 (Health Care Claim Status) | β Functional | Functional with differences in output, core functionality working correctly including TRN and STC segments |
| EDI278 (Health Care Services Review) | β Functional | Functional with correct handling of AR/HS prefixes in UM segment, some segments missing in output (DTP, SV2, PRV) |
| EDI837P (Health Care Claim Professional) | β Functional | Functional with differences in output, core functionality working correctly but missing several segments |
| EDI837I (Health Care Claim Institutional) | β Functional | Functional with specialized handling for CL1 segment, missing several segments in output |
| EDI837D (Health Care Claim Dental) | β Functional | Functional with specialized handling for TOO segment, core functionality working correctly |
| EDI820 (Health Insurance Exchange Related Payments) | Partially functional with many missing segments in output (N1, ENT, NM1, RMR, DTM) | |
| EDI834 (Benefit Enrollment and Maintenance) | β Not Implemented | Format not currently recognized by the parser |
edi/
βββ src/ # Source code directory
β βββ edi835/ # Healthcare Claim Payment/Advice format implementation
β βββ edi999/ # Functional Acknowledgment format implementation
β βββ edi270/ # Eligibility Benefit Inquiry format implementation
β βββ edi271/ # Eligibility Benefit Response format implementation
β βββ edi276/ # Health Care Claim Status Request implementation
β βββ edi277/ # Health Care Claim Status Response implementation
β βββ edi278/ # Health Care Services Review implementation
β βββ edi837/ # Health Care Claim implementation (Professional, Institutional, Dental)
β βββ edi820/ # Health Insurance Exchange Related Payments implementation
β βββ helper/ # Utility functions and shared helpers
β βββ segments/ # EDI segment definitions and processors
β βββ error.rs # Error handling module
β βββ transaction_processor.rs # Generic transaction set processor
β βββ segment_config.rs # Configuration-driven segment definitions
β βββ loop_processor.rs # Enhanced loop detection and processing
β βββ lib.rs # Library exports
β βββ main.rs # Application entry point
βββ Cargo.toml # Rust project configuration and dependencies
βββ Cargo.lock # Locked dependencies versions
- Multiple Transaction Set Support: 835, 999, 270/271, 276/277, 278, 837P/I/D, 820
- Configuration-Driven Architecture: Segment and loop definitions are configurable
- Robust Error Handling: Comprehensive error types and validation
- Bidirectional Conversion: EDI to JSON and JSON to EDI
- Extensible Design: Easy to add new transaction sets and segments
- Special Format Handling: Support for complex CTX segments and other special formats
- Variant-Specific Components: Specialized handling for format-specific segments like TOO in 837D and CL1 in 837I
- Prefix Support: Handling for special prefixes like AR/HS in UM segments for 278 transaction sets
- Rust toolchain (1.56.0 or later)
- Cargo package manager
- Environment with logging capabilities for debug output
# Clone the repository
git clone [repository-url]
cd edi
# Build the project
cargo build --release
# Run tests
cargo test-f <file> Input file path (EDI or JSON)
-o <file> Output file path
-w Write mode (convert JSON to EDI)
-j Specify input is JSON
-h, --help Show help information
# Convert EDI to JSON
cargo run -- -f input.edi -o output.json
# Convert JSON to EDI
cargo run -- -f input.json -o output.edi -w -j- Parse EDI files to JSON and verify structure
- Generate EDI files from JSON and verify structure
- Compare original and generated EDI files
- Identify unprocessed segments and structural differences
# Parse EDI to JSON
cargo run -- -f ./demo/edi835-1.edi -o ./demo/test835-new.json
# Generate EDI from JSON
cargo run -- -f ./demo/test835-new.json -o ./demo/test835-new.edi -w -j
# Compare files
diff ./demo/edi835-1.edi ./demo/test835-new.ediπ VALIDATION_REPORT.md
Current System Status & Testing Results
- Comprehensive validation of all implemented formats
- Real-time testing results and system health
- Production readiness assessment
- Quality assurance methodology and findings
π AmazonQ.md
Implementation History & Technical Details
- Phase-by-phase development process
- Technical architecture and design decisions
- Detailed segment and loop structures
- Development roadmap and next steps
π Status: All items below have been validated through comprehensive testing. See VALIDATION_REPORT.md for current results.
- β Fixed CTX segment implementation in 999 format
- β Improved error handling for malformed input files
- β Addressed Table 1 content placement issues
- β Added comprehensive unit tests
- β
Common Infrastructure Updates
- β Generic transaction set processor
- β Configuration-driven segment definitions
- β Enhanced loop detection and processing
- β Standardized error handling
- β Transaction Set 270/271 (Health Care Eligibility)
- β
Transaction Set 276/277 (Health Care Claim Status)
- β Fixed TRN and STC segment handling in 277 format
- β
Transaction Set 278 (Health Care Services Review)
- β Implemented all loops and segments
- β Added support for AR/HS prefixes in UM segment
- β Added facility address handling
- β Added service provider details
- β
Transaction Set 837P/I/D (Health Care Claim)
- β Implemented variant-specific components
- β Added specialized handling for TOO segment in 837D
- β Added specialized handling for CL1 segment in 837I
- β
Transaction Set 820 (Health Insurance Exchange Related Payments)
- β Implemented basic structure and segments
- β Added parsing and generation functionality
- Implement EDI834 Format
- Create directory structure and module organization
- Implement member-level detail segments (INS, HD, DSB)
- Implement loop structures for enrollment and maintenance
- Create controller with TransactionSet trait implementation
- Improve Incomplete Implementations
- Enhance the EDI820 implementation to preserve all segments
- Improve the EDI837P and EDI837I implementations to preserve all segments
- Fix segment order issues in generated files
- Code Cleanup
- Address compiler warnings, particularly unused imports and functions
- Fix unused variable warnings
- Improve code organization and documentation
- Performance Optimization
- Optimize parsing algorithms for better performance with large files
- Implement caching for frequently used segments
- Reduce memory usage for large files
- Additional Features
- Add support for custom delimiters
- Implement pretty printing for output files
- Add schema validation
- Create a web interface for EDI processing
Contributions are welcome! Please feel free to submit a Pull Request.
[Specify your license here]