0

I'm attempting to create an object of an HL7 message by parsing a raw text string.

The object model is a follows. enter image description here

The object I want to create would be a representation of this, allowing calling methods to access information based on indexes. If information from the 2nd sub-subfield in the 3rd subfield of the 5th field of the segment named "PID" for the message you'd do it like this:

HL7Message h = HL7Message(messageRawText);

Console.Writeline(h.GetInfo("PID",5,3,2)+" is sub-subfield I'm looking for")

I'd also like to access at higher levels e.g.

Console.Writeline(h.GetInfo("PID",5)+" is field I'm looking for")

Approaches I've considered are

  1. creating an object that has fields that are lists of strings
  2. creating an object that has fields that other user defined objects of Segments, Fields, Subfields...

What would be the best approach? I imagine the scenario must exist somewhere, but can't find a neat fit for my solution.

Nimbocrux
  • 509
  • 2
  • 10
  • 27

0 Answers0