Skip to content
Snippets Groups Projects
Commit e8ce12e0 authored by jpko19's avatar jpko19
Browse files

Update dims pee_por_categoria

parent d484d84f
No related branches found
No related tags found
3 merge requests!329Update enrollment - new filters,!324Dev,!309Merge new updates into master
...@@ -19,6 +19,7 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>. ...@@ -19,6 +19,7 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/ */
const express = require('express'); const express = require('express');
const { result } = require('lodash');
const enrollmentApp = express.Router(); const enrollmentApp = express.Router();
...@@ -811,7 +812,29 @@ enrollmentApp.get('/', rqf.parse(), (req, res, next) => { ...@@ -811,7 +812,29 @@ enrollmentApp.get('/', rqf.parse(), (req, res, next) => {
.where('((matricula.tipo<=3 OR matricula.tipo IS NULL) AND (matricula.tipo_atendimento_turma IS NULL OR matricula.tipo_atendimento_turma <= 2))'); .where('((matricula.tipo<=3 OR matricula.tipo IS NULL) AND (matricula.tipo_atendimento_turma IS NULL OR matricula.tipo_atendimento_turma <= 2))');
} }
next(); next();
}, rqf.build(), query, id2str.transform(false), response('enrollment')); }, rqf.build(), query, id2str.transform(false), (req, res, next) => {
if('pee_por_categoria' in req.dims){
let result_total = [];
for (var j = 0;j < result.result.length;j++){
let result_parcial = result.result[j];
for (var i in result_parcial){
if(i !== 'year'){
let obj = {
category_name: '',
year: 0,
total: 0
};
obj.category_name = i;
obj.total = result_parcial[i];
obj.year = result_parcial.year;
result_total.push(obj);
}
}
}
req.result = result_total;
}
next();
}, response('enrollment'));
enrollmentApp.get('/diagnosis', rqf.parse(), (req, res, next) => { enrollmentApp.get('/diagnosis', rqf.parse(), (req, res, next) => {
req.dims = {}; req.dims = {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment