The idgen subfolder contains CSV configuration files that help modify and create identifier sources. It should be possible in most cases to configure them via a single CSV configuration file, however there can be as many CSV files as desired. This is a possible example of how the configuration subfolder may look like:
idgen/
└── idgen.csv
The CSV configuration allows to either modify existing identifier sources or to create new identifier sources. The following headers are supported:
This is the UUID of the source to create or modify
This is the name of the source
This is the description of the source
If the value is truthy this will retire the given source
This is the reference to the underlying identifier type, both an identifier type name or UUID can be provided.
One can choose to organize their sources in CSV files however they like. They can combine multiple types of sources in a single file that contains a superset of all necessary headers, or they can create multiple files that only contain the headers relevant for the sources in those files.
For a given row in the CSV file, the type of source that will be instantiated is based on the columns that are populated for that row. The below sections describe the 3 types of sources that can be created. If a non-empty value is supplied for a given column that is specific to one of these sources, then this is what determines that this type of source is what is created. All sources have at least one required column to ensure successful identification.
The range of characters used in a given identifier
The first base identifier in the character set (the first identifier that should be generated, less prefix and suffix)
A prefix that should be present on all generated identifiers
A suffix that should be present on all generated identifiers
The minimum length of an identifier (an identifier will be padded with leading zeros as necessary)
The maximum length that this generator is allowed to produce
The url to the remote source
The username to authenticate with the remote source
The password to authenticate with the remote source
NOTE: Remote Identifier Sources have properties that contain sensitive information. For this reason, we enable the ability
to for these properties to be specified either as fixed values in the CSV or as values defined in runtime or system
properties. All three properties - Url
, User
, and Password
can be specified in this way. In order to indicate
that a property should be loaded from a runtime or system property, one should specify the property value in the form
of property:name_of_property
.
For example, one could add properties to their openmrs-runtime.properties file as such:
myRemoteUrl=http://localhost:8080/openmrs/module/idgen/exportIdentifiers.form?source=3
myRemoteUser=admin
myRemotePassword=Admin123
Then, in the idgen domain CSV, one could indicate that these should be used to populate a particular source as:
Uuid | Name | Url | User | Password |
---|---|---|---|---|
1dd85dab-f6d6-4bec-bde6-c4cddeaaad35 | My Remote | property:myRemoteUrl | property:myRemoteUrl | property:myRemotePassword |
The UUID of the identifier source that should be used as the source of the pool
The number of identifiers to refill from the linked source in a given batch
The minimum size of the pool that should be maintained (used by the scheduled refill task)
Set to a truthy value to indicate that the pool should be refilled on a schedule with the configured batch size when minimum size is reached
Set to false to indicate that the pool should issue identifiers randomly rather than in the order in which they are added from the source
Not currently used, but available as a means to provide future backwards compatibility
If multiple csv files are present in a domain, if an order is specified, the lower order will be processed first
Please look at the test configuration folder for sample import files for all domains, see here.