ballerinax/edifact.d03a.services Ballerina library

1.0.0

Overview

UN/EDIFACT is the United Nations standard for electronic data interchange, used to exchange business documents such as orders, invoices and despatch advices between trading partners.

This package provides Ballerina record types and parser functions for the 29 UN/EDIFACT D03A messages grouped under services: insurance premiums, claims assessment and inspections, job orders and applications, payroll deductions, medical prescriptions, reports and resource usage, life reinsurance, berth management and stowage instructions, sales reports and forecasts, and social administration and work grants.

Key Features

  • Typed records for all 29 messages in the services group, each in its own submodule, so a program only pulls in the records for the messages it handles.
  • Envelope-aware parsing and serialization: an interchange is read from UNB through UNZ, including the UNH/UNT message header and trailer.
  • Round-trips in both directions — EDI text to records, and records back to conformant EDI text with the UNT segment count recomputed.
  • Generated from the UN/EDIFACT D03A directory with the Ballerina EDI tool, so the records follow the published specification.

Quickstart

To use the edifact.d03a.services package in your Ballerina application, modify the .bal file as follows:

Step 1: Import the module

Import the package and the submodules for the messages you handle.

Copy
import ballerina/io;
import ballerinax/edifact.d03a.services;
import ballerinax/edifact.d03a.services.mBERMAN;

Step 2: Read an EDI message

Convert an EDIFACT interchange into a Ballerina record.

Copy
public function main() returns error? {
    string ediText = check io:fileReadString("berman.edi");
    mBERMAN:EDI_BERMAN_BERMAN message =
        check services:fromEdiString(ediText, services:EDI_BERMAN).ensureType();
    io:println(message);
}

services:getEDINames() returns every message name this package supports. interchangeFromEdiString gives access to the full UNB/UNZ interchange, and headersFromEdiString reads just the headers.

Step 3: Write an EDI message

Convert a Ballerina record back into an EDIFACT interchange.

Copy
string ediText = check services:toEdiString(message, services:EDI_BERMAN);

Use interchangeToEdiString to write the full interchange rather than the message body alone.

Step 4: Run the Ballerina application

Copy
bal run

Supported messages

MessageDescriptionModule
BERMANBerth managementedifact.d03a.services.mBERMAN
BMISRMBulk marine inspection summary reportedifact.d03a.services.mBMISRM
ICASRPInsurance claim assessment and reportingedifact.d03a.services.mICASRP
INSDESInstruction to despatchedifact.d03a.services.mINSDES
INSPREInsurance premiumedifact.d03a.services.mINSPRE
INSREQInspection requestedifact.d03a.services.mINSREQ
INSRPTInspection reportedifact.d03a.services.mINSRPT
JOBAPPJob application proposaledifact.d03a.services.mJOBAPP
JOBCONJob order confirmationedifact.d03a.services.mJOBCON
JOBMODJob order modificationedifact.d03a.services.mJOBMOD
JOBOFFJob orderedifact.d03a.services.mJOBOFF
JUPREQJustified payment requestedifact.d03a.services.mJUPREQ
LREACTLife reinsurance activityedifact.d03a.services.mLREACT
LRECLMLife reinsurance claimsedifact.d03a.services.mLRECLM
MEDPIDPerson identificationedifact.d03a.services.mMEDPID
MEDPREMedical prescriptionedifact.d03a.services.mMEDPRE
MEDREQMedical service requestedifact.d03a.services.mMEDREQ
MEDRPTMedical service reportedifact.d03a.services.mMEDRPT
MEDRUCMedical resource usage and costedifact.d03a.services.mMEDRUC
MEQPOSMeans of transport and equipment positionedifact.d03a.services.mMEQPOS
MOVINSStowage instructionedifact.d03a.services.mMOVINS
PAYDUCPayroll deductions adviceedifact.d03a.services.mPAYDUC
RECLAMReinsurance claimsedifact.d03a.services.mRECLAM
REGENTRegistration of enterpriseedifact.d03a.services.mREGENT
SLSFCTSales forecastedifact.d03a.services.mSLSFCT
SLSRPTSales data reportedifact.d03a.services.mSLSRPT
SOCADESocial administrationedifact.d03a.services.mSOCADE
WKGRDCWork grant decisionedifact.d03a.services.mWKGRDC
WKGRREWork grant requestedifact.d03a.services.mWKGRRE

Import

import ballerinax/edifact.d03a.services;Copy

Other versions

Metadata

Released date: 3 days ago

Version: 1.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 30

Current verison: 0


Weekly downloads


Source repository


Keywords

insurance

employment

healthcare

EDI

EDIFACT

D03A

B2B

Business Management/ERP

Cost/Free

Vendor/Other

Area/ERP & Business Operations

Type/Library

Name/EDIFACT D03A Services


Contributors