Real Time Information Director User Documentation
RTID Metadata Language
Hewlett-Packard Company 61 529618-002
Generating a Unique ID
One common motivation for a real-time solution using the Director is to gain the benefits
of a comprehensive, customer-centric data store. For example, the EHR demo illustrates
the benefits of capturing and correlating information related to a patient (named Michael
in the demo).
When a source system or client refers to a person, that system or client uses an external
ID, which might be a number, a name, or some other kind of code. Because the same
person might have multiple external IDs (and for some other reasons), a unique internal
ID must be assigned to represent the person.
One enrichment that generates a unique internal ID is called SystemKey. The use of
SystemKey is illustrated in the following hypothetical example:
new DocumentRecord("PERSON", new SystemKey("UNIQUEIDENTIFIER", new
KeyDispenser("PERSONID",100)), new RelatedRecords[] { . . . }
This metadata assigns a unique ID to the value of the UNIQUEIDENTIFIER column in
the PERSON table. This internal ID corresponds to the external ID because the external
ID is inserted into the same database row, in a column called
EXTERNALIDENTIFIER.
Of course, an entity other than a person might require a unique ID. For example, you
could use the SystemKey enrichment to provide a unique identifier for each medical
encounter in a healthcare solution.
If your data store is partitioned, you’ll want to use the PartitionedSystemKey enrichment,
rather than this one. PartionedSystemKey is introduced in the section called
“Partitioning,” earlier in this document, and illustrated in “Partitioning Tables,” below.
Propagation of the Unique ID to Related Records
When a record is inserted into the database, the relevant information is propagated to all
the related records. The EHR example illustrates this behavior. Specifically, the
definition of the OTHERSTATUS record, in the metadata file EHR.java, obtains a
unique identifier for a patient:
public static EnrichedRecord otherStatusRecord =
new EnrichedRecord("OTHERSTATUS",
new PartitionedSystemKey("UNIQUEIDENTIFIER",
"PARTITIONID", personIdDispenser,
new RoundRobinPartitionId(STARTING_PARTITION,
NO_OF_PARTITIONS)));
The Encounter record, which describes a medical event involving the patient, includes the
same unique identifier: