ensure order accession number uniqueness in a subclass

yes not sure if thats being paranoid but better safe than sorry :innocent:

I made an AccessionNumberGenerator like the OrderNumberGenerator with the sequence seed value coming from a global property. So when a user enters a radiology order he doesnt specify the accessionNumber and the accessionNumber is set in the RadiologyOrderService when saving. So with this approach I dont really need validation since the accessionNumber is auto-generated and the way the OrderNumberGenerator does it ensures uniqueness (+ its thread safe).

I just wonder what happens if I would allow users to specify the accession number themselves when entering an order. Not sure if this could be a requirement. But in that case I would have two sources (user + generator) which could cause such collisions. I dont think I will allow this now, I just wanted to think the whole accession number generation through thoroughly also with input from others on potential issues :slight_smile: thanks for your input!!