Efferent-Health/HL7-dotnetcore

Assigned value not showing when segment printed

jmergens1 opened this issue · 3 comments

I assign a value top PID.4.1 and when I print the PID or add it to a message the value is blank.
I can access it through the Segment and message but it does not show when printed other than explicitly calling the field.
I can also access all other fields and they print out with the segment just fine
Can someone explain this to me?

Please provide some concrete source code

emluk commented

From your description I am assuming that you are trying something like this:

var message = new Message(content);
message.ParseMessage();
message.Segments("PID")[0].Fields(4).Components(1).Value = "SomeValue";

Console.WriteLine(message.HL7Message);

If my assumption is correct, changing the last line to

Console.WriteLine(message.SerializeMessage(false));

should do the trick.

closing as there is no more feedback