NCPDP EDI Translator API

Overview

Built an internal NCPDP D.0 EDI translation capability for a PBM ecosystem, enabling downstream applications and services to convert inbound D.0 claim files into normalized JSON with consistent validation and extensibility. The goal was twofold: (1) deliver a low-latency private translation API for internal consumers, and (2) package the translation logic as a reusable .NET DLL and Python library so teams could embed translation directly into their own services without duplicating parsing rules.

The core translation engine was implemented on top of EdiFabric (.NET) with a customization layer to support non-standard/custom D.0 segments and partner-specific variations. Custom templates and translator adapters map EDI loops/segments into a stable JSON contract, with schema validation, predictable handling for optional fields, and clear error reporting.

The service was deployed as an AWS serverless private API using API Gateway (Private) and AWS Lambda (.NET runtime), ensuring secure VPC-scoped access and minimal operational overhead. For interoperability with Python-based services, a Python package invokes the .NET translation DLL via pythonnet, along with runtime guidance for installing the .NET runtime in container images/Lambda where required.

Security and compliance were designed-in for HIPAA-aligned handling: private network access, encrypted transport, least-privilege IAM, and audit-friendly logging.

Scope / Modules Delivered

  • Private Translation API (D.0 EDI payload → JSON response)
  • Reusable .NET DLL (translation engine + custom adapters/templates)
  • Reusable Python Library (pythonnet wrapper + integration utilities)

Tech Stack

  • AWS Lambda (Serverless) – .NET runtime
  • Amazon API Gateway – Private API
  • EdiFabric .NET Library
  • Custom EDI templates for NCPDP D.0 segment extensions
  • Python integration via pythonnet
  • Docker/Lambda container runtime support for .NET dependencies

Key Architecture Elements

  • Private API endpoint access (VPC-scoped) for internal consumers
  • Translation pipeline: Parse → Validate → Map → JSON contract
  • Reusable translation core used both by Lambda and embedded library consumers
  • Observability-ready design (structured logs and metrics hooks)

Challenges & Solutions

  • Creating a low-latency lightweight private API:

Used AWS Lambda (.NET) with API Gateway Private API for secure internal access and fast scaling.

  • Supporting custom segments in D.0 files:

Created custom templates for EdiFabric and implemented translator adapters to extend standard mappings.

  • Invoking translation DLLs from Python services:

Used pythonnet to call .NET library functions from Python; packaged as a reusable Python module and documented runtime setup for .NET dependencies in containers/Lambda.

Outcomes

All key challenges were successfully addressed, resulting in a robust, reusable, and efficient EDI translation solution that standardized D.0 → JSON processing across internal applications while allowing partner-specific extensions.

Skills 

  • AWS Lambda
  • Amazon API Gateway
  • Serverless Architecture
  • .NET
  • Python
  • pythonnet
  • EDI / NCPDP D.0
  • EdiFabric
  • Docker
  • HIPAA Compliance
Architecture Diagram