Generating custom-IDs for samples


#1

This question was posted in Beginner's problems by @RaabJoh I have moved it because I thoutgh it was interesting to have the question and the answer in a more specficic discussion than previous one.

I still struggle with generating custom-IDs for the samples, maybe you or anyone else can help.

This is the configuration in ID server I use right now. But whenever I generate a new sample by opening an AR i only get SampleID = {sampleType}-{seq:04d}
Do I have to change the ID generation on the AR? or is there no way to get more info into the ID?
Is it possible to generate extra-strings I would like to have in the ID generation? For example manufacturer or anything similar?


Beginner's problems
#2

If you are using 1.3 or higher, Sample and AR have been “merged” into AR behind the scenes. Therefore you need to set the AR config in the ID Server.

WRT extra info in the strings, this is not possible at the moment but you could add them to core and create a pull request.


#3

Alright, thank you for the information on merging.

I also found out that I can use {clientId} to remove the error I generate after using {client}
Is there a full list of customizable things I can put in my ID? Like {clientId} or {year} besides the one in the BikaLims documentation or in senaite’s ID server settings?


#4

Well spotted wrt clientId - please create an issue here so it’s not forgotten https://github.com/senaite/senaite.core/issues

Regarding available variables, I only know of the ones listed on the ID Server tab.


#5

Hi, can you provide an example of what you mean by “set the AR config in the ID server”. I have the following defaults from the install.

AnalysisRequest {sampleid}-AR{seq:01d}
SampleID {sampleType}{year}-{seq:04d}

neither seems to work as when I submit an AR or indeed any sample_scheduled or other I get an

Error sampleid

It then goes on to create a nightmare sampleid like : 291431adf6dc5721277e90c3e4bbeec5

The whole id server lacks a clear explanation anywhere on the BIKA LIMS or SENAITE manuals. Is there a beginners guide here on what this all means. What is the logic? Especially the Counter Ref and Context, being “contained” vs 'backreferenced". A prize to the person who can explain it to me a neophyte.

many thanks
Ben


#6

Hello Ben,

If I am correct it might be a Problem, that you use {sampleid} instead of {sampleId}. At least, that’s what created an error during my experimentation, although I am not entirely sure it was due to a lack of capitalization…
I agree that the whole ID-Server lacks explanation and is not really easy to understand. Currently I’m doing fine by something easy like
AnalysisRequest = {SampleType}-{clientID}-{seq:04d}
AnalysisRequest = {SampleType}-{year}-{seq:04d}
Those two worked well in my case.
Although I’m just beginning to dive into possible variables and how to set them up for ID generation…

I actually have found no need to change anything in the ID Server except for the AnalysisRequest part, since everything else is basically created by submitting an Analysis Request.

Kind regards