Real Time Information Director User Documentation

RTID Metadata Language
Hewlett-Packard Company 72 529618-002
Once you have constructed the Mapper object, you can use it to produce Mapping
enrichments in individual Document Definitions. The effect of such an enrichment,
remember, is to map from external identifiers to internal ones on input, and to perform
the reverse mapping on output, so the application deals only with the external values, and
the database stores the internal ones. You create a Mapping enrichment by calling the
map method of the Mapper class. The map method takes two string parameters.
The name of the column, in the data store, that contains or must contain the value
of the internal ID. (When an insert or update document is received, the mapping
will cause the internal ID to be looked up and stored in the column. When a
query document is received, the mapping will cause this column to be read, and
the corresponding external values to be found and placed in the response to the
query.)
The names of the elements in the inbound or outbound document containing the
external identifying values
If you call the map method with zero or one parameter, the names of elements for the
external identifying values are presumed to be the same as the names of the
corresponding columns of the mapping table. If you call the map method with no
parameters, the value of the column containing the internal ID is presumed to be the same
as the name of the corresponding column in the mapping table.
Here is another excerpt from the EHR.java class. The class makes multiple uses of a
lookup table called PERSON, which maps between external and internal means of
identifying a person, such as a patient or a doctor, or an organization, such as a hospital.
Each use applies to a separate table in the document. In each case, there is a mapping
between the external and internal IDs representing a medical-service provider and/or the
organization providing the service. Here is the enrichment of the CHARTENTRY
record, first to include the partitioning strategy and instance ID, then to incorporate
mappings between internal and external IDs. Enrichments for the related records look
similar (see the file EHR.java).
public static EnrichedRecord chartEntryRecord =
new EnrichedRecord("CHARTENTRY", new Enrichment[] {
encounterAffinityKey,
new InstanceId("CHARTENTRYIDENTIFIER")
});
public static EnrichedRecord externalChartEntryRecord =
chartEntryRecord.enrich(new Enrichment[] {
personMapper.map("SOURCEPROVIDER",
"PROVIDEREXTERNALID PROVIDERTYPECODE"),
personMapper.map("SOURCEORGANISATION",
"ORGANISATIONEXTERNALID ORGANISATIONTYPECODE"),
new OrderBy("DATETIMERECORDED DESC")
});