Skip to content
Snippets Groups Projects
Commit ad8b7d16 authored by Fernando Gbur dos Santos's avatar Fernando Gbur dos Santos
Browse files

[ADD] Adding 'modality_shift' filter

parent 2dcc6da5
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!386Merge development -> homologa,!385Merge new_pnad -> development
/*
Copyright (C) 2024 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 modalityShift(id) {
switch (id) {
case null:
return 'Não informado';
case 1:
return 'Matutino';
case 2:
return 'Vespertino';
case 3:
return 'Noturno';
case 4:
return 'Integral - matutino e vespertino';
case 5:
return 'Outros';
case 6:
return 'Não se aplica - pós graduação presencial';
case 7:
return 'EaD ou semipresencial';
case 99:
return 'Não frequenta instituição de ensino';
}
};
......@@ -112,6 +112,7 @@ const ethnicGroupNewPnad = require(`${libs}/convert/ethnicGroupNewPnad`);
const capitalCode = require(`${libs}/convert/capitalCode`);
const regionCode = require(`${libs}/convert/regionCode`);
const metroCode = require(`${libs}/convert/metroCode`);
const modalityShift = require(`${libs}/convert/modalityShift`);
const ids = {
gender_id: gender,
......@@ -216,7 +217,8 @@ const ids = {
new_pnad_ethnic_group_id: ethnicGroupNewPnad,
cap_code_id: capitalCode,
reg_code_id: regionCode,
metro_code_id: metroCode
metro_code_id: metroCode,
modality_shift_id: modalityShift
};
function transform(removeId=false) {
......@@ -343,5 +345,6 @@ module.exports = {
ethnicGroupNewPnad,
capitalCode,
regionCode,
metroCode
metroCode,
modalityShift
};
......@@ -215,6 +215,16 @@ rqf.addField({
type: 'integer',
field: 'nivel_etapa_modalidade_freq'
}
}).addValue({
name: 'modality_shift',
table: 'pnad_novo',
tableField: 'turno_nivel_etapa',
resultField: 'modality_shift_id',
where: {
relation: '=',
type: 'integer',
field: 'modality_shift_id'
}
}).addValue({
name: 'bolsa_familia',
table: 'pnad_novo',
......@@ -239,7 +249,7 @@ rqf.addField({
name: 'age_range',
table: 'pnad_novo',
tableField: 'faixa_etaria',
resultField: 'age_range_id',
resultField: 'age_range_all_id',
where: {
relation: '=',
type: 'integer',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment