You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
The 837D dental claim (005010X224A2) parses and writes, closing the
read side of #2. It shares the professional claim's envelope and hierarchy;
the claim carries orthodontic months (DN1) and missing or to-be-extracted
teeth (DN2), and each line carries the dental procedure (SV3) with tooth
numbers and surfaces (TOO). Four segments are new to the library: SV3,
TOO, DN1 and DN2. Three synthetic samples join the round-trip sweep: a
subscriber's filling, a child's orthodontic claim, and a tertiary claim
whose crown was adjudicated by two earlier payers. Files declaring
005010X224 or 005010X224A1 read with the same model.
generate_837d and x12sdk-generate 837d, completing #2. Lines bill
CDT codes under the AD qualifier; a line done to a tooth carries a TOO
segment, with surfaces for a filling, and invented files mix those with
lines that have no tooth (an exam, a cleaning). Both patient branches
appear by default, and one payer is named throughout the file. ServiceLineSpec gains tooth and surfaces, validated against the
Universal tooth numbers and the seven surface codes; the 837P and 837I
refuse a tooth rather than dropping it.
claims() and subscribers() on the 837D, the same flattened access
the 837P and 837I have.
generate_claim_pair: a claim submission and the remittance that
answers it, from one specification, for the 837P, 837I or 837D. Every
claim is answered by exactly one claim payment, linked by CLM01 = CLP01,
with the same charges, line procedures, patient, payer and payee. Invented
outcomes mix paid in full, contractual write-offs, patient cost share and
outright denials (denial_rate). A ClaimSpec's adjustments and status
describe the payer's decision: they reach the 835 and are kept off the
837. build_835 gains procedure_qualifier, patients and payee_npi
so a remittance can answer a particular submission; its output for
existing seeds is unchanged, and a new test pins the README sample to what
the library prints.
x12sdk-mcp, an MCP server for AI assistants, behind the optional mcp extra (pip install "x12sdk[mcp]"). Five read-only tools: validate_x12 (where and why a file fails, without echoing its content), parse_x12, list_claims (flat rows from an 837, 835, 276 or 277), generate_x12 (any supported set, the same bytes as the library) and generate_claim_pair. The server works only on the text it is given: the
reader also accepts file paths, and the server refuses them so an assistant
cannot read files off the machine. A bad argument returns its explanation
to the assistant. Built on the MCP Python SDK 2.x.
scripts/build_dataset.py, which builds the public synthetic dataset
of claims and remittances: X12 file pairs for the 837P, 837I and 837D with
their 835s, and claims and service_lines tables read back out of those
files with the library's own reader, plus a dataset card. The same
arguments rebuild the same bytes. Outcomes are random, and the card says so.
The dataset itself is published at https://huggingface.co/datasets/owgreen-dev/x12sdk under CC BY 4.0.
Fixed
A service line adjudicated by more than one payer kept only the last
adjudication in every 837 except the new dental claim: the 837P, the 837I
and both 4010 implementations. The 2430 initializer was guarded by if TransactionLoops.X:, which is always true, so each SVD reset the list.
A claim sent to a secondary or tertiary payer lost the earlier payers' line
decisions without an error. The audit suite gains a check for guards that
can never be false, which finds exactly these four.