Repository for UBC Capstone project 2021/2022, group LIMS 0
A Laboratory Information Management System (LIMS) is an internal software program with multiple modules that manages laboratory work flows and information including but not limited to samples and test orders and results. The implementation of the LIMS will simplify data consolidation, improve data quality and security, facilitate receiving samples and track work orders.
The client’s target is to prepare a user-friendly LIMS which will have all the options a lab could imagine with different module systems. It should be a plug and play software based integrated LIMS to minimize a requirement of software engineer in a lab facility.
Goals of the LIMS is to develop and deploy a server/cloud-based system that provides effective and efficient management of laboratory work flow and information within the organization. The LIMS will be a proponent part of all the regulatory requirement as it will track personnel activates, monitor equipment, record methods validation, record instrument calibration, record and produce technical documents, integrate measurements of uncertainty, ensure validity of results, general reporting, control data and information management.
- To implement a server/cloud-based LIMS to manage various lab work flow and information pertaining to tracking sample from receipt to completion.
- To provide Inventory Management for consumables.
- Maintain track-record of reagents, samples and current location.
- Equipment integration for free-flowing data management, compliant to International Standardized Organization.
- To record Quality Control procedures and meet objectives.
- To facilitate real time reporting and record keeping.
- To use unique identifiers (QR/Barcode).
- To use app enabled devices for easy accessibility.
- Incorporating accounting management to make it a complete package.
- Easy to operate module system for any laboratory persons.
- Clients’ portal to access test results and invoices
More Info in LIMS.pdf
- Place your .env file under LIMS_IMAGE
- Your .env file should be formatted like so
SECRET_KEY=fake_key
DJANGO_SETTINGS_MODULE=src.settings
EMAIL_PASSWORD=email_app_password
MSSQL_HOST=fake_mssql_host_name
DB_USER=fake_user
DB_PASSWORD=fake_password
POSTGRES_DB=fake_postgres_db_name
POSTGRES_HOST=fake_postgres_host_name
POSTGRES_USER=fake_user
POSTGRES_PASSWORD=fake_password
- For the SECRET_KEY, start up the web server (instructions below) use the bash command to get inside the contianer and run
- Replace the fake data with the correct data for the rest of the variables.
python -c "import secrets; print(secrets.token_urlsafe())"
This will generate your own SECRET_KEY
sudo docker exec -it lims_web_server python manage.py migratesudo docker exec -it lims_web_server python manage.py createsuperuserand follow the prompts.
- Get superuser login from User.md
- Visit localhost:8000/admin and use the superuser account to login.
Alternatively
- Get superuser login from User.md
- Visit localhost:8000 and login use the superuser account to login
- In the navigation bar select "Administrator Dashboard" to be redirected to the admin site
When you change something about the database structure in the application we need to migrate those changes
docker-compose --builddocker exec -it lims_web_server bashpython manage.py makemigrationspython manage.py migrate
Note: If a change to the models was made that prevents the container from starting before the migrations are made, you can run this command in isolation: docker-compose run web python manage.py makemigrations and do the same to migrate.
Email settings are defined in settings.py. To change the email address, change the EMAIL_HOST_USER and EMAIL_HOST_PASSWORD values (and other values if changing to a provider other than gmail). The email host password is defined in the .env file. To change to a new gmail account, ensure to use an app password and not the google account password.
The testing README is found in the testing folder, along with all the tests
- Ensure docker and docker-compose are installed, and that this repo is cloned to your machine.
- cd into
LIMS_IMAGE. - For first-time setup run
docker-compose up --build db-postgresto let the database build (make sure you wait until it says the database is ready to accept connections. It may pause after the message 'ok' but that does not mean it is finished). - After the database has run bring it down (
CTRL+C) then rundocker-compose up --build.
- Start Up the Web Server in one terminal
- In a new terminal, cd into
LIMS_IMAGE. - Run
docker exec -it lims_db_server_postgres bash
This is required to persist data from the database in the repository. This will export the data as a backup file that will be used to initialize the database next time the container is built. When pulling updates with a new database backup, you must rebuild the container.
To create a database backup, simply run the following command while the container is running: docker exec -it lims_web_server python manage.py dumpdata -o datadump.json (this command also assumes the current directory is /LIMS_IMAGE)
We have done our best to leave explanitory comments throughout the code. We have linted the code to the best of our ability using pylint