wokket / rust-hl7

Learning rust by playing with a HL7 parser. Use for real at your own risk!
19 stars 10 forks source link

Feature/field encapsulation #13

Closed sempervictus closed 3 years ago

sempervictus commented 3 years ago

Using Field as an Enum made sense in the context of planning to make multiple variants containing Field components or more nested subcomponents in a single Enum. Using a functional approach to extract those sub-fields allows for replacing the Enum with a Struct and permitting encapsulated storage of sub-field delimeters for external callers which don't have easy access to them but need a sub-field value returned.

Implement the data conversion, parsing changes, and functional changes to sub-field accessors.

Testing: Passes tests

sempervictus commented 3 years ago

Superceded by #11