edi icon indicating copy to clipboard operation
edi copied to clipboard

QUESTION: Should I write my own tokenizer for GenericSegments?

Open cole-maxwell1 opened this issue 1 year ago • 1 comments

Hi,

I am new to the X12 EDI format, and I have a question about the intended use of this package. Is your intent to have people write a tokenizer that fits their specific use case? For example, I would like to use this package to deserialize an 834 Benefit Enrollment and Maintenance file into custom rust structs. In the crate, the structs like InterchangeControl have a function parse_from_tokens(). Would you recommend that I follow that approach?

If you are willing to write it, having an example guide of how people might write something to process GenericSegment structs into their own structs would be very helpful. It doesn't necessarily need to be an 834 doc. For example, Golang's omniparser library has a nice guide where they use the UPS 240/214 as an example. But that's no fun because it's Golang, not Rust! Let me know if there's any way I could help.

cole-maxwell1 avatar Jun 06 '23 21:06 cole-maxwell1

Hi @cole-maxwell1!

Sorry for the year-late reply. I never saw this issue get filed.

This crate is not very generic right now. I wrote it to parse the general x12 format according to the spec, and the idea is that you manually convert the resulting x12 EDI struct into your own struct.

If you are still facing this problem, I'd be happy to guide you on any modifications necessary to suit your use case. We could make the tokenizer generic and swappable.

sezna avatar Jun 10 '24 18:06 sezna