"""
CCRS Constants | Cannlytics
Copyright (c) 2022-2023 Cannlytics

Authors:
    Keegan Skeate <https://github.com/keeganskeate>
    Candace O'Sullivan-Sutherland <https://github.com/candy-o>
Created: 4/12/2022
Updated: 1/3/2023
License: <https://github.com/cannlytics/cannlytics/blob/main/LICENSE>

Description: Helpful CCRS constants.

Data Sources:

    - WAC 314-55-102 Quality assurance and quality control
    URL: <https://app.leg.wa.gov/wac/default.aspx?cite=314-55-102&pdf=true>

    - WAC 314-55-108 Pesticide action levels
    URL: <https://apps.leg.wa.gov/WAC/default.aspx?cite=314-55-108>

    - WAC 246-70-050 Quality assurance testing
    URL: <https://app.leg.wa.gov/WAC/default.aspx?cite=246-70-050&pdf=true>

    - WSLCB `TestName` List
    URL: <https://lcb.wa.gov/sites/default/files/publications/Cannabis/CCRS/Lab%20Test%20CSV%20TestName.pdf>

    - WSLCB Testing Requirements
    URL: <https://lcb.wa.gov/sites/default/files/publications/Cannabis/Education/Cannabis_Prod_Testing_Req_Past_vs_Current_infograph.pdf>
"""

# Datasets that comprise the CCRS.
CCRS_DATASETS = {
    'areas': {
        'dataset': 'Areas',
        'singular': 'area',
        'fields': {
            'AreaId': 'string',
            'LicenseeId': 'string',
            'Name': 'string',
            'IsQuarantine': 'boolean',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'contacts': {
        'dataset': 'Contacts',
        'singular': 'contact',
        'fields': {
            'ContactId': 'string',
            'LicenseeId': 'string',
            'IntegratorId': 'string',
            'FirstName': 'string',
            'MiddleInitial': 'string',
            'LastName': 'string',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
            'IsAdmin': 'boolean',
        },
        'date_fields': [
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'integrators': {
        'dataset': 'Integrator',
        'singular': 'integrator',
        'fields': {
            'IntegratorId': 'string',
            'Name': 'string',
            'IsActive': 'boolean',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'inventory': {
        'dataset': 'Inventory',
        'singular': 'inventory_item',
        'fields': {
            'LicenseeId': 'string',
            'InventoryId': 'string',
            'StrainId': 'string',
            'AreaId': 'string',
            'ProductId': 'string',
            'InventoryIdentifier': 'string',
            'InitialQuantity': 'float',
            'QuantityOnHand': 'float',
            'TotalCost': 'float',
            'IsMedical': 'boolean',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'updatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'updatedDate',
        ],
    },
    'inventory_adjustments': {
        'dataset': 'InventoryAdjustments',
        'singular': 'inventory_adjustment',
        'fields': {
            'InventoryAdjustmentId': 'string',
            'InventoryId': 'string',
            'InventoryAdjustmentReason': 'string',
            'AdjustmentDetail': 'string',
            'Quantity': 'float',
            'AdjustmentDate': 'datetime64',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'AdjustmentDate',
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'inventory_plant_transfers': {
        'dataset': 'InventoryPlantTransfers',
        'singular': 'inventory_adjustment',
        'fields': {
            'InventoryPlantTransferID': 'string',
            'InventoryTransferId': 'string',
            'PlantTransferId': 'string',
            'FromLicenseeId': 'string',
            'ToLicenseeId': 'string',
            'FromInventoryId': 'string',
            'ToInventoryId': 'string',
            'FromPlantId': 'string',
            'ToPlantId': 'string',
            'Quantity': 'float',
            'TransferDate': 'datetime64',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'TransferDate',
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'lab_results': {
        'dataset': 'LabResult',
        'singular': 'lab_result',
        'fields': {
            'LabResultId': 'string',
            'LabLicenseeId': 'string',
            'LicenseeId': 'string',
            'LabTestStatus': 'string',
            'InventoryId': 'string',
            'TestName': 'string',
            'TestDate': 'datetime64',
            'TestValue': 'float',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'string',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'TestDate',
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'licensees': {
        'dataset': 'Licensee',
        'singular': 'licensee',
        'fields': {
            'LicenseeId': 'string',
            'LicenseStatus': 'string',
            'UBI': 'string',
            'LicenseNumber': 'string',
            'Name': 'string',
            'DBA': 'string',
            'LicenseIssueDate': 'datetime64',
            'LicenseExpirationDate': 'datetime64',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'Address1': 'string',
            'Address2': 'string',
            'City': 'string',
            'State': 'string',
            'ZipCode': 'string',
            'County': 'string',
            'EmailAddress': 'string',
            'PhoneNumber': 'string',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'LicenseIssueDate',
            'LicenseExpirationDate',
            'UpdatedDate',
        ],
    },
    'plants': {
        'dataset': 'Plant',
        'singular': 'plant',
        'fields': {
            'PlantId': 'string',
            'LicenseeId': 'string',
            'AreaId': 'string',
            'StrainId': 'string',
            'PlantSource': 'string',
            'PlantState': 'string',
            'GrowthStage': 'string',
            'HarvestCycle': 'string',
            'MotherPlantId': 'string',
            'PlantIdentifier': 'string',
            'HarvestDate': 'datetime64',
            'IsMotherPlant': 'boolean',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'string',
        },
        'date_fields': [
            'CreatedDate',
            'HarvestDate',
            'UpdatedDate',
        ],
    },
    'plant_destructions': {
        'dataset': 'PlantDestructions',
        'singular': 'plant_destruction',
        'fields': {
            'PlantDestructionId': 'string',
            'PlantId': 'string',
            'DestructionReason': 'string',
            'DestructionMethod': 'string',
            'DestructionDate': 'datetime64',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'DestructionDate',
            'UpdatedDate',
        ],
    },
    'products': {
        'dataset': 'Product',
        'singular': 'product',
        'fields': {
            'ProductId': 'string',
            'LicenseeId': 'string',
            'InventoryType': 'string',
            'Name': 'string',
            'Description': 'string',
            'UnitWeightGrams': 'float',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'sale_headers': {
        'dataset': 'SaleHeader',
        'singular': 'sale',
        'fields': {
            'SaleHeaderId': 'string',
            'LicenseeId': 'string',
            'SoldToLicenseeId': 'string',
            'SaleType': 'string',
            'SaleDate': 'datetime64',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'SaleDate',
            'UpdatedDate',
        ],
    },
    'sale_details': {
        'dataset': 'SalesDetail',
        'singular': 'sale_item',
        'fields': {
            'SaleDetailId': 'string',
            'SaleHeaderId': 'string',
            'InventoryId': 'string',
            'PlantId': 'string',
            'Quantity': 'float',
            'UnitPrice': 'float',
            'Discount': 'float',
            'SalesTax': 'float',
            'OtherTax': 'float',
            'ExternalIdentifier': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    'strains': {
        'dataset': 'Strains',
        'singular': 'strain',
        'fields': {
            'StrainId': 'string',
            'StrainType': 'string',
            'Name': 'string',
            'IsDeleted': 'boolean',
            'CreatedBy': 'string',
            'CreatedDate': 'datetime64',
            'UpdatedBy': 'string',
            'UpdatedDate': 'datetime64',
        },
        'date_fields': [
            'CreatedDate',
            'UpdatedDate',
        ],
    },
    # Legacy: Transfers have been removed.
    'transfers': {
        'legacy': True,
        'dataset': 'Transfers',
        'singular': 'transfer',
        'fields': {
            'Serial': 'string',
            'SID': 'string',
            'Submitted Time': 'datetime64',
            'Completed Time': 'datetime64',
            'Modified Time': 'datetime64',
            'Draft': 'int',
            'UID': 'string',
            'Username': 'string',
            'Transportation Type': 'string',
            'Scheduled Transportation Date': 'datetime64',
            'UBI Number': 'string',
            'Origin License Number': 'string',
            'Origin Trade Name': 'string',
            'Origin License Address': 'string',
            'Origin License Phone': 'string',
            'Origin License E-mail Address': 'string',
            'Departure Date': 'datetime64',
            'Estimated Departure Time': 'time',
            'Arrival Date': 'datetime64',
            'Estimated Arrival Time': 'time',
            'Destination License Name': 'string',
            'Destination License Number': 'string',
            'Destination License Email': 'string',
            'Destination License Phone': 'string',
            'Destination License Address': 'string',
            'Items Shipped': 'string', # This is actually a complex CSV, TSV, etc.
        },
        'date_fields': [
            'Submitted Time',
            'Completed Time',
            'Modified Time',
            'Scheduled Transportation Date',
            'Departure Date',
            'Arrival Date',
        ],
    },
}

# CCRS analyses.
CCRS_ANALYSES = {
    'Foreign Matter': 'foreign_matter',
    'Heavy Metal': 'heavy_metals',
    'microbe': 'microbes',
    'Microbiological': 'microbes',
    'moisture': 'moisture',
    'Moisture': 'moisture',
    'Moisture Analysis': 'moisture',
    'Moistures Analysis': 'moisture',
    'Mycotoxin': 'mycotoxins',
    'mycotoxin': 'mycotoxins',
    'Pesticide': 'pesticides',
    'Potency': 'cannabinoids',
    'Residual Solvent': 'residual_solvents',
    'Terpene': 'terpenes',
    'terpene': 'terpenes',
    'Water Activity': 'water_activity',
    'water_activity': 'water_activity',
}

# CCRS analyte constants.
CCRS_ANALYTES = {
    'd9-THC': {'key': 'delta_9_thc', 'type': 'Potency', 'units': 'percent'},
    'CBD': {'key': 'cbd', 'type': 'Potency', 'units': 'percent'},
    'd9-THCA': {'key': 'thca', 'type': 'Potency', 'units': 'percent'},
    'Total d9-THC': {'key': 'total_thc', 'type': 'Potency', 'units': 'percent'},
    'CBDA': {'key': 'cbda', 'type': 'Potency', 'units': 'percent'},
    'Total CBD': {'key': 'total_cbd', 'type': 'Potency', 'units': 'percent'},
    'THC': {'key': 'delta_9_thc', 'type': 'Potency', 'units': 'percent'},
    'THCA': {'key': 'thca', 'type': 'Potency', 'units': 'percent'},
    'MAX THC': {'key': 'total_thc', 'type': 'Potency', 'units': 'percent'},
    'MAX CBD': {'key': 'total_cbd', 'type': 'Potency', 'units': 'percent'},
    'Microbial- I502 panel (3)-E.coli': {'key': 'e_coli', 'type': 'microbe', 'units': 'CFU/G'},
    'Microbial- I502 panel (3)-Bile Tolerant gram neg': {'key': 'btgn', 'type': 'microbe', 'units': 'CFU/G'},
    'Microbial- I502 panel (3)-Salmonella': {'key': 'salmonella', 'type': 'microbe', 'units': 'CFU/G'},
    'Moisture & Water Activity-Moisture(%)': {'key': 'moisture', 'type': 'moisture', 'units': 'percent'},
    'Moisture & Water Activity-Water Activity (Aw)(%)': {'key': 'water_activity', 'type': 'water_activity', 'units': 'aw'},
    'Mycotoxins-Total Aflatoxins': {'key': 'aflatoxins', 'type': 'mycotoxin', 'units': 'CFU/G'},
    'Mycotoxins-Ochratoxin A': {'key': 'ochratoxin', 'type': 'mycotoxin', 'units': 'CFU/G'},
    'Terpineol': {'key': 'terpineol', 'type': 'terpene', 'units': 'percent'},
    'Microbiological - BTGN (CFU/g)': {'key': 'btgn', 'type': 'Microbiological', 'units': 'CFU/g'},
    'Residual Solvent - Butanes (ppm)': {'key': 'butanes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Propanes (ppm)': {'key': 'propanes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Benzene (ppm)': {'key': 'benzene', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Potency - D9THCA (%)': {'key': 'thca', 'type': 'Potency', 'units': 'percent'},
    'Potency - Total THC (%)': {'key': 'total_thc', 'type': 'Potency', 'units': 'percent'},
    'Potency - CBDA (%)': {'key': 'cbda', 'type': 'Potency', 'units': 'percent'},
    'Foreign Matter - Seeds or Other (%)': {'key': 'seeds_or_other', 'type': 'Foreign Matter', 'units': 'percent'},
    'Potency - Total CBD (%)': {'key': 'total_cbd', 'type': 'Potency', 'units': 'percent'},
    'Potency - D9THC (%)': {'key': '9_thc', 'type': 'Potency', 'units': 'percent'},
    'Potency - CBD (%)': {'key': 'cbd', 'type': 'Potency', 'units': 'percent'},
    'Foreign Matter - Stems (%)': {'key': 'stems', 'type': 'Foreign Matter', 'units': 'percent'},
    'Residual Solvent - Toluene (ppm)': {'key': 'toluene', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Heptanes (ppm)': {'key': 'heptanes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Microbiological - Salmonella (CFU/g)': {'key': 'salmonella', 'type': 'Microbiological', 'units': 'CFU/g'},
    'Microbiological - Ste (CFU/g)': {'key': 'stec', 'type': 'Microbiological', 'units': 'CFU/g'},
    'Moisture Analysis - Water Activity (aw)': {'key': 'water_activity', 'type': 'Moisture Analysis', 'units': 'aw'},
    'Mycotoxin - Ochratoxin A (ppb)': {'key': 'ochratoxin', 'type': 'Mycotoxin', 'units': 'ppb'},
    'Moistures Analysis - Moisture Content (%)': {'key': 'moisture_content', 'type': 'Moistures Analysis', 'units': 'percent'},
    'Mycotoxin - Total Aflatoxins (ppb)': {'key': 'total_aflatoxins', 'type': 'Mycotoxin', 'units': 'ppb'},
    'Residual Solvent - Hexanes (ppm)': {'key': 'hexanes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Acetone (ppm)': {'key': 'acetone', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Xylenes (ppm)': {'key': 'xylenes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Methanol (ppm)': {'key': 'methanol', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Isopropanol (ppm)': {'key': 'isopropanol', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Chloroform (ppm)': {'key': 'chloroform', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Dichloromethane (ppm)': {'key': 'dichloromethane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Ethyl Acetate (ppm)': {'key': 'ethyl_acetate', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Cyclohexane (ppm)': {'key': 'cyclohexane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Potency - CBDV (%)': {'key': 'cbdv', 'type': 'Potency', 'units': 'percent'},
    'Potency - THCV (%)': {'key': 'thcv', 'type': 'Potency', 'units': 'percent'},
    'Potency - CBG (%)': {'key': 'cbg', 'type': 'Potency', 'units': 'percent'},
    'Potency - CBGA (%)': {'key': 'cbga', 'type': 'Potency', 'units': 'percent'},
    'Potency - CBN (%)': {'key': 'cbn', 'type': 'Potency', 'units': 'percent'},
    'Potency - D8THC (%)': {'key': 'delta_8_thc', 'type': 'Potency', 'units': 'percent'},
    'Potency - CBC (%)': {'key': 'cbc', 'type': 'Potency', 'units': 'percent'},
    'Potency - THCA (%)': {'key': 'thca', 'type': 'Potency', 'units': 'percent'},
    'Mycotoxin - Total Aflatoxins (ug/kg)': {'key': 'total_aflatoxins', 'type': 'Mycotoxin', 'units': 'ug/kg'},
    'Mycotoxin - Ochratoxin A (ug/kg)': {'key': 'ochratoxin', 'type': 'Mycotoxin', 'units': 'ug/kg'},
    'Residual Solvent - Acetone (ug/g)': {'key': 'acetone', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Acetonitrile (ug/g)': {'key': 'acetonitrile', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Benzene (ug/g)': {'key': 'benzene', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Butanes (ug/g)': {'key': 'butane', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Chloroform (ug/g)': {'key': 'chloroform', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Cyclohexane (ug/g)': {'key': 'cyclohexane', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Dichloromethane (ug/g)': {'key': 'dichloromethane', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Ethanol (ug/g)': {'key': 'ethanol', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Ethanol (ppm)': {'key': 'ethanol', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Ethanol': {'key': 'ethanol', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Total Butanes': {'key': 'butane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Ethyl Acetate (ug/g)': {'key': 'ethyl_acetate', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Ethyl Ether (ug/g)': {'key': 'ethyl_ether', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Heptanea (ug/g)': {'key': 'heptane', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Hexanes (ug/g)': {'key': 'hexanes', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Isobutane (ug/g)': {'key': 'isobutane', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Methanol (ug/g)': {'key': 'methanol', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Pentanes (ug/g)': {'key': 'pentanes', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - 2-Propanol (IPA) (ug/g)': {'key': '2_propanol', 'type': 'Residual Solvent', 'units': 'IPA '},
    'Residual Solvent - Propanes (ug/g)': {'key': 'propanes', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Toluene (ug/g)': {'key': 'toluene', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Xylenes (ug/g)': {'key': 'xylenes', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Moisture Analysis - Moisture Content (%)': {'key': 'moisture_content', 'type': 'Moisture Analysis', 'units': 'percent'},
    'Residual Solvent - Heptanes (ug/g)': {'key': 'heptanes', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Residual Solvent - Isopropanol (ug/g)': {'key': 'isopropanol', 'type': 'Residual Solvent', 'units': 'ug/g'},
    'Potency - CBD (mg/g)': {'key': 'cbd', 'type': 'Potency', 'units': 'mg/g'},
    'Potency - CBDA (mg/g)': {'key': 'cbda', 'type': 'Potency', 'units': 'mg/g'},
    'Potency - D9THC (mg/g)': {'key': 'delta_9_thc', 'type': 'Potency', 'units': 'mg/g'},
    'Potency - D9THCA (mg/g)': {'key': 'thca', 'type': 'Potency', 'units': 'mg/g'},
    'Potency - Total THC (mg/g)': {'key': 'total_thc', 'type': 'Potency', 'units': 'mg/g'},
    'Potency - Total CBD (mg/g)': {'key': 'total_cbd', 'type': 'Potency', 'units': 'mg/g'},
    'Potency - CBD (mg/mL)': {'key': 'cbd', 'type': 'Potency', 'units': 'mg/mL'},
    'Potency - CBDA (mg/mL)': {'key': 'cbda', 'type': 'Potency', 'units': 'mg/mL'},
    'Potency - D9THC (mg/mL)': {'key': 'delta_9_thc', 'type': 'Potency', 'units': 'mg/mL'},
    'Potency - D9THCA (mg/mL)': {'key': 'thca', 'type': 'Potency', 'units': 'mg/mL'},
    'Potency - Total THC (mg/mL)': {'key': 'total_thc', 'type': 'Potency', 'units': 'mg/mL'},
    'Potency - Total CBD (mg/mL)': {'key': 'total_cbd', 'type': 'Potency', 'units': 'mg/mL'},
    'Microbiological - BTGN (CFU/G)': {'key': 'btgn', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Mycotoxin - Ochratoxin (CFU/G)': {'key': 'ochratoxin', 'type': 'Mycotoxin', 'units': 'CFU/G'},
    'Microbiological - STEC (CFU/G)': {'key': 'stec', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Microbiological - STEC (CFU/g)': {'key': 'stec', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Microbiological - Salmonella (CFU/G)': {'key': 'salmonella', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Mycotoxin - Aflatoxins (CFU/G)': {'key': 'aflatoxins', 'type': 'Mycotoxin', 'units': 'CFU/G'},
    'Residual Solvent - Benzene (PPM)': {'key': 'benzene', 'type': 'Residual Solvent', 'units': 'PPM'},
    'Residual Solvent - Dichloro-Methane (ppm)': {'key': 'dichloromethane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Heptane (ppm)': {'key': 'heptane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - n-Hexane (ppm)': {'key': 'n_hexane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Pentanes (ppm)': {'key': 'pentanes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Residual Solvent - Propane (ppm)': {'key': 'propane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Potency - D9THC (mg/serving)': {'key': 'delta_9_thc', 'type': 'Potency', 'units': 'mg/serving'},
    'Potency - D9THCA (mg/serving)': {'key': 'thca', 'type': 'Potency', 'units': 'mg/serving'},
    'Potency - CBD (mg/serving)': {'key': 'cbd', 'type': 'Potency', 'units': 'mg/serving'},
    'Potency - CBDA (mg/serving)': {'key': 'cbda', 'type': 'Potency', 'units': 'mg/serving'},
    'Potency - Total THC (mg/serving)': {'key': 'total_thc', 'type': 'Potency', 'units': 'mg/serving'},
    'Potency - Total CBD (mg/serving)': {'key': 'total_cbd', 'type': 'Potency', 'units': 'mg/serving'},
    'Potency - D9THC ()': {'key': 'delta_9_thc', 'type': 'Potency', 'units': ''},
    'Potency - D9THCA ()': {'key': 'thca', 'type': 'Potency', 'units': ''},
    'Potency - CBD ()': {'key': 'cbd', 'type': 'Potency', 'units': ''},
    'Potency - CBDA ()': {'key': 'cbda', 'type': 'Potency', 'units': ''},
    'Potency - Total THC ()': {'key': 'total_thc', 'type': 'Potency', 'units': ''},
    'Potency - Total CBD ()': {'key': 'total_cbd', 'type': 'Potency', 'units': ''},
    'Potency - THCA (mg/serving)': {'key': 'thca', 'type': 'Potency', 'units': 'mg/serving'},
    'Heavy Metal - Arsenic (ppm)': {'key': 'arsenic', 'type': 'Heavy Metal', 'units': 'ppm'},
    'Heavy Metal - Cadmium (ppm)': {'key': 'cadmium', 'type': 'Heavy Metal', 'units': 'ppm'},
    'Heavy Metal - Lead (ppm)': {'key': 'lead', 'type': 'Heavy Metal', 'units': 'ppm'},
    'Heavy Metal - Mercury (ppm)': {'key': 'mercury', 'type': 'Heavy Metal', 'units': 'ppm'},
    'Heavy Metal - Arsenic (ug/g)': {'key': 'arsenic', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Heavy Metal - Mercury (ug/g)': {'key': 'mercury', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Heavy Metal - Cadmium (ug/g)': {'key': 'cadmium', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Heavy Metal - Lead (ug/g)': {'key': 'lead', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Arsenic': {'key': 'arsenic', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Cadmium': {'key': 'cadmium', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Lead': {'key': 'lead', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Mercury': {'key': 'mercury', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Pb': {'key': 'lead', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'As': {'key': 'arsenic', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Hg': {'key': 'mercury', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Cd': {'key': 'cadmium', 'type': 'Heavy Metal', 'units': 'ug/g'},
    'Pesticide - Abamectin (ppm)': {'key': 'abamectin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Acephate (ppm)': {'key': 'acephate', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Acequinocyl (ppm)': {'key': 'acequinocyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Acetamiprid (ppm)': {'key': 'acetamiprid', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Aldicarb (ppm)': {'key': 'aldicarb', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Azoxystrobin (ppm)': {'key': 'azoxystrobin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Bifenazate (ppm)': {'key': 'bifenazate', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Bifenthrin (ppm)': {'key': 'bifenthrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Boscalid (ppm)': {'key': 'boscalid', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Carbaryl (ppm)': {'key': 'carbaryl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Carbofuran (ppm)': {'key': 'carbofuran', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Chlorantraniliprole (ppm)': {'key': 'chlorantraniliprole', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Chlorfenapyr (ppm)': {'key': 'chlorfenapyr', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Chlorpyrifos (ppm)': {'key': 'chlorpyrifos', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Clofentizine (ppm)': {'key': 'clofentizine', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Cyfluthrin (ppm)': {'key': 'cyfluthrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Cypermethrin (ppm)': {'key': 'cypermethrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Daminozide (ppm)': {'key': 'daminozide', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - DDVP (dichlorvos) (ppm)': {'key': 'ddvp', 'type': 'Pesticide', 'units': 'dichlorvos '},
    'Pesticide - Diazinon (ppm)': {'key': 'diazinon', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Dimethoate (ppm)': {'key': 'dimethoate', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Ethoprophos (ppm)': {'key': 'ethoprophos', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Etofenprox (ppm)': {'key': 'etofenprox', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Etoxazole (ppm)': {'key': 'etoxazole', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Fenoxycarb (ppm)': {'key': 'fenoxycarb', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Fenpyroximate (ppm)': {'key': 'fenpyroximate', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Fipronil (ppm)': {'key': 'fipronil', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Flonicamid (ppm)': {'key': 'flonicamid', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Fludioxonil (ppm)': {'key': 'fludioxonil', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Hexythiazox (ppm)': {'key': 'hexythiazox', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Imazalil (ppm)': {'key': 'imazalil', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Imidacloprid (ppm)': {'key': 'imidacloprid', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Kresoxim-Methyl (ppm)': {'key': 'kresoxim_methyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Malathion (ppm)': {'key': 'malathion', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Metalaxyl (ppm)': {'key': 'metalaxyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Methiocarb (ppm)': {'key': 'methiocarb', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Methomyl (ppm)': {'key': 'methomyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Methyl parathion (ppm)': {'key': 'methyl_parathion', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - MGK-264 (ppm)': {'key': 'mgk_264', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Myclobutanil (ppm)': {'key': 'myclobutanil', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Naled (ppm)': {'key': 'naled', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Oxamyl (ppm)': {'key': 'oxamyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Paclobutrazol (ppm)': {'key': 'paclobutrazol', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Permethrins (ppm)': {'key': 'permethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Phosmet (ppm)': {'key': 'phosmet', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Piperonyl butoxide (ppm)': {'key': 'piperonyl_butoxide', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Prallethrin (ppm)': {'key': 'prallethrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Propiconazole (ppm)': {'key': 'propiconazole', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Propoxur (ppm)': {'key': 'propoxur', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Pyrethrins (ppm)': {'key': 'pyrethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Pyridaben (ppm)': {'key': 'pyridaben', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Spinosad (ppm)': {'key': 'spinosad', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Spiromesifen (ppm)': {'key': 'spiromesifen', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Spirotetramat (ppm)': {'key': 'spirotetramat', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Spiroxamine (ppm)': {'key': 'spiroxamine', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Tebuconazole (ppm)': {'key': 'tebuconazole', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Thiacloprid (ppm)': {'key': 'thiacloprid', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Thiamethoxam (ppm)': {'key': 'thiamethoxam', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Trifloxystrobin (ppm)': {'key': 'trifloxystrobin', 'type': 'Pesticide', 'units': 'ppm'},
    'Etofenprox': {'key': 'etofenprox', 'type': 'Pesticide', 'units': 'ppm'},
    'Bifenthrin': {'key': 'bifenthrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Moisture Analysis - Water Activity (Aw)': {'key': 'water_activity', 'type': 'Moisture', 'units': 'Aw'},
    'Moisture Content': {'key': 'moisture_content', 'type': 'Moisture Analysis', 'units': 'percent'},
    'Water Activity': {'key': 'water_activity', 'type': 'Moisture', 'units': 'Aw'},
    'Foreign Matter - IHE (Boolean)': {'key': 'soil', 'type': 'Foreign Matter', 'units': 'boolean'},
    'Foreign Matter - IHE (ea.)': {'key': 'soil', 'type': 'Foreign Matter', 'units': 'ea'},
    'Foreign Matter - HIE (ea)': {'key': 'foreign_matter', 'type': 'Foreign Matter', 'units': 'ea'},
    'Foreign Matter - IHE (%)': {'key': 'foreign_matter', 'type': 'Foreign Matter', 'units': 'percent'},
    'Foreign I.H.E.': {'key': 'foreign_matter', 'type': 'Foreign Matter', 'units': 'percent'},
    'Foreign Matter': {'key': 'foreign_matter', 'type': 'Foreign Matter', 'units': 'percent'},
    'Foreign Matter (%)': {'key': 'foreign_matter', 'type': 'Foreign Matter', 'units': 'percent'},
    'Stems (%)': {'key': 'stems', 'type': 'Foreign Matter', 'units': 'percent'},
    'Stems': {'key': 'stems', 'type': 'Foreign Matter', 'units': 'percent'},
    'Foreign matter': {'key': 'foreign_matter', 'type': 'Foreign Matter', 'units': 'percent'},
    'Mycotoxin - Aflatoxins (ug/kg)': {'key': 'total_aflatoxins', 'type': 'Mycotoxin', 'units': 'ug/kg'},
    'Mycotoxin - Ochratoxin (ug/kg)': {'key': 'ochratoxin_a', 'type': 'Mycotoxin', 'units': 'ug/kg'},
    'Mycotoxin - Aflatoxins (ï¿½g/kg)': {'key': 'total_aflatoxins', 'type': 'Mycotoxin', 'units': 'ug/kg'},
    'Mycotoxin - Ochratoxin (ï¿½g/kg)': {'key': 'ochratoxin_a', 'type': 'Mycotoxin', 'units': 'ug/kg'},
    'Aflatoxins': {'key': 'ochratoxin', 'type': 'Mycotoxin', 'units': 'CFU/G'},
    'Total Aflatoxins': {'key': 'total_aflatoxins', 'type': 'Mycotoxin', 'units': 'CFU/G'},
    'Ochratoxin A': {'key': 'ochratoxin_a', 'type': 'Mycotoxin', 'units': 'CFU/G'},
    'BTGN': {'key': 'btgn', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Salmonella': {'key': 'salmonella', 'type': 'Microbiological', 'units': 'CFU/G'},
    'E Coli': {'key': 'e_coli', 'type': 'Microbiological', 'units': 'CFU/G'},
    'STEC': {'key': 'stec', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Salmonella spp.': {'key': 'salmonella', 'type': 'Microbiological', 'units': 'CFU/G'},
    'Acetone': {'key': 'acetone', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Toluene': {'key': 'toluene', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Total Hexanes': {'key': 'hexane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Total Xylenes': {'key': 'total_xylenes', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Total Propanes': {'key': 'propane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Benzene': {'key': 'benzene', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Total Heptanes': {'key': 'heptane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'iso-Propanol': {'key': 'isopropanol', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Chloroform': {'key': 'chloroform', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Cyclohexane': {'key': 'cyclohexane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Dichloromethane': {'key': 'dichloromethane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Total Pentanes': {'key': 'pentane', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Ethyl_Acetate': {'key': 'ethyl_acetate', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Methanol': {'key': 'methanol', 'type': 'Residual Solvent', 'units': 'ppm'},
    'Piperonyl Butoxide': {'key': 'piperonyl_butoxide', 'type': 'Pesticide', 'units': 'ppm'},
    'Cyfluthrin': {'key': 'cyfluthrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Chlorfenapyr': {'key': 'chlorfenapyr', 'type': 'Pesticide', 'units': 'ppm'},
    'Cypermethrin': {'key': 'cypermethrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Total MGK 264': {'key': 'total_mgk_264', 'type': 'Pesticide', 'units': 'ppm'},
    'Total Permethrins': {'key': 'total_permethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Carbofuran': {'key': 'carbofuran', 'type': 'Pesticide', 'units': 'ppm'},
    'Total Pyrethrins': {'key': 'pyrethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Azoxystrobin': {'key': 'azoxystrobin', 'type': 'Pesticide', 'units': 'ppm'},
    'Fludioxonil': {'key': 'fludioxonil', 'type': 'Pesticide', 'units': 'ppm'},
    'Propiconazole': {'key': 'propiconazole', 'type': 'Pesticide', 'units': 'ppm'},
    'Ethoprophos': {'key': 'ethoprophos', 'type': 'Pesticide', 'units': 'ppm'},
    'Imidacloprid': {'key': 'imidacloprid', 'type': 'Pesticide', 'units': 'ppm'},
    'Propoxur': {'key': 'propoxur', 'type': 'Pesticide', 'units': 'ppm'},
    'Myclobutanil': {'key': 'myclobutanil', 'type': 'Pesticide', 'units': 'ppm'},
    'Hexythiazox': {'key': 'hexythiazox', 'type': 'Pesticide', 'units': 'ppm'},
    'Paclobutrazol': {'key': 'paclobutrazol', 'type': 'Pesticide', 'units': 'ppm'},
    'Total Abamectin': {'key': 'total_abamectin', 'type': 'Pesticide', 'units': 'ppm'},
    'Dichlorvos': {'key': 'dichlorvos', 'type': 'Pesticide', 'units': 'ppm'},
    'Trifloxystrobin': {'key': 'trifloxystrobin', 'type': 'Pesticide', 'units': 'ppm'},
    'Tebuconazole': {'key': 'tebuconazole', 'type': 'Pesticide', 'units': 'ppm'},
    'Thiamethoxam': {'key': 'thiamethoxam', 'type': 'Pesticide', 'units': 'ppm'},
    'Acequinocyl': {'key': 'acequinocyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Diazinon': {'key': 'diazinon', 'type': 'Pesticide', 'units': 'ppm'},
    'Fenoxycarb': {'key': 'fenoxycarb', 'type': 'Pesticide', 'units': 'ppm'},
    'Methiocarb': {'key': 'methiocarb', 'type': 'Pesticide', 'units': 'ppm'},
    'Etoxazole': {'key': 'etoxazole', 'type': 'Pesticide', 'units': 'ppm'},
    'Carbaryl': {'key': 'carbaryl', 'type': 'Pesticide', 'units': 'ppm'},
    'Fenpyroximate': {'key': 'fenpyroximate', 'type': 'Pesticide', 'units': 'ppm'},
    'Spirotetramat': {'key': 'spirotetramat', 'type': 'Pesticide', 'units': 'ppm'},
    'Methomyl': {'key': 'methomyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Clofentezine': {'key': 'clofentezine', 'type': 'Pesticide', 'units': 'ppm'},
    'Aldicarb': {'key': 'aldicarb', 'type': 'Pesticide', 'units': 'ppm'},
    'Spiromesifen': {'key': 'spiromesifen', 'type': 'Pesticide', 'units': 'ppm'},
    'Boscalid': {'key': 'boscalid', 'type': 'Pesticide', 'units': 'ppm'},
    'Imazalil': {'key': 'imazalil', 'type': 'Pesticide', 'units': 'ppm'},
    'Acephate': {'key': 'acephate', 'type': 'Pesticide', 'units': 'ppm'},
    'Fipronil': {'key': 'fipronil', 'type': 'Pesticide', 'units': 'ppm'},
    'Total Spinosads': {'key': 'spinosad', 'type': 'Pesticide', 'units': 'ppm'},
    'Daminozide': {'key': 'daminozide', 'type': 'Pesticide', 'units': 'ppm'},
    'Metalaxyl': {'key': 'metalaxyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Bifenazate': {'key': 'bifenazate', 'type': 'Pesticide', 'units': 'ppm'},
    'Spiroxamine': {'key': 'spiroxamine', 'type': 'Pesticide', 'units': 'ppm'},
    'Naled': {'key': 'naled', 'type': 'Pesticide', 'units': 'ppm'},
    'Dimethoate': {'key': 'dimethoate', 'type': 'Pesticide', 'units': 'ppm'},
    'Kresoxim-methyl': {'key': 'kresoxim_methyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Oxamyl': {'key': 'oxamyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pyridaben': {'key': 'pyridaben', 'type': 'Pesticide', 'units': 'ppm'},
    'Malathion': {'key': 'malathion', 'type': 'Pesticide', 'units': 'ppm'},
    'Methyl parathion': {'key': 'methyl_parathion', 'type': 'Pesticide', 'units': 'ppm'},
    'Flonicamid': {'key': 'flonicamid', 'type': 'Pesticide', 'units': 'ppm'},
    'Acetamiprid': {'key': 'acetamiprid', 'type': 'Pesticide', 'units': 'ppm'},
    'Prallethrin': {'key': 'prallethrin', 'type': 'Pesticide', 'units': 'ppm'},
    'Phosmet': {'key': 'phosmet', 'type': 'Pesticide', 'units': 'ppm'},
    'Chlorpyrifos': {'key': 'chlorpyrifos', 'type': 'Pesticide', 'units': 'ppm'},
    'Chlorantraniliprole': {'key': 'chlorantraniliprole', 'type': 'Pesticide', 'units': 'ppm'},
    'Thiacloprid': {'key': 'thiacloprid', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Flonicamid (ug/g)': {'key': 'flonicamid', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Fludioxonil (ug/g)': {'key': 'fludioxonil', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Hexythiazox (ug/g)': {'key': 'hexythiazox', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Imazalil (ug/g)': {'key': 'imazalil', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Imidacloprid (ug/g)': {'key': 'imidacloprid', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Kresoxim-Methyl (ug/g)': {'key': 'kresoxim_methyl', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Malathion (ug/g)': {'key': 'malathion', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Metalaxyl (ug/g)': {'key': 'metalaxyl', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Methiocarb (ug/g)': {'key': 'methiocarb', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Methomyl (ug/g)': {'key': 'methomyl', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Methyl parathion (ug/g)': {'key': 'methyl_parathion', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - MGK-264 (ug/g)': {'key': 'mgk_264', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Myclobutanil (ug/g)': {'key': 'myclobutanil', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Naled (ug/g)': {'key': 'naled', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Oxamyl (ug/g)': {'key': 'oxamyl', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Paclobutrazol (ug/g)': {'key': 'paclobutrazol', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Permethrins (ug/g)': {'key': 'permethrins', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Phosmet (ug/g)': {'key': 'phosmet', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Piperonyl butoxide (ug/g)': {'key': 'piperonyl_butoxide', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Prallethrin (ug/g)': {'key': 'prallethrin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Propiconazole (ug/g)': {'key': 'propiconazole', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Propoxur (ug/g)': {'key': 'propoxur', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Pyrethrins (ug/g)': {'key': 'pyrethrins', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Pyridaben (ug/g)': {'key': 'pyridaben', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Spinosad (ug/g)': {'key': 'spinosad', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Spiromesifen (ug/g)': {'key': 'spiromesifen', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Spirotetramat (ug/g)': {'key': 'spirotetramat', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Spiroxamine (ug/g)': {'key': 'spiroxamine', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Tebuconazole (ug/g)': {'key': 'tebuconazole', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Thiacloprid (ug/g)': {'key': 'thiacloprid', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Thiamethoxam (ug/g)': {'key': 'thiamethoxam', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Trifloxystrobin (ug/g)': {'key': 'trifloxystrobin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Acephate (ug/g)': {'key': 'acephate', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Acequinocyl (ug/g)': {'key': 'acequinocyl', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Acetamiprid (ug/g)': {'key': 'acetamiprid', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Aldicarb (ug/g)': {'key': 'aldicarb', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Bifenazate (ug/g)': {'key': 'bifenazate', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Bifenthrin (ug/g)': {'key': 'bifenthrin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Boscalid (ug/g)': {'key': 'boscalid', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Carbaryl (ug/g)': {'key': 'carbaryl', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Carbofuran (ug/g)': {'key': 'carbofuran', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Chlorfenapyr (ug/g)': {'key': 'chlorfenapyr', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Chlorpyrifos (ug/g)': {'key': 'chlorpyrifos', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Clofentizine (ug/g)': {'key': 'clofentizine', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Cyfluthrin (ug/g)': {'key': 'cyfluthrin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Cypermethrin (ug/g)': {'key': 'cypermethrin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Daminozide (ug/g)': {'key': 'daminozide', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - DDVP (dichlorvos) (ug/g)': {'key': 'ddvp_dichlorvos', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Diazinon (ug/g)': {'key': 'diazinon', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Dimethoate (ug/g)': {'key': 'dimethoate', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Ethoprophos (ug/g)': {'key': 'ethoprophos', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Etofenprox (ug/g)': {'key': 'etofenprox', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Etoxazole (ug/g)': {'key': 'etoxazole', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Fenoxycarb (ug/g)': {'key': 'fenoxycarb', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Fenpyroximate (ug/g)': {'key': 'fenpyroximate', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Fipronil (ug/g)': {'key': 'fipronil', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Abamectin (ug/g)': {'key': 'abamectin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Azoxystrobin (ug/g)': {'key': 'azoxystrobin', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Chlorantraniliprole (ug/g)': {'key': 'chlorantraniliprole', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - DDVP (dichlorvos)': {'key': 'ddvp_dichlorvos', 'type': 'Pesticide', 'units': 'ug/g'},
    'Pesticide - Clofentezine (ppm)': {'key': 'clofentezine', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Dichlorvos (DDVP) (ppm)': {'key': 'dichlorvos_ddvp', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Kresoxin-methyl (ppm)': {'key': 'kresoxin_methyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Permethrins (total) (ppm)': {'key': 'permethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Phosemet (ppm)': {'key': 'phosemet', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Piperonyl Butoxide (ppm)': {'key': 'piperonyl_butoxide', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Pyrethrin I (ppm)': {'key': 'pyrethrin_i', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Spinosads (total) (ppm)': {'key': 'spinosad', 'type': 'Pesticide', 'units': 'ppm'},
    'Pesticide - Piperonyl Butoxide (ug/g)': {'key': 'piperonyl_butoxide', 'type': 'Pesticide', 'units': 'ug/g'},
    'Loss on Drying': {'key': 'moisture_content', 'type': 'Moistures Analysis', 'units': 'percent'},
    'Abamectin B1a': {'key': 'abamectin', 'type': 'Pesticide', 'units': 'ppm'},
    'Pyrethrins I': {'key': 'pyrethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Pyrethrins (Total)': {'key': 'pyrethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'DDVP (dichlorvos)': {'key': 'ddvp', 'type': 'Pesticide', 'units': 'dichlorvos '},
    'Kresoxim-Methyl': {'key': 'kresoxim_methyl', 'type': 'Pesticide', 'units': 'ppm'},
    'Clofentizine': {'key': 'clofentizine', 'type': 'Pesticide', 'units': 'ppm'},
    'Piperonyl butoxide': {'key': 'piperonyl_butoxide', 'type': 'Pesticide', 'units': 'ppm'},
    'Permethrins': {'key': 'permethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Spinosad': {'key': 'spinosad', 'type': 'Pesticide', 'units': 'ppm'},
    'MGK-264': {'key': 'mgk_264', 'type': 'Pesticide', 'units': 'ppm'},
    'Pyrethrins': {'key': 'pyrethrins', 'type': 'Pesticide', 'units': 'ppm'},
    'Abamectin': {'key': 'abamectin', 'type': 'Pesticide', 'units': 'ppm'},
}

# CCRS plant constants.
CCRS_PLANT_GROWTH_STAGES = ['Vegetative', 'Immature', 'Flowering']
CCRS_PLANT_HARVEST_CYCLES = [3,  6,  9, 12]
CCRS_PLANTS_SOURCES = ['Clone', 'Seed']
CCRS_PLANT_STATES = [
    'Growing',
    'Inventory',
    'Drying',
    'Harvested',
    'Destroyed',
    'Sold',
]
