Skip to content

Commit 1d6b034

Browse files
committed
feat: initial release v0.1.0
Complete X12 EDI Python toolkit with: - Parser, Generator, Validator core components - 15 transaction schemas (837P/I/D, 835, 270/271, 834, 278, 820, 850, 856, 810, 855, 860) - 19 code sets (CARC, RARC, taxonomy, modifiers, etc.) - Memory-bounded streaming for large files - 997/999 acknowledgment generation - Trading partner configuration - 393 passing tests with 83% coverage
0 parents  commit 1d6b034

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+13938
-0
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e ".[dev]"
28+
29+
- name: Run tests with coverage
30+
run: |
31+
pytest tests/ --cov=x12 --cov-report=xml --cov-report=term-missing
32+
33+
- name: Upload coverage to Codecov
34+
if: matrix.python-version == '3.12'
35+
uses: codecov/codecov-action@v4
36+
with:
37+
file: ./coverage.xml
38+
fail_ci_if_error: false
39+
40+
lint:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "3.12"
49+
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install ruff
54+
55+
- name: Run ruff check
56+
run: ruff check x12/
57+
58+
- name: Run ruff format check
59+
run: ruff format --check x12/
60+
61+
type-check:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Set up Python
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: "3.12"
70+
71+
- name: Install dependencies
72+
run: |
73+
python -m pip install --upgrade pip
74+
pip install -e ".[dev]"
75+
76+
- name: Run mypy
77+
run: mypy x12/ --ignore-missing-imports
78+
continue-on-error: true # Don't fail CI on type errors for now

.gitignore

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.nox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*.cover
46+
*.py,cover
47+
.pytest_cache/
48+
*/.pytest_cache/
49+
50+
# Hypothesis testing
51+
.hypothesis/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Environments
58+
.env
59+
.venv/
60+
env/
61+
venv/
62+
ENV/
63+
env.bak/
64+
venv.bak/
65+
66+
# IDE
67+
.idea/
68+
.vscode/
69+
*.swp
70+
*.swo
71+
*~
72+
.project
73+
.pydevproject
74+
.settings/
75+
76+
# Windsurf / AI assistants
77+
.windsurf/
78+
.cursor/
79+
.aider/
80+
81+
# Project-specific - Internal docs
82+
rfcs/
83+
RFCs/
84+
docs/rfcs/
85+
docs/internal/
86+
87+
# OS files
88+
.DS_Store
89+
.DS_Store?
90+
._*
91+
Thumbs.db
92+
ehthumbs.db
93+
Desktop.ini
94+
95+
# mypy
96+
.mypy_cache/
97+
.dmypy.json
98+
dmypy.json
99+
100+
# ruff
101+
.ruff_cache/
102+
103+
# Jupyter
104+
.ipynb_checkpoints/
105+
*.ipynb
106+
107+
# Local development
108+
*.local
109+
.env.local
110+
.env.development
111+
.env.production
112+
113+
# Logs
114+
*.log
115+
logs/
116+
117+
# Temporary files
118+
tmp/
119+
temp/
120+
*.tmp
121+
*.bak

CHANGELOG.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2024-11-28
11+
12+
### Added
13+
14+
#### Core Components
15+
- `Parser` - Full X12 EDI parsing with automatic delimiter detection
16+
- `Generator` - EDI generation with proper envelope wrapping
17+
- `X12Validator` - Multi-level validation (syntax, semantic, HIPAA)
18+
- `Tokenizer` - Low-level EDI tokenization
19+
- `Delimiters` - ISA-based delimiter detection
20+
21+
#### Models
22+
- `Segment`, `Element` - Core EDI building blocks
23+
- `Loop` - Hierarchical loop structures
24+
- `Interchange`, `FunctionalGroup`, `TransactionSet` - Envelope models
25+
26+
#### Healthcare Transactions (HIPAA 5010)
27+
- 837P Professional Claim (005010X222A1)
28+
- 837I Institutional Claim (005010X223A3)
29+
- 837D Dental Claim (005010X224A3)
30+
- 835 Remittance Advice (005010X221A1)
31+
- 270/271 Eligibility Inquiry/Response (005010X279A1)
32+
- 276/277 Claim Status Request/Response (005010X212)
33+
- 834 Benefit Enrollment (005010X220A1)
34+
- 278 Prior Authorization (005010X217)
35+
- 820 Premium Payment (005010X218)
36+
37+
#### Supply Chain Transactions (4010)
38+
- 850 Purchase Order
39+
- 856 Ship Notice/Manifest (ASN)
40+
- 810 Invoice
41+
- 855 Purchase Order Acknowledgment
42+
- 860 Purchase Order Change
43+
44+
#### Acknowledgments
45+
- 997 Functional Acknowledgment generation
46+
- 999 Implementation Acknowledgment generation
47+
48+
#### Code Sets
49+
- Entity Identifier Codes (NM101)
50+
- Place of Service Codes
51+
- Claim Status Codes
52+
- Claim Adjustment Reason Codes (CARC)
53+
- Remittance Advice Remark Codes (RARC)
54+
- Service Type Codes (270/271)
55+
- Diagnosis Type Qualifiers
56+
- Procedure Code Qualifiers
57+
- Claim Frequency Codes
58+
- Provider Taxonomy Codes
59+
- Revenue Codes (UB-04)
60+
- Modifier Codes
61+
- Unit of Measure Codes
62+
- Adjustment Group Codes
63+
- Eligibility/Benefit Information Codes
64+
- Time Period Qualifier Codes
65+
66+
#### Streaming
67+
- `StreamingSegmentReader` - Memory-bounded streaming for large files
68+
- `StreamingTransactionParser` - Stream-based transaction parsing
69+
70+
#### Validation
71+
- NPI validation with Luhn check
72+
- Tax ID (EIN) validation
73+
- ICD-10 diagnosis code format validation
74+
- CPT/HCPCS procedure code validation
75+
76+
#### Trading Partners
77+
- `TradingPartner` - Partner configuration
78+
- `PartnerRegistry` - Partner management
79+
- Custom delimiter support per partner
80+
81+
### Testing
82+
- 393 passing tests
83+
- 83% code coverage
84+
- Unit, integration, property, compliance, and performance tests
85+
- Hypothesis property-based testing
86+
87+
[Unreleased]: https://github.com/donjohnson/x12-edi-tools/compare/v0.1.0...HEAD
88+
[0.1.0]: https://github.com/donjohnson/x12-edi-tools/releases/tag/v0.1.0

0 commit comments

Comments
 (0)