Codemap objects (notes for DBA’s)

Code maps relate fields that are returned as codes/numbers to the textual values that those codes equate to. More information is provided about code maps later in this document.

For each Codemap required by the Lookup definitions a view is required that will return the list of possible values from the external data source. The Codemap then allows the RefTracker user to map each external value to an equivalent RefTracker value.

Example

External department table contains

The name for this is decided by the creator but must return two columns:

  1. {viewname}_id
  2. {viewname}_desc


Example

It is not required that the the _id value be numeric; it’s not even required that the source be different. Consider the following scenario:

Client data is uploaded that contains the client name, email address and department name. It’s imperative that the department name be kept accurate; a custom code table should be created. However, in the data set present, only the department name exists. Therefore, it’s quite possible to create a view that selects the department name as both the _id and _desc. 

If a view within an enabled datasource exists that does not include an _id and a _desc, it will not be recognized as a valid code map, and will throw an error. 

Exercise

If there are any code maps appearing when you click on code maps, have your DBA set up the view described above and use the Code map function to create Code map details for each of them.