The OpenTHC Compliance Reporting Engine is an API and Database to record crop, inventory, lab reports and sales.
The API
This system presents an API, similar to BioTrack, LeafData or Metrc.
Regulatory agencies or MSOs can use this system to collect and draw reports on the companies and licensees they manage.
The Database
Our CRE is backed by PostgreSQL the world's most advanced open source database.
This allows our CRE to scale to thousands of licensees and millions of inventory with ease.
The schema is not complex and uses well-established patterns such as triggers for logging changes and ensuring necessary timestamps are recorded.
The Reporting
The reporting for this system is backed by the Metabase business intelligence platform.
Metabase presents data dashboards, metrics, measurments over time and plenty of statisitics.
With Metabase even ad-hoc, custom reports are a breeze.
{% apply markdown %}
# Compliance Reporting Engine
The CRE is the core database schema (PostgreSQL), API (PHP/Slim) and core test cases (PHPUnit).
It is designed to provide a [FAIR](https://en.wikipedia.org/wiki/FAIR_data) data-system for regulators, auditors and businesses.
This system is designed primarily to use ULID formatted primary identifiers for all objects.
However, it is capable of handling identifiers from legacy systems as well.
This system is typically deployed on to a database-host node, with replication and a separate application-host nodes.
## Migration
The CRE provides migration scripts to import data from existing platforms.
### Migration from BioTrack
Data from an existing BioTrack based environment can be copied in from either API or direct SQL access.
The API based import must be run once (or twice) for each License to migrate.
### Migration from LeafData
LeafData systems can be migrated via the LeafData API.
However, the process must be run once, for each License to migrate.
### Migration from METRC
METRC systems can be migrated via the METRC API.
The process must be run three times, for each License in sequence (eg: A, B, C; A, B, C; A, B, C)
{% endapply %}
Technical Components
Cannabis/Crop Reporting Engine - CRE
This is a simple software solution for collecting and reporting on crops of cannabis or other tightly tracked, regulated products.
A simple setup of an event-object-audit-log database, along with the API end-point to collect the necessary details.
The platform is easy to extend by the regulatory agency or their selected vendor through middleware.
More information is available at https://openthc.com/
Global Storage
- Company
- License
- Contact
- Product
- Variety
License Specific Data
- Crop / Plant
- Inventory Lot
- Section (aka: Area, Room)
- Transfer (aka: Purchase Order, Manifest, Invoice)
Actions / Events
- Plant/Create - Create Plants from Inventory Lot (of type: Plant, Clone or Seed)
- Plant/Collect/Wet - Collect raw materials from the crop
- Plant/Collect/Dry - Account for Raw materials Dry/Cured/Trimmed state.
- Plant/Collect/Lot - Creates Production Inventory Lot
- Lot/Create
- Lot/Convert - One or more Source Lots into one Output Lot
- Lot/Combine
- Lot/Sample - Remove a Small Portion for Unique Sample (Employee, QA, Vendor, etc)
- Transfer/Create - File the Transfer
- Transfer/Commit - Commit/Send the Transfer
- Transfer/Accept - Accept/Receive the Transfer
- Transfer/Reject - Reject the Transfer
Reporting
- Realtime Object States
- Realtime Activity Reports
- Verbose Logging with complete Object delta
- Easily extendable via Middleware components
APIs
- Simple API Interface
- Direct Write/Update of Objects (Plant, Lot, Transfer)
- Indirect Update via Actions
Identifiers
- ULID - https://github.com/ulid/spec
- No reliance on central authority (BioTrack, METRC, LeafData)
- No reliance on expensive RFID (METRC)
- No "Smart" numbers (BioTrack, LeafData)
- Support for billions of billions of tracked items
- Usable until 10889 AD
- 1.21 Giga-Giga (2^80) unique items per millisecond!
Customizing
If you want to add new custom Services, Middleware or other code use the ./Custom
directory.
All of your custom libraries would be in ./Custom/Service
or ./Custom/Middleware
.
Then you can use them in the ./webroot/front.php
script.