git-svn-id: https://svn.coded.pt/svn/SIPRP@1972 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
João Maurício 11 years ago
parent 6242a7d54e
commit 13a2fcd041

@ -17,10 +17,8 @@
' <li><a href="#section10">Absentismo</a></li>' + ' <li><a href="#section10">Absentismo</a></li>' +
' <li><a href="#section11">Esquema Vacinal</a></li>' + ' <li><a href="#section11">Esquema Vacinal</a></li>' +
' <li><a href="#section12">Conclusões/Resumo</a></li>' + ' <li><a href="#section12">Conclusões/Resumo</a></li>' +
//' <li><a href="#section13"> Propostas de Solução</a></li>' +
' <li><a href="#section14">Observações</a></li>' + ' <li><a href="#section14">Observações</a></li>' +
' <li><a href="#section15">Parecer/Reavaliação</a></li>' + ' <li><a href="#section15">Parecer/Reavaliação</a></li>' +
//' <li><a href="#section16">Reavaliação</a></li>' +
' <li><a href="#section17">Data do Exame</a></li>' + ' <li><a href="#section17">Data do Exame</a></li>' +
'</ul> ' + '</ul> ' +
'</div>' '</div>'
@ -33,13 +31,6 @@
$scope.habilitacoes = new globals.dataService.store(); $scope.habilitacoes = new globals.dataService.store();
$scope.estadosCivis = new globals.dataService.store(); $scope.estadosCivis = new globals.dataService.store();
$scope.storeDadosFicha = new globals.dataService.store({
model: null,
actions: {
get: 'getDadosFichaFromBD'
}
});
$scope.storeFichasClinicas = new globals.dataService.store({ $scope.storeFichasClinicas = new globals.dataService.store({
model: null, model: null,
actions: { actions: {
@ -53,68 +44,32 @@
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.editing = angular.copy(selected); $scope.storeFichasClinicas.extraParams = {
fichaID: null,
$scope.editing.antecentesOcupacionaisActividadesAnteriores = []; trabalhadorID: selected.ficha.trabalhador_id,
$scope.editing.antecentesOcupacionaisAcidentesTrabalho = []; tipoFichaID: selected.ficha.tipo_ficha_id
$scope.editing.antecentesOcupacionaisDoencasProfissionais = [];
$scope.editing.antecentesOcupacionaisActividadesAnteriores = [];
//TODO: rever estes modelos - 3 novas grelhas
$scope.editing.antecedentesPessoaisCirurgias = [];
$scope.editing.antecedentesPessoaisFracturas = [];
$scope.editing.antecedentesPessoaisInternamentos = [];
$scope.editing.actividade = {
posto_representa_risco_saude: false
};
$scope.editing.antecentesOcupacionais = {
exposto_factores_risco: false,
acidentes_trabalho: false,
doencas_profissionais: false,
doencas_relacionadas_com_trabalho: false
}; };
//TODO: remaining fields!!! $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.editing.exameObjectivo = {
boca_nariz_normal: true,
pele_mucosas_normal: true,
acuidade_auditiva_normal: true,
adenopatias_normal: true,
pescoco_normal: true,
torax_normal: true,
auscultacao_cardiaca_normal: true,
auscultacao_pulmonar_normal: true,
mama_normal: true,
abdomen_normal: true,
coluna_vertebral_normal: true,
membros_normal: true,
exame_neurologico_normal: true
};
$scope.editing.classificacaoIndividualSaude = { $scope.selected = items.fichaData;
sem_problemas_saude: true
};
$scope.editing.conclusoesResumo = { $scope.editing = angular.copy($scope.selected);
inapto_radio: 1,
reavaliacao_radio: 1
};
globals.plugins.buildFloatingSideMenu({ globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica', title: 'Ficha Clinica',
scrollspyItems: scrollspyItems, scrollspyItems: scrollspyItems,
afterrender: function(){ afterrender: function(){
$('body').scrollspy({ $('body').scrollspy({
target: '#scrollspyItems' target: '#scrollspyItems'
}); });
}, },
documentclick: function(){ documentclick: function(){
$scope.openModalDocumentos(); $scope.openModalDocumentos();
} }
});
}); });
}; };
@ -123,33 +78,31 @@
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.storeFichasClinicas.extraParams = { $scope.storeFichasClinicas.extraParams = {
fichaID: selected.id fichaID: selected.id,
trabalhadorID: null,
tipoFichaID: null
}; };
$scope.storeFichasClinicas.get(function(response, status, headers, config, items){ $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.selected = items; $scope.selected = items.fichaData;
$scope.editing = angular.copy($scope.selected); $scope.editing = angular.copy($scope.selected);
$timeout(function () { globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica',
globals.plugins.buildFloatingSideMenu({ scrollspyItems: scrollspyItems,
title: 'Ficha Clinica', afterrender: function(){
scrollspyItems: scrollspyItems,
afterrender: function(){
$('body').scrollspy({ $('body').scrollspy({
target: '#scrollspyItems' target: '#scrollspyItems'
}); });
}, },
documentclick: function(){ documentclick: function(){
$scope.openModalDocumentos();
}
});
}, 0); $scope.openModalDocumentos();
}
});
}); });
}; };
@ -169,15 +122,8 @@
$scope.editing.ficha.data_conclusao = null; $scope.editing.ficha.data_conclusao = null;
} }
//var isNewRecord = $scope.editing.ficha.id == null;
$scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing){ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing){
//if(isNewRecord && response.success)
//{
// $scope.isNewRecord = true;
//}
if(response.success && complete) if(response.success && complete)
{ {
globals.plugins.hideFloatingSideMenu(); globals.plugins.hideFloatingSideMenu();
@ -344,27 +290,15 @@
}); });
}; };
$scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){ $scope.$watch('storeFichasClinicas.items', function(newVal, oldVal){
if(tipo_ficha_id){
$scope.storeDadosFicha.extraParams = {
tipoFichaID: tipo_ficha_id
};
$scope.storeDadosFicha.get(function(response, status, headers, config, items){ if(newVal.fieldsData){
if(response.data){ $scope.habilitacoes.items = [];
$scope.habilitacoes.loadData(newVal.fieldsData.habilitacoes);
if(response.data.habilitacoes){ $scope.estadosCivis.items = [];
$scope.habilitacoes.loadData(response.data.habilitacoes); $scope.estadosCivis.loadData(newVal.fieldsData.estadosCivis);
}
if(response.data.estadosCivis){
$scope.estadosCivis.loadData(response.data.estadosCivis);
}
}
});
} }
}); });
@ -390,11 +324,6 @@
} }
}; };
$scope.test = function(){
alert('888');
};
$scope.$on('afterrender', function(event, args){ $scope.$on('afterrender', function(event, args){
//listeners //listeners

@ -8,13 +8,6 @@
$scope.motivos = new globals.dataService.store(); $scope.motivos = new globals.dataService.store();
$scope.storeDadosFicha = new globals.dataService.store({
model: null,
actions: {
get: 'getDadosFichaFromBD'
}
});
$scope.storeFichasClinicas = new globals.dataService.store({ $scope.storeFichasClinicas = new globals.dataService.store({
model: null, model: null,
actions: { actions: {
@ -26,45 +19,59 @@
$scope.add = function(selected){ $scope.add = function(selected){
globals.plugins.buildFloatingSideMenu({ $scope.editForm.$reset();
title: 'Ficha Clinica',
documentclick: function(){
$scope.openModalDocumentos(); $scope.storeFichasClinicas.extraParams = {
} fichaID: null,
}); trabalhadorID: selected.ficha.trabalhador_id,
tipoFichaID: selected.ficha.tipo_ficha_id
};
$scope.editForm.$reset(); $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.selected = items.fichaData;
$scope.editing = angular.copy(selected); $scope.editing = angular.copy($scope.selected);
globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica',
documentclick: function(){
$scope.openModalDocumentos();
}
});
});
}; };
$scope.edit = function(selected){ $scope.edit = function(selected){
globals.plugins.buildFloatingSideMenu({ $scope.editForm.$reset();
title: 'Ficha Clinica',
documentclick: function(){
$scope.openModalDocumentos(); $scope.storeFichasClinicas.extraParams = {
} fichaID: selected.id,
}); trabalhadorID: null,
tipoFichaID: null
};
$timeout(function () { $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.editForm.$reset(); $scope.selected = items.fichaData;
$scope.storeFichasClinicas.extraParams = { $scope.editing = angular.copy($scope.selected);
fichaID: selected.id
};
$scope.storeFichasClinicas.get(function(response, status, headers, config, items){ $timeout(function () {
$scope.selected = items; globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica',
documentclick: function(){
$scope.editing = angular.copy($scope.selected); $scope.openModalDocumentos();
}); }
});
}, 0);
}, 0); });
}; };
$scope.save = function(complete){ $scope.save = function(complete){
@ -155,25 +162,12 @@
}); });
}; };
$scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){ $scope.$watch('storeFichasClinicas.items', function(newVal, oldVal){
if(tipo_ficha_id){ if(newVal.fieldsData){
$scope.motivos.items = []; $scope.motivos.items = [];
$scope.motivos.loadData(newVal.fieldsData.motivos);
$scope.storeDadosFicha.extraParams = {
tipoFichaID: tipo_ficha_id
};
$scope.storeDadosFicha.get(function(response, status, headers, config, items){
if(response.data){
if(response.data.motivos){
$scope.motivos.loadData(response.data.motivos);
}
}
});
} }
}); });

@ -8,13 +8,6 @@
$scope.motivos = new globals.dataService.store(); $scope.motivos = new globals.dataService.store();
$scope.storeDadosFicha = new globals.dataService.store({
model: null,
actions: {
get: 'getDadosFichaFromBD'
}
});
$scope.storeFichasClinicas = new globals.dataService.store({ $scope.storeFichasClinicas = new globals.dataService.store({
model: null, model: null,
actions: { actions: {
@ -28,48 +21,53 @@
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.editing = angular.copy(selected); $scope.storeFichasClinicas.extraParams = {
fichaID: null,
$scope.editing.conclusoesResumo = { trabalhadorID: selected.ficha.trabalhador_id,
inapto_radio: 1, tipoFichaID: selected.ficha.tipo_ficha_id
reavaliacao_radio: 1
}; };
globals.plugins.buildFloatingSideMenu({ $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
title: 'Ficha Clinica',
documentclick: function(){
$scope.openModalDocumentos(); $scope.selected = items.fichaData;
}
$scope.editing = angular.copy($scope.selected);
globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica',
documentclick: function(){
$scope.openModalDocumentos();
}
});
}); });
}; };
$scope.edit = function(selected){ $scope.edit = function(selected){
$timeout(function () { $scope.editForm.$reset();
$scope.editForm.$reset();
$scope.storeFichasClinicas.extraParams = { $scope.storeFichasClinicas.extraParams = {
fichaID: selected.id fichaID: selected.id,
}; trabalhadorID: null,
tipoFichaID: null
};
$scope.storeFichasClinicas.get(function(response, status, headers, config, items){ $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.selected = items; $scope.selected = items.fichaData;
$scope.editing = angular.copy($scope.selected); $scope.editing = angular.copy($scope.selected);
globals.plugins.buildFloatingSideMenu({ globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica', title: 'Ficha Clinica',
documentclick: function(){ documentclick: function(){
$scope.openModalDocumentos(); $scope.openModalDocumentos();
} }
});
}); });
}, 0); });
}; };
$scope.save = function(complete){ $scope.save = function(complete){
@ -160,23 +158,12 @@
}); });
}; };
$scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){ $scope.$watch('storeFichasClinicas.items', function(newVal, oldVal){
if(tipo_ficha_id){ if(newVal.fieldsData){
$scope.storeDadosFicha.extraParams = { $scope.motivos.items = [];
tipoFichaID: tipo_ficha_id $scope.motivos.loadData(newVal.fieldsData.motivos);
};
$scope.storeDadosFicha.get(function(response, status, headers, config, items){
if(response.data){
if(response.data.motivos){
$scope.motivos.loadData(response.data.motivos);
}
}
});
} }
}); });

