Skip to content

django-lis/getresults-receive

 
 

Repository files navigation

Build Status Coverage Status

getresults-receive

The Receive model automatically allocates a unique receiving identifier for a new specimen.

>>>receive = Receive.objects.create(patient=self.patient)
>>>receive.receive_identifier
'AAA0001'

In settings, add:

RECEIVE_IDENTIFIER_SEED = ('AAA', '0000')
RECEIVE_IDENTIFIER_ALPHA_PATTERN = r'^[A-Z]{3}$'
RECEIVE_IDENTIFIER_NUMERIC_PATTERN = r'^[0-9]{4}$'

Identifiers

With the above attributes in settings your identifier will start with 'AAA0001'. For example:

>>> from getresults_receive.receive_identifier import ReceiveIdentifier
>>> new_id = ReceiveIdentifier(None)
>>> print(new_id)
'AAA0001'

The identifier increments on the numeric sequence then the alpha:

>>> new_id = ReceiveIdentifier('AAZ9998)
>>> print(new_id)
'AAA9999'	

>>> new_id.increment()
>>> print(new_id)
'AAB9999'	

>>> new_id = ReceiveIdentifier('AAZ9998)
>>> print(new_id)
'AAZ9999'	
>>> new_id.increment()
>>> print(new_id)
'ABA0001'	

See getresults-identifier for more details.

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.2%
  • JavaScript 35.0%
  • HTML 15.5%
  • CSS 1.3%