Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • #974-receita-potencial
  • aggregate_enrollment
  • attendance_rate
  • courseAggregate
  • db-conn
  • development
  • docentes-ies-ente-federativo
  • enrollment_rate
  • es23-superior-enrollment
  • homologa
  • hotfix-enrollment-aggregate
  • instruction_level_fixes
  • instruction_number
  • issue_935
  • issue_953
  • issue_958
  • issues_indicadores_agregados
  • master
  • new-indicators
  • receita-potencial
  • teachers-ies
  • years-of-study-mean
  • v0.1.0
  • v1.0.0
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.1.0
  • v1.1.1
  • v1.14
  • v1.14.0
  • v1.14.1
  • v1.14.2
  • v1.15.1
  • v1.16.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.5.0
  • v1.6.0
  • v1.6.1
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.9.0
55 results

Target

Select target project
  • simcaq/simcaq-node
  • SMPPIR/SMPPIR-Node
2 results
Select Git revision
  • #974-receita-potencial
  • aggregate_enrollment
  • attendance_rate
  • courseAggregate
  • db-conn
  • development
  • docentes-ies-ente-federativo
  • enrollment_rate
  • es23-superior-enrollment
  • homologa
  • hotfix-enrollment-aggregate
  • instruction_level_fixes
  • instruction_number
  • issue_935
  • issue_953
  • issue_958
  • issues_indicadores_agregados
  • master
  • new-indicators
  • receita-potencial
  • teachers-ies
  • years-of-study-mean
  • v0.1.0
  • v1.0.0
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.1.0
  • v1.1.1
  • v1.14
  • v1.14.0
  • v1.14.1
  • v1.14.2
  • v1.15.1
  • v1.16.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.5.0
  • v1.6.0
  • v1.6.1
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.9.0
55 results
Show changes
Commits on Source (132)
Showing
with 560 additions and 5 deletions
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function ageRangeAggregate(id) {
switch (id) {
case 1:
return '0 a 3 anos';
case 2:
return '4 a 5 anos';
case 3:
return '6 a 10 anos';
case 4:
return '11 a 14 anos';
case 5:
return '15 a 17 anos';
case 6:
return '18 anos ou mais';
default:
return 'Não declarada';
}
};
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function ageRangeEntity(id) {
switch (id) {
case 1:
return 'Até 24 anos';
case 2:
return '25 a 29 anos';
case 3:
return '30 a 39 anos';
case 4:
return '40 a 49 anos';
case 5:
return '50 a 54 anos';
case 6:
return '55 a 59 anos';
case 7:
return '60 anos ou mais';
default:
return 'Não declarada';
}
};
...@@ -38,8 +38,6 @@ module.exports = function attendedModality(id) { ...@@ -38,8 +38,6 @@ module.exports = function attendedModality(id) {
return 'Educação profissional - técnica integrada'; return 'Educação profissional - técnica integrada';
case 9: case 9:
return 'Educação profissional - técnica concomitante e subsequente'; return 'Educação profissional - técnica concomitante e subsequente';
case 10:
return 'Ensino Médio Regular e Profissional articulado';
case 11: case 11:
return 'EJA - Ensino Médio'; return 'EJA - Ensino Médio';
case 12: case 12:
......
...@@ -74,6 +74,7 @@ module.exports = function capitalCode(id) { ...@@ -74,6 +74,7 @@ module.exports = function capitalCode(id) {
return 'Goiânia'; return 'Goiânia';
case 53: case 53:
return 'Brasília'; return 'Brasília';
case null:
case 99: case 99:
return 'Não é capital'; return 'Não é capital';
default: default:
......
...@@ -28,5 +28,9 @@ module.exports = function location(id) { ...@@ -28,5 +28,9 @@ module.exports = function location(id) {
return 'Terra indígena'; return 'Terra indígena';
case 3: case 3:
return 'Área remanescente de quilombos'; return 'Área remanescente de quilombos';
case 8:
return 'Área onde se localizam povos e comunidades tradicionais';
default:
return 'Não definido';
} }
}; };
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function educationDegreeEntity(id) {
switch (id) {
case 1:
return 'Ensino Fundamental';
case 2:
return 'Ensino Médio';
case 3:
return 'Graduação Com Licenciatura';
case 4:
return 'Graduação Sem Licenciatura';
}
};
...@@ -24,11 +24,11 @@ module.exports = function educationLevelBasic(id) { ...@@ -24,11 +24,11 @@ module.exports = function educationLevelBasic(id) {
return 'Creche'; return 'Creche';
case 2: case 2:
return 'Pré-Escola'; return 'Pré-Escola';
case 4: case 3:
return 'Ensino Fundamental - anos iniciais'; return 'Ensino Fundamental - anos iniciais';
case 5: case 4:
return 'Ensino Fundamental - anos finais'; return 'Ensino Fundamental - anos finais';
case 6: case 5:
return 'Ensino Médio'; return 'Ensino Médio';
default: default:
return 'Não classificada'; return 'Não classificada';
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function educationLevelMod(id) {
switch (id) {
case 1:
return 'Creche';
case 2:
return 'Pré-Escola';
case 3:
return 'Ensino Fundamental - anos iniciais';
case 4:
return 'Ensino Fundamental - anos finais';
case 5:
return 'Ensino Médio';
case 6:
return 'Ensino Medio Integrado ou Normal - tecnico';
case 7:
return 'EJA - Ensino Fundamental';
case 8:
return 'EJA - Ensino Médio';
case 9:
return 'EJA - EF e EM Integrado - tecnico';
case 10:
return 'Educacao Profissional - concomitante e subsequente';
case 11:
return 'suporte_total'
default:
return 'Não classificada';
}
};
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function educationLevelModDoc(id) {
switch (id) {
case 1:
return 'Creche';
case 2:
return 'Pré-Escola';
case 3:
return 'Ensino Fundamental - anos iniciais';
case 4:
return 'Ensino Fundamental - anos finais';
case 5:
return 'Ensino Médio';
case 6:
return 'Profissional';
case 7:
return 'EJA - Ensino Fundamental';
case 8:
return 'EJA - Ensino Médio';
default:
return 'Não classificada';
}
};
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function educationLevelShort(id) {
switch (id) {
case 1:
return 'Creche';
case 2:
return 'Pré-Escola';
case 3:
return 'Ensino Fundamental - anos iniciais';
case 4:
return 'Ensino Fundamental - anos finais';
case 5:
return 'Ensino Médio Propedêutico';
case 6:
return 'Ensino Médio Normal Magistério';
case 7:
return 'Ensino Médio Integrado';
case 8:
return 'Educação Profissional Técnica - Associado ao Nível Médio';
case 9:
return 'Educação Profissional Técnica - Concomitante';
case 10:
return 'Educação Profissional Técnica - Subsequente';
case 11:
return 'Educação Profissional - Misto';
case 12:
return 'Educação Profissional FIC Concomitante';
case 13:
return 'Educacao Profissional FIC Integrado EJA';
case 14:
return 'EJA Ensino Fundamental';
case 15:
return 'EJA Ensino Médio';
default:
return 'Não classificada';
}
};
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function educationLevelShort(id) {
switch (id) {
case 1:
return 'Educação Infantil';
case 2:
return 'Ensino Fundamental';
case 3:
return 'Ensino Médio';
case 4:
return 'Educação Profissional';
case 5:
return 'Educação Profissional Técnica de Nível Médio';
case 6:
return 'Educação Profissional FIC';
case 7:
return 'EJA';
default:
return 'Não classificada';
}
};
...@@ -36,5 +36,7 @@ module.exports = function incomeRange(id) { ...@@ -36,5 +36,7 @@ module.exports = function incomeRange(id) {
return 'Mais de 5 salários mínimos'; return 'Mais de 5 salários mínimos';
case 9: case 9:
return 'Não informado ou ignorado'; return 'Não informado ou ignorado';
case 10:
return "Ignorado"
} }
}; };
...@@ -62,6 +62,7 @@ module.exports = function metroCode(id) { ...@@ -62,6 +62,7 @@ module.exports = function metroCode(id) {
return 'Região Metropolitana de Vale do Rio Cuiabá'; return 'Região Metropolitana de Vale do Rio Cuiabá';
case 52: case 52:
return 'Região Metropolitana de Goiânia'; return 'Região Metropolitana de Goiânia';
case null:
case 99: case 99:
return 'Não é região metropolitana ou região administrativa integrada'; return 'Não é região metropolitana ou região administrativa integrada';
default: default:
......
...@@ -35,6 +35,7 @@ module.exports = function modalityShift(id) { ...@@ -35,6 +35,7 @@ module.exports = function modalityShift(id) {
case 7: case 7:
return 'EaD ou semipresencial'; return 'EaD ou semipresencial';
case 9: case 9:
case null:
return 'Não informado'; return 'Não informado';
case 99: case 99:
return 'Não frequenta instituição de ensino'; return 'Não frequenta instituição de ensino';
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function ageRange(id) {
switch (id) {
case 1:
return 'Pós-Graduação Especialização';
case 2:
return 'Pós-Graduação Mestrado';
case 3:
return 'Pós-Graduação Doutorado';
default:
return '';
}
};
/*
Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function specialEducation(id) {
switch (id) {
case 1:
return 'Inclusiva';
case 2:
return 'Exclusiva';
default:
return 'Não definido';
}
};
/*
Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function specialEducationDoc(id) {
switch (id) {
case 1:
return 'Classe Comum';
case 2:
return 'Classe Especial';
default:
return 'Não definido';
}
};
/*
Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function specialEducation(id) {
switch (id) {
case 1:
return 'Classe Comum';
case 2:
return 'Classe Exclusiva';
default:
return 'Não definido';
}
};
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function totalDoc(id) {
return '';
};
const id2str = require(`./id2str`);
/*
Middleware que tem como função formatar dados agregados.
Dados agregados não podem ser 'puxados' do banco de dados da mesma maneira que os dados tradicioanis, dessa maneira é
necessário formatá-los para que sigam o padrão.
*/
// Faz o mapeamento dos filtros com seus respectivos 'id2str'
const convert = {
adm_dependency_detailed: 'admDependencyPriv',
location: 'location',
diff_location: 'diffLocation',
region: 'regionCode',
state: 'stateName',
age_range: 'ageRangeAggregate',
gender: 'gender',
ethnic_group: 'ethnicGroup',
education_level_mod_agg: 'educationLevelModAgg',
integral_time_agg: 'integralTime',
period_agg: 'period',
modality_integral_time: 'educationLevelBasic',
special_education: 'specialEducation',
special_education_doc: 'specialEducationDoc',
special_education_entity: 'specialEducationEntity',
education_level_mod_doc: 'educationLevelModDoc',
education_level_mod_entity_seg: 'educationLevelModEntitySeg',
education_level_mod_entity_agg: 'educationLevelModEntityAgg',
adm_dependency_entity_agg: 'newPnadAdmDependency',
adm_dependency_entity: 'admDependency',
location_entity: 'location',
gender_entity: 'gender',
age_range_entity: 'ageRangeEntity',
post_graduation_entity: 'postGraduationEntity',
contract_type_entity: 'contractType',
total_doc: "totalDoc",
education_degree_entity: "educationDegreeEntity",
government_agreement: "governmentAgreement"
}
function aggregateData(req, res, next) {
if (req.query.dims) {
const newResult = []
const aggregateFields = [
'gender',
'age_range',
'ethnic_group',
'education_level_mod_agg',
'education_level_mod_doc',
'integral_time_agg',
'period_agg',
'modality_integral_time',
'special_education',
'special_education_doc',
'special_education_entity',
'education_level_mod_entity_seg',
'education_level_mod_entity_agg',
'adm_dependency_entity_agg',
'adm_dependency_entity',
'location_entity',
'gender_entity',
'age_range_entity',
'post_graduation_entity',
'contract_type_entity',
'education_degree_entity'
]
let id;
const fields = req.query.dims.split(',');
let currentAggregateField;
let currentNonAggregateField;
// Verifica se o filtro passado está presente nos filtros agregados
fields.forEach(field => {if (aggregateFields.includes(field)) currentAggregateField = field; else currentNonAggregateField = field});
if (currentAggregateField) {
req.result.forEach((r) => {
// Alguns filtros começam com o id = 0 outros id = 1
id = ['ethnic_group', 'integral_time_agg'].includes(currentAggregateField) ? 0 : 1;
for (const property in r) {
// Dados agregados são identificados com a substring 'total_' em sua chave
if (property.includes('total_')) {
let data = {
total: r[property],
year: r.year,
[`${currentAggregateField}_id`]: id,
[`${currentAggregateField}_name`]: id2str[convert[currentAggregateField]](id)
}
if (currentNonAggregateField) {
data[`${currentNonAggregateField}_id`] = r[`${currentNonAggregateField}_id`];
data[`${currentNonAggregateField}_name`] = id2str[convert[currentNonAggregateField]](r[`${currentNonAggregateField}_id`]);
}
newResult.push(data)
++id;
}
}
})
req.result = newResult;
}
}
next();
}
module.exports = aggregateData;
\ No newline at end of file