Real Time Information Director User Documentation
    RTID Metadata Language 
Hewlett-Packard Company  75  529618-002   
document has to specify the category ENCOUNTERTYPE; that category was specified 
when the encounterTypeMapper was constructed. 
Here are some examples of the use of QualifiedMapping enrichments from the EHR 
example. Notice that the invocations of the map method are indistinguishable from the 
use of simple Mapping enrichments. Only the names of the Mappers hint that they are 
qualified. (To make your document definitions readable, consider using Mapper names 
that indicate whether the Mapper is qualified.)  
public static EnrichedRecord descriptiveTestsRecord = 
 externalTestsRecord.enrich( 
 testTypeMapper.map("TESTTYPE", 
"TESTTYPEDESCRIPTION")); 
… 
public static EnrichedRecord descriptiveObservationRecord = 
 observationRecord.enrich(new Enrichment[] { 
 encounterTypeMapper.map("VISITTYPECODE", 
"VISITDESCRIPTION"), 
 observationCodeMapper.map("TYPESUBCODE", 
"TYPESUBDESCRIPTION") 
 }); 
… 
public static EnrichedRecord descriptiveImmunisationRecord = 
 externalImmunisationRecord.enrich( 
 immunisationCodeMapper.map("IMMUNISATIONTYPE",  
 "IMMUNISATIONDESCRIPTION")); 
Writing Enrichments 
In addition to using predefined enrichments, you can write your own. Enrichments can 
be applied in the context of a document Delsert, Query, Upsert, or Subscription, and can 
occur in any of the following metadata statements: 
•  DocumentRecord. An enrichment that you specify for the DocumentRecord is 
executed just once. It applies to the document as a whole. 
•  RelatedRecords. An enrichment that you specify for RelatedRecords is executed 
once for each of the records. 
•  EnrichedRecord. An enrichment that you specify as an EnrichedRecord applies to 
a specific table and can be used in place of the table name in any number of 
document definitions. 