@ -17,10 +17,8 @@
' <li><a href="#section10">Absentismo</a></li>' + ' <li><a href="#section10">Absentismo</a></li>' +
' <li><a href="#section11">Esquema Vacinal</a></li>' + ' <li><a href="#section11">Esquema Vacinal</a></li>' +
' <li><a href="#section12">Conclusões/Resumo</a></li>' + ' <li><a href="#section12">Conclusões/Resumo</a></li>' +
//' <li><a href="#section13"> Propostas de Solução</a></li>' +
' <li><a href="#section14">Observações</a></li>' + ' <li><a href="#section14">Observações</a></li>' +
' <li><a href="#section15">Parecer/Reavaliação</a></li>' + ' <li><a href="#section15">Parecer/Reavaliação</a></li>' +
//' <li><a href="#section16">Reavaliação</a></li>' +
' <li><a href="#section17">Data do Exame</a></li>' + ' <li><a href="#section17">Data do Exame</a></li>' +
'</ul> ' + '</ul> ' +
'</div>' '</div>'
@ -33,13 +31,6 @@
$scope.habilitacoes = new globals.dataService.store(); $scope.habilitacoes = new globals.dataService.store();
$scope.estadosCivis = new globals.dataService.store(); $scope.estadosCivis = new globals.dataService.store();
$scope.storeDadosFicha = new globals.dataService.store({
model: null,
actions: {
get: 'getDadosFichaFromBD'
}
});
$scope.storeFichasClinicas = new globals.dataService.store({ $scope.storeFichasClinicas = new globals.dataService.store({
model: null, model: null,
actions: { actions: {
@ -53,68 +44,32 @@
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.editing = angular.copy(selected); $scope.storeFichasClinicas.extraParams = {
fichaID: null,
$scope.editing.antecentesOcupacionaisActividadesAnteriores = []; trabalhadorID: selected.ficha.trabalhador_id,
$scope.editing.antecentesOcupacionaisAcidentesTrabalho = []; tipoFichaID: selected.ficha.tipo_ficha_id
$scope.editing.antecentesOcupacionaisDoencasProfissionais = [];
$scope.editing.antecentesOcupacionaisActividadesAnteriores = [];
//TODO: rever estes modelos - 3 novas grelhas
$scope.editing.antecedentesPessoaisCirurgias = [];
$scope.editing.antecedentesPessoaisFracturas = [];
$scope.editing.antecedentesPessoaisInternamentos = [];
$scope.editing.actividade = {
posto_representa_risco_saude: false
};
$scope.editing.antecentesOcupacionais = {
exposto_factores_risco: false,
acidentes_trabalho: false,
doencas_profissionais: false,
doencas_relacionadas_com_trabalho: false
}; };
//TODO: remaining fields!!! $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.editing.exameObjectivo = {
boca_nariz_normal: true,
pele_mucosas_normal: true,
acuidade_auditiva_normal: true,
adenopatias_normal: true,
pescoco_normal: true,
torax_normal: true,
auscultacao_cardiaca_normal: true,
auscultacao_pulmonar_normal: true,
mama_normal: true,
abdomen_normal: true,
coluna_vertebral_normal: true,
membros_normal: true,
exame_neurologico_normal: true
};
$scope.editing.classificacaoIndividualSaude = { $scope.selected = items.fichaData;
sem_problemas_saude: true
};
$scope.editing.conclusoesResumo = { $scope.editing = angular.copy($scope.selected);
inapto_radio: 1,
reavaliacao_radio: 1
};
globals.plugins.buildFloatingSideMenu({ globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica', title: 'Ficha Clinica',
scrollspyItems: scrollspyItems, scrollspyItems: scrollspyItems,
afterrender: function(){ afterrender: function(){
$('body').scrollspy({ $('body').scrollspy({
target: '#scrollspyItems' target: '#scrollspyItems'
}); });
}, },
documentclick: function(){ documentclick: function(){
$scope.openModalDocumentos(); $scope.openModalDocumentos();
} }
});
}); });
}; };
@ -123,33 +78,31 @@
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.storeFichasClinicas.extraParams = { $scope.storeFichasClinicas.extraParams = {
fichaID: selected.id fichaID: selected.id,
trabalhadorID: null,
tipoFichaID: null
}; };
$scope.storeFichasClinicas.get(function(response, status, headers, config, items){ $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.selected = items; $scope.selected = items.fichaData;
$scope.editing = angular.copy($scope.selected); $scope.editing = angular.copy($scope.selected);
$timeout(function () { globals.plugins.buildFloatingSideMenu({
title: 'Ficha Clinica',
scrollspyItems: scrollspyItems,
afterrender: function(){
globals.plugins.buildFloatingSideMenu({ $('body').scrollspy({
title: 'Ficha Clinica', target: '#scrollspyItems'
scrollspyItems: scrollspyItems, });
afterrender: function(){ },
documentclick: function(){
$('body').scrollspy({
target: '#scrollspyItems'
});
},
documentclick: function(){
$scope.openModalDocumentos();
}
});
}, 0); $scope.openModalDocumentos();
}
});
}); });
}; };
@ -169,15 +122,8 @@
$scope.editing.ficha.data_conclusao = null; $scope.editing.ficha.data_conclusao = null;
} }
//var isNewRecord = $scope.editing.ficha.id == null;
$scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing){ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing){
//if(isNewRecord && response.success)
//{
// $scope.isNewRecord = true;
//}
if(response.success && complete) if(response.success && complete)
{ {
globals.plugins.hideFloatingSideMenu(); globals.plugins.hideFloatingSideMenu();
@ -344,27 +290,15 @@
}); });
}; };
$scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){ $scope.$watch('storeFichasClinicas.items', function(newVal, oldVal){
if(tipo_ficha_id){
$scope.storeDadosFicha.extraParams = { if(newVal.fieldsData){
tipoFichaID: tipo_ficha_id
};
$scope.storeDadosFicha.get(function(response, status, headers, config, items){ $scope.habilitacoes.items = [];
$scope.habilitacoes.loadData(newVal.fieldsData.habilitacoes);
if(response.data){ $scope.estadosCivis.items = [];
$scope.estadosCivis.loadData(newVal.fieldsData.estadosCivis);
if(response.data.habilitacoes){
$scope.habilitacoes.loadData(response.data.habilitacoes);
}
if(response.data.estadosCivis){
$scope.estadosCivis.loadData(response.data.estadosCivis);
}
}
});
} }
}); });

@ -24,21 +24,17 @@
$scope.storeFichasClinicas.get(function(response, status, headers, config, items){ $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.selected = items; $scope.selected = items.fichaData;
$scope.editing = angular.copy($scope.selected); $scope.editing = angular.copy($scope.selected);
$timeout(function () { globals.plugins.buildFloatingSideMenu({
title: 'Ficha de Aptidão',
documentclick: function(){
globals.plugins.buildFloatingSideMenu({ $scope.openModalDocumentos();
title: 'Ficha de Aptidão', }
documentclick: function(){ });
$scope.openModalDocumentos();
}
});
}, 0);
}); });
}; };

@ -177,7 +177,7 @@
<div class="col-md-8 p-l-none"> <div class="col-md-8 p-l-none">
<div ng-show="editing.ficha.tipo_ficha_id == 7" class="row"> <div ng-show="editing.ficha.tipo_ficha_id == 7" class="row">
<!--<div class="col-lg-12 p-l-none"> <div class="col-lg-12 p-l-none">
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input ng-model="editing.ficha.motivo_id" name="rb_ocasional_motivo" ng-value="200" type="radio"/> <input ng-model="editing.ficha.motivo_id" name="rb_ocasional_motivo" ng-value="200" type="radio"/>
@ -228,7 +228,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> --> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save