Merge branch 'master' of https://pdp-pds.eimt.uoc.edu/pds19-grupo2/myhealth.git
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
||||
@@ -49,8 +49,17 @@
|
||||
<target name="compileEjb" depends="init">
|
||||
<copy file="${sourcesrc}/META-INF/persistence.xml" todir="${buildjar}/META-INF" />
|
||||
<copy file="${sourcesrc}/log4j.properties" todir="${buildjar}" />
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildjar}" includes="ejb/**/*.java, jpa/**/*.java, TO/**/*.java, common/**/*.java" classpathref="jboss.classpath"
|
||||
includeantruntime="true" />
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildjar}" includeantruntime="true" source="1.8" target="1.8">
|
||||
<classpath>
|
||||
<path refid="jboss.classpath" />
|
||||
</classpath>
|
||||
<include name="ejb/**/*.java" />
|
||||
<include name="jpa/**/*.java" />
|
||||
<include name="TO/**/*.java" />
|
||||
<include name="common/**/*.java" />
|
||||
<exclude name="managedbean/**/*.java" />
|
||||
</javac>
|
||||
<delete verbose="true" dir="${buildjar}/managedbean" />
|
||||
</target>
|
||||
|
||||
<!-- Update the EJB jar file and create if not exist -->
|
||||
@@ -63,11 +72,16 @@
|
||||
<copy todir="${buildwar}">
|
||||
<fileset dir="${docroot}" />
|
||||
</copy>
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includes="managedbean/**/*.java" includeantruntime="true">
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includeantruntime="true" source="1.8" target="1.8">
|
||||
<classpath>
|
||||
<path refid="jboss.classpath" />
|
||||
<path refid="lib.dir" />
|
||||
</classpath>
|
||||
<include name="managedbean/**/*.java" />
|
||||
<exclude name="ejb/**/*.java" />
|
||||
<exclude name="jpa/**/*.java" />
|
||||
<exclude name="TO/**/*.java" />
|
||||
<exclude name="common/**/*.java" />
|
||||
</javac>
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/ejb" />
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/jpa" />
|
||||
|
||||
@@ -9,26 +9,13 @@
|
||||
<title>MyHealth Online Services</title>
|
||||
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
|
||||
<h:outputStylesheet library="css" name="estilos.css" />
|
||||
<h:outputScript library="js" name="common.js" />
|
||||
</h:head>
|
||||
<h:outputScript>
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if(args.validationFailed || !args.loggedIn) {
|
||||
PF('dlgLogin').jq.effect("shake", {times:5}, 100);
|
||||
PF('btnLogin').enable();
|
||||
}
|
||||
else {
|
||||
PF('btnLogin').enable();
|
||||
PF('dlgLogin').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function startLogin() {
|
||||
PF('btnLogin').disable();
|
||||
}
|
||||
|
||||
function onAjaxError() {
|
||||
alert('Ajax error');
|
||||
}
|
||||
// Si hay un error AJAX, lo más probable es que la sesión expirase, vamos a la página de error
|
||||
function onAjaxError() {
|
||||
window.location.href = "#{request.contextPath}/error.xhtml?type=expired";
|
||||
}
|
||||
</h:outputScript>
|
||||
<h:body>
|
||||
<p:growl id="messages" globalOnly="true" sticky="false" showDetail="true" life="15000" />
|
||||
@@ -39,10 +26,12 @@
|
||||
<div id="menuDiv" style="margin-bottom: 10px;">
|
||||
<p:ajaxStatus style="width:32px; height:32px; position:fixed; right:32px; bottom:32px" onerror="onAjaxError()">
|
||||
<f:facet name="start">
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em"></i>
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em" />
|
||||
</f:facet>
|
||||
|
||||
<f:facet name="error">Error!</f:facet>
|
||||
<f:facet name="error">
|
||||
<i class="pi pi-exclamation-triangle" style="font-size: 3em" />
|
||||
</f:facet>
|
||||
</p:ajaxStatus>
|
||||
|
||||
<h:form id="frmLogin">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
<f:metadata>
|
||||
<f:viewParam name="refresh" value="#{home.refresh}" />
|
||||
</f:metadata>
|
||||
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form>
|
||||
@@ -16,20 +12,17 @@
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:outputLabel for="selectorTema" value="Cambio de tema" />
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<div class="ui-g-3 ui-md-3">
|
||||
<p:themeSwitcher id="selectorTema" style="width:300px" value="#{sessionPreferences.currentTheme}">
|
||||
<f:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
|
||||
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
|
||||
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
|
||||
</p:themeSwitcher>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-1" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-4 ui-md-4 ">
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:commandButton value="Usar tema en este sesión" update="mesgs" action="#{sessionPreferences.updateCurrentTheme}" icon="pi pi-save" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-5 ui-md-5" />
|
||||
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<div class="ui-inputgroup">
|
||||
|
||||
@@ -3,23 +3,6 @@
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
|
||||
<h:head>
|
||||
<title>login</title>
|
||||
</h:head>
|
||||
<h:outputScript>
|
||||
<script type="text/javascript">
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if(args.validationFailed || !args.loggedIn) {
|
||||
PF('dlg').jq.effect("shake", {times:5}, 100);
|
||||
}
|
||||
else {
|
||||
PF('dlg').hide();
|
||||
$('#loginLink').fadeOut();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</h:outputScript>
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<div class="ui-g-12 ui-g-nopad">
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-2 ui-md-2 ">
|
||||
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{BeanName.actionMethod}" icon="pi pi-check" />
|
||||
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{PendingQuestions.saveData}" icon="pi pi-check" />
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
<p:panel id="PanelPHC" header="Cambiar médico de familia asignado" rendered="#{home.patient}">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Médico de familia actualmente asignado:" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeFD.currentFamilyDoctor.displayName}" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-6" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Nuevo médico de familia:" for="newFamilyDocAC" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:autoComplete id="newFamilyDocAC" dropdown="true" required="true" value="#{ChangeFD.newFamilyDoctor}" completeMethod="#{ChangeFD.completeFamilyDoctor}" var="fd"
|
||||
itemLabel="#{fd.displayName}" itemValue="#{fd}" forceSelection="true" requiredMessage="Por favor, selecciona un médico de familia"
|
||||
placeholder="Seleccione su nuevo médico de familia o teclee para buscar...">
|
||||
@@ -58,7 +58,7 @@
|
||||
</p:column>
|
||||
</p:autoComplete>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-6">
|
||||
<p:message for="newFamilyDocAC" />
|
||||
</div>
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
<p:panel id="PanelPHC" header="Cambiar centro de antención primaria asignado" rendered="#{home.familyDoctor}">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel value="Centro de antención primaria actualmente asignado:" />
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Centro de antención primaria actual:" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeCAP.currentCenter.displayName}" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-6" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Nuevo centro de atención primaria:" for="newCenter" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:autoComplete id="newCenter" dropdown="true" required="true" value="#{ChangeCAP.newCenter}" completeMethod="#{ChangeCAP.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria"
|
||||
placeholder="Seleccione una CAP o teclee para buscar...">
|
||||
@@ -55,7 +55,7 @@
|
||||
</p:column>
|
||||
</p:autoComplete>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-6">
|
||||
<p:message for="newCenter" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -44,25 +44,6 @@
|
||||
</h:form>
|
||||
|
||||
<h:form id="frmRegisterUser" rendered="#{not RegisterUser.registered}">
|
||||
<h:outputScript>
|
||||
function handleRequest(xhr, status, args) {
|
||||
var nif = PF('nifButton');
|
||||
if ( args.NIFisDupe == false ) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-times");
|
||||
nif.jq.removeClass('red-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-check");
|
||||
nif.jq.addClass('green-button');
|
||||
}
|
||||
else if (nif.jq.hasClass('red-button') == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-check");
|
||||
nif.jq.removeClass('green-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-times");
|
||||
nif.jq.addClass('red-button');
|
||||
}
|
||||
}
|
||||
</h:outputScript>
|
||||
<p:growl id="mesgs" globalOnly="true" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="tipoUsuario" header="Especifique el tipo de usuario que desea registrarse">
|
||||
<div class="ui-g ui-fluid">
|
||||
@@ -86,7 +67,7 @@
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-inputgroup">
|
||||
<p:inputText id="nif" value="#{RegisterUser.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{RegisterUser.hadleNIFValueChange}" oncomplete="handleRequest(xhr, status, args)" />
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{RegisterUser.hadleNIFValueChange}" oncomplete="handleNIFResponse(xhr, status, args)" />
|
||||
</p:inputText>
|
||||
<p:commandButton widgetVar="nifButton" icon="pi pi-times" styleClass="red-button" />
|
||||
</div>
|
||||
|
||||
@@ -7,25 +7,6 @@
|
||||
<ui:composition template="../header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form id="frmUpdateProfile">
|
||||
<h:outputScript>
|
||||
function handleRequest(xhr, status, args) {
|
||||
var nif = PF('nifButton');
|
||||
if ( args.NIFisDupe == false ) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-times");
|
||||
nif.jq.removeClass('red-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-check");
|
||||
nif.jq.addClass('green-button');
|
||||
}
|
||||
else if (nif.jq.hasClass('red-button') == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-check");
|
||||
nif.jq.removeClass('green-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-times");
|
||||
nif.jq.addClass('red-button');
|
||||
}
|
||||
}
|
||||
</h:outputScript>
|
||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
|
||||
<p:panel id="tipoUsuario" header="Tipo de usuario registrado">
|
||||
@@ -61,7 +42,7 @@
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-inputgroup">
|
||||
<p:inputText id="nif" value="#{UpdateProfile.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{UpdateProfile.hadleNIFValueChange}" oncomplete="handleRequest(xhr, status, args)" />
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{UpdateProfile.hadleNIFValueChange}" oncomplete="handleNIFResponse(xhr, status, args)" />
|
||||
</p:inputText>
|
||||
<p:commandButton widgetVar="nifButton" icon="pi pi-check" styleClass="green-button" />
|
||||
</div>
|
||||
@@ -138,7 +119,7 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selPHC" dropdown="true" value="#{UpdateProfile.primaryHealthCareCenter}" completeMethod="#{UpdateProfile.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.phcList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{phc.name}" />
|
||||
@@ -159,7 +140,7 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selMS" dropdown="true" value="#{UpdateProfile.medicalSpecialty}" completeMethod="#{UpdateProfile.completeMedicalSpecialty}" var="ms"
|
||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.medicalSpecialtiesList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{ms.name}" />
|
||||
|
||||
@@ -11,7 +11,7 @@ BODY {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
ul.ui-menu-child {
|
||||
ul.ui-menu-list {
|
||||
white-space: nowrap;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
41
1.sources/MyHealth/docroot/resources/js/common.js
Normal file
41
1.sources/MyHealth/docroot/resources/js/common.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Funciones comunes JavaScript para el proyecto MyHealth
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// Gestiona la ventana de login
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if (args.validationFailed || !args.loggedIn) {
|
||||
PF('dlgLogin').jq.effect("shake", {
|
||||
times : 5
|
||||
}, 100);
|
||||
PF('btnLogin').enable();
|
||||
} else {
|
||||
PF('btnLogin').enable();
|
||||
PF('dlgLogin').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Tras empezar la petición AJAX de login desabilita el botón para evitar doble login
|
||||
function startLogin() {
|
||||
PF('btnLogin').disable();
|
||||
}
|
||||
|
||||
// Valida si un NIF está duplicado.
|
||||
function handleNIFResponse(xhr, status, args) {
|
||||
var nif = PF('nifButton');
|
||||
if (args.NIFisDupe == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-times");
|
||||
nif.jq.removeClass('red-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-check");
|
||||
nif.jq.addClass('green-button');
|
||||
} else if (nif.jq.hasClass('red-button') == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-check");
|
||||
nif.jq.removeClass('green-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-times");
|
||||
nif.jq.addClass('red-button');
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
<application>
|
||||
<display-name>MyHealth</display-name>
|
||||
<module>
|
||||
<web>
|
||||
<web-uri>MyHealth.war</web-uri>
|
||||
<context-root>/MyHealth</context-root>
|
||||
</web>
|
||||
</module>
|
||||
<module>
|
||||
<ejb>MyHealth.jar</ejb>
|
||||
</module>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
|
||||
<application-name>MyHealth</application-name>
|
||||
<display-name>MyHealth</display-name>
|
||||
<module>
|
||||
<web>
|
||||
<web-uri>MyHealth.war</web-uri>
|
||||
<context-root>/MyHealth</context-root>
|
||||
</web>
|
||||
</module>
|
||||
<module>
|
||||
<ejb>MyHealth.jar</ejb>
|
||||
</module>
|
||||
</application>
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import jpa.FamilyDoctorJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package ejb.common;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
@@ -10,9 +9,6 @@ import TO.MedicalSpecialtyTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.SpecialistDoctorTO;
|
||||
import jpa.FamilyDoctorJPA;
|
||||
import jpa.PatientJPA;
|
||||
import jpa.SpecialistDoctorJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -278,8 +278,6 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
* @return FamilyDoctorTO (Transfer Object del médico de familia al que se la ha cambiado el CAP).
|
||||
*/
|
||||
public FamilyDoctorTO changePrimaryHealthCareCenter(int professionalId, PrimaryHealthCareCenterTO newCenter) throws Exception {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, professionalId);
|
||||
if (fd == null) {
|
||||
throw new Exception("No se encuentra en la base de datos ningún médico de familia con id: " + String.valueOf(professionalId));
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.io.Serializable;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.primefaces.model.menu.DefaultMenuItem;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package managedbean.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ThemeService {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ThemeService implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String DEFAULT_THEME = "nova-light";
|
||||
public static final List<Theme> THEMES = new ArrayList<Theme>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
int i = 1;
|
||||
add(new Theme(i++, "afterdark", "afterdark"));
|
||||
|
||||
@@ -12,8 +12,6 @@ import org.primefaces.model.LazyDataModel;
|
||||
import org.primefaces.model.SortOrder;
|
||||
|
||||
import TO.QuestionTO;
|
||||
import common.Constants;
|
||||
import ejb.medicalTest.MedicalTestFacadeRemote;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
|
||||
@@ -50,4 +48,8 @@ public class PendingQuestionsMBean extends ManagedBeanBase implements Serializab
|
||||
public LazyDataModel<QuestionTO> getLazyDataModelQuestionList() {
|
||||
return lazyDataModelQuestionList;
|
||||
}
|
||||
|
||||
public void saveData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,12 +84,13 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
||||
int error = 0;
|
||||
|
||||
if (this.getNewFamilyDoctor() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado", "Por favor, especifique un nuevvo médico de familia.");
|
||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado",
|
||||
"Por favor, especifique un nuevvo médico de familia.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (this.getCurrentFamilyDoctor() != null && this.getNewFamilyDoctor().getId() == this.getCurrentFamilyDoctor().getId()) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
||||
"Por favor, seleccione un médico de familia diferente al que tiene actualmente asignado.");
|
||||
error++;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package managedbean.profile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -86,12 +85,12 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
||||
int error = 0;
|
||||
|
||||
if (this.getNewCenter() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un nuevvo centro de atención primaria.");
|
||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un nuevvo centro de atención primaria.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (this.getNewCenter().getName().equals(this.getCurrentCenter().getName())) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente", "Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente", "Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
||||
error++;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,11 +198,11 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
int error = 0;
|
||||
|
||||
if (this.isFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un centro de atención primaria.");
|
||||
this.addFacesMessage("frmRegisterUser:selPHC", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un centro de atención primaria.");
|
||||
error++;
|
||||
}
|
||||
if (this.isSpecialistDoctor() && this.medicalSpecialty == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||
this.addFacesMessage("frmRegisterUser:selMS", FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||
error++;
|
||||
}
|
||||
if (ValidationUtils.isValid(nif) == false) {
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package managedbean.systemAdmin;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.primefaces.PrimeFaces;
|
||||
|
||||
import TO.LoggedUserTO;
|
||||
import ejb.systemAdmin.SystemAdminFacadeRemote;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ import javax.faces.validator.ValidatorException;
|
||||
import org.primefaces.validate.ClientValidator;
|
||||
|
||||
@FacesValidator("emailValidator")
|
||||
public class EmailValidator implements Validator, ClientValidator {
|
||||
public class EmailValidator implements Validator<String>, ClientValidator {
|
||||
|
||||
private final static String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
|
||||
private final static Pattern EMAIL_COMPILED_PATTERN = Pattern.compile(EMAIL_PATTERN);
|
||||
|
||||
public void validate(FacesContext context, UIComponent comp, Object value) throws ValidatorException {
|
||||
public void validate(FacesContext context, UIComponent comp, String value) throws ValidatorException {
|
||||
String strValue = "";
|
||||
|
||||
if (value != null)
|
||||
|
||||
@@ -14,9 +14,9 @@ import org.primefaces.validate.ClientValidator;
|
||||
import managedbean.common.ValidationUtils;
|
||||
|
||||
@FacesValidator("nifValidator")
|
||||
public class NifValidator implements Validator, ClientValidator {
|
||||
public class NifValidator implements Validator<String>, ClientValidator {
|
||||
|
||||
public void validate(FacesContext context, UIComponent comp, Object value) throws ValidatorException {
|
||||
public void validate(FacesContext context, UIComponent comp, String value) throws ValidatorException {
|
||||
String strValue = "";
|
||||
|
||||
if (value != null)
|
||||
|
||||
Reference in New Issue
Block a user