The entities are configured in the .env
#{ENTITY_TYPE}_PREFIX=The prefix for the internal ID.
BIOSPECIMEN_PREFIX=SP
#{ENTITY_TYPE}_PAD=Number of characters for the padding.
BIOSPECIMEN_PAD=7
#{ENTITY_TYPE}_PAD_CHAR=Character to be used for the padding.
BIOSPECIMEN_PAD_CHAR=0Returns all the mappings for a given entity type
Returns an id for the sequence corresponding to the entity name
Returns a range of N id for the sequence corresponding to the entity name (N = batch_size)
Returns the internal id for the entity matching the hash OR creates and returns it if not found.
N.B.: If found, will return an HTTP 200 code along with the internal id. If created, will return an HTTP 201 code along with the internal id.
Creates a new mapping with the given internal id previously generated using /entity/{entity_type}/id endpoint.
Create a batch of mappings
Request body format:
{
"hash" : "entity_type"
}Request body example:
{
"alsjf30222v20nv20vn20vn20": "study",
"ywerwer9y8w0r98yw08ywerey": "study",
"ywerweraiselajglasj3421ey": "biospecimen",
"n0gnd098s0f98ns098n0s9n8s": "sample_registration",
"bwvw98rw98ruvw98rw987v9w8": "sample_registration"
}Response body example:
{
"alsjf30222v20nv20vn20vn20": "ST0000001",
"ywerwer9y8w0r98yw08ywerey": "ST0000002",
"ywerweraiselajglasj3421ey": "SP0000044",
"n0gnd098s0f98ns098n0s9n8s": "SR0000001",
"bwvw98rw98ruvw98rw987v9w8": "SR0000002"
}