Jul 18, 2013 at 10:41 PM
Edited Jul 18, 2013 at 10:51 PM
You need to first grab the segment that contains the element for the patient name.
So as you know each interchange
can contain 1 or more functional groups
and each functional group can contain 1 or more
So the first step for you will be getting down to the transaction level because this is your actual document (855, 990 ect) the rest is more or less just the envelope your information will be sent inside.
For the sake of this sample i'm just going to assume there is 1 interchange, 1 functional group and 1 transaction.
Our first step is again to get down to the transaction.
var tran = interchange.FunctionGroups.First().Transactions.First();
Now that we have our transaction we need to get the segment
that contains the
we want to modify.
To find your segment you need to make sure you understand the spec you are working with. To get the segment you need to understand where it really is in the document (is it inside of a loop you will need to find first ect). I will provide the most basic example
of getting a segment called "IT1"
var segment = transaction.Segments.FirstOrDefault(o => o.SegmentId == "IT1");
Now we are finally able to modify our segment. I will modify the first element in this segment to hold "myvalue".