Documentation

SDK Overview

Architecture, supported transactions, language bindings, and build-from-source.

A high-performance X12 healthcare EDI parsing, validation, and analysis engine.

ExactEDI SDK provides native libraries for processing HIPAA X12 EDI transactions in C++, C, Python, and .NET applications. Built for healthcare claims processing, analytics pipelines, and AI/ML integrations.

Key Features

FeatureDescription
Multi-format Support14 X12 transaction types recognized — 837P/I/D, 835, 270/271, 276/277, 277CA, 278, 820, 834, 999, TA1; loop-aware structural validation on 10
PHI-Safe FactsHIPAA Safe Harbor compliant fact extraction for LLM/analytics
High Performance200+ MB/s parsing throughput, streaming support for large files
Memory-based I/OProcess data from files, memory buffers, or streams
Cross-platformWindows, Linux, macOS (x64 and ARM64)
Multiple Language BindingsC++, C, Python (pybind11), .NET (P/Invoke)

Supported Transaction Types

The TransactionType enum recognizes 14 HIPAA X12 transaction types. Ten of them also receive Tier-2 loop-aware structural validation — §2.3.1 loop nesting, trigger segments, segment placement, and repeat-count caps.

CodeNameLoop-aware validation
837PProfessional ClaimYes
837IInstitutional Claim
837DDental Claim
835Remittance AdviceYes
270Eligibility InquiryYes
271Eligibility ResponseYes
276Claim Status RequestYes
277Claim Status ResponseYes
277CAClaim AcknowledgmentYes
278Health Care Services Review (Prior Auth)Yes
820Premium PaymentYes
834Benefit Enrollment
999Implementation AcknowledgmentYes
TA1Interchange Acknowledgment

Quick Start

#include <exactedi/sdk/sdk.hpp>
#include <iostream>

int main() {
    // Quick analysis with default options
    auto result = exactedi::analyze_file("claims.edi");

    if (!result) {
        std::cerr << "Error: " << result.error().message() << "\n";
        return 1;
    }

    const auto& data = result.value();
    std::cout << "Transactions: " << data.transactions.size() << "\n";
    std::cout << "Valid: " << (data.is_valid() ? "Yes" : "No") << "\n";

    // Access PHI-safe facts
    for (const auto& tx : data.transactions) {
        std::cout << "Type: " << tx.type_string()
                  << ", Claim: " << tx.claim_id
                  << ", Charge: 
quot; << tx.total_charge << "\n"; } return 0; }

Python

import exactedi

# Analyze a file
result = exactedi.analyze_file("claims.edi")
print(f"Found {result.transaction_count} transactions")

# Access transaction facts (PHI-safe)
for tx in result.transactions:
    print(f"Type: {tx.type}")
    print(f"Claim ID: {tx.claim_id}")
    print(f"Total Charge: ${tx.total_charge:.2f}")

C# / .NET

using ExactEDI;

// Analyze a file
using var result = ExactEDI.AnalyzeFile("claims.edi");
Console.WriteLine(
quot;Found {result.TransactionCount} transactions"); // Access transaction facts (PHI-safe) foreach (var tx in result.Transactions) { Console.WriteLine(
quot;Type: {tx.Type}"); Console.WriteLine(
quot;Claim ID: {tx.ClaimId}"); Console.WriteLine(
quot;Total Charge: ${tx.TotalCharge:F2}"); }

C

#include <exactedi/sdk/c_api.h>
#include <stdio.h>

int main() {
    // Create context with default options
    exactedi_context_t ctx = exactedi_create(NULL);

    // Analyze file
    exactedi_result_t result = NULL;
    if (exactedi_analyze_file(ctx, "claims.edi", &result) == EXACTEDI_OK) {
        // Get JSON output
        char* json = NULL;
        exactedi_result_to_facts_json(result, &json);
        printf("%s\n", json);

        exactedi_free_string(json);
        exactedi_result_free(result);
    } else {
        printf("Error: %s\n", exactedi_get_last_error());
    }

    exactedi_destroy(ctx);
    return 0;
}

Architecture

┌─────────────────────────────────────────────────────────────┐
│                      Your Application                        │
├─────────────────────────────────────────────────────────────┤
│     Python SDK    │    .NET SDK     │       C/C++ SDK       │
│    (pybind11)     │   (P/Invoke)    │      (Native)         │
├─────────────────────────────────────────────────────────────┤
│                       C API Layer                            │
├─────────────────────────────────────────────────────────────┤
│                   ExactEDI Core Engine                       │
│  ┌──────────┬─────────────┬─────────────┬────────────┐      │
│  │ Tokenizer│  Validator  │   Facts     │   JSON     │      │
│  │          │             │  Extractor  │  Output    │      │
│  └──────────┴─────────────┴─────────────┴────────────┘      │
└─────────────────────────────────────────────────────────────┘

Input Sources

The SDK supports multiple input sources:

MethodC++Python.NETC
File pathanalyze_file()analyze_file()AnalyzeFile()exactedi_analyze_file()
Stringanalyze_string()analyze_string()AnalyzeString()exactedi_analyze_memory()
Bytes/Memoryanalyze_memory()analyze_bytes()AnalyzeMemory()exactedi_analyze_memory()
Streamanalyze_stream()---
Streaming callbackanalyze_file_streaming()analyze_file_streaming()AnalyzeFileStreaming()exactedi_analyze_file_streaming()

PHI-Safe Facts Output

ExactEDI extracts structured, de-identified facts from transactions that are safe for:

  • AI/LLM processing (no PHI exposure)
  • Analytics dashboards
  • Compliance reporting
  • Claim adjudication workflows

What's Included (PHI-Safe)

  • Transaction control numbers (ISA/GS/ST)
  • Payer and provider NPIs
  • Organization names (payers, providers)
  • Service dates (not patient DOB)
  • Diagnosis and procedure codes (ICD-10, CPT/HCPCS)
  • Monetary amounts (charges, payments)
  • Claim status codes

What's Excluded (PHI)

  • Patient names, dates of birth, addresses
  • Medical record numbers (MRNs)
  • Social Security Numbers
  • Subscriber/member IDs
  • Free-text descriptions
  • Any direct patient identifiers

Options and Configuration

exactedi::AnalyzerOptions options;
options.strict_validation = true;      // Enforce envelope structure validation
options.extract_facts = true;          // Extract PHI-safe facts
options.include_raw_segments = false;  // Don't include raw segment data
options.max_transactions = 1000;       // Limit to first 1000 transactions
options.continue_on_error = true;      // Continue after validation errors

exactedi::Analyzer analyzer(options);
auto result = analyzer.analyze_file("claims.edi");

Streaming Large Files

For files that don't fit in memory, use streaming callbacks:

exactedi::Analyzer analyzer;
auto stats = analyzer.analyze_file_streaming("huge.edi",
    [](const exactedi::TransactionFacts& tx) {
        // Process each transaction individually
        std::cout << "Processing: " << tx.claim_id << "\n";
        return true;  // Continue processing (false to stop)
    });

std::cout << "Processed " << stats.transaction_count << " transactions\n";

Validation Results

auto result = exactedi::analyze_file("claims.edi");
if (result) {
    const auto& data = result.value();

    // Check overall validity
    if (data.is_valid()) {
        std::cout << "No validation errors\n";
    } else {
        std::cout << data.stats.error_count << " errors found\n";
    }

    // Iterate diagnostics
    for (const auto& diag : data.diagnostics) {
        std::cout << diag.severity_string() << ": "
                  << diag.message() << "\n";
    }
}

JSON Output

The SDK can export results in multiple JSON formats:

Facts JSON (PHI-Safe, for Analytics/LLM)

auto facts = result.value().to_facts_json();
std::string json = facts.to_string(true);  // pretty-printed

Output structure:

{
  "file": {
    "filename": "claims.edi",
    "file_size": 4096,
    "parse_timestamp": "2025-01-16T12:00:00Z"
  },
  "counts": {
    "interchanges": 1,
    "groups": 1,
    "transactions": 5,
    "segments": 156
  },
  "transactions": [
    {
      "type": "837P",
      "claim_id": "CLM001",
      "total_charge": 1500.00,
      "procedure_codes": ["99213", "99214"],
      "diagnosis_codes": ["Z23", "M54.5"]
    }
  ],
  "validation": {
    "errors": 0,
    "warnings": 0
  }
}

Installation

C++ (CMake)

find_package(ExactEDI REQUIRED)
target_link_libraries(your_app PRIVATE ExactEDI::exactedi)

Python

ExactEDI wheels are distributed through your customer portal (not PyPI):

pip install ./exactedi-X.Y.Z-<platform>.whl

.NET

ExactEDI packages are distributed through your customer portal (not nuget.org):

# From the directory containing the downloaded .nupkg
dotnet add package ExactEDI --source .

C

Link against exactedi library and include <exactedi/sdk/c_api.h>.

Licensing

ExactEDI SDK is a commercial product. Features:

LicenseTransactions/DaySupportPrice
Trial100CommunityFree
Professional10,000EmailContact sales
EnterpriseUnlimitedPriorityContact sales

Check license status programmatically:

// C++
std::cout << exactedi::license_status() << "\n";
# Python
print(exactedi.license_status())
// C#
Console.WriteLine(ExactEDI.LicenseStatus);

Documentation

DocumentDescription
API ReferenceComplete C++ API reference
C APIC API documentation
Python GuidePython SDK usage guide
C# Guide.NET SDK usage guide
Integration GuideOutput format specifications
Facts JSON SchemaPHI-safe JSON output schema

Thread Safety

  • Each Analyzer instance is independent and can be used from a single thread
  • Multiple Analyzer instances can be created and used concurrently
  • Global functions (analyze_file(), etc.) create temporary analyzers and are thread-safe
  • Results are fully owned and can be passed between threads

Error Handling

The SDK uses a Result<T, Error> pattern (C++) or exceptions (Python/.NET):

// C++ - Check result
auto result = exactedi::analyze_file("claims.edi");
if (!result) {
    std::cerr << "Error: " << result.error().message() << "\n";
    return;
}
# Python - Exceptions
try:
    result = exactedi.analyze_file("claims.edi")
except exactedi.ExactEDIError as e:
    print(f"Error: {e}")
// C# - Exceptions
try
{
    using var result = ExactEDI.AnalyzeFile("claims.edi");
}
catch (ExactEDIException ex)
{
    Console.WriteLine(
quot;Error: {ex.Message}"); }

Support

Include sample input files and code snippets when reporting issues.