1. A method for establishing mapping rules for assigning codes to prescription transaction data records, wherein each data record comprises at least a first, a second and a third data field, the method comprising: receiving a set of previously mapped data records in which codes have been assigned to the data records based on at least the values of the third data fields; determining a unique combination of first and second data field values present in the set of previously mapped data records; determining a code that is assigned to the data records having the unique combination of first and second data field values with an acceptable frequency; and storing a mapping rule that maps the code to the unique combination of first and second data field values, wherein the mapping rule is stored only for the unique combinations of the first and second data field values that occur with a frequency greater than a cutoff limit.