Master Segment

You will not always need a item to print for every possible record that could be produced from the data hierarchy in an IDoc. BarTender can be configured at print-time to select only some records, but some documents that draw data from an IDoc will not need every possible record even in the typical case. BarTender uses the concept of the Master Segment to help you produce just the records you need from an IDoc.

The Master Segment is the segment whose data is the focus of interest with respect to your design needs. BarTender will produce one record for every segment in the IDoc that you designate as the Master Segment.

Consider the data tree shown in the Understanding IDocs help page. If the hospital needs a label for every drug prescribed, then it would set the Master Segment at the fourth level. This would cause BarTender to produce three records:

Patient Name

Diagnosis

Visit

Drug

Johnson

tibia fracture

admission

codeine

Johnson

tibia fracture

admission

amidol

Johnson

tibia fracture

followup

naprosin

Suppose the hospital keeps separate files for every patient visit and wants to generate labels to be used for file folders. Only one label is needed for each visit. So the Master Segment is set to the third level, and BarTender produces two records:

Patient Name

Diagnosis

Visit

Drug

Johnson

tibia fracture

admission

codeine amidol

Johnson

tibia fracture

followup

naprosin

In the first of these records, BarTender included the field Drug from the level below the Master Segment and concatenated all the data from segments at that lower level. (For more information, see Repeating Segment Rules window.)

Since BarTender will produce one record for every instance of the Master Segment, a rule of thumb for deciding what your Master Segment should be is:

In the typical run of items built from this IDoc, I'll want one item to print for every _____________.

In the preceding example, if "visit" fills the blank, then the third level would probably be the best choice of Master Segment level, but if "prescribed drug" fills the blank, then the fourth level would probably be a better choice.