Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As of version OpenMRS v1.5 most objects/tables have a UUID property. This property is automatically filled in for every row and is 99.9% guaranteed to be unique across the universe. The primary reason for uuids is to support the Sync Module and allow for identifying objects that are identical across different OpenMRS installations.

The uuid value will be hexidecimal hexadecimal digits in the form of 8chars-4-4-4-12chars (e.g 0febc204-bca1-11de-913d-0010c6dffd0f). Depending on whether mysql or java generates these (see below), the uuid could be in version 1 or version 4 respectively.

...

All uuid columns can hold up to 38 character to accommodate MSSQL server's desire to put a curly brace ({}) at the beginning and end of the 36 chars.

Info

You may hear the term GUID used as a synonym of UUID. GUID is Microsoft's implementation of UUID.

Primary Key Argument

The UUID is used as a normal property of every object instead of a primary key for several reasons:

...

The API uses the Java UUID class randomUUID() generation method (and so will be UUID v4 reference above).

OpenMRS UUIDs

There are some UUIDs shared across all OpenMRS implementations for metadata that are common across all implementations.

Concept Datatype UUIDs

Name

UUID

Numeric

8d4a4488-c2cc-11de-8d13-0010c6dffd0f

Coded

8d4a48b6-c2cc-11de-8d13-0010c6dffd0f

Text

8d4a4ab4-c2cc-11de-8d13-0010c6dffd0f

N/A

8d4a4c94-c2cc-11de-8d13-0010c6dffd0f

Document

8d4a4e74-c2cc-11de-8d13-0010c6dffd0f

Date

8d4a505e-c2cc-11de-8d13-0010c6dffd0f

Time

8d4a591e-c2cc-11de-8d13-0010c6dffd0f

Datetime

8d4a5af4-c2cc-11de-8d13-0010c6dffd0f

Boolean

8d4a5cca-c2cc-11de-8d13-0010c6dffd0f

Rule

8d4a5e96-c2cc-11de-8d13-0010c6dffd0f

Structured Numeric

8d4a606c-c2cc-11de-8d13-0010c6dffd0f

Complex

8d4a6242-c2cc-11de-8d13-0010c6dffd0f

Tables without UUIDs

There are many tables without the uuid property because they are either helper tables, mapping tables, or just used for business logic by other libraries used within openmrs.

  • cohort_member
  • concept_complex (extends concept table and shares uuids with that)
  • concept_derived
  • concept_name_tag_map (1 to many mapping from tags to names)
  • liquibasechangelog (externally used by liquibase library)
  • liquibasechangeloglock (created by liquibase library)
  • location_tag_map
  • notification_alert_recipient
  • role_privilege
  • role_role
  • scheduler_task_config_property
  • patient (extends person table and shares uuids with that...might change for 1.6)
  • user (extends person table and shares uuids with that...might change for 1.6)
  • user_role

See Also