diff --git a/database/src/migrations/20220809133100_update_moose_composition_and_srb_validation_schemas.ts b/database/src/migrations/20220901133100_update_survey_validation_schemas.ts similarity index 51% rename from database/src/migrations/20220809133100_update_moose_composition_and_srb_validation_schemas.ts rename to database/src/migrations/20220901133100_update_survey_validation_schemas.ts index 6ed983a68e..093dbcffcc 100644 --- a/database/src/migrations/20220809133100_update_moose_composition_and_srb_validation_schemas.ts +++ b/database/src/migrations/20220901133100_update_survey_validation_schemas.ts @@ -1,24 +1,35 @@ import { Knex } from 'knex'; +import { goatRecruitmentCompositionJSON } from './template_methodology_species_validations/goat_population_recruitment_composition_survey_1'; import { mooseCompositionJSON } from './template_methodology_species_validations/moose_composition_survey_1'; import { mooseSrbJSON } from './template_methodology_species_validations/moose_srb_survey_1'; +import { mooseTransectDistanceJSON } from './template_methodology_species_validations/moose_transect_distance_survey_1'; +import { sheepRecruitmentCompositionJSON } from './template_methodology_species_validations/sheep_population_recruitment_composition_survey_1'; const DB_SCHEMA = process.env.DB_SCHEMA; const moose_composition_validation = mooseCompositionJSON; const moose_srb_validation = mooseSrbJSON; +const moose_transect_distance_validation = mooseTransectDistanceJSON; +const sheep_population_recruitment_compostion_validation = sheepRecruitmentCompositionJSON; +const goat_population_recruitment_compostion_validation = goatRecruitmentCompositionJSON; enum COMMON_SURVEY_METHODOLOGY { COMPOSITION = 'Composition', - STRATIFIED_RANDOM_BLOCK = 'Stratified Random Block' + STRATIFIED_RANDOM_BLOCK = 'Stratified Random Block', + TRANSECT = 'Encounter Transects', + POPULATION_COUNT = 'Total Count' } enum TEMPLATE_NAME { MOOSE_COMPOSITION_SURVEY = 'Moose Composition Survey', - MOOSE_SRB_SURVEY = 'Moose SRB Survey' + MOOSE_SRB_SURVEY = 'Moose SRB Survey', + MOOSE_TRANSECT_DISTANCE_SURVEY = 'Moose Transect Distance Survey', + SHEEP_POPULATION_TOTAL_COUNT = 'Sheep Population Total Count Recruitment Composition Survey', + GOAT_POPULATION_TOTAL_COUNT = 'Goat Population Total Count Recruitment Composition Survey' } const validationSchema = [ - // Common Survey Methodology: Composition, SRB + //Common Survey Methodology: Composition, SRB, Transect, Population Recruitment { v_schema: JSON.stringify(moose_composition_validation), field_method: COMMON_SURVEY_METHODOLOGY.COMPOSITION, @@ -28,6 +39,21 @@ const validationSchema = [ v_schema: JSON.stringify(moose_srb_validation), field_method: COMMON_SURVEY_METHODOLOGY.STRATIFIED_RANDOM_BLOCK, template: TEMPLATE_NAME.MOOSE_SRB_SURVEY + }, + { + v_schema: JSON.stringify(moose_transect_distance_validation), + field_method: COMMON_SURVEY_METHODOLOGY.TRANSECT, + template: TEMPLATE_NAME.MOOSE_TRANSECT_DISTANCE_SURVEY + }, + { + v_schema: JSON.stringify(sheep_population_recruitment_compostion_validation), + field_method: COMMON_SURVEY_METHODOLOGY.POPULATION_COUNT, + template: TEMPLATE_NAME.SHEEP_POPULATION_TOTAL_COUNT + }, + { + v_schema: JSON.stringify(goat_population_recruitment_compostion_validation), + field_method: COMMON_SURVEY_METHODOLOGY.POPULATION_COUNT, + template: TEMPLATE_NAME.GOAT_POPULATION_TOTAL_COUNT } ]; @@ -52,6 +78,21 @@ export async function up(knex: Knex): Promise { ${DB_SCHEMA}.template (name, version, record_effective_date, description) values ('${TEMPLATE_NAME.MOOSE_SRB_SURVEY}', '1.0', now(), 'Moose SRB Survey'); + + insert into + ${DB_SCHEMA}.template (name, version, record_effective_date, description) + values + ('${TEMPLATE_NAME.MOOSE_TRANSECT_DISTANCE_SURVEY}', '1.0', now(), 'Moose Transect Distance Survey'); + + insert into + ${DB_SCHEMA}.template (name, version, record_effective_date, description) + values + ('${TEMPLATE_NAME.SHEEP_POPULATION_TOTAL_COUNT}', '1.0', now(), 'Sheep Population Total Count Recruitment Composition Survey'); + + insert into + ${DB_SCHEMA}.template (name, version, record_effective_date, description) + values + ('${TEMPLATE_NAME.GOAT_POPULATION_TOTAL_COUNT}', '1.0', now(), 'Goat Population Total Count Recruitment Composition Survey'); `); for (const v_schema of validationSchema) { diff --git a/database/src/migrations/template_methodology_species_validations/goat_population_recruitment_composition_survey_1.ts b/database/src/migrations/template_methodology_species_validations/goat_population_recruitment_composition_survey_1.ts new file mode 100644 index 0000000000..1bcf98c618 --- /dev/null +++ b/database/src/migrations/template_methodology_species_validations/goat_population_recruitment_composition_survey_1.ts @@ -0,0 +1,486 @@ +import { basicCodeValidator, basicNumericValidator, GoatItems } from './picklist_variables/v0.2'; +export const goatRecruitmentCompositionJSON = { + name: '', + description: '', + files: [ + { + name: 'Effort & Site Conditions', + description: '', + columns: [ + { + name: 'Total Time (hours)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Time (mins)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Time (mins)/block area (km2)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Aircraft Type', + description: '', + validations: basicCodeValidator(GoatItems.aircraftType) + }, + { + name: 'Light', + description: '', + validations: basicCodeValidator(GoatItems.light) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Population Unit', + 'Block ID/SU ID', + 'Population Unit/Block Area (km2)', + 'Date', + 'Start Time 1 (24hrs)', + 'End Time 1 (24hrs)', + 'Start Time 2 (24hrs)', + 'End Time 2 (24hrs)', + 'Start Time 3 (24hrs)', + 'End Time 3 (24hrs)', + 'Start Time 4 (24hrs)', + 'End Time 4 (24hrs)', + 'Total Block Time', + 'Total Time (hours)', + 'Total Time (mins)', + 'Time (mins)/block area (km2)', + 'Aircraft Company', + 'Aircraft Type', + 'Pilot', + 'Navigator', + 'Rear Left Observer', + 'Rear Right Observer', + 'Air Temperature (C)', + 'Visibility', + 'Cloud Cover (%)', + 'Wind Speed', + 'Precipitation', + 'Light', + 'Snow Cover', + 'Snow Conditions', + 'Snow Depth', + 'Days Since Snowfall', + 'Weather Description', + 'Location Description', + 'Effort & Site Comments' + ] + } + } + ] + }, + { + name: 'Observations', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(GoatItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(GoatItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(GoatItems.latLongUnits) + }, + { + name: 'Species', + description: '', + validations: basicCodeValidator(GoatItems.species) + }, + { + name: 'Nanny', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Billy', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Kid', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unclassified Age/Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Count', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Sign Type', + description: '', + validations: basicCodeValidator(GoatItems.signType) + }, + { + name: 'Age of Sign', + description: '', + validations: basicCodeValidator(GoatItems.signAge) + }, + { + name: 'Veg Cover (%)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Snow Cover (%)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Activity', + description: '', + validations: basicCodeValidator(GoatItems.activityObservation) + }, + { + name: 'Elevation (m) of Observation', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Habitat', + description: '', + validations: basicCodeValidator(GoatItems.habitat) + }, + { + name: 'Wind Blown', + description: '', + validations: basicCodeValidator(GoatItems.yN) + }, + { + name: 'Terrain Obstruction', + description: '', + validations: basicCodeValidator(GoatItems.yN) + }, + { + name: 'Number of Marked Animals Observed', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Survey or Telemetry Search', + description: '', + validations: basicCodeValidator(GoatItems.searchType) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Population Unit', + 'Block ID/SU ID', + 'Date', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Species', + 'Nanny', + 'Billy', + 'Kid', + 'Adult Unclassified Sex', + 'Unclassified Age/Sex', + 'Total Count', + 'Sign Type', + 'Age of Sign', + 'Veg Cover (%)', + 'Snow Cover (%)', + 'Activity', + 'Elevation (m) of Observation', + 'Habitat', + 'Wind Blown', + 'Terrain Obstruction', + 'Number of Marked Animals Observed', + 'Survey or Telemetry Search', + 'Photos', + 'Observation Comments' + ] + } + } + ] + }, + { + name: 'Marked Animals', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(GoatItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(GoatItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(GoatItems.latLongUnits) + }, + { + name: 'Targeted or Non-Targeted', + description: '', + validations: basicCodeValidator(GoatItems.targetType) + }, + { + name: 'Mark Type', + description: '', + validations: basicCodeValidator(GoatItems.markType) + }, + { + name: 'Frequency Unit', + description: '', + validations: basicCodeValidator(GoatItems.frequencyUnits) + }, + { + name: 'Location of Identifier on Individual', + description: '', + validations: basicCodeValidator(GoatItems.locationOfIdentifier) + }, + { + name: 'Shape', + description: '', + validations: basicCodeValidator(GoatItems.shape) + }, + { + name: 'Pattern', + description: '', + validations: basicCodeValidator(GoatItems.pattern) + }, + { + name: 'Color', + description: '', + validations: basicCodeValidator(GoatItems.color) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Block ID/SU ID', + 'Date', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Targeted or Non-Targeted', + 'Wildlife Health ID', + 'Animal ID', + 'Mark Type', + 'Mark ID Value', + 'Frequency', + 'Frequency Unit', + 'Location of Identifier on Individual', + 'Shape', + 'Pattern', + 'Color', + 'Marked Animals Comments' + ] + } + } + ] + }, + { + name: 'Incidental Observations', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(GoatItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(GoatItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(GoatItems.latLongUnits) + }, + { + name: 'Adult Males', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Females', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adults - Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juvenile Males', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juvenile Females', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juveniles - Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unknown Age/Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Count', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Species Occurrence Status', + description: '', + validations: basicCodeValidator(GoatItems.speciesOccurrenceStatus) + }, + { + name: 'Activity', + description: '', + validations: basicCodeValidator(GoatItems.activityIncidentalObservation) + }, + { + name: 'Feature Type', + description: '', + validations: basicCodeValidator(GoatItems.featureType) + }, + { + name: 'Sign Type', + description: '', + validations: basicCodeValidator(GoatItems.signType) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Block ID/SU ID', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Date', + 'Species', + 'Adult Males', + 'Adult Females', + 'Adults - Unclassified Sex', + 'Juvenile Males', + 'Juvenile Females', + 'Juveniles - Unclassified Sex', + 'Unknown Age/Sex', + 'Total Count', + 'Species Occurrence Status', + 'Activity', + 'Feature Type', + 'Sign Type', + 'Photos', + 'Incidental Observation Comments' + ] + } + } + ] + } + ], + validations: [ + { + submission_required_files_validator: { + required_files: ['Effort & Site Conditions', 'Observations', 'Marked Animals', 'Incidental Observations'] + } + }, + { + mimetype_validator: { + reg_exps: ['application\\/vnd.*'] + } + } + ] +}; diff --git a/database/src/migrations/template_methodology_species_validations/moose_composition_survey_1.ts b/database/src/migrations/template_methodology_species_validations/moose_composition_survey_1.ts index 7dcf5e6f06..2b85c5b6e4 100644 --- a/database/src/migrations/template_methodology_species_validations/moose_composition_survey_1.ts +++ b/database/src/migrations/template_methodology_species_validations/moose_composition_survey_1.ts @@ -134,6 +134,41 @@ export const mooseCompositionJSON = { description: '', validations: basicNumericValidator() }, + { + name: 'RISC Class I Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class II Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class III Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class I Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class II Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class III Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Bulls - Unclassified', + description: '', + validations: basicNumericValidator() + }, { name: 'Bulls - Unclassified', description: '', @@ -160,7 +195,12 @@ export const mooseCompositionJSON = { validations: basicNumericValidator() }, { - name: 'Unclassified', + name: 'Adult Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unclassified Age/Sex', description: '', validations: basicNumericValidator() }, @@ -214,7 +254,6 @@ export const mooseCompositionJSON = { required_columns: [ 'Study Area', 'Block ID/SU ID', - 'Date', 'UTM Zone', 'Easting', 'Northing', @@ -224,16 +263,23 @@ export const mooseCompositionJSON = { 'Lat/Long Units', 'Species', 'Yearling Bulls', - 'Adult Bulls - Unclassified', 'Sub-Prime Bulls', 'Prime Bulls', 'Senior Bulls', + 'RISC Class I Bulls', + 'RISC Class II Bulls', + 'RISC Class III Bulls', + 'Oswald (1997) Class I Bulls', + 'Oswald (1997) Class II Bulls', + 'Oswald (1997) Class III Bulls', + 'Adult Bulls - Unclassified', 'Bulls - Unclassified', 'Lone Cows', 'Cow W/1 calf', 'Cow W/2 calves', 'Lone calf', - 'Unclassified', + 'Adult Unclassified Sex', + 'Unclassified Age/Sex', 'Total Count', 'Spike/Fork Bulls', '3 Brow/10 Points Bulls', diff --git a/database/src/migrations/template_methodology_species_validations/moose_srb_survey_1.ts b/database/src/migrations/template_methodology_species_validations/moose_srb_survey_1.ts index efb0135520..72d2388c7b 100644 --- a/database/src/migrations/template_methodology_species_validations/moose_srb_survey_1.ts +++ b/database/src/migrations/template_methodology_species_validations/moose_srb_survey_1.ts @@ -138,11 +138,6 @@ export const mooseSrbJSON = { name: 'Observations', description: '', columns: [ - { - name: 'Stratum', - description: '', - validations: basicNumericValidator() - }, { name: 'UTM Zone', description: '', @@ -198,6 +193,41 @@ export const mooseSrbJSON = { description: '', validations: basicNumericValidator() }, + { + name: 'RISC Class I Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class II Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class III Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class I Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class II Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class III Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Bulls - Unclassified', + description: '', + validations: basicNumericValidator() + }, { name: 'Bulls - Unclassified', description: '', @@ -224,7 +254,12 @@ export const mooseSrbJSON = { validations: basicNumericValidator() }, { - name: 'Unclassified', + name: 'Adult Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unclassified Age/Sex', description: '', validations: basicNumericValidator() }, @@ -278,7 +313,6 @@ export const mooseSrbJSON = { required_columns: [ 'Study Area', 'Block ID/SU ID', - 'Stratum', 'UTM Zone', 'Easting', 'Northing', @@ -288,16 +322,23 @@ export const mooseSrbJSON = { 'Lat/Long Units', 'Species', 'Yearling Bulls', - 'Adult Bulls - Unclassified', 'Sub-Prime Bulls', 'Prime Bulls', 'Senior Bulls', + 'RISC Class I Bulls', + 'RISC Class II Bulls', + 'RISC Class III Bulls', + 'Oswald (1997) Class I Bulls', + 'Oswald (1997) Class II Bulls', + 'Oswald (1997) Class III Bulls', + 'Adult Bulls - Unclassified', 'Bulls - Unclassified', 'Lone Cows', 'Cow W/1 calf', 'Cow W/2 calves', 'Lone calf', - 'Unclassified', + 'Adult Unclassified Sex', + 'Unclassified Age/Sex', 'Total Count', 'Spike/Fork Bulls', '3 Brow/10 Points Bulls', @@ -441,11 +482,6 @@ export const mooseSrbJSON = { description: '', validations: basicCodeValidator(MooseItems.latLongUnits) }, - { - name: 'Species', - description: '', - validations: basicCodeValidator(MooseItems.species) - }, { name: 'Adult Males', description: '', diff --git a/database/src/migrations/template_methodology_species_validations/moose_transect_distance_survey_1.ts b/database/src/migrations/template_methodology_species_validations/moose_transect_distance_survey_1.ts new file mode 100644 index 0000000000..bfda499d71 --- /dev/null +++ b/database/src/migrations/template_methodology_species_validations/moose_transect_distance_survey_1.ts @@ -0,0 +1,539 @@ +import { basicCodeValidator, basicNumericValidator, MooseItems } from './picklist_variables/v0.2'; +export const mooseTransectDistanceJSON = { + name: '', + description: '', + files: [ + { + name: 'Effort & Site Conditions', + description: '', + columns: [ + { + name: 'Total Time (hours)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Time (mins)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Time (mins)/km', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Aircraft Type', + description: '', + validations: basicCodeValidator(MooseItems.aircraftType) + }, + { + name: 'Light', + description: '', + validations: basicCodeValidator(MooseItems.light) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Total Distance Flown (km)', + 'Date', + 'Start Time 1 (24hrs)', + 'End Time 1 (24hrs)', + 'Start Time 2 (24hrs)', + 'End Time 2 (24hrs)', + 'Total Block Time', + 'Total Time (hours)', + 'Total Time (mins)', + 'Time (mins)/km', + 'Aircraft Company', + 'Aircraft Type', + 'Pilot', + 'Navigator', + 'Rear Left Observer', + 'Rear Right Observer', + 'Air Temperature (C)', + 'Visibility', + 'Cloud Cover (%)', + 'Wind Speed', + 'Precipitation', + 'Light', + 'Snow Cover', + 'Snow Depth', + 'Days Since Snowfall', + 'Weather Description', + 'Habitat Description', + 'Effort & Site Comments' + ] + } + } + ] + }, + { + name: 'Observations', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(MooseItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(MooseItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(MooseItems.latLongUnits) + }, + { + name: 'Species', + description: '', + validations: basicCodeValidator(MooseItems.species) + }, + { + name: 'Yearling Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Bulls - Unclassified', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Sub-Prime Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Prime Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Senior Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class I Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class II Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'RISC Class III Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class I Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class II Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Oswald (1997) Class III Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Bulls - Unclassified', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Bulls - Unclassified', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Lone Cows', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Cow W/1 calf', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Cow W/2 calves', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Lone Calf', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unclassified Age/Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Count', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Spike/Fork Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: '3 Brow/10 Points Bulls', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Veg Cover (%)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Snow Cover (%)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Activity', + description: '', + validations: basicCodeValidator(MooseItems.activityObservation) + }, + { + name: 'Number of Marked Animals Observed', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Survey or Telemetry Search', + description: '', + validations: basicCodeValidator(MooseItems.searchType) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Block ID/SU ID', + 'Transect ID', + 'Date', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Perpendicular Distance From Transect Line (m)', + 'Species', + 'Yearling Bulls', + 'Sub-Prime Bulls', + 'Prime Bulls', + 'Senior Bulls', + 'RISC Class I Bulls', + 'RISC Class II Bulls', + 'RISC Class III Bulls', + 'Oswald (1997) Class I Bulls', + 'Oswald (1997) Class II Bulls', + 'Oswald (1997) Class III Bulls', + 'Adult Bulls - Unclassified', + 'Bulls - Unclassified', + 'Lone Cows', + 'Cow W/1 calf', + 'Cow W/2 calves', + 'Lone calf', + 'Adult Unclassified Sex', + 'Unclassified Age/Sex', + 'Total Count', + 'Spike/Fork Bulls', + '3 Brow/10 Points Bulls', + 'Veg Cover (%)', + 'Snow Cover (%)', + 'Activity', + 'Number of Marked Animals Observed', + 'Survey or Telemetry Search', + 'Photos', + 'Observation Comments' + ] + } + } + ] + }, + { + name: 'Marked Animals', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(MooseItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(MooseItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(MooseItems.latLongUnits) + }, + { + name: 'Targeted or Non-Targeted', + description: '', + validations: basicCodeValidator(MooseItems.targetType) + }, + { + name: 'Mark Type', + description: '', + validations: basicCodeValidator(MooseItems.markType) + }, + { + name: 'Frequency Unit', + description: '', + validations: basicCodeValidator(MooseItems.frequencyUnits) + }, + { + name: 'Location of Identifier on Individual', + description: '', + validations: basicCodeValidator(MooseItems.locationOfIdentifier) + }, + { + name: 'Shape', + description: '', + validations: basicCodeValidator(MooseItems.shape) + }, + { + name: 'Pattern', + description: '', + validations: basicCodeValidator(MooseItems.pattern) + }, + { + name: 'Color', + description: '', + validations: basicCodeValidator(MooseItems.color) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Transect ID', + 'Date', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Targeted or Non-Targeted', + 'Wildlife Health ID', + 'Animal ID', + 'Mark Type', + 'Mark ID Value', + 'Frequency', + 'Frequency Unit', + 'Location of Identifier on Individual', + 'Shape', + 'Pattern', + 'Color', + 'Marked Animals Comments' + ] + } + } + ] + }, + { + name: 'Incidental Observations', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(MooseItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(MooseItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(MooseItems.latLongUnits) + }, + { + name: 'Adult Males', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Females', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adults - Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juvenile Males', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juvenile Females', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juveniles - Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unknown Age/Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Count', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Species Occurrence Status', + description: '', + validations: basicCodeValidator(MooseItems.speciesOccurrenceStatus) + }, + { + name: 'Activity', + description: '', + validations: basicCodeValidator(MooseItems.activityIncidentalObservation) + }, + { + name: 'Feature Type', + description: '', + validations: basicCodeValidator(MooseItems.featureType) + }, + { + name: 'Sign Type', + description: '', + validations: basicCodeValidator(MooseItems.signType) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Block ID/SU ID', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Date', + 'Species', + 'Adult Males', + 'Adult Females', + 'Adults - Unclassified Sex', + 'Juvenile Males', + 'Juvenile Females', + 'Juveniles - Unclassified Sex', + 'Unknown Age/Sex', + 'Total Count', + 'Species Occurrence Status', + 'Activity', + 'Feature Type', + 'Sign Type', + 'Photos', + 'Incidental Observation Comments' + ] + } + } + ] + } + ], + validations: [ + { + submission_required_files_validator: { + required_files: ['Effort & Site Conditions', 'Observations', 'Marked Animals', 'Incidental Observations'] + } + }, + { + mimetype_validator: { + reg_exps: ['application\\/vnd.*'] + } + } + ] +}; diff --git a/database/src/migrations/template_methodology_species_validations/picklist_variables/v0.2.ts b/database/src/migrations/template_methodology_species_validations/picklist_variables/v0.2.ts index fd25b56557..3648fd5a18 100644 --- a/database/src/migrations/template_methodology_species_validations/picklist_variables/v0.2.ts +++ b/database/src/migrations/template_methodology_species_validations/picklist_variables/v0.2.ts @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ const yN = [ { name: 'Y', description: '' }, { name: 'N', description: '' } @@ -54,6 +55,7 @@ const ActivityObservation = [ { name: 'Bedding' }, { name: 'Running' }, { name: 'Walking' }, + { name: 'Not Moving' }, { name: 'Moving' } ]; @@ -237,13 +239,58 @@ const SignType = [ { name: 'Described in Comments' } ]; +const SignAge = [{ name: 'Fresh' }, { name: 'Old' }]; + +const Habitat = [ + { name: 'Alpine' }, + { name: 'Alpine Barren' }, + { name: 'Alpine Heath Meadows' }, + { name: 'Avalanche Path' }, + { name: 'Broken Cliffs' }, + { name: 'Broken Cliff in Timber' }, + { name: 'Burn' }, + { name: 'Caves' }, + { name: 'Clearcut' }, + { name: 'Cliff' }, + { name: 'Cliff - open' }, + { name: 'Cliff in Forest' }, + { name: 'Coniferous' }, + { name: 'Deciduous' }, + { name: 'Dissected Cliffs' }, + { name: 'Flat or Open Slopes' }, + { name: 'Glacier' }, + { name: 'Grass' }, + { name: 'Krummholtz' }, + { name: 'Mixed Wood' }, + { name: 'Moraine' }, + { name: 'Ridge' }, + { name: 'Riparian' }, + { name: 'Rock/Talus' }, + { name: 'Scree' }, + { name: 'Shrub' }, + { name: 'Snow' }, + { name: 'Sub-Alpine' }, + { name: 'Talus/Slope' }, + { name: 'Terraces' }, + { name: 'Timber' }, + { name: 'Wetland/Meadow' }, + { name: 'Willow/Shrub' } +]; + +const HabitatSlope = [ + { name: 'Flat (0%)', description: 'Flat (0%)' }, + { name: 'Minimum (5-20%)', description: 'Minimum (5-20%)' }, + { name: 'Moderate (20-50%)', description: 'Moderate (20-50%)' }, + { name: 'Steep (>50%)', description: 'Steep (>50%)' } +]; + const SheepSpecies = [ { name: 'Bighorn Sheep' }, { name: 'Ovis canadensis' }, { name: 'M-OVCA' }, - { name: "Dall's Sheep" }, + { name: "Dall''s Sheep" }, { name: 'M-OVDA-DA' }, - { name: "Stone's Sheep" }, + { name: "Stone''s Sheep" }, { name: 'M-OVDA-ST' }, { name: 'Thinhorn Sheep' }, { name: 'Ovis dalli' }, @@ -255,7 +302,9 @@ const MooseSpecies = [ { name: 'Alces Alces' }, { name: 'Alces Americanus' }, { name: 'M-ALAL' }, - { name: 'M-ALAM' } + { name: 'M-ALAM' }, + { name: 'Caribou' }, + { name: 'Elk' } ]; const GoatSpecies = [{ name: 'Mountain Goat' }, { name: 'Oreamnos americanus' }, { name: 'M-ORAM' }, { name: 'ORAM' }]; @@ -306,7 +355,10 @@ export const defaultPicklist = { speciesOccurrenceStatus: SpeciesOccurrenceStatus, activityIncidentalObservation: ActivityIncidentalObservation, featureType: FeatureType, - signType: SignType + signType: SignType, + signAge: SignAge, + habitat: Habitat, + habitatSlope: HabitatSlope }; export const SheepItems = { diff --git a/database/src/migrations/template_methodology_species_validations/sheep_population_recruitment_composition_survey_1.ts b/database/src/migrations/template_methodology_species_validations/sheep_population_recruitment_composition_survey_1.ts new file mode 100644 index 0000000000..5070e00a1e --- /dev/null +++ b/database/src/migrations/template_methodology_species_validations/sheep_population_recruitment_composition_survey_1.ts @@ -0,0 +1,517 @@ +import { basicCodeValidator, basicNumericValidator, SheepItems } from './picklist_variables/v0.2'; +export const sheepRecruitmentCompositionJSON = { + name: '', + description: '', + files: [ + { + name: 'Effort & Site Conditions', + description: '', + columns: [ + { + name: 'Total Time (hours)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Time (mins)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Time (mins)/block area (km2)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Aircraft Type', + description: '', + validations: basicCodeValidator(SheepItems.aircraftType) + }, + { + name: 'Light', + description: '', + validations: basicCodeValidator(SheepItems.light) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Population Unit', + 'Block ID/SU ID', + 'Population Unit/Block Area (km2)', + 'Date', + 'Start Time 1 (24hrs)', + 'End Time 1 (24hrs)', + 'Start Time 2 (24hrs)', + 'End Time 2 (24hrs)', + 'Start Time 3 (24hrs)', + 'End Time 3 (24hrs)', + 'Start Time 4 (24hrs)', + 'End Time 4 (24hrs)', + 'Total Block Time', + 'Total Time (hours)', + 'Total Time (mins)', + 'Time (mins)/block area (km2)', + 'Aircraft Company', + 'Aircraft Type', + 'Pilot', + 'Navigator', + 'Rear Left Observer', + 'Rear Right Observer', + 'Air Temperature (C)', + 'Visibility', + 'Cloud Cover (%)', + 'Wind Speed', + 'Precipitation', + 'Light', + 'Snow Cover', + 'Snow Conditions', + 'Snow Depth', + 'Days Since Snowfall', + 'Weather Description', + 'Location Description', + 'Effort & Site Comments' + ] + } + } + ] + }, + { + name: 'Observations', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(SheepItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(SheepItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(SheepItems.latLongUnits) + }, + { + name: 'Species', + description: '', + validations: basicCodeValidator(SheepItems.species) + }, + { + name: 'Ram - Class I', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Ram - Class II', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Ram - Class III', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Ram - Class IV', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Ewes', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Yearling', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Lamb', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Ewe-Like Sheep', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unclassified Age/Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Count', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Sign Type', + description: '', + validations: basicCodeValidator(SheepItems.signType) + }, + { + name: 'Age of Sign', + description: '', + validations: basicCodeValidator(SheepItems.signAge) + }, + { + name: 'Elevation (m) of Observation', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Habitat', + description: '', + validations: basicCodeValidator(SheepItems.habitat) + }, + { + name: 'Habitat - Slope', + description: '', + validations: basicCodeValidator(SheepItems.habitatSlope) + }, + { + name: 'Terrain Obstruction', + description: '', + validations: basicCodeValidator(SheepItems.yN) + }, + { + name: 'Veg Cover (%)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Snow Cover (%)', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Activity', + description: '', + validations: basicCodeValidator(SheepItems.activityObservation) + }, + { + name: 'Number of Marked Animals Observed', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Survey or Telemetry Search', + description: '', + validations: basicCodeValidator(SheepItems.searchType) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Population Unit', + 'Block ID/SU ID', + 'Date', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Species', + 'Ram - Class I', + 'Ram - Class II', + 'Ram - Class III', + 'Ram - Class IV', + 'Ram - Unclassified', + 'Ewes', + 'Yearling', + 'Lamb', + 'Ewe-Like Sheep', + 'Adult Unclassified Sex', + 'Unclassified Age/Sex', + 'Total Count', + 'Sign Type', + 'Age of Sign', + 'Elevation (m) of Observation', + 'Habitat', + 'Habitat - Slope', + 'Terrain Obstruction', + 'Veg Cover (%)', + 'Snow Cover (%)', + 'Activity', + 'Number of Marked Animals Observed', + 'Survey or Telemetry Search', + 'Photos', + 'Observation Comments' + ] + } + } + ] + }, + { + name: 'Marked Animals', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(SheepItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(SheepItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(SheepItems.latLongUnits) + }, + { + name: 'Targeted or Non-Targeted', + description: '', + validations: basicCodeValidator(SheepItems.targetType) + }, + { + name: 'Mark Type', + description: '', + validations: basicCodeValidator(SheepItems.markType) + }, + { + name: 'Frequency Unit', + description: '', + validations: basicCodeValidator(SheepItems.frequencyUnits) + }, + { + name: 'Location of Identifier on Individual', + description: '', + validations: basicCodeValidator(SheepItems.locationOfIdentifier) + }, + { + name: 'Shape', + description: '', + validations: basicCodeValidator(SheepItems.shape) + }, + { + name: 'Pattern', + description: '', + validations: basicCodeValidator(SheepItems.pattern) + }, + { + name: 'Color', + description: '', + validations: basicCodeValidator(SheepItems.color) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Block ID/SU ID', + 'Date', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Targeted or Non-Targeted', + 'Wildlife Health ID', + 'Animal ID', + 'Mark Type', + 'Mark ID Value', + 'Frequency', + 'Frequency Unit', + 'Location of Identifier on Individual', + 'Shape', + 'Pattern', + 'Color', + 'Marked Animals Comments' + ] + } + } + ] + }, + { + name: 'Incidental Observations', + description: '', + columns: [ + { + name: 'UTM Zone', + description: '', + validations: basicCodeValidator(SheepItems.uTMZone) + }, + { + name: 'Easting', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Northing', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Datum', + description: '', + validations: basicCodeValidator(SheepItems.gPSDatum) + }, + { + name: 'Lat/Long Units', + description: '', + validations: basicCodeValidator(SheepItems.latLongUnits) + }, + { + name: 'Adult Males', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adult Females', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Adults - Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juvenile Males', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juvenile Females', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Juveniles - Unclassified Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Unknown Age/Sex', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Total Count', + description: '', + validations: basicNumericValidator() + }, + { + name: 'Species Occurrence Status', + description: '', + validations: basicCodeValidator(SheepItems.speciesOccurrenceStatus) + }, + { + name: 'Activity', + description: '', + validations: basicCodeValidator(SheepItems.activityIncidentalObservation) + }, + { + name: 'Feature Type', + description: '', + validations: basicCodeValidator(SheepItems.featureType) + }, + { + name: 'Sign Type', + description: '', + validations: basicCodeValidator(SheepItems.signType) + } + ], + validations: [ + { + file_duplicate_columns_validator: {} + }, + { + file_required_columns_validator: { + required_columns: [ + 'Study Area', + 'Block ID/SU ID', + 'UTM Zone', + 'Easting', + 'Northing', + 'Datum', + 'Lat', + 'Long', + 'Lat/Long Units', + 'Date', + 'Species', + 'Adult Males', + 'Adult Females', + 'Adults - Unclassified Sex', + 'Juvenile Males', + 'Juvenile Females', + 'Juveniles - Unclassified Sex', + 'Unknown Age/Sex', + 'Total Count', + 'Species Occurrence Status', + 'Activity', + 'Feature Type', + 'Sign Type', + 'Photos', + 'Incidental Observation Comments' + ] + } + } + ] + } + ], + validations: [ + { + submission_required_files_validator: { + required_files: ['Effort & Site Conditions', 'Observations', 'Marked Animals', 'Incidental Observations'] + } + }, + { + mimetype_validator: { + reg_exps: ['application\\/vnd.*'] + } + } + ] +};