예제 #1
0
class tblS6AccidentChemicals(BaseRMPModel):
    accidentchemicalid = CopyFromIntegerField(
        source_column='AccidentChemicalID',
        primary_key=True,
    )
    accidenthistoryid = CopyFromForeignKey(
        'tblS6AccidentHistory',
        source_column='AccidentHistoryID',
        on_delete=models.PROTECT,
    )
    chemicalid = CopyFromForeignKey(
        'tlkpChemicals',
        source_column='ChemicalID',
        on_delete=models.PROTECT,
    )
    quantityreleased = CopyFromFloatField(
        source_column='QuantityReleased',
        null=True,
    )
    percentweight = CopyFromFloatField(
        source_column='PercentWeight',
        null=True,
    )

    class Meta:
        verbose_name = 'Accident History: Chemicals'
        verbose_name_plural = 'Accident History: Chemicals'
예제 #2
0
class tblS7PreventionProgramChemicals(BaseRMPModel):
    PrimaryKey = CopyFromIntegerField(
        primary_key=True,
        verbose_name='Primary Key',
        help_text='Unique identifier for the Prevention Program 3 chemicals '
                  'record destination table. Generated by RMP*Submit and 3rd-'
                  'party programs.',
    )
    PreventionProgram3ID = CopyFromForeignKey(
        'Tbls7PreventionProgram3',
        db_column='PreventionProgram3ID',
        verbose_name='Prevention Program 3 ID',
        on_delete=models.PROTECT,
        help_text='A unique number used to identify each prevention program '
                  'within a NAICS code within a process. Generated by '
                  'RMP*Submit and 3rd-party programs.',
    )
    ProcessChemicalID = CopyFromForeignKey(
        'tbls1ProcessChemicals',
        db_column='ProcessChemicalID',
        on_delete=models.PROTECT,
        verbose_name='Process Chemical ID',
        help_text='A number used to identify each chemical within a single RMP'
                  'from Section 1 Chemicals in Covered Process. Generated by '
                  'RMP*Submit and 3rd-party programs.'
    )

    source_file = 'tblS7_Prevention_Program_Chemicals'

    class Meta:
        verbose_name = 'Prevention Program: Program Level 3 Chemical'
        verbose_name_plural = 'Prevention Program: Program Level 3 Chemical'
예제 #3
0
class tblS1Process_NAICS(BaseRMPModel):
    Process_NAICS_ID = CopyFromIntegerField(
        primary_key=True,
        verbose_name='Process NAICS ID',
        help_text='Unique number used to identify each NAICS code within a '
        'covered process in an RMP. Generated by RMP*Submit and '
        '3rd-party programs.',
    )
    ProcessID = CopyFromForeignKey(
        'tblS1Processes',
        db_column='ProcessID',
        on_delete=models.PROTECT,
        verbose_name='Process ID',
        help_text='Unique number used to identify each covered process in an '
        'RMP reported in Section 1. Generated by RMP*Submit and 3rd-'
        'party programs.',
    )
    NAICSCode = CopyFromForeignKey(
        'tlkpNAICS',
        db_column='NAICSCode',
        on_delete=models.PROTECT,
        verbose_name='1.17.b NAICS Code',
        help_text='The 5- or 6-digit NAICS Code.',
    )

    class Meta:
        verbose_name = 'Process: NAICS Code'
        verbose_name_plural = 'Process: NAICS Code'
예제 #4
0
class ProcChem(BaseRMPModel):
    procchem_id = CopyFromBigIntegerField(
        primary_key=True,
        source_column='procchem_id',
    )
    process = CopyFromForeignKey(
        'Process',
        on_delete=models.CASCADE
    )
    chemical = CopyFromForeignKey(
        'ChemCd',
        on_delete=models.CASCADE
    )
    quantity_lbs = CopyFromBigIntegerField()
    cbi_flag = CopyFromBooleanField()
    num_alt_flam = CopyFromBigIntegerField()
    num_alt_tox = CopyFromBigIntegerField()
    num_prevent_2_chem = CopyFromBigIntegerField()
    num_prevent_3_chem = CopyFromBigIntegerField()
    num_proc_flam = CopyFromBigIntegerField()
    num_worst_flam = CopyFromBigIntegerField()
    num_worst_tox = CopyFromBigIntegerField()
    cas = CopyFromBigIntegerField()
    chemical_type = CopyFromCharField(max_length=1)

    source_file = 'rmp_proc_chem'
예제 #5
0
class tblS1FlammableMixtureChemicals(BaseRMPModel):
    FlamMixChemID = CopyFromIntegerField(
        primary_key=True,
        verbose_name='Flam Mix Chem ID',
        help_text='Unique identifier for the Section 1 Flammable Mixture '
        'Chemicals record destination table. Generated by '
        'RMP*Submit and 3rd-party programs.',
    )
    ProcessChemicalID = CopyFromForeignKey(
        'tbls1ProcessChemicals',
        db_column='ProcessChemicalID',
        on_delete=models.PROTECT,
        verbose_name='Process Chemical ID',
        help_text='Unique number used to identify each chemical within a '
        'single RMP. Generated by RMP*Submit and 3rd-party '
        'programs.',
    )
    ChemicalID = CopyFromForeignKey(
        'tlkpChemicals',
        db_column='ChemicalID',
        on_delete=models.PROTECT,
        verbose_name='Chemical ID',
        help_text='Chemical Abstract Service (CAS) registry number for the '
        'flammable chemical.',
    )

    class Meta:
        verbose_name = 'Registration Information'
        verbose_name_plural = 'Registration Information'
예제 #6
0
class AccFlam(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='FlamMixChemID',
        verbose_name='Flammable Chemical ID',
        help_text='A unique ID for each flammable chemical record.',
    )
    accchem = CopyFromForeignKey(
        'AccChem',
        on_delete=models.PROTECT,
        source_column='AccidentChemicalID',
        verbose_name='Accident Chemical Record ID',
        help_text='A unique ID for each accident chemical record.')
    chemical = CopyFromForeignKey(
        'ChemCd',
        on_delete=models.PROTECT,
        source_column='ChemicalID',
        verbose_name='Chemical ID',
        help_text=
        'The identifying ID for a particular flammable chemical released in an accident.',
    )

    @classmethod
    def get_transform_queryset(self):
        m = raw_models.tblS6FlammableMixtureChemicals
        """
        Baseline table for accidents
        """
        return m.objects.get_default_transform_queryset()
예제 #7
0
class AccChem(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='accchem_id',
        verbose_name='Accident Chemical Record ID',
        help_text='A unique ID for each accident chemical record.',
    )
    accident = CopyFromForeignKey(
        'Accident',
        on_delete=models.PROTECT,
        help_text='The unique ID for each accident record',
    )
    chemical = CopyFromForeignKey(
        'ChemCd',
        on_delete=models.PROTECT,
        help_text='The identifying ID for a particular chemical released in an '
                  'accident.',
    )
    quantity_lbs = CopyFromIntegerField(
        null=True,
        verbose_name='Amount Released (lbs)',
        help_text='The amount of the substance released in the accident, in '
                  'pounds, to two significant digits.',
    )
    percent_weight = CopyFromDecimalField(
        decimal_places=2,
        null=True,
        max_digits=5,
        verbose_name='Percent Weight (Within Mixture)',
        help_text='The percent weight of a chemical within a mixture released '
                  'in an accident.',
    )
    num_acc_flam = CopyFromIntegerField(
        null=True,
        verbose_name='Number of Flammable Components',
        help_text='The number of listed flammable component chemicals for this'
                  ' chemical record.',
    )
    cas = CopyFromCharField(
        max_length=9,
        verbose_name='CAS number',
        help_text='The identifying CAS number for a chemical.',
    )
    CHEMICAL_TYPE_CHOICES = (
        ('T', 'toxic'),
        ('F', 'flammable'),
    )
    chemical_type = CopyFromCharField(
        max_length=1,
        choices=CHEMICAL_TYPE_CHOICES,
        help_text='"The type of chemical.',
    )

    source_file = 'rmp_acc_chem'
예제 #8
0
class tblS6FlammableMixtureChemicals(BaseRMPModel):
    FlamMixChemID = CopyFromIntegerField(primary_key=True, )
    AccidentChemicalID = CopyFromForeignKey(
        'tblS6AccidentChemicals',
        db_column='AccidentChemicalID',
        on_delete=models.PROTECT,
    )
    ChemicalID = CopyFromForeignKey('tlkpChemicals',
                                    db_column='ChemicalID',
                                    on_delete=models.PROTECT)

    class Meta:
        verbose_name = 'Accident History: Flammable Mixture Chemicals'
        verbose_name_plural = 'Accident History: Flammable Mixture Chemicals'
예제 #9
0
class ProcFlam(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='flammixchem_id',
    )
    procchem = CopyFromForeignKey(
        ProcChem,
        on_delete=models.CASCADE
    )
    chemical = CopyFromForeignKey(
        'ChemCd',
        on_delete=models.CASCADE
    )

    source_file = 'rmp_proc_flam'
예제 #10
0
class CountyCd(BaseRMPModel):
    state_code = CopyFromForeignKey(
        'StateCd',
        on_delete=PROTECT,
        help_text='The U.S. Postal Service abbreviation for the state in which'
        ' the facility is located.',
        db_column='State_Code',
    )
    county_code = CopyFromCharField(
        max_length=2,
        help_text='Federal Information Processing Standard (FIPS) code for the'
        ' county in which the facility is located.',
    )
    county_name = CopyFromCharField(
        max_length=30,
        help_text='The name of the county.',
    )
    state_county_code = CopyFromIntegerField(
        primary_key=True,
        help_text='Concatenation of state_code and county_code(?)',
    )

    @classmethod
    def get_transform_queryset(self):
        m = raw_models.tlkpCountyFIPSCodes

        return m.objects.get_default_transform_queryset()
예제 #11
0
class FlammablesWorstCase(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='flammable_id',
    )
    procchem = CopyFromForeignKey(
        'ProcChem',
        on_delete=models.CASCADE
    )
    analytical_basis = CopyFromCharField(max_length=255, blank=True)
    # quantity_lbs = CopyFromDecimalField(max_digits=6, decimal_places=2, blank=True)
    # endpoint_distance = CopyFromDecimalField(max_digits=5, decimal_places=1)
    quantity_lbs = CopyFromCharField(max_length=20, blank=True)
    endpoint_distance = CopyFromCharField(max_length=20, blank=True)
    population = CopyFromCharField(max_length=9, blank=True)
    pr_schools = CopyFromBooleanField()
    pr_residences = CopyFromBooleanField()
    pr_hospitals = CopyFromBooleanField()
    pr_prisons = CopyFromBooleanField()
    pr_public_rec = CopyFromBooleanField()
    pr_comm_ind = CopyFromBooleanField()
    pr_othertype = CopyFromCharField(max_length=200, blank=True)
    er_natlstateparks = CopyFromBooleanField()
    er_wildlife_sanct = CopyFromBooleanField()
    er_fedwilderness = CopyFromBooleanField()
    er_othertype = CopyFromCharField(max_length=200, blank=True)
    pm_blastwalls = CopyFromBooleanField()
    pm_othertype = CopyFromCharField(max_length=200, blank=True)
    ptrgraphic = CopyFromCharField(max_length=12, blank=True)
    cbi_flag = CopyFromBooleanField()

    source_file = 'rmp_worst_flam'
예제 #12
0
class tblRMPError(BaseRMPModel):
    FacilityID = CopyFromForeignKey(
        'tblFacility',
        on_delete=models.PROTECT,
        source_column='FacilityID',
        verbose_name='Facility ID',
        help_text='Unique identifier for all RMPs submitted by a specific '
        'facility (assigned by Reporting Center for first-time '
        'submission). * After this number is assigned to the first '
        'submission for a facility, subsequent submissions for the '
        'same facility must include this identifier.',
    )
    SequenceNumber = CopyFromIntegerField(
        source_column='SequenceNumber',
        verbose_name='Sequence Number',
        help_text='Unique sequence number.',
    )
    ErrorText = CopyFromTextField(
        source_column='ErrorText',
        verbose_name='Error Text',
        help_text='Error message text.',
    )

    class Meta:
        verbose_name = 'RMP ValidationError'
        verbose_name_plural = 'RMP ValidationErrors'
예제 #13
0
class Prevent3Chem(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='primary_key',
    )
    prevent_3 = CopyFromForeignKey(
        'PreventionProgram3',
        on_delete=models.CASCADE,
        source_column='prevent_3_id',
    )
    procchem = CopyFromForeignKey(
        'ProcChem',
        on_delete=models.CASCADE
    )

    source_file = 'rmp_prevent_3_chem'
예제 #14
0
class tblS8_Prevention_Program_Chemicals(BaseRMPModel):
    primarykey = CopyFromIntegerField(
        source_column='PrimaryKey',
        primary_key=True,
    )
    preventionprogram2id = CopyFromForeignKey(
        'tblS8PreventionProgram2',
        source_column='PreventionProgram2ID',
        on_delete=models.PROTECT)
    processchemicalid = CopyFromForeignKey('tblS1ProcessChemicals',
                                           source_column='ProcessChemicalID',
                                           on_delete=models.PROTECT)

    class Meta:
        verbose_name = 'Prevention Program: Program Level 2 Chemicals'
        verbose_name_plural = 'Prevention Program: Program Level 2 Chemicals'
예제 #15
0
class tlkpCountyFIPSCodes(BaseRMPModel):
    State_Code = CopyFromForeignKey(
        'tlkpStateFIPSCodes',
        on_delete=models.PROTECT,
        help_text='The U.S. Postal Service abbreviation for the state in which'
                  ' the facility is located.',
    )
    County_Code = CopyFromCharField(
        max_length=2,
        help_text='Federal Information Processing Standard (FIPS) code for the'
                  ' county in which the facility is located.',
    )
    County_Name = CopyFromCharField(
        max_length=30,
        help_text='The name of the county.',
    )
    StateCounty_Code = CopyFromCharField(
        primary_key=True,
        help_text='Concatenation of state_code and county_code(?)',
        max_length=5,
    )

    source_file = 'tlkpCountyFIPSCodes'

    class Meta:
        verbose_name='Lookup: County FIPS codes'
예제 #16
0
class tblExecutiveSummaries(BaseRMPModel):
    ESSeqNum = CopyFromIntegerField(
        verbose_name='Executive Summary Sequence Number',
        help_text='Unique sequence number for the executive summary.',
    )
    FacilityID = CopyFromForeignKey(
        'tblS1Facilities',
        db_column='FacilityID',
        on_delete=models.PROTECT,
        verbose_name='Facility ID',
        help_text='Unique identifier for all RMPs submitted by a specific '
        'facility (assigned by Reporting Center for first-time '
        'submission). * After this number is assigned to the first '
        'submission for a facility, subsequent submissions for the '
        'same facility must include this identifier.',
    )
    SummaryText = CopyFromTextField(
        verbose_name='Executive Summary',
        blank=True,
        help_text='The Executive Summary includes a brief description of the '
        "facility's risk management program.",
    )

    source_file = 'tblExecutiveSummaries'

    class Meta:
        db_table = 'tblExecutiveSummaries'
예제 #17
0
class tblS7PreventionProgram3Description_ChangeHistory(BaseRMPModel):
    preventionprogram3descchangehistoryid = CopyFromIntegerField(
        primary_key=True,
        source_column='PreventionProgram3DescChangeHistoryID',
    )
    facilitychangehistoryid = CopyFromIntegerField(
        source_column='FacilityChangeHistoryID', )
    cdxcorrectioncode = CopyFromCharField(
        max_length=1,
        source_column='CDXCorrectionCode',
    )
    preventionprogram3id = CopyFromForeignKey(
        'tblS7PreventionProgram3',
        on_delete=models.PROTECT,
        source_column='PreventionProgram3ID',
    )
    description = CopyFromTextField(
        source_column='Description',
        blank=True,
    )
    olddescription = CopyFromTextField(
        source_column='OldDescription',
        blank=True,
    )
    seqnum = CopyFromIntegerField(source_column='SeqNum', )
예제 #18
0
class tblS7PreventionProgramChemicalsChangeHistory(BaseRMPModel):
    pp3chemchangehistoryid = CopyFromIntegerField(
        primary_key=True,
        source_column='PP3ChemChangeHistoryID',
        verbose_name='PP3 Chemical Change History ID',
    )
    facilitychangehistoryid = CopyFromIntegerField(
        source_column='FacilityChangeHistoryID',
        verbose_name='Facility Change History ID',
    )
    cdxcorrectioncode = CopyFromCharField(
        max_length=1,
        source_column='CDXCorrectionCode',
        verbose_name='CDX Correction Code',
    )
    pp3chemid = CopyFromForeignKey(
        'tblS7PreventionProgramChemicals',
        on_delete=models.PROTECT,
        source_column='PP3ChemID',
        verbose_name='Prevention Program Chemical ID',
    )
    preventionprogram3id = CopyFromForeignKey(
        'tblS7PreventionProgram3',
        on_delete=models.PROTECT,
        source_column='PreventionProgram3ID',
        verbose_name='Prevention Program3 ID',
    )
    processchemicalid = CopyFromForeignKey(
        'tblS1ProcessChemicals',
        on_delete=models.PROTECT,
        source_column='ProcessChemicalID',
        verbose_name='Process Chemical ID',
    )
    process_naics_id = CopyFromForeignKey(
        'tblS1ProcessNAICS',
        on_delete=models.PROTECT,
        source_column='Process_NAICS_ID',
        verbose_name='',
    )
    naicscode = CopyFromForeignKey(
        'tlkpNAICS',
        on_delete=models.PROTECT,
        source_column='NAICSCode',
        verbose_name='NAICS Code',
    )

    source_file = 'tblS7_Prevention_Program_Chemicals_ChangeHistory'
예제 #19
0
class tblS6FlammableMixtureChemicals(BaseRMPModel):
    flammixchemid = CopyFromIntegerField(
        source_column='FlamMixChemID',
        primary_key=True,
    )
    accidentchemicalid = CopyFromForeignKey(
        'Tbls6Accidentchemicals',
        source_column='AccidentChemicalID',
        on_delete=models.PROTECT,
    )
    chemicalid = CopyFromForeignKey('tlkpChemicals',
                                    source_column='ChemicalID',
                                    on_delete=models.PROTECT)

    class Meta:
        verbose_name = 'Accident History: Flammable Mixture Chemicals'
        verbose_name_plural = 'Accident History: Flammable Mixture Chemicals'
예제 #20
0
class tblS8_Prevention_Program_Chemicals(BaseRMPModel):
    PrimaryKey = CopyFromIntegerField(
        primary_key=True,
    )
    PreventionProgram2ID = CopyFromForeignKey(
        'tblS8PreventionProgram2',
        db_column='PreventionProgram2ID',
        on_delete=models.PROTECT,
    )
    ProcessChemicalID = CopyFromForeignKey(
        'tblS1ProcessChemicals',
        db_column='ProcessChemicalID',
        on_delete=models.PROTECT,
    )

    class Meta:
        verbose_name = 'Prevention Program: Program Level 2 Chemicals'
        verbose_name_plural = 'Prevention Program: Program Level 2 Chemicals'
예제 #21
0
class tblS6AccidentChemicals(BaseRMPModel):
    AccidentChemicalID = CopyFromIntegerField(primary_key=True, )
    AccidentHistoryID = CopyFromForeignKey(
        'tblS6AccidentHistory',
        db_column='AccidentHistoryID',
        on_delete=models.PROTECT,
    )
    ChemicalID = CopyFromForeignKey(
        'tlkpChemicals',
        db_column='ChemicalID',
        on_delete=models.PROTECT,
    )
    QuantityReleased = CopyFromFloatField(null=True, )
    PercentWeight = CopyFromFloatField(null=True, )

    class Meta:
        verbose_name = 'Accident History: Chemicals'
        verbose_name_plural = 'Accident History: Chemicals'
예제 #22
0
class tblS7PreventionProgramChemicalsChangeHistory(BaseRMPModel):
    PP3ChemChangeHistoryID = CopyFromIntegerField(
        primary_key=True,
        verbose_name='PP3 Chemical Change History ID',
    )
    FacilityChangeHistoryID = CopyFromIntegerField(
        verbose_name='Facility Change History ID',
    )
    CDXCorrectionCode = CopyFromCharField(
        max_length=1,
        verbose_name='CDX Correction Code',
    )
    PP3ChemID = CopyFromForeignKey(
        'tblS7PreventionProgramChemicals',
        db_column='PP3ChemID',
        on_delete=models.PROTECT,
        verbose_name='Prevention Program Chemical ID',
    )
    PreventionProgram3ID = CopyFromForeignKey(
        'tblS7PreventionProgram3',
        db_column='PreventionProgram3ID',
        on_delete=models.PROTECT,
        verbose_name='Prevention Program3 ID',
    )
    ProcessChemicalID = CopyFromForeignKey(
        'tblS1ProcessChemicals',
        db_column='ProcessChemicalID',
        on_delete=models.PROTECT,
        verbose_name='Process Chemical ID',
    )
    process_naics_id = CopyFromForeignKey(
        'tblS1Process_NAICS',
        db_column='process_naics_id',
        on_delete=models.PROTECT,
        verbose_name='',
    )
    NAICSCode = CopyFromForeignKey(
        'tlkpNAICS',
        db_column='NAICSCode',
        on_delete=models.PROTECT,
        verbose_name='NAICS Code',
    )

    source_file = 'tblS7_Prevention_Program_Chemicals_ChangeHistory'
예제 #23
0
class tblS1ProcessChemicals(BaseRMPModel):
    processchemicalid = CopyFromIntegerField(
        primary_key=True,
        source_column='ProcessChemicalID',
        verbose_name='Process Chemical ID',
        help_text='Unique number used to identify each chemical within a '
        'single RMP. Generated by RMP*Submit and 3rd-party programs.')
    processid = CopyFromForeignKey(
        'tblS1Processes',
        on_delete=models.PROTECT,
        source_column='ProcessID',
        verbose_name='Process ID',
        help_text='Unique number used to identify each covered process within '
        'an RMP from Section 1 Program Level for the Covered '
        'Process. Generated by RMP*Submit and 3rd-party programs.',
    )
    chemicalid = CopyFromForeignKey(
        'tlkpChemicals',
        on_delete=models.PROTECT,
        source_column='ChemicalID',
        verbose_name='Chemical ID',
        help_text='Chemical Abstract Service (CAS) registry number for the '
        'chemical.',
    )
    quantity = CopyFromDecimalField(
        max_digits=28,
        decimal_places=16,
        null=True,
        source_column='Quantity',
        verbose_name='1.17.c.3 Quantity',
        help_text='The maximum inventory quantity of the regulated substance '
        'or mixture in the process in pounds.',
    )
    cbi_flag = CopyFromBooleanField(
        source_column='CBI_Flag',
        verbose_name='CBI Flag',
        help_text='An indication that the quantity was claimed as CBI.',
    )

    class Meta:
        verbose_name = 'Process: Chemical'
        verbose_name_plural = 'Process: Chemicals'
예제 #24
0
class tblS7PreventionProgram3Description_ChangeHistory(BaseRMPModel):
    PreventionProgram3DescChangeHistoryID = CopyFromIntegerField(
        primary_key=True, )
    FacilityChangeHistoryID = CopyFromIntegerField()
    CDXCorrectionCode = CopyFromCharField(max_length=1, )
    PreventionProgram3ID = CopyFromForeignKey(
        'tblS7PreventionProgram3',
        db_column='PreventionProgram3ID',
        on_delete=models.PROTECT,
    )
    Description = CopyFromTextField(blank=True, )
    OldDescription = CopyFromTextField(blank=True, )
    SeqNum = CopyFromIntegerField()
예제 #25
0
class ToxicsWorstCase(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='toxic_id',
    )
    procchem = CopyFromForeignKey(
        'ProcChem',
        on_delete=models.CASCADE
    )
    percent_weight = CopyFromDecimalField(
        max_digits=4,
        decimal_places=1,
        null=True,
    )
    # percent_weight = CopyFromCharField(max_length=7)
    physical_state = CopyFromCharField(max_length=1, blank=True)
    analytical_basis = CopyFromCharField(max_length=255, blank=True)
    scenario = CopyFromCharField(max_length=1, blank=True)
    # quantity_lbs = CopyFromDecimalField(max_digits=6, decimal_places=2, blank=True)
    quantity_lbs = CopyFromCharField(max_length=4, blank=True)
    # release_duration = CopyFromDecimalField(max_digits=7, decimal_places=2, blank=True)
    release_duration = CopyFromCharField(max_length=7, blank=True)
    # release_rate = CopyFromDecimalField(max_digits=4, decimal_places=1, blank=True)
    release_rate = CopyFromCharField(max_length=7, blank=True)
    wind_speed = CopyFromDecimalField(max_digits=4, decimal_places=1, blank=True)
    stability_class = CopyFromCharField(max_length=1, blank=True)
    topography = CopyFromCharField(max_length=1, blank=True)
    # endpoint_distance = CopyFromDecimalField(max_digits=5, decimal_places=1)
    endpoint_distance = CopyFromCharField(max_length=4, blank=True)
    population = CopyFromCharField(max_length=9, blank=True)
    pr_schools = CopyFromBooleanField()
    pr_residences = CopyFromBooleanField()
    pr_hospitals = CopyFromBooleanField()
    pr_prisons = CopyFromBooleanField()
    pr_public_rec= CopyFromBooleanField()
    pr_comm_ind = CopyFromBooleanField()
    pr_othertype = CopyFromCharField(max_length=200, blank=True)
    er_natlstateparks = CopyFromBooleanField()
    er_wildlifesanct = CopyFromBooleanField()
    er_fedwilderness = CopyFromBooleanField()
    er_othertype = CopyFromCharField(max_length=200, blank=True)
    pm_dikes = CopyFromBooleanField()
    pm_enclosures = CopyFromBooleanField()
    pm_berms = CopyFromBooleanField()
    pm_drains = CopyFromBooleanField()
    pm_sumps = CopyFromBooleanField()
    pm_othertype = CopyFromCharField(max_length=200, blank=True)
    ptrgraphic = CopyFromCharField(max_length=12, blank=True)
    cbi_flag = CopyFromBooleanField()

    source_file = 'rmp_worst_tox'
예제 #26
0
class ProcNaics(BaseRMPModel):
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='procnaics_id',
    )
    process = CopyFromForeignKey(
        'Process',
        on_delete=models.CASCADE
    )
    naics = CopyFromIntegerField()
    num_prevent_2 = CopyFromIntegerField()
    num_prevent_3 = CopyFromIntegerField()

    source_file = 'rmp_proc_naics'
예제 #27
0
class AccFlam(BaseRMPModel):
    flammixchem_id = CopyFromIntegerField(
        primary_key=True,
        source_column='FlamMixChemID',
        verbose_name='Flammable Chemical ID',
        help_text='A unique ID for each flammable chemical record.',
    )
    accchem = CopyFromForeignKey(
        'AccChem',
        on_delete=models.PROTECT,
        source_column='AccidentChemicalID',
        verbose_name='Accident Chemical Record ID',
        help_text='A unique ID for each accident chemical record.'
    )
    chemical = CopyFromForeignKey(
        'ChemCd',
        on_delete=models.PROTECT,
        source_column='ChemicalID',
        verbose_name='Chemical ID',
        help_text='The identifying ID for a particular flammable chemical released in an accident.',
    )

    source_file = 'tblS6FlammableMixtureChemicals'
예제 #28
0
class ProcFlam(BaseRMPModel):
    """
    Bottom level table for process data tables.
    """
    id = CopyFromIntegerField(
        primary_key=True,
        source_column='FlamMixChemID',
    )
    procchem = CopyFromForeignKey(
        'ProcChem',
        on_delete=models.PROTECT,
        source_column="ProcessChemicalID",
    )
    chemical = CopyFromForeignKey(
        'ChemCd',
        on_delete=models.PROTECT,
        source_column="ChemicalID",
    )

    @classmethod
    def get_transform_queryset(self):
        m = raw_models.tblS1FlammableMixtureChemicals

        return m.objects.get_default_transform_queryset()
예제 #29
0
class tblS4FlammablesWorstCase(BaseRMPModel):
    FlammableID = CopyFromIntegerField(primary_key=True, )
    ProcessChemicalID = CopyFromForeignKey(
        'tblS1ProcessChemicals',
        db_column='ProcessChemicalID',
        on_delete=models.PROTECT,
    )
    AnalyticalBasis = CopyFromCharField(
        max_length=255,
        blank=True,
    )
    QuantityReleased = CopyFromFloatField(null=True, )
    Distance2Endpoint = CopyFromFloatField(null=True, )
    ResidentialPopulation = CopyFromCharField(
        max_length=9,
        blank=True,
    )
    PR_Schools = CopyFromBooleanField()
    PR_Residences = CopyFromBooleanField()
    PR_Hospitals = CopyFromBooleanField()
    PR_Prisons = CopyFromBooleanField()
    PR_PublicRecreation = CopyFromBooleanField()
    PR_Comm_Ind = CopyFromBooleanField()
    PR_OtherType = CopyFromCharField(
        max_length=200,
        blank=True,
    )
    ER_NatlStateParks = CopyFromBooleanField()
    ER_WildlifeSactuary = CopyFromBooleanField()
    ER_FedWilderness = CopyFromBooleanField()
    ER_OtherType = CopyFromCharField(
        max_length=200,
        blank=True,
    )
    PM_BlastWalls = CopyFromBooleanField()
    PM_OtherType = CopyFromCharField(
        max_length=200,
        blank=True,
    )
    ptrGraphic = CopyFromCharField(
        max_length=12,
        blank=True,
    )
    CBI_Flag = CopyFromBooleanField()

    class Meta:
        verbose_name = 'Flammables: Worst Case Scenario'
예제 #30
0
class tblS1Processes(BaseRMPModel):
    processid = CopyFromIntegerField(
        primary_key=True,
        source_column='ProcessID',
        verbose_name='Process ID',
        help_text='Unique number used to identify each process within the '
        'RMP. The same number will not necessarily be assigned to '
        'the same process for an RMP in a resubmission.',
    )
    altid = CopyFromCharField(
        max_length=25,
        source_column='AltID',
        blank=True,
        verbose_name='Process Description',
        help_text='Optional Process Description.',
    )
    facilityid = CopyFromForeignKey(
        'tblFacility',
        on_delete=models.PROTECT,
        source_column='FacilityID',
        verbose_name='Facility ID',
        help_text='Unique identifier for all RMPs submitted by a specific '
        'facility (assigned by Reporting Center for first-time '
        'submission). * After this number is assigned to the first '
        'submission for a facility, subsequent submissions for the '
        'same facility must include this identifier.',
    )
    programlevel = CopyFromCharField(
        max_length=1,
        source_column='ProgramLevel',
        verbose_name='1.17.a Program Level',
        help_text='Program category, (e.g., Program Level 1, 2, or 3), to '
        'identify with which program level the process complies.',
    )
    cbi_flag = CopyFromBooleanField(
        source_column='CBI_Flag',
        verbose_name='CBI Flag',
        help_text='If Process Record Contains CBI Data.',
    )

    class Meta:
        verbose_name = 'Process'
        verbose_name_plural = 'Process'