The Optrel Parser (Stevanto / S.P.A.M.I) is a django/python script that enables you to import batch reports (.pdf) and audit logs (.csv) to a postgres database from any Optrel Inspection (I was using the MCA 150 and MCA 200 LKD machines) machine that is using WinCC Flexible PVSI which will enable you to view them in a readable, user friendly website.
I created this script due to there being no way to tie processed batch reports to their corresponding audit log, this program will highlight any issues that have happened while inspection has taken place. e.g common faults such as safety clutche slips or having to remove a vial manually when it faults to the wrong reject channel
- Import batch report .pdf's
- Import audit log .csv's
- Authentication is required before viewing any reports
psql postgres
create database optrel_reports;
pip install -r requirements.txt
Located in /optrel/.env.example
, fill this with the correct environment varibles before continuing and rename to .env
python manage.py migrate
I created a batch script making use of Robocopy on windows to automatically retrieve all newly created audit logs / batch reports from the machines and copy to the projects directory nightly.
"/files/vials"
"/files/ampoules"
"/files/vial_audit"
"/files/ampoule_audit"
Use the --truncate
argument to empty table before importing
python manage.py import_vials
python manage.py import_ampoules
python manage.py import_ampoule_audit
python manage.py import_vial_audit
These can take a long time to run on first import
python manage.py createsuperuser
python manage.py createsuperuser
python manage.py runserver 8000
To view imported batch data
localhost:8000/ampoules
localhost:8000/vials
You must be logged in to view these pages!
The stylesheet located at /static/reports/style.css
will need to be updated to match your inspection machines recipes - starting at line 371
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Optrel Parser uses a number of open source projects