Parsing EDI 271 input into JSON output

My organization has been tasked with parsing raw EDI 271 messages into JSON strings in order to feed a downstream application.  A few key details about the task:

  • The raw EDI 271 will be coming across as a standard format from a single outbound upstream system
  • The EDI 271 messages adhere to the 5010 standard
  • We do not need EVERY field from the EDI message, only a select number of fields.  However some of the fields we need (e.g. coverage details) are dynamic in size and will be variable in # of segments both on the EDI side as well as the receiving JSON side.
  • We will be looking to build one incoming business operation for the stream of 271 messages which will then be parsed into Medicare and non-Medicare
  • The JSON output has a static format per class of payor (sample can be referenced below for both Medicare and non-Medicare payors):

Medicare Example JSON:

https://gist.github.com/zaeem/7ea42a2555b40fea40c7516bec6c3d66

Non-Medicare Example JSON:

https://gist.github.com/zaeem/88b77c112dbd56f8427ca66557a09ab4

Our ask to the community: has anyone tackled a similar situation like this before?  If so, can you provide some guidance on how you went about working through this challenge?

Please let me know if any further information would be helpful.

Thanks!

  • + 1
  • 0
  • 1409
  • 6
  • 0

Comments

Hi Eduard,

I thought I'd add to my previous response to give some context.

We have not yet established an approach to tackling this issue however based on your question would you suggest that a persistent class is the best place to start? Any pointers in the right direction will be very helpful. Thanks.

If you have classes (persistent or not) producing JSON is much easier.

How will you approach it Eduard?

Please bear in mind some of these fields vary in segment and are dynamic. 

 

Disclaimer. I am not familiar with EDI.

Some solutions would be:

  • Get official EDI 271 xsd schema files and import them into Caché
  • Alternatively you can read EDI 271 specification/check examples and write your own classes

Then you need a dtl to transform incoming message into your new classes. If there's a lot of them maybe it would be better to write one generic transformer or write a transformer generator based on class (which would generate transformation method based on class properties).

After that you  can transform your class object into json via several ways:

  • Old json via %ZEN.proxyObject/%ZEN.auxillary.jsonProvider
  • New json via dynamic objects