diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js
index 87ff0657..ba2d5315 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js
@@ -29,6 +29,16 @@
$scope.descricao = null;
$scope.calculatedAge = 0;
+
+ $scope.habilitacoes = 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({
model: null,
@@ -38,7 +48,7 @@
destroy: 'sendFicha'
}
});
-
+
$scope.add = function(selected){
globals.plugins.buildFloatingSideMenu({
@@ -262,6 +272,30 @@
});
};
+ $scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){
+
+ if(tipo_ficha_id){
+
+ $scope.storeDadosFicha.extraParams = {
+ tipoFichaID: tipo_ficha_id
+ };
+
+ $scope.storeDadosFicha.get(function(response, status, headers, config, items){
+
+ if(response.data){
+
+ if(response.data.habilitacoes){
+ $scope.habilitacoes.loadData(response.data.habilitacoes);
+ }
+
+ if(response.data.estadosCivis){
+ $scope.estadosCivis.loadData(response.data.estadosCivis);
+ }
+ }
+ });
+ }
+ });
+
$scope.$on('afterrender', function(event, args){
//listeners
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html
index 3d31d9b5..dd7ff107 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html
@@ -121,109 +121,37 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js
index 14b50d26..c5c446fd 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js
@@ -5,6 +5,15 @@
$scope.descricao = null;
$scope.calculatedAge = 0;
+
+ $scope.motivos = new globals.dataService.store();
+
+ $scope.storeDadosFicha = new globals.dataService.store({
+ model: null,
+ actions: {
+ get: 'getDadosFichaFromBD'
+ }
+ });
$scope.storeFichasClinicas = new globals.dataService.store({
model: null,
@@ -145,6 +154,26 @@
//$scope.modalDocumentos.hide();
});
};
+
+ $scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){
+
+ if(tipo_ficha_id){
+
+ $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);
+ }
+ }
+ });
+ }
+ });
$scope.$on('afterrender', function(event, args){
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html
index 3663436a..d9a2b7a3 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html
@@ -79,15 +79,35 @@
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js
index 920a47af..29a99ad9 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js
@@ -5,6 +5,15 @@
$scope.descricao = null;
$scope.calculatedAge = 0;
+
+ $scope.motivos = new globals.dataService.store();
+
+ $scope.storeDadosFicha = new globals.dataService.store({
+ model: null,
+ actions: {
+ get: 'getDadosFichaFromBD'
+ }
+ });
$scope.storeFichasClinicas = new globals.dataService.store({
model: null,
@@ -145,6 +154,26 @@
//$scope.modalDocumentos.hide();
});
};
+
+ $scope.$watch('editing.ficha.tipo_ficha_id', function(tipo_ficha_id, oldVal){
+
+ if(tipo_ficha_id){
+
+ $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);
+ }
+ }
+ });
+ }
+ });
$scope.$on('afterrender', function(event, args){
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html
index b271161d..b7afdf0c 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html
@@ -85,61 +85,23 @@