text: var args = arguments[0] || {};
  
  $.tempaversijala.open();
  
  var idPaciente = arguments[0].idPatient;
          
          $.sendDASA.addEventListener("click", function(){
          	insertData(idPaciente);
          });
          
          $.dialogError.addEventListener("click", function(ev){
  			if (ev.index == 0) { // clicked "Yes"
  		      insertData(idPaciente);
  		    } else if (ev.index == 1) { // clicked "No"
  		      // do nothing
  		    }
  		});
          
          $.question1.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question1.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question1.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question1.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question1.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question1.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question1.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question1.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question1.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question1.value = 9;
  		    }
  		    else {
  		        $.question1.value = 10;
  		    }
  		});
  		
  		$.question2.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question2.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question2.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question2.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question2.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question2.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question2.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question2.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question2.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question2.value = 9;
  		    }
  		    else {
  		        $.question2.value = 10;
  		    }
  		});
  		
  		$.question3.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question3.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question3.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question3.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question3.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question3.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question3.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question3.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question3.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question3.value = 9;
  		    }
  		    else {
  		        $.question3.value = 10;
  		    }
  		});
  		
  		$.question4.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question4.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question4.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question4.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question4.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question4.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question4.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question4.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question4.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question4.value = 9;
  		    }
  		    else {
  		        $.question4.value = 10;
  		    }
  		});
          
          $.question5.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question5.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question5.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question5.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question5.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question5.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question5.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question5.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question5.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question5.value = 9;
  		    }
  		    else {
  		        $.question5.value = 10;
  		    }
  		});
          
          $.question6.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		         $.question6.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		         $.question6.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		         $.question6.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		         $.question6.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		         $.question6.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		         $.question6.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		         $.question6.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		         $.question6.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		         $.question6.value = 9;
  		    }
  		    else {
  		         $.question6.value = 10;
  		    }
  		});
          
          $.question7.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question7.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question7.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question7.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question7.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question7.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question7.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question7.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question7.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question7.value = 9;
  		    }
  		    else {
  		        $.question7.value = 10;
  		    }
  		});
          
          $.question8.addEventListener('stop', function(e) {
  		    if(e.value < 1.5) {
  		        $.question8.value = 1;
  		    }
  		    else if(e.value < 2.5) {
  		        $.question8.value = 2;
  		    }
  		    else if(e.value < 3.5) {
  		        $.question8.value = 3;
  		    }
  		    else if(e.value < 4.5) {
  		        $.question8.value = 4;
  		    }
  		    else if(e.value < 5.5) {
  		        $.question8.value = 5;
  		    }
  		    else if(e.value < 6.5) {
  		        $.question8.value = 6;
  		    }
  		    else if(e.value < 7.5) {
  		        $.question8.value = 7;
  		    }
  		    else if(e.value < 8.5) {
  		        $.question8.value = 8;
  		    }
  		    else if(e.value < 9.5) {
  		        $.question8.value = 9;
  		    }
  		    else {
  		        $.question8.value = 10;
  		    }
  		});
          
          function insertData(idPaciente){ 
          	//if there is something in the textbox 
               if($.question1.value != "" && $.question1.value != null){ 
                       var request = Ti.Network.createHTTPClient({ 
                    onload: function(){
                    	alert("Gracias por llenar el Diario!");
                    	//abrirEncuesta();
                    	$.tempaversijala.close();
                    },
                    onerror: function(e){ 
                        Ti.API.debug(e.error); 
                        $.dialogError.show();
                    }, 
                    timeout:3000, 
                       });    
  //Request the data from the web service, Here you have to change it for your local ip 
                       request.open("POST","http://app.bluecoreservices.com/webservices/addDAS-A.php"); 
                       var params = ({
                       	"id": idPaciente,
                       	"question1": $.question1.value,
                       	"question2": $.question2.value,
                       	"question3": $.question3.value,
                       	"question4": $.question4.value,
                       	"question5": $.question5.value,
                       	"question6": $.question6.value,
                       	"question7": $.question7.value,
                       	"question8": $.question8.value,
                       	});  
                    request.send(params); 
                }
         };  
         
         function abrirEncuesta(){
         		var evaluacionTerapeuta = Alloy.createController('evalTerapeuta').getView();
         		Ti.API.info(evaluacionTerapeuta);
         		//alert(persistentObjects[0].id);
  			//persistentObjects[0].open(temp);
         }; 