How to Create an EDI to JSON Transformation
Gordon Crenshaw offers a tutorial for converting legacy EDI data into JSON using various transformation tools and techniques.
Join the DZone community and get the full member experience.Join For Free
with the exploding adoption of iot and mobile applications, how do you handle all this data behind rest web services along with their expanded requirements?
for years, progress customers have been using xml converters to bidirectionally convert edi and flat-file data into xml documents and streams. as companies adopt and integrate with iot, mobile devices, and data behind rest web services, their requirements have expanded, now requiring bi-directional conversion of edi and flat-file data into json instead of xml.
how to convert edi and flat-file data into json with xquery and xml converters
how can one do this with xquery and the xml converters ? let me show you using the following sample x12 270 5010 (real-time eligibility, coverage, or benefit requests) hipaa document and stylus studio.
using stylus studio’s xml mapper functionality and the datadirect xquery engine, you’ve mapped your edi data into the desired xml schema (see below).
when you press the green preview button, you generate your desired xml output.
the datadirect xquery engine is seamlessly integrated with the xml converters and can force the output into another supported format just by using one of the datadirect xquery functions. to generate the output as json data, write the following command at the beginning of your existing xquery statement:
declare option ddtek:serialize “method=json”;
re-run your xquery statement by pressing the green preview button. you’ll see that the output has been converted to json based on the xml schema defined.
now, your web clients, mobile applications or iot devices are ready to support real-time eligibility, coverage or benefit requests with json.
real-time access to xml data
get instant sql connectivity from tabular and hierarchical-formatted xml documents with a single connector. progress datadirect enables you to connect to xml via odbc , xml converters , xquery or xml editor . these solutions enable the easy integration of xml data with your application, along with the ability to quickly retrieve data from either a local file system, a web server, or a web service. you can try it now here.
Published at DZone with permission of Gordon Crenshaw. See the original article here.
Opinions expressed by DZone contributors are their own.