Real Time Information Director User Documentation
    RTID Metadata Language 
Hewlett-Packard Company  53  529618-002   
Mapping 
The Mapping enrichment looks up fields in a table that correlates external identifying 
information, such as a person’s name, with an internal identifier assigned by the Director. 
The enrichment is reversible, in that it performs a lookup in one direction for an inbound 
document and in the opposite direction for an outbound document. For example, a 
Mapping enrichment is used to obtain the internal ID of a patient from the external ID of 
the patient in an update document. In the corresponding query, the same enrichment is 
used to obtain the patient’s external ID from the internal ID. The goal is to expose the 
external ID to the client application, in both inbound and outbound documents, while 
storing the internal ID in the database. The searched table should be keyed or indexed in 
both directions, unless it is very small, or unless you take pains to ensure that mapping 
occurs in only one direction. 
Note:  This use of the term “mapping” is unrelated to the task, discussed earlier, of 
mapping elements of an IDoc to the database. 
The Mapping enrichment is often used in records that reference a table keyed using the 
SystemKey enrichment. However there is no requirement for these enrichments to be 
used together. 
A Mapping enrichment requires you to 
1.  Construct a Mapper object to describe the table that maps external identifiers to 
internal ones. The constructor requires you to specify the name of the mapping 
table, the column that contains the internal ID, and the column or columns that 
contain the corresponding external identifiers. 
2.  Construct an actual mapping, within a document definition, by calling the map 
method of the Mapper object. When you invoke the map method, you specify the 
elements of the inbound or outbound document that contain the external 
identifiers, and the column of the corresponding database table where the internal 
ID is stored or must be stored. 
It is possible to use the same mapping table to store different types of internal and 
external IDs. For example, you could use the same table to store IDs for people and 
organizations. In this case, each row of the mapping table includes a typecode that places 
the external and internal IDs in the appropriate category. The steps for creating what we 
call a Qualified Mapping enrichments differ only slightly from the steps for creating a 
regular Mapping enrichment: 
1.  Construct an UnqualifiedMapper object to describe the lookup table. The 
parameters are the same as for a regular Mapper, except that you must also 
specify the column that contains the typecode. 










