Converting IDoc Hierarchical Data to Flat Records

Since data in a child segment is always associated with the data in its parent, any non-branching path through a tree in an IDoc, from a top node to a bottom node can be thought of as a record just like the records in a table-oriented database.

For example, consider the following data hierarchy, in which each segment has just one field for simplicity:

Patient Name: Johnson

 

 

 

 

Diagnosis: croup

 

 

 

Diagnosis: tibia fracture

 

 

 

 

Visit Type: admission

 

 

 

 

Drug: codeine

 

 

 

Drug: amidol

 

 

Visit Type: followup

 

 

 

 

Drug: naprosin

Patient Johnson has been treated at different times for croup and a tibia fracture. (Details of the first illness are not depicted.) In the first hospital visit for the fracture the doctor prescribed codeine and amidol. In the second, the doctor ordered naprosin.

The path through the tibia fracture and the prescription for naprosin can be collapsed into a flat record like this:

Patient Name

Diagnosis

Visit

Drug

Johnson

tibia fracture

followup

naprosin

The two other complete paths could be collapsed into these records:

Patient Name

Diagnosis

Visit

Drug

Johnson

tibia fracture

admission

codeine

Johnson

tibia fracture

admission

amidol

When BarTender reads IDocs, it will collapse data trees into flat records. You will select the fields from these records that you need in objects on your template.

Related Topics