Compare commits
1 Commits
rorden
...
unique_ind
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2da2a222e6 |
@@ -14,7 +14,7 @@ ci_build:
|
|||||||
script:
|
script:
|
||||||
- cd 1.sources/MyHealth
|
- cd 1.sources/MyHealth
|
||||||
- ant clean
|
- ant clean
|
||||||
- ant ear
|
- ant all
|
||||||
|
|
||||||
ci_test:
|
ci_test:
|
||||||
stage: test
|
stage: test
|
||||||
@@ -25,13 +25,10 @@ ci_test:
|
|||||||
deploy_pre:
|
deploy_pre:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- echo "Eliminamos archivo ear anterior..."
|
|
||||||
- rm -f $JBOSS_HOME/standalone/deployments/MyHealth.*
|
|
||||||
- echo "Despliegue al servidor de PRE"
|
- echo "Despliegue al servidor de PRE"
|
||||||
- cd 1.sources/MyHealth
|
- cd 1.sources/MyHealth
|
||||||
- ant deployear
|
- ant deployear
|
||||||
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
name: pre
|
name: pre
|
||||||
url: https://localhost:8080/MyHealth
|
url: https://localhost:8080/MyHealth
|
||||||
@@ -41,8 +38,6 @@ deploy_pre:
|
|||||||
deploy_pro:
|
deploy_pro:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- echo "Eliminamos archivo ear anterior..."
|
|
||||||
- rm -f $JBOSS_HOME/standalone/deployments/MyHealth.*
|
|
||||||
- echo "Despliegue al servidor de PRO"
|
- echo "Despliegue al servidor de PRO"
|
||||||
- cd 1.sources/MyHealth
|
- cd 1.sources/MyHealth
|
||||||
- ant deployear
|
- ant deployear
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 14.0 Runtime"/>
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 14.0 Runtime"/>
|
||||||
<classpathentry kind="lib" path="docroot/WEB-INF/lib/primefaces-7.0.jar" />
|
<classpathentry kind="lib" path="docroot/WEB-INF/lib/primefaces-7.0.jar" sourcepath="C:/Users/mark/.m2/repository/org/primefaces/primefaces/7.0/primefaces-7.0-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="docroot/WEB-INF/lib/omnifaces-3.4.1.jar" />
|
<classpathentry kind="lib" path="docroot/WEB-INF/lib/omnifaces-3.4.1.jar" sourcepath="C:/Users/mark/.m2/repository/org/omnifaces/omnifaces/3.4.1/omnifaces-3.4.1-sources.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<fileset dir="docroot/WEB-INF" flatten="false" inWorkspace="true" includes="**/*">
|
<fileset dir="docroot/WEB-INF" flatten="false" inWorkspace="true" includes="**/*">
|
||||||
<properties/>
|
<properties/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<folder name="classes/managedbean">
|
<folder name="classes\managedbean">
|
||||||
<fileset dir="bin/managedbean" flatten="false" inWorkspace="true" includes="**">
|
<fileset dir="bin/managedbean" flatten="false" inWorkspace="true" includes="**">
|
||||||
<properties/>
|
<properties/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.release=disabled
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=1.6
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
<property environment="env" />
|
<property environment="env" />
|
||||||
<property name="jboss.home" value="${env.JBOSS_HOME}" />
|
<property name="jboss.home" value="${env.JBOSS_HOME}" />
|
||||||
<property name="source" value="." />
|
<property name="source" value="." />
|
||||||
<property name="java.encoding" value="UTF-8" />
|
|
||||||
<property name="sourcesrc" value="${source}/src" />
|
<property name="sourcesrc" value="${source}/src" />
|
||||||
<property name="build" value="${source}/build" />
|
<property name="build" value="${source}/build" />
|
||||||
<property name="buildjar" value="${build}/jar" />
|
<property name="buildjar" value="${build}/jar" />
|
||||||
@@ -28,7 +27,7 @@
|
|||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<target name="all" depends="clean, init, deployear" />
|
<target name="all" depends="clean, init, ear" />
|
||||||
|
|
||||||
<target name="init" description="inicialitzacions is relevant: the structure created
|
<target name="init" description="inicialitzacions is relevant: the structure created
|
||||||
copy files and directories there. xml ">
|
copy files and directories there. xml ">
|
||||||
@@ -49,17 +48,7 @@
|
|||||||
<target name="compileEjb" depends="init">
|
<target name="compileEjb" depends="init">
|
||||||
<copy file="${sourcesrc}/META-INF/persistence.xml" todir="${buildjar}/META-INF" />
|
<copy file="${sourcesrc}/META-INF/persistence.xml" todir="${buildjar}/META-INF" />
|
||||||
<copy file="${sourcesrc}/log4j.properties" todir="${buildjar}" />
|
<copy file="${sourcesrc}/log4j.properties" todir="${buildjar}" />
|
||||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildjar}" includeantruntime="true" source="1.8" target="1.8">
|
<javac srcdir="${sourcesrc}" destdir="${buildjar}" includes="ejb/**/*.java, jpa/**/*.java, TO/**/*.java" classpathref="jboss.classpath" includeantruntime="true" />
|
||||||
<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>
|
</target>
|
||||||
|
|
||||||
<!-- Update the EJB jar file and create if not exist -->
|
<!-- Update the EJB jar file and create if not exist -->
|
||||||
@@ -72,21 +61,15 @@
|
|||||||
<copy todir="${buildwar}">
|
<copy todir="${buildwar}">
|
||||||
<fileset dir="${docroot}" />
|
<fileset dir="${docroot}" />
|
||||||
</copy>
|
</copy>
|
||||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includeantruntime="true" source="1.8" target="1.8">
|
<javac srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includes="managedbean/**/*.java" includeantruntime="true">
|
||||||
<classpath>
|
<classpath>
|
||||||
<path refid="jboss.classpath" />
|
<path refid="jboss.classpath" />
|
||||||
<path refid="lib.dir" />
|
<path refid="lib.dir" />
|
||||||
</classpath>
|
</classpath>
|
||||||
<include name="managedbean/**/*.java" />
|
|
||||||
<exclude name="ejb/**/*.java" />
|
|
||||||
<exclude name="jpa/**/*.java" />
|
|
||||||
<exclude name="TO/**/*.java" />
|
|
||||||
<exclude name="common/**/*.java" />
|
|
||||||
</javac>
|
</javac>
|
||||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/ejb" />
|
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/ejb" />
|
||||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/jpa" />
|
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/jpa" />
|
||||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/TO" />
|
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/TO" />
|
||||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/common" />
|
|
||||||
</target>
|
</target>
|
||||||
<!-- <war destfile="${build.dir}/CrunchifyRESTJerseyExample.war" webxml="WebContent/WEB-INF/web.xml"> -->
|
<!-- <war destfile="${build.dir}/CrunchifyRESTJerseyExample.war" webxml="WebContent/WEB-INF/web.xml"> -->
|
||||||
<!-- <classes dir="${build.dir}" /> -->
|
<!-- <classes dir="${build.dir}" /> -->
|
||||||
@@ -96,8 +79,7 @@
|
|||||||
|
|
||||||
<!-- Update the WAR file and create if not exist -->
|
<!-- Update the WAR file and create if not exist -->
|
||||||
<target name="deployWar" depends="compileWar">
|
<target name="deployWar" depends="compileWar">
|
||||||
<jar jarfile="${dist}/MyHealth.war" basedir="${buildwar}" excludes="/WEB-INF/classes/ejb/*.*, /WEB-INF/classes/jpa/*.*, /WEB-INF/classes/TO/*.*, /WEB-INF/classes/common/*.*"
|
<jar jarfile="${dist}/MyHealth.war" basedir="${buildwar}" excludes="/WEB-INF/classes/ejb/*.*, /WEB-INF/classes/jpa/*.*, /WEB-INF/classes/TO/*.*" update="yes" />
|
||||||
update="yes" />
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Update the application ear file and created if not exist -->
|
<!-- Update the application ear file and created if not exist -->
|
||||||
|
|||||||
@@ -2,7 +2,4 @@
|
|||||||
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd" version="2.3">
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd" version="2.3">
|
||||||
|
|
||||||
<factory>
|
|
||||||
<exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory>
|
|
||||||
</factory>
|
|
||||||
</faces-config>
|
</faces-config>
|
||||||
|
|||||||
@@ -18,14 +18,7 @@
|
|||||||
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
|
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
|
||||||
<param-value>true</param-value>
|
<param-value>true</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
<context-param>
|
|
||||||
<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
|
|
||||||
<param-value>true</param-value>
|
|
||||||
</context-param>
|
|
||||||
<context-param>
|
|
||||||
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
|
|
||||||
<param-value>client</param-value>
|
|
||||||
</context-param>
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
|
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
|
||||||
<param-value>.xhtml</param-value>
|
<param-value>.xhtml</param-value>
|
||||||
@@ -34,6 +27,8 @@
|
|||||||
<param-name>primefaces.FONT_AWESOME</param-name>
|
<param-name>primefaces.FONT_AWESOME</param-name>
|
||||||
<param-value>true</param-value>
|
<param-value>true</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>primefaces.THEME</param-name>
|
<param-name>primefaces.THEME</param-name>
|
||||||
<param-value>#{sessionPreferences.currentTheme}</param-value>
|
<param-value>#{sessionPreferences.currentTheme}</param-value>
|
||||||
@@ -47,59 +42,36 @@
|
|||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<!-- Map these files with JSF -->
|
<!-- Map these files with JSF -->
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>Faces Servlet</servlet-name>
|
||||||
|
<url-pattern>/faces/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>Faces Servlet</servlet-name>
|
||||||
|
<url-pattern>*.jsf</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>Faces Servlet</servlet-name>
|
||||||
|
<url-pattern>*.faces</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>Faces Servlet</servlet-name>
|
<servlet-name>Faces Servlet</servlet-name>
|
||||||
<url-pattern>*.xhtml</url-pattern>
|
<url-pattern>*.xhtml</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- Filters -->
|
|
||||||
<filter>
|
|
||||||
<filter-name>facesExceptionFilter</filter-name>
|
|
||||||
<filter-class>org.omnifaces.filter.FacesExceptionFilter</filter-class>
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<!-- Filter mappings -->
|
|
||||||
<filter-mapping>
|
|
||||||
<filter-name>facesExceptionFilter</filter-name>
|
|
||||||
<url-pattern>/*</url-pattern>
|
|
||||||
</filter-mapping>
|
|
||||||
|
|
||||||
<!-- Error pages mapping -->
|
|
||||||
<error-page>
|
|
||||||
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
|
|
||||||
<location>/error.xhtml?type=expired</location>
|
|
||||||
</error-page>
|
|
||||||
<error-page>
|
|
||||||
<exception-type>java.sql.SQLException</exception-type>
|
|
||||||
<exception-type>org.hibernate.exception.GenericJDBCException</exception-type>
|
|
||||||
<exception-type>java.net.ConnectException</exception-type>
|
|
||||||
<exception-type>javax.persistence.PersistenceException</exception-type>
|
|
||||||
<location>/error.xhtml?type=sql</location>
|
|
||||||
</error-page>
|
|
||||||
<error-page>
|
|
||||||
<exception-type>javax.persistence.PersistenceException</exception-type>
|
|
||||||
<location>/error.xhtml?type=runtime</location>
|
|
||||||
</error-page>
|
|
||||||
<error-page>
|
|
||||||
<exception-type>java.net.ConnectException</exception-type>
|
|
||||||
<location>/error.xhtml?type=sql</location>
|
|
||||||
</error-page>
|
|
||||||
<error-page>
|
<error-page>
|
||||||
<error-code>500</error-code>
|
<error-code>500</error-code>
|
||||||
<location>/error.xhtml</location>
|
<location>/error.xhtml</location>
|
||||||
</error-page>
|
</error-page>
|
||||||
<error-page>
|
|
||||||
<error-code>401</error-code>
|
|
||||||
<location>/error.xhtml?type=expired</location>
|
|
||||||
</error-page>
|
|
||||||
|
|
||||||
<session-config>
|
<session-config>
|
||||||
<session-timeout>30</session-timeout>
|
<session-timeout>30</session-timeout>
|
||||||
|
|
||||||
</session-config>
|
</session-config>
|
||||||
|
|
||||||
<!-- The Welcome File List -->
|
<!-- The Welcome File List -->
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
<welcome-file>/home.xhtml</welcome-file>
|
<welcome-file>home.xhtml</welcome-file>
|
||||||
</welcome-file-list>
|
</welcome-file-list>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
|
||||||
|
|
||||||
<ui:composition template="./header.xhtml">
|
<ui:composition template="./header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
@@ -10,36 +9,24 @@
|
|||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-2 ui-md-2" />
|
<div class="ui-g-2 ui-md-2" />
|
||||||
<div class="ui-g-8 ui-md-8">
|
<div class="ui-g-8 ui-md-8">
|
||||||
<p:panel id="ErrorPanel">
|
<p:panel id="ErrorPanel" header="Se ha producido un error inesperado">
|
||||||
<f:facet name="header">
|
|
||||||
<p:outputLabel rendered="#{param.type == 'sql'}" value="No se puede conectar con la base de datos" />
|
|
||||||
<p:outputLabel rendered="#{param.type == 'auth'}" value="Se ha producido un error de autorización" />
|
|
||||||
<p:outputLabel rendered="#{param.type == 'expired'}" value="Su sesión ha caducado" />
|
|
||||||
<p:outputLabel rendered="#{param.type == 'runtime'}" value="Se producido un error en tiempo de ejecución" />
|
|
||||||
<p:outputLabel rendered="#{param.type == '' or param.type == null}" value="Se ha producido un error desconocido" />
|
|
||||||
</f:facet>
|
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-12">
|
<div class="ui-g-12">La acción que estaba realizando a causado un error inesperado en el sistema. A continuación podrá ver un descripción detallada del error para que
|
||||||
<p:outputLabel rendered="#{param.type == 'sql'}"
|
pueda comunicarlo al equipo de soporte.</div>
|
||||||
value="No ha sido posible realizar una conexión con el servidor de base de datos subyante, o ha ocurrido un error grave cuando se intentaba realizar la conexión. Por favor contacte con el equipo de soporte." />
|
|
||||||
<p:outputLabel rendered="#{param.type == 'auth'}"
|
<div class="ui-g-12" style="font-weight: bold;">
|
||||||
value="No está autorizado a ver la url consultada. Por favor, vaya a la página principal y utilice el menú de la aplicación para acceder las funcionalidades disponibles." />
|
Descripción del error
|
||||||
<p:outputLabel rendered="#{param.type == 'expired'}" value="Su sesión ha caducado. Por favor, incie sesión de nuevo en el sistema." />
|
|
||||||
<p:outputLabel rendered="#{param.type == 'runtime'}"
|
|
||||||
value="Se ha producido un error en el servidor durante la ejecución de la última acción. Por favor, intentelo de nuevo o contacte con el equipo de soporte." />
|
|
||||||
<p:outputLabel rendered="#{param.type == '' or param.type == null}"
|
|
||||||
value="La acción que estaba realizando a causado un error inesperado en el sistema. A continuación podrá ver un descripción detallada del error para que pueda comunicarlo al equipo de soporte." />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-12">
|
<div class="ui-g-12">
|
||||||
<p:messages id="errorMessage" showDetail="true" closable="false" autoupdate="true" showSummary="true" showIcon="true" />
|
<h:messages fatalClass="ErrorMessage" showDetail="true" showSummary="true" globalOnly="true" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-4" />
|
<div class="ui-g-5" />
|
||||||
<div class="ui-g-4">
|
<div class="ui-g-2">
|
||||||
<p:button value="Ir a la página principal" outcome="home" icon="pi pi-home" />
|
<p:button value="Ir a la página principal" outcome="home" icon="pi pi-home" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4" />
|
<div class="ui-g-5" />
|
||||||
</div>
|
</div>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,35 +2,45 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<h:head>
|
<h:head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
<title>MyHealth Online Services</title>
|
<title>MyHealth Online Services</title>
|
||||||
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
|
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
|
||||||
<h:outputStylesheet library="css" name="estilos.css" />
|
<h:outputStylesheet library="css" name="estilos.css" />
|
||||||
<h:outputScript library="js" name="common.js" />
|
|
||||||
</h:head>
|
</h:head>
|
||||||
<h:outputScript>
|
<h:outputScript>
|
||||||
// Si hay un error AJAX, lo más probable es que la sesión expirase, vamos a la página de error
|
function handleLoginRequest(xhr, status, args) {
|
||||||
function onAjaxError() {
|
if(args.validationFailed || !args.loggedIn) {
|
||||||
window.location.href = "#{request.contextPath}/error.xhtml?type=expired";
|
PF('dlgLogin').jq.effect("shake", {times:5}, 100);
|
||||||
|
//PF('Login').attr("disabled", false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
PF('dlgLogin').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function startLogin() {
|
||||||
|
//PF('Login').attr("disabled", true);
|
||||||
}
|
}
|
||||||
</h:outputScript>
|
</h:outputScript>
|
||||||
<h:body>
|
<h:body>
|
||||||
<p:growl id="messages" globalOnly="true" sticky="false" showDetail="true" life="15000" />
|
|
||||||
<div id="layout">
|
<div id="layout">
|
||||||
<div id="top" class="top">
|
<div id="top" class="top">
|
||||||
<h:graphicImage library="images" name="logo-small.png" height="116" alt="MyHealth by Grupo 2"/>
|
<!-- <h1 class="Titulo">myHealth Site</h1> -->
|
||||||
|
<h:graphicImage library="images" name="logo-small.png" />
|
||||||
</div>
|
</div>
|
||||||
<div id="menuDiv" style="margin-bottom: 10px;">
|
<hr />
|
||||||
<p:ajaxStatus style="width:32px; height:32px; position:fixed; right:48px; bottom:48px" onerror="onAjaxError()">
|
<div id="menuDiv">
|
||||||
|
<p:growl id="messages" sticky="false" showDetail="true" life="15000" />
|
||||||
|
<p:ajaxStatus style="width:32px; height:32px; position:fixed; right:32px; bottom:32px">
|
||||||
<f:facet name="start">
|
<f:facet name="start">
|
||||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em" />
|
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em"></i>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
|
|
||||||
<f:facet name="error">
|
<f:facet name="complete">
|
||||||
<i class="pi pi-exclamation-triangle" style="font-size: 3em" />
|
<h:outputText value="" />
|
||||||
</f:facet>
|
</f:facet>
|
||||||
</p:ajaxStatus>
|
</p:ajaxStatus>
|
||||||
|
|
||||||
@@ -39,15 +49,15 @@
|
|||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-12">
|
<div class="ui-g-12">
|
||||||
<h:outputLabel for="username" value="Usuario:" />
|
<h:outputLabel for="username" value="Usuario:" />
|
||||||
<p:inputText id="username" value="#{loginView.username}" placeholder="Escriba su código CIP o NP" />
|
<p:inputText id="username" value="#{loginView.username}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-12">
|
<div class="ui-g-12">
|
||||||
|
|
||||||
<h:outputLabel for="password" value="Contraseña:" />
|
<h:outputLabel for="password" value="Contraseña:" />
|
||||||
<p:password id="password" value="#{loginView.password}" placeholder="Contraseña" />
|
<p:password id="password" value="#{loginView.password}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6">
|
<div class="ui-g-6">
|
||||||
<p:commandButton widgetVar="btnLogin" value="Login" update="messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
<p:commandButton value="Login" update="frmMenu, messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
||||||
oncomplete="handleLoginRequest(xhr, status, args)" />
|
oncomplete="handleLoginRequest(xhr, status, args)" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6">
|
<div class="ui-g-6">
|
||||||
@@ -60,7 +70,7 @@
|
|||||||
<p:menubar model="#{menuView.model}">
|
<p:menubar model="#{menuView.model}">
|
||||||
<f:facet name="options">
|
<f:facet name="options">
|
||||||
<ui:fragment rendered="#{home.logedIn}">
|
<ui:fragment rendered="#{home.logedIn}">
|
||||||
<h:outputText value="Bienvenido, #{home.userDisplayName} (#{home.userType}) " />
|
<h:outputText value="logeado como #{home.userName} (#{home.userType}) " />
|
||||||
<p:commandButton value="Logout" icon="pi pi-sign-out" action="#{loginView.logout}" />
|
<p:commandButton value="Logout" icon="pi pi-sign-out" action="#{loginView.logout}" />
|
||||||
</ui:fragment>
|
</ui:fragment>
|
||||||
<ui:fragment rendered="#{not home.logedIn}">
|
<ui:fragment rendered="#{not home.logedIn}">
|
||||||
|
|||||||
@@ -2,30 +2,44 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
<f:metadata>
|
||||||
|
<f:viewParam name="refresh" value="#{home.refresh}" />
|
||||||
|
</f:metadata>
|
||||||
|
|
||||||
<ui:composition template="./header.xhtml">
|
<ui:composition template="./header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form>
|
<h:form>
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
<p:panel header="Pagina principal">
|
<p:panel header="Pagina principal">
|
||||||
<div class="ui-g ui-fluid">
|
<p:panelGrid>
|
||||||
<div class="ui-g-12 ui-md-12">
|
|
||||||
Logeado como: <h:outputLabel value="#{home.userDisplayName}" style="font-weight: bold;" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:outputLabel for="selectorTema" value="Cambio de tema" />
|
<p:outputLabel for="selectorTema" value="Cambio de tema" />
|
||||||
</div>
|
<p:themeSwitcher id="selectorTema" style="width:165px" value="#{sessionPreferences.currentTheme}">
|
||||||
<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:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
|
||||||
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
|
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
|
||||||
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
|
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
|
||||||
</p:themeSwitcher>
|
</p:themeSwitcher>
|
||||||
</div>
|
</p:panelGrid>
|
||||||
<div class="ui-g-2 ui-md-2">
|
<h:panelGrid columns="2">
|
||||||
<p:commandButton value="Usar tema" update="messages" action="#{sessionPreferences.updateCurrentTheme}" icon="pi pi-save" />
|
<h:outputLabel value="Fecha" />
|
||||||
</div>
|
<p:calendar pattern="dd/MM/yyyy" />
|
||||||
<div class="ui-g-5 ui-md-5" />
|
<h:outputLabel value="Rich Text Editor" />
|
||||||
</div>
|
<p:editor />
|
||||||
|
</h:panelGrid>
|
||||||
|
<h:panelGroup>
|
||||||
|
<h:panelGrid columns="2">
|
||||||
|
<h:outputLabel value="Logeado como:" />
|
||||||
|
<p:inputText readonly="true" value="#{home.userName}" />
|
||||||
|
</h:panelGrid>
|
||||||
|
</h:panelGroup>
|
||||||
|
</p:panel>
|
||||||
|
<p:panel>
|
||||||
|
<h:panelGroup>
|
||||||
|
<h:panelGrid columns="1">
|
||||||
|
<p:commandButton value="Usar tema en este sesión" update="mesgs" action="#{sessionPreferences.updateCurrentTheme}" icon="pi pi-save" />
|
||||||
|
</h:panelGrid>
|
||||||
|
</h:panelGroup>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
</h:form>
|
</h:form>
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|||||||
@@ -2,7 +2,24 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.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:composition template="./header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form>
|
<h:form>
|
||||||
|
|||||||
@@ -2,188 +2,58 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
|
<h:form id="TestForm">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
<p:panel id="PanelUnderConstruction" header="Pagina en construcción de Pruebas médicas">
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-5 ui-md-5">
|
|
||||||
<h:form id="frmMT">
|
|
||||||
<p:panel id="mainPanel" header="Pruebas médicas">
|
|
||||||
<f:facet name="actions">
|
|
||||||
<h:commandLink rendered="#{mt.specialistDoctor}" action="#{mt.addMT}" update="frmMT,frmNEW" styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default">
|
|
||||||
<h:outputText styleClass="ui-icon pi pi-plus" />
|
|
||||||
</h:commandLink>
|
|
||||||
<h:commandLink rendered="#{mt.patSelector}" action="#{mt.clearFilteredPatient}" immediate="true" update="frmMT,frmNEW"
|
|
||||||
styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default">
|
|
||||||
<h:outputText styleClass="ui-icon pi pi-refresh" title="Quitar filtro y ver todos los registros" />
|
|
||||||
</h:commandLink>
|
|
||||||
</f:facet>
|
|
||||||
<p:autoComplete rendered="#{mt.patSelector}" id="filterPatient" widgetVar="filterPatient" dropdown="true" value="#{mt.patientFilterSelected}"
|
|
||||||
completeMethod="#{mt.completePatientFilter}" var="p" itemLabel="#{p.displayName}" itemValue="#{p}" forceSelection="true"
|
|
||||||
placeholder="Seleccione un paciente o teclee para buscar...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{mt.patientWithTestList}" />
|
|
||||||
<f:selectItem itemLabel="Ver todos" itemValue="">
|
|
||||||
<p:column headerText="Num. Prof.">
|
|
||||||
<h:outputText value="Ver todos" />
|
|
||||||
</p:column>
|
|
||||||
</f:selectItem>
|
|
||||||
<p:column headerText="Num. Prof.">
|
|
||||||
<h:outputText value="#{p.personalIdentificationCode}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Nombre">
|
|
||||||
<h:outputText value="#{p.name}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Apellidos">
|
|
||||||
<h:outputText value="#{p.surname}" />
|
|
||||||
</p:column>
|
|
||||||
<p:ajax event="itemSelect" listener="#{mt.onSelectPatient}" update="medicalTestList" />
|
|
||||||
<p:ajax event="change" listener="#{mt.onChangePatient}" update="medicalTestList" />
|
|
||||||
</p:autoComplete>
|
|
||||||
|
|
||||||
<p:orderList id="medicalTestList" value="#{mt.medicalTests}" var="el" itemValue="#{el}" controlsLocation="none" responsive="true">
|
|
||||||
<p:ajax event="select" listener="#{mt.onSelectMT}" update="frmNEW,frmImage" />
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{mt.medicalTests}" />
|
|
||||||
<p:column>
|
|
||||||
<h:outputText value="#{el.date}">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
</h:outputText>
|
|
||||||
- <h:outputText value="#{el.type.testTypeName}" />
|
|
||||||
<br />
|
|
||||||
<h:outputText rendered="#{mt.patientFilterSelected == null}" value="#{el.patient.displayName}" style="font-size: 0.8em !important; font-style: italic;" />
|
|
||||||
</p:column>
|
|
||||||
</p:orderList>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-7 ui-md-7">
|
|
||||||
<h:form id="frmImage" enctype="multipart/form-data">
|
|
||||||
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
|
|
||||||
<p:commandButton value="Sí" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check" />
|
|
||||||
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times" />
|
|
||||||
</p:confirmDialog>
|
|
||||||
|
|
||||||
<p:panel rendered="#{mt.viewEdit}" id="detailPanel" header="Detalle de prueba médica">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-3">Fecha:</div>
|
|
||||||
<div class="ui-g-9">
|
|
||||||
<h:outputText value="#{mt.selected.date}">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" timeStyle="short" />
|
|
||||||
</h:outputText>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-3">Hora:</div>
|
|
||||||
<div class="ui-g-9">
|
|
||||||
<h:outputText value="#{mt.selected.time}" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-3">Observaciones:</div>
|
|
||||||
<div class="ui-g-9">
|
|
||||||
<h:outputText escape="false" value="#{mt.selected.observations}" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-3">Tipo de prueba:</div>
|
|
||||||
<div class="ui-g-9">
|
|
||||||
<h:outputText value="#{mt.selected.type.testTypeName}" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<p:outputPanel rendered="#{mt.selected.type != 'BLOOD_TEST'}">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-3">Imagen de alta resolución:</div>
|
|
||||||
<div class="ui-g-5">
|
|
||||||
<p:fileUpload rendered="#{mt.specialistDoctor}" value="#{mt.imageUpload}" mode="simple" skinSimple="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:commandButton rendered="#{mt.specialistDoctor}" value="Subir" icon="pi pi-upload" ajax="false" action="#{mt.addImage}" update="frmImage" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:commandButton rendered="#{mt.specialistDoctor}" value="Eliminar" icon="pi pi-trash" action="#{mt.removeImage}" disabled="#{mt.selected.highresimage == null}"
|
|
||||||
update="frmImage">
|
|
||||||
<p:confirm header="Confirme la eliminación" message="¿Está seguro de que desea eliminar la imagen?" icon="pi pi-exclamation-triangle" />
|
|
||||||
</p:commandButton>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-12 ui-md-12" style="align-content: center; text-align: center;">
|
|
||||||
<img src="#{mt.selected.highresimage}" style="max-width: 300px !important;" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:outputPanel>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
<h:form id="frmNEW">
|
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
|
|
||||||
<p:panel rendered="#{mt.viewCreate}" id="createPanel" header="Añadir una nueva prueba médica">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-2">Paciente:</div>
|
|
||||||
<div class="ui-g-10">
|
|
||||||
<p:autoComplete id="addTestPatient" dropdown="true" value="#{mt.patSelected}" completeMethod="#{mt.completePatient}" var="p" itemLabel="#{p.displayName}" itemValue="#{p}"
|
|
||||||
forceSelection="true" placeholder="Seleccione un paciente o teclee para buscar..." required="true"
|
|
||||||
requiredMessage="Por favor, seleccione un paciente al cual aádir la prueba.">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{mt.patientList}" />
|
|
||||||
<p:column headerText="Num. Prof.">
|
|
||||||
<h:outputText value="#{p.personalIdentificationCode}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Nombre">
|
|
||||||
<h:outputText value="#{p.name}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Apellidos">
|
|
||||||
<h:outputText value="#{p.surname}" />
|
|
||||||
</p:column>
|
|
||||||
</p:autoComplete>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">Fecha:</div>
|
|
||||||
<div class="ui-g-3">
|
|
||||||
<p:datePicker id="fecha" value="#{mt.testDate}" pattern="dd/MM/yyyy" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la fecha de la prueba médica">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" timeStyle="short" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1" />
|
|
||||||
<div class="ui-g-6">
|
|
||||||
<p:message for="fecha" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">Hora:</div>
|
|
||||||
<div class="ui-g-3">
|
|
||||||
<p:datePicker id="hora" value="#{mt.testTime}" timeOnly="true" pattern="HH:mm" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la hora de la prueba médica">
|
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1" />
|
|
||||||
<div class="ui-g-6">
|
|
||||||
<p:message for="hora" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">Observaciones:</div>
|
|
||||||
<div class="ui-g-10">
|
|
||||||
<p:textEditor value="#{mt.testObservations}" required="true" requiredMessage="Debe indicar las observaciones de la prueba" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">Tipo de prueba:</div>
|
|
||||||
<div class="ui-g-5">
|
|
||||||
<p:selectOneMenu id="selUsertype" value="#{mt.testType}" required="true" unselectable="false" requiredMessage="Debe especificar un tipo de prueba médica">
|
|
||||||
<f:selectItems value="#{mt.medicalTestTypes}" var="item" itemLabel="#{item.testTypeName}" />
|
|
||||||
</p:selectOneMenu>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1" />
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<p:message for="selUsertype" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:commandButton value="Guardar" action="#{mt.save}" icon="pi pi-save" update="frmMT,frmImage,frmNEW" />
|
<p:outputLabel for="campo" value="Etiqueta para campo de formulario:" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo" value="Valor del campo del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:message for="campo" display="text" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:outputLabel for="campo2" value="Etiqueta para campo 2 de formulario:" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo2" value="Valor del campo 2 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:message for="campo" display="text" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:outputLabel for="campo3" value="Etiqueta para campo 3 de formulario:" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo3" value="Valor del campo 3 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:message for="campo" display="text" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
</h:form>
|
</h:form>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ui:define>
|
</ui:define>
|
||||||
</ui:composition>
|
</ui:composition>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="frmQuestions">
|
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
|
|
||||||
<p:panel id="panelQuestions" header="Preguntas">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<p:panel id="panelQuestionList" header="">
|
|
||||||
<f:facet name="header">
|
|
||||||
<h:outputText rendered="#{Questions.patient}" value="Lista de preguntas realizadas" />
|
|
||||||
<h:outputText rendered="#{Questions.familyDoctor}" value="Lista de preguntas pendientes" />
|
|
||||||
</f:facet>
|
|
||||||
<f:facet name="actions">
|
|
||||||
<h:commandLink action="#{Questions.init}" immediate="true" update="frmQuestions" styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default">
|
|
||||||
<h:outputText styleClass="ui-icon pi pi-refresh" />
|
|
||||||
</h:commandLink>
|
|
||||||
<h:commandLink rendered="#{Questions.patient}" action="#{Questions.create}" update="questionDetail" styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default">
|
|
||||||
<h:outputText styleClass="ui-icon pi pi-plus" />
|
|
||||||
</h:commandLink>
|
|
||||||
</f:facet>
|
|
||||||
<p:orderList value="#{Questions.pendingQuestions}" var="pq" controlsLocation="none" itemValue="#{pq}" responsive="true">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{Questions.pendingQuestions}" />
|
|
||||||
<p:ajax event="select" listener="#{Questions.onSelect}" update="questionDetail" />
|
|
||||||
<p:ajax event="unselect" listener="#{Questions.onUnSelect}" update="questionDetail" />
|
|
||||||
<p:column>
|
|
||||||
<h:graphicImage name="images/#{pq.status}.png" alt="#{pq.status}" styleClass="ui-theme" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Título">
|
|
||||||
<h:outputText value="#{pq.title}" />
|
|
||||||
</p:column>
|
|
||||||
</p:orderList>
|
|
||||||
</p:panel>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:outputPanel id="questionDetail">
|
|
||||||
<p:panel id="panelAddQuestion" rendered="#{Questions.addNewMode}" header="Añadir nueva pregunta">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<h3>Título:</h3>
|
|
||||||
<p:inputText value="#{Questions.selected.title}" required="true" requiredMessage="Es necesario especificar el título de la pregunta" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<h3>Pregunta:</h3>
|
|
||||||
<p:textEditor value="#{Questions.selected.message}" required="true" requiredMessage="Es necesario especificar el texto de la pregunta" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4" />
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<p:commandButton value="Preguntar" action="#{Questions.addNewQuestion}" update="frmQuestions" icon="pi pi-save" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4" />
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
<p:panel id="panelDetail" rendered="#{Questions.showPanelDetail}" header="Pregunta de #{Questions.selected.patient.displayName}">
|
|
||||||
<!-- Responder pregunta -->
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<h3>Título:</h3>
|
|
||||||
<p:inputText value="#{Questions.selected.title}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<h3>Pregunta:</h3>
|
|
||||||
<p:textEditor value="#{Questions.selected.message}" toolbarVisible="false" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<h3>Respuesta:</h3>
|
|
||||||
<p:textEditor value="#{Questions.selected.response}" toolbarVisible="#{Questions.respuestaEditable}" readonly="#{not Questions.respuestaEditable}" required="true"
|
|
||||||
requiredMessage="Es necesario especificar una respuesta." />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4" />
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<p:commandButton value="Responder" rendered="#{Questions.respuestaEditable}" action="#{Questions.save}" update="frmQuestions" icon="pi pi-save" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4" />
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</p:outputPanel>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="TestForm">
|
|
||||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="frmSSbD" header="Búsqueda de médicos especialista por especialidad">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:outputLabel for="selMS" value="Especialidad:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-6 ui-md-6">
|
|
||||||
<p:autoComplete id="selMS" dropdown="true" required="true" value="#{sspec.medicalSpeciality}" completeMethod="#{sspec.completeMedicalSpeciality}" var="ms"
|
|
||||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" requiredMessage="Por favor, selecciona una especialidad médica"
|
|
||||||
placeholder="Seleccione una especialidad médica o teclee para buscar...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.medicalSpecialtiesList}" />
|
|
||||||
<p:ajax event="itemSelect" update="dtDoctorList" onstart="PF('dtDoctorList').getPaginator().setPage(0);" />
|
|
||||||
<p:column headerText="Nombre">
|
|
||||||
<h:outputText value="#{ms.name}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Descripción">
|
|
||||||
<h:outputText value="#{ms.description}" />
|
|
||||||
</p:column>
|
|
||||||
</p:autoComplete>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<p:dataTable id="dtDoctorList" widgetVar="dtDoctorList" var="d" value="#{sspec.lazyDataModelDoctorList}" lazy="true" paginator="true" rows="10" paginatorPosition="bottom"
|
|
||||||
paginatorAlwaysVisible="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
|
|
||||||
rowsPerPageTemplate="10,20,30,40" emptyMessage="No existe ningún especialista para la especialidad seleccionada.">
|
|
||||||
|
|
||||||
<p:column headerText="Núm. Profesional" width="90">
|
|
||||||
<h:outputText value="#{d.professionalNumber}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Nombre" width="150">
|
|
||||||
<h:outputText value="#{d.name}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Apellidos" width="auto">
|
|
||||||
<h:outputText value="#{d.surname}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Correo electrónico" width="auto">
|
|
||||||
<h:outputText value="#{d.email}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<f:facet name="paginatorBottomLeft">
|
|
||||||
<p:commandButton type="button" icon="pi pi-refresh" onclick="PF('dtDoctorList').getPaginator().setPage(0);" />
|
|
||||||
</f:facet>
|
|
||||||
</p:dataTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
51
1.sources/MyHealth/docroot/menubar.xhtml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<h:form>
|
||||||
|
<p:growl id="messages" />
|
||||||
|
|
||||||
|
<p:menubar>
|
||||||
|
<p:submenu label="File" icon="pi pi-file">
|
||||||
|
<p:submenu label="New" icon="pi pi-briefcase">
|
||||||
|
<p:menuitem value="Project" url="#" />
|
||||||
|
<p:menuitem value="Other" url="#" />
|
||||||
|
</p:submenu>
|
||||||
|
<p:menuitem value="Open" url="#" />
|
||||||
|
<p:separator />
|
||||||
|
<p:menuitem value="Quit" url="#" />
|
||||||
|
</p:submenu>
|
||||||
|
|
||||||
|
<p:submenu label="Edit" icon="pi pi-pencil">
|
||||||
|
<p:menuitem value="Undo" url="#" icon="pi pi-angle-double-left" />
|
||||||
|
<p:menuitem value="Redo" url="#" icon="pi pi-angle-double-right" />
|
||||||
|
</p:submenu>
|
||||||
|
|
||||||
|
<p:submenu label="Help" icon="pi pi-question">
|
||||||
|
<p:menuitem value="Contents" url="#" />
|
||||||
|
<p:submenu label="Search" icon="pi pi-search">
|
||||||
|
<p:submenu label="Text">
|
||||||
|
<p:menuitem value="Workspace" url="#" />
|
||||||
|
</p:submenu>
|
||||||
|
<p:menuitem value="File" url="#" />
|
||||||
|
</p:submenu>
|
||||||
|
</p:submenu>
|
||||||
|
|
||||||
|
<p:submenu label="Actions" icon="pi pi-cog">
|
||||||
|
<p:submenu label="Ajax" icon="pi pi-refresh">
|
||||||
|
<p:menuitem value="Save" action="#{menuView.save}" icon="pi pi-save"
|
||||||
|
update="messages" />
|
||||||
|
<p:menuitem value="Update" action="#{menuView.update}"
|
||||||
|
icon="pi pi-refresh" update="messages" />
|
||||||
|
</p:submenu>
|
||||||
|
<p:submenu label="Non-Ajax" icon="pi pi-clone">
|
||||||
|
<p:menuitem value="Delete" action="#{menuView.delete}"
|
||||||
|
icon="pi pi-times" update="messages" ajax="false" />
|
||||||
|
</p:submenu>
|
||||||
|
</p:submenu>
|
||||||
|
|
||||||
|
<p:menuitem value="Quit" url="http://www.primefaces.org"
|
||||||
|
icon="pi pi-times" />
|
||||||
|
|
||||||
|
<f:facet name="options">
|
||||||
|
<p:inputText style="margin:1px 10px 1px 1px;" placeholder="Search" />
|
||||||
|
<p:commandButton type="button" value="Logout" icon="pi pi-home" />
|
||||||
|
</f:facet>
|
||||||
|
</p:menubar>
|
||||||
|
</h:form>
|
||||||
39
1.sources/MyHealth/docroot/profile/AddFamilyDoctor.xhtml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Añadir un nuevo médico de familia">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
38
1.sources/MyHealth/docroot/profile/AddPatient.xhtml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Añadir un nuevo paciente">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
37
1.sources/MyHealth/docroot/profile/AddSpecialistDoctor.xhtml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Añadir un nuevo médico especialista">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define> </ui:composition>
|
||||||
|
</html>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="frmChangeFD">
|
<h:form id="frmChangeFD">
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
<p:panel id="badProfile" rendered="#{not home.patient}">
|
<p:panel id="badProfile" rendered="#{not home.patient}">
|
||||||
<div class="ui-g-3 ui-md-3" />
|
<div class="ui-g-3 ui-md-3" />
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
@@ -31,24 +31,23 @@
|
|||||||
<p:panel id="PanelPHC" header="Cambiar médico de familia asignado" rendered="#{home.patient}">
|
<p:panel id="PanelPHC" header="Cambiar médico de familia asignado" rendered="#{home.patient}">
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel value="Médico de familia actualmente asignado:" />
|
<p:outputLabel value="Médico de familia actualmente asignado:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeFD.currentFamilyDoctor.displayName}" />
|
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeFD.currentFamilyDoctor.displayName}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel value="Nuevo médico de familia:" for="newFamilyDocAC" />
|
<p:outputLabel value="Nuevo médico de familia:" for="newFamilyDocAC" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="newFamilyDocAC" dropdown="true" required="true" value="#{ChangeFD.newFamilyDoctor}" completeMethod="#{ChangeFD.completeFamilyDoctor}" var="fd"
|
<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"
|
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...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{ChangeFD.familyDoctorList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{ChangeFD.familyDoctorList}" />
|
||||||
<p:column headerText="Num. Prof.">
|
<p:column headerText="Num. Prof.">
|
||||||
<h:outputText value="#{fd.professionalNumber}" />
|
<h:outputText value="#{fd.id}" />
|
||||||
</p:column>
|
</p:column>
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre">
|
||||||
<h:outputText value="#{fd.name}" />
|
<h:outputText value="#{fd.name}" />
|
||||||
@@ -58,7 +57,7 @@
|
|||||||
</p:column>
|
</p:column>
|
||||||
</p:autoComplete>
|
</p:autoComplete>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:message for="newFamilyDocAC" />
|
<p:message for="newFamilyDocAC" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -73,6 +72,7 @@
|
|||||||
<div class="ui-g-4 ui-md-4" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</p:panel>
|
</p:panel>
|
||||||
</h:form>
|
</h:form>
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="frmChangePHCC">
|
<h:form id="frmChangePHCC">
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
<p:panel id="badProfile" rendered="#{not home.familyDoctor}">
|
<p:panel id="badProfile" rendered="#{not home.familyDoctor}">
|
||||||
<div class="ui-g-3 ui-md-3" />
|
<div class="ui-g-3 ui-md-3" />
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
@@ -31,31 +31,26 @@
|
|||||||
<p:panel id="PanelPHC" header="Cambiar centro de antención primaria asignado" rendered="#{home.familyDoctor}">
|
<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 ui-fluid">
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel value="Centro de antención primaria actual:" />
|
<p:outputLabel value="Centro de antención primaria actualmente asignado:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeCAP.currentCenter.displayName}" />
|
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeCAP.currentCenter.displayName}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel value="Nuevo centro de atención primaria:" for="newCenter" />
|
<p:outputLabel value="Nuevo centro de atención primaria:" for="newCenter" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="newCenter" dropdown="true" required="true" value="#{ChangeCAP.newCenter}" completeMethod="#{ChangeCAP.completePrimaryHealCareCenter}" var="phc"
|
<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"
|
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...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{ChangeCAP.phcList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{ChangeCAP.phcList}" />
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre"><h:outputText value="#{phc.name}" /></p:column>
|
||||||
<h:outputText value="#{phc.name}" />
|
<p:column headerText="Localización"><h:outputText value="#{phc.location}" /></p:column>
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Localización">
|
|
||||||
<h:outputText value="#{phc.location}" />
|
|
||||||
</p:column>
|
|
||||||
</p:autoComplete>
|
</p:autoComplete>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:message for="newCenter" />
|
<p:message for="newCenter" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="ui-g-6">
|
<div class="ui-g-6">
|
||||||
<p:button value="Ir a la página principal" outcome="/home" icon="pi pi-home" />
|
<p:button value="Ir a la página principal" outcome="/home" icon="pi pi-home" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-3" />
|
<div class="ui-g-3"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</p:panel>
|
</p:panel>
|
||||||
@@ -44,18 +44,36 @@
|
|||||||
</h:form>
|
</h:form>
|
||||||
|
|
||||||
<h:form id="frmRegisterUser" rendered="#{not RegisterUser.registered}">
|
<h:form id="frmRegisterUser" rendered="#{not RegisterUser.registered}">
|
||||||
<p:growl id="mesgs" globalOnly="true" showDetail="true" closable="true" autoupdate="true" />
|
<h:outputScript>
|
||||||
|
function handleRequest(xhr, status, args) {
|
||||||
|
/*
|
||||||
|
if(args.specs) {
|
||||||
|
$('#panCentros').slideUp();
|
||||||
|
$('#panEspecialidades').slideDown();
|
||||||
|
}
|
||||||
|
else if (args.caps) {
|
||||||
|
$('#panEspecialidades').slideUp();
|
||||||
|
$('#panCentros').slideDown();
|
||||||
|
} else if (args.pats) {
|
||||||
|
$('#panCentros').slideUp();
|
||||||
|
$('#panEspecialidades').slideUp();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
</h:outputScript>
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
<p:panel id="tipoUsuario" header="Especifique el tipo de usuario que desea registrarse">
|
<p:panel id="tipoUsuario" header="Especifique el tipo de usuario que desea registrarse">
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:outputLabel value="Tipo de usuario:" for="selUsertype" />
|
<p:outputLabel value="Tipo de usuario:" for="selUsertype" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-10 ui-md-10">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:selectOneButton id="selUsertype" value="#{RegisterUser.userType}" required="true" unselectable="false" requiredMessage="Debe especificar un tipo de usuario">
|
<p:selectOneButton id="selUsertype" value="#{RegisterUser.userType}" required="true" unselectable="false" requiredMessage="Debe especificar un tipo de usuario">
|
||||||
<f:selectItems value="#{RegisterUser.availableUserTypes}" var="item" itemLabel="#{item.userTypename}" />
|
<f:selectItems value="#{RegisterUser.availableUserTypes}" var="item" itemLabel="#{item.userTypename}" />
|
||||||
<p:ajax listener="#{RegisterUser.onUserTypeChange}" update="panCombos" />
|
<p:ajax listener="#{RegisterUser.onUserTypeChange}" update="panCombos" oncomplete="handleRequest(xhr, status, args)" />
|
||||||
</p:selectOneButton>
|
</p:selectOneButton>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4" />
|
||||||
</div>
|
</div>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
<br />
|
<br />
|
||||||
@@ -65,15 +83,10 @@
|
|||||||
<p:outputLabel value="NIF:" for="nif" />
|
<p:outputLabel value="NIF:" for="nif" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<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:inputText id="nif" widgetVar="nif" value="#{RegisterUser.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
|
||||||
<p:ajax event="blur" update="nifmsg" listener="#{RegisterUser.handleNIFValueChange}" oncomplete="handleNIFResponse(xhr, status, args)" />
|
|
||||||
</p:inputText>
|
|
||||||
<p:commandButton widgetVar="nifButton" icon="pi pi-times" styleClass="red-button" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:message id="nifmsg" for="nif" />
|
<p:message for="nif" display="text" showDetail="true" showSummary="true" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
@@ -101,12 +114,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:inputText id="email" value="#{RegisterUser.email}" required="true" maxlength="120" validator="emailValidator"
|
<p:inputText id="email" value="#{RegisterUser.email}" required="true" maxlength="120" validator="emailValidator"
|
||||||
validatorMessage="La dirección de correo electrónico #{RegisterUser.email} no es válida" requiredMessage="Por favor, especifique su correo electrónico">
|
validatorMessage="La dirección #{RegisterUser.email} no es válida" requiredMessage="Por favor, especifique su correo electrónico">
|
||||||
<f:validateRegex pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" />
|
<f:validateRegex pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" />
|
||||||
</p:inputText>
|
</p:inputText>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:message for="email" />
|
<p:message for="email" display="text" showDetail="true" showSummary="true" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:outputLabel value="Contraseña" for="password" />
|
<p:outputLabel value="Contraseña" for="password" />
|
||||||
@@ -135,9 +148,8 @@
|
|||||||
<p:outputLabel value="Centro:" for="selPHC" />
|
<p:outputLabel value="Centro:" for="selPHC" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="selPHC" dropdown="true" required="true" value="#{RegisterUser.primaryHealthCareCenter}" completeMethod="#{RegisterUser.completePrimaryHealCareCenter}"
|
<p:autoComplete id="selPHC" dropdown="true" value="#{RegisterUser.primaryHealthCareCenter}" completeMethod="#{RegisterUser.completePrimaryHealCareCenter}" var="phc"
|
||||||
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" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||||
placeholder="Seleccione una CAP o teclee para buscar...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.phcList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.phcList}" />
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre">
|
||||||
<h:outputText value="#{phc.name}" />
|
<h:outputText value="#{phc.name}" />
|
||||||
@@ -157,9 +169,8 @@
|
|||||||
<p:outputLabel value="Especialidad médica:" for="selMS" />
|
<p:outputLabel value="Especialidad médica:" for="selMS" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="selMS" dropdown="true" required="true" value="#{RegisterUser.medicalSpecialty}" completeMethod="#{RegisterUser.completeMedicalSpecialty}" var="ms"
|
<p:autoComplete id="selMS" dropdown="true" value="#{RegisterUser.medicalSpecialty}" completeMethod="#{RegisterUser.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" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||||
placeholder="Seleccione una especialidad médica o teclee para buscar...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.medicalSpecialtiesList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.medicalSpecialtiesList}" />
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre">
|
||||||
<h:outputText value="#{ms.name}" />
|
<h:outputText value="#{ms.name}" />
|
||||||
|
|||||||
38
1.sources/MyHealth/docroot/profile/ShowFamilyDoctor.xhtml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Consultar datos de médico de familia">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
38
1.sources/MyHealth/docroot/profile/ShowPaciente.xhtml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Consultar datos de paciente">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Consultar datos de especialista">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
39
1.sources/MyHealth/docroot/profile/UpdateFamilyDoctor.xhtml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Actualizar médico de familia">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
39
1.sources/MyHealth/docroot/profile/UpdatePatient.xhtml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Actualizar paciente">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
@@ -7,19 +7,20 @@
|
|||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="frmUpdateProfile">
|
<h:form id="frmUpdateProfile">
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
<p:panel id="tipoUsuario" header="Tipo de usuario registrado">
|
<p:panel id="tipoUsuario" header="Tipo de usuario registrado">
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:outputLabel value="Tipo de usuario:" for="selUsertype" />
|
<p:outputLabel value="Tipo de usuario:" for="selUsertype" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-10 ui-md-10">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:selectOneButton id="selUsertype" value="#{UpdateProfile.userType}" disabled="true" required="true" unselectable="false"
|
<p:selectOneButton id="selUsertype" value="#{UpdateProfile.userType}" disabled="true" required="true" unselectable="false"
|
||||||
requiredMessage="Debe especificar un tipo de usuario">
|
requiredMessage="Debe especificar un tipo de usuario">
|
||||||
<f:selectItems value="#{UpdateProfile.userTypes}" var="item" itemLabel="#{item.userTypename}" itemValue="#{item.name}" />
|
<f:selectItems value="#{UpdateProfile.userTypes}" var="item" itemLabel="#{item.userTypename}" itemValue="#{item.name}" />
|
||||||
</p:selectOneButton>
|
</p:selectOneButton>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
</div>
|
</div>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
<br />
|
<br />
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
<p:outputLabel value="Número de Profesional:" rendered="#{UpdateProfile.userTypeDoctor}" for="cipCode" />
|
<p:outputLabel value="Número de Profesional:" rendered="#{UpdateProfile.userTypeDoctor}" for="cipCode" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:inputText id="cipCode" value="#{UpdateProfile.cipCode}" readonly="true" required="true" requiredMessage="Es necesario un código de identificación" />
|
<p:inputText id="cipCode" value="#{UpdateProfile.cipCode}" disabled="true" required="true" requiredMessage="Es necesario un código de identificación" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:message for="cipCode" display="text" />
|
<p:message for="cipCode" display="text" />
|
||||||
@@ -40,15 +41,10 @@
|
|||||||
<p:outputLabel value="NIF:" for="nif" />
|
<p:outputLabel value="NIF:" for="nif" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<div class="ui-inputgroup">
|
<p:inputText id="nif" value="#{UpdateProfile.nif}" validator="nifValidator" required="true" maxlength="50" requiredMessage="Por favor, indque su NIF" />
|
||||||
<p:inputText id="nif" widgetVar="nif" value="#{UpdateProfile.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
|
||||||
<p:ajax event="blur" update="nifmsg" listener="#{UpdateProfile.handleNIFValueChange}" oncomplete="handleNIFResponse(xhr, status, args)" />
|
|
||||||
</p:inputText>
|
|
||||||
<p:commandButton widgetVar="nifButton" icon="pi pi-check" styleClass="green-button" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:message id="nifmsg" for="nif" display="text" />
|
<p:message for="nif" display="text" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
@@ -75,8 +71,8 @@
|
|||||||
<p:outputLabel value="Correo electrónico:" for="email" />
|
<p:outputLabel value="Correo electrónico:" for="email" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:inputText id="email" value="#{UpdateProfile.email}" required="true" maxlength="120" validator="emailValidator"
|
<p:inputText id="email" value="#{UpdateProfile.email}" required="true" maxlength="120" validator="emailValidator" validatorMessage="La dirección #{RegisterUser.email} no es válida"
|
||||||
validatorMessage="La dirección #{RegisterUser.email} no es válida" requiredMessage="Por favor, especifique su correo electrónico">
|
requiredMessage="Por favor, especifique su correo electrónico">
|
||||||
<f:validateRegex pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" />
|
<f:validateRegex pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" />
|
||||||
</p:inputText>
|
</p:inputText>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,7 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="selPHC" dropdown="true" value="#{UpdateProfile.primaryHealthCareCenter}" completeMethod="#{UpdateProfile.completePrimaryHealCareCenter}" var="phc"
|
<p:autoComplete id="selPHC" dropdown="true" value="#{UpdateProfile.primaryHealthCareCenter}" completeMethod="#{UpdateProfile.completePrimaryHealCareCenter}" var="phc"
|
||||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.phcList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.phcList}" />
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre">
|
||||||
<h:outputText value="#{phc.name}" />
|
<h:outputText value="#{phc.name}" />
|
||||||
@@ -140,12 +136,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="selMS" dropdown="true" value="#{UpdateProfile.medicalSpecialty}" completeMethod="#{UpdateProfile.completeMedicalSpecialty}" var="ms"
|
<p:autoComplete id="selMS" dropdown="true" value="#{UpdateProfile.medicalSpecialty}" completeMethod="#{UpdateProfile.completeMedicalSpecialty}" var="ms"
|
||||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.medicalSpecialtiesList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.medicalSpecialtiesList}" />
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre">
|
||||||
<h:outputText value="#{ms.name}" />
|
<h:outputText value="#{ms.name}" />
|
||||||
</p:column>
|
</p:column>
|
||||||
<p:column headerText="Descripción">
|
<p:column headerText="Localización">
|
||||||
<h:outputText value="#{ms.description}" />
|
<h:outputText value="#{ms.description}" />
|
||||||
</p:column>
|
</p:column>
|
||||||
</p:autoComplete>
|
</p:autoComplete>
|
||||||
@@ -160,12 +156,11 @@
|
|||||||
<p:outputLabel value="Médico de familia:" for="FamilyDoc" />
|
<p:outputLabel value="Médico de familia:" for="FamilyDoc" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:autoComplete id="FamilyDoc" readonly="true" dropdown="true" required="true" value="#{UpdateProfile.familyDoctor}" completeMethod="#{UpdateProfile.completeFamilyDoctor}"
|
<p:autoComplete id="FamilyDoc" disabled="true" dropdown="true" required="true" value="#{UpdateProfile.familyDoctor}" completeMethod="#{UpdateProfile.completeFamilyDoctor}"
|
||||||
var="fd" itemLabel="#{fd.displayName}" itemValue="#{fd}" forceSelection="true" requiredMessage="Por favor, selecciona un médico de familia"
|
var="fd" itemLabel="#{fd.displayName}" itemValue="#{fd}" forceSelection="true" requiredMessage="Por favor, selecciona un médico de familia">
|
||||||
placeholder="Seleccione su médico de familia a través de la opción de cambiar médico de familia...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.familyDoctorList}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.familyDoctorList}" />
|
||||||
<p:column headerText="Num. Prof.">
|
<p:column headerText="Num. Prof.">
|
||||||
<h:outputText value="#{fd.professionalNumber}" />
|
<h:outputText value="#{fd.id}" />
|
||||||
</p:column>
|
</p:column>
|
||||||
<p:column headerText="Nombre">
|
<p:column headerText="Nombre">
|
||||||
<h:outputText value="#{fd.name}" />
|
<h:outputText value="#{fd.name}" />
|
||||||
@@ -176,7 +171,6 @@
|
|||||||
</p:autoComplete>
|
</p:autoComplete>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-6 ui-md-6">
|
<div class="ui-g-6 ui-md-6">
|
||||||
<p:button icon="fa fa-edit" outcome="ChangeFamilyDoctor" alt="Modificar médico de familia" />
|
|
||||||
<p:message for="FamilyDoc" />
|
<p:message for="FamilyDoc" />
|
||||||
</div>
|
</div>
|
||||||
</h:panelGroup>
|
</h:panelGroup>
|
||||||
@@ -184,7 +178,7 @@
|
|||||||
<div class="ui-g-12 ui-g-nopad">
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
<div class="ui-g-4 ui-md-4"></div>
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
<div class="ui-g-2 ui-md-2 ">
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
<p:commandButton validateClient="true" value="Guardar" update="frmUpdateProfile,frmMenu" action="#{UpdateProfile.saveData}" icon="pi pi-check" />
|
<p:commandButton validateClient="true" value="Guardar" update="frmUpdateProfile" action="#{UpdateProfile.saveData}" icon="pi pi-check" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmRegisterUser">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
|
||||||
|
<p:panel id="DatosPersonales" header="Consultar médico especialista">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:outputLabel value="Campo1:" for="campo1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo1" value="123 asdf 123" required="true" requiredMessage="Por favor, indque el campo 1" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-6 ui-md-6">
|
||||||
|
<p:message for="campo1" display="text" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Guardar" update="mesgs" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
body {
|
BODY {
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10,39 +10,3 @@ body {
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.ui-menu-list {
|
|
||||||
white-space: nowrap;
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-orderlist.ui-grid-responsive .ui-orderlist-list {
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.green-button.ui-button.ui-state-default {
|
|
||||||
background-color: #5cb85c;
|
|
||||||
border-color: #5cb85c;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.green-button.ui-button.ui-state-default:enabled:hover, .green-button.ui-button.ui-state-default:focus {
|
|
||||||
background-color: #4cae4c;
|
|
||||||
border-color: #5cb85c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.red-button.ui-button.ui-state-default {
|
|
||||||
background-color: #d9534f;
|
|
||||||
border-color: #d9534f;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.red-button.ui-button.ui-state-default:enabled:hover, .red-button.ui-button.ui-state-default:focus {
|
|
||||||
background-color: #d43f3a;
|
|
||||||
border-color: #d9534f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-orderlist .ui-orderlist-list {
|
|
||||||
height: 62vh !important;
|
|
||||||
width: 25vw !important;
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 775 B |
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="215.434px" height="215.434px" viewBox="0 0 215.434 215.434" enable-background="new 0 0 215.434 215.434" xml:space="preserve">
|
|
||||||
<g>
|
|
||||||
<circle fill="#54C147" cx="107.717" cy="107.717" r="106.299"/>
|
|
||||||
<polygon fill="#FFFFFF" points="96.977,121.718 145.084,50.79 168.752,69.02 103.583,164.647 46.678,120.299 63.562,96.402 "/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 909 B |
@@ -1,248 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="71.337982mm"
|
|
||||||
height="65.062035mm"
|
|
||||||
viewBox="0 0 71.337982 65.062035"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="Pendiente.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="1.4"
|
|
||||||
inkscape:cx="21.631587"
|
|
||||||
inkscape:cy="107.22382"
|
|
||||||
inkscape:document-units="mm"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
fit-margin-top="0"
|
|
||||||
fit-margin-left="0"
|
|
||||||
fit-margin-right="0"
|
|
||||||
fit-margin-bottom="0"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1015"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="0"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Capa 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(-46.72982,-68.677315)">
|
|
||||||
<circle
|
|
||||||
style="fill:#ffdd55;fill-opacity:1;stroke-width:0.31121486"
|
|
||||||
id="path3813"
|
|
||||||
cx="81.031158"
|
|
||||||
cy="99.249031"
|
|
||||||
r="29.009672" />
|
|
||||||
<path
|
|
||||||
style="fill:#000000;stroke:none;stroke-width:0.03527778"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
d="m 74.462809,68.91145 c -3.457222,0.529167 -8.854723,2.504722 -12.065001,4.409722 -4.833056,2.892778 -9.771945,8.219723 -12.347223,13.370279 -1.446389,2.8575 -2.751667,7.408334 -3.139722,11.112501 -1.516945,13.864168 6.632222,27.728338 19.438057,33.196388 4.727222,2.01084 7.408333,2.54 13.052778,2.54 6.138334,0 7.231945,-0.28222 7.231945,-1.69333 v -1.02306 l -6.526389,-0.0353 c -6.385278,0 -6.596945,-0.0353 -9.877779,-1.16417 -4.691944,-1.55222 -8.396111,-3.84528 -11.818056,-7.26722 -6.0325,-6.0325 -8.960556,-12.91167 -8.995834,-21.13139 0,-11.394726 6.279445,-21.695838 16.404168,-26.775839 5.856111,-2.963333 13.687779,-3.915833 20.073057,-2.434166 9.136945,2.116666 16.93333,8.466667 20.74333,16.862778 1.23473,2.751667 2.39889,7.090834 2.39889,8.960557 0,1.199444 0.70556,2.43417 1.37584,2.43417 0.14111,0 0.56444,-0.21167 0.91722,-0.493893 0.635,-0.458611 0.635,-0.670277 0.21167,-3.421944 -0.59973,-3.880556 -2.04612,-8.149167 -3.95112,-11.465279 -1.79916,-3.175 -6.20888,-7.972778 -9.348607,-10.230556 -2.963334,-2.116667 -7.549445,-4.198056 -11.112501,-5.08 C 83.67031,68.735061 77.708365,68.417561 74.462809,68.91145 Z"
|
|
||||||
id="path3790" />
|
|
||||||
<path
|
|
||||||
style="fill:#000000;stroke:none;stroke-width:0.03527778"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
d="m 78.625587,74.908673 c -0.599722,0.3175 -0.635,1.199444 -0.635,10.548056 v 10.195278 l -1.023056,0.529167 c -2.434166,1.27 -3.668889,4.056946 -2.892778,6.526386 l 0.423334,1.27 -4.797778,4.62139 c -2.610556,2.54 -4.762501,4.86834 -4.762501,5.18584 0,0.67027 0.881945,1.41111 1.552223,1.23472 0.282222,-0.0706 2.645833,-2.11667 5.221111,-4.55084 3.880556,-3.66888 4.833056,-4.40972 5.397501,-4.16277 1.375833,0.52916 3.845278,0.35277 5.044722,-0.38806 3.4925,-2.15194 3.421945,-7.725833 -0.176389,-9.489722 L 80.812809,95.863674 V 85.738951 c 0,-8.713612 -0.07055,-10.195278 -0.564444,-10.65389 -0.635,-0.670277 -0.811389,-0.670277 -1.622778,-0.176388 z m 2.8575,24.518057 c 1.023056,1.30528 0.917222,2.46944 -0.3175,3.73944 -0.917222,0.88195 -1.27,1.02306 -2.2225,0.84667 -3.421945,-0.67028 -2.998611,-5.503333 0.493889,-5.503333 1.023056,0 1.481667,0.211667 2.046111,0.917223 z"
|
|
||||||
id="path3792" />
|
|
||||||
<path
|
|
||||||
style="fill:#000000;stroke:none;stroke-width:0.03527778"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
d="m 99.192533,104.01284 c -7.47889,2.01083 -12.347223,9.45445 -11.077223,16.93334 1.093611,6.27944 5.644445,11.04194 11.88861,12.3825 2.32834,0.49389 3.10445,0.52916 5.22111,0.17639 5.04473,-0.88195 9.2075,-3.95112 11.25361,-8.32556 2.18723,-4.69195 2.11667,-8.74889 -0.21166,-13.51139 -3.06917,-6.20889 -10.33639,-9.48972 -17.074447,-7.65528 z m 8.254997,2.99861 c 2.57528,0.9525 5.50334,3.66889 6.77334,6.24417 0.88194,1.76389 0.98777,2.39889 0.98777,5.36222 0,2.96334 -0.10583,3.59834 -0.98777,5.36222 -3.70417,7.51417 -13.58195,9.34862 -19.579171,3.66889 -2.751667,-2.57527 -3.704167,-4.62139 -3.880556,-8.32555 -0.211666,-4.445 1.164167,-7.65528 4.480278,-10.44223 3.03389,-2.54 8.254999,-3.35138 12.206109,-1.86972 z"
|
|
||||||
id="path3794" />
|
|
||||||
<circle
|
|
||||||
style="fill:#ffdd55;fill-opacity:1;stroke-width:0.13077107"
|
|
||||||
id="path3813-3"
|
|
||||||
cx="102.99097"
|
|
||||||
cy="118.6227"
|
|
||||||
r="12.189734" />
|
|
||||||
<image
|
|
||||||
y="106.07389"
|
|
||||||
x="90.484489"
|
|
||||||
id="image3875"
|
|
||||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAYAAADRcblEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
|
|
||||||
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4wwWCB4YJbjQ/wAAABl0RVh0Q29tbWVudABDcmVhdGVk
|
|
||||||
IHdpdGggR0lNUFeBDhcAACAASURBVHja7Z19fFTVue9/a+29ZybJJANJIJFgMEbUIHIsFGsLVw9e
|
|
||||||
IyCF1k8tbZVaX6CeW6niKcrRWqvo0RtfEKnoUQQ5GGsvxcMxHFo58cqlhc/HQsPxAA0oxEggMSEv
|
|
||||||
MJkJs2f23mvdPyYBQl7Iy7ztmef3V4Aws1/Wdz0v61nPYlJKkOIsaRRJoRfK0ImLpdE6BqY3Txon
|
|
||||||
RkujOUda7SNhnfJIcdoN4c+A0F1S+DQAKkQHAyABmOAZBgCd8cwOMO4Hc3iZVnAS3NPKVM8Jpo1q
|
|
||||||
YtqoBqblHmOqpw7ayFrGXQDT6PnHUYwAjJlcACaJQM1EqddNkMGjV4rAwfEyWFMsjeOKFC1gTAPA
|
|
||||||
On/dATCl8+dOSJg6CKjNzh+Mzj9bAELhH2UIACzGc2uYNvYwcxYf4mkl1cw57gBzFe7jacU6vS4C
|
|
||||||
0O6aLAI13xAd1VNFx/4pomPHJGl8DkABY45zANMGB1bEra8ZhrQT0DCc1j7umlrFXNfsUTKn/oWn
|
|
||||||
X7GXuQrpjRKACa2pUq+bYfk/vV74dk0X/h2esFVzACwt/qANGcwApAx5Gc/dyTO+9See9ffbFfc1
|
|
||||||
ewhIAjDeypaW7xbR/teZ1qkPS4VvW56UfjDmDls2lpaEsaoJSB1S+puYkl/JM2/epoyc9Qcl82tt
|
|
||||||
FEsSgLFQgbR837VO/r/vWKe2lsrTO8IxG0tLTuAuCGQAkKcBsErunvWBMnLuvyueb9aDu2ikEIAR
|
|
||||||
Uyak8UPr1M7vW23vl1r+Dzvdyix7uZQxgTEAQFZy9+zfKznf+53imeajB0MADlUzhX//ArN184+E
|
|
||||||
9z0lbOkIukHAaAF4j3sWlKujf7CNpxXTcyEAL6gcCP1es/n9u8zWDSXSqAHjntR0LyMIoxTeg9x5
|
|
||||||
zXol9861avbNreSiEoDna7II1Nxnnnh3kXXqbcaYB2AusnYRBdEEpC6l9K5RRix6QxuzaC/TRhGA
|
|
||||||
KQ5gqfDvX2w0rp4nOj4iaxdbq1ihZM57Vc1bWMkzJhCAKaa5wr9/idFQdqMIfALGc8naxQ3Eto95
|
|
||||||
2rSVWsFjW1IRxFQDcLbw73/YaCibQeAllnsqRct2nnHTC1rBw39MpYRNqgA4TXRUP2rUPztHBHaB
|
|
||||||
8TwCL2FBbNqqZM1/Thu7dFcqxIjJDmCRNJp/ZRx77m7LV0EWz14x4ttqzuKntTH/UJvMWdNkBvAJ
|
|
||||||
o+HNJ83m5xklV2wq4ZcAnlTHLF+u5s4jAG2iW6323f9sHH2gBFIHuJsGsu1BbDsI9eJfOsa9vDnZ
|
|
||||||
EjXJBOAYCL0s9OVjCyxfBZiSTwM36eLDlnJlxD3LHOMeayAAE0uLrLbKF4zjD3pStjA6ddxSL5jy
|
|
||||||
sDbu9TVK1rUEYJxVAKGvDH352G1k9VLMIFqNm5QRdy5xFD5ab+etUHYG8HbLu+s3xtFF2WT1UtYa
|
|
||||||
toG7f+645PXfcvfVtrwFbtNHvzp09Nl3Q1/+JBs8m+BLVXF3NqT5brBm3mqj4U2ygDHQFKnXvRH8
|
|
||||||
YtEUmE2U4SSdYw3bqphr8n2O4termJJJAEZB95gtW94y6h9itKBO6j0wDEgACx1F69fZxSW1iwv6
|
|
||||||
Uujos2uN+ocYU/IJPlIf5iSNgaWtDdbMe8lsepcsYASULS3fhtDhu+fI0BFyOUmDcElbt/LMeXc6
|
|
||||||
israCMChabLU68qDh+eXAAYlWkhDgNB/kDkuW+C8vHxvotaTJqoLOtdq371D/+zGkk7XggYTaQij
|
|
||||||
210ijeM79L9Nmyv1OgJwgLrXbNlSEar9gZviPdLwfTzVDWgVwc9n3iv8+wnAC+gRs3H9W0b9A2BK
|
|
||||||
AQ0eUqQgBHjOW8GaeY9YbZUUA/ahp43jKx83W1+lkjJS1CSt+me0glW/UnPnEoDn6MXQ0eW/EN73
|
|
||||||
AJ5Do4QUbQhf0i4qW6qOnk8AAngldHT5A8L7O4Bn0+ggxQrCVVr+Mw+qeXekdAxI8JHiY3mUggeM
|
|
||||||
xsdfMRvXpyyAL4aOPkvwkeILYdMzL5onNqYcgE8bx1f+QnjfIfhIcYYw/xfGV8ueNlu2pAyAj5iN
|
|
||||||
6x83W1+lhAspUSzh40b9A49Y3l2x/+4YJ2HuDe9ooHU+UuJJWvULnZdtXRvLxk+xBHCu1b67IlT7
|
|
||||||
A4KPlLgSbfOcJTu2xKopcKwAnCwCNTuCn9/kJvhIiW0GTT+YeoPrqu17Y9FrJhYxYLa0fOWhI3e4
|
|
||||||
Gc+jF0xK8IBQdUMGyoOH745JdjAWAG4IHb67c1cDFVaT7ABhWonUD2wIHV1uewBfCh1dHt5MS/CR
|
|
||||||
7CTunmOd2vCS2VJh2xjwHrOlYq1R/49UXE2yb0ho1d/rvGzrumhlRqMF4BQRqNkT/HwmI/hIdmcQ
|
|
||||||
MjDVddWuqmjsqo+OCyqNN0I1Pwl3LyORbB4RAngjeGShbWLA1aHaZVMgAxT3kZIEwbQpUt+7OhqF
|
|
||||||
25EG8HazpeJnlq+C+riQkks8+2dG01O3i47qhI0BC6TRvE+vvjabFttJyRkNmm1QPJNcE7bVJ6IF
|
|
||||||
XBmqfSibFttJyeuKqtkwm1aGjj6bcC7oIvPExtukvpfiPlKSu6Lu26xT6xZFqsNaJFzQMdJortar
|
|
||||||
r/WQ60lKEVfUC6ZOcE3cOeyTeiNhActCtQ95yPUkpZAr6oHwlxn1q+Pugt5qtmxZIPUqcj1JqeaK
|
|
||||||
LjBbXr51uB23h+eCCr1aP/C1EtrZTkpRV/Qgc142wXl5eVws4BOhYytKwNLpRZBS1RUtkXrVE9bJ
|
|
||||||
7TG3gEUiUFMT/PwmRokXUqrbQUiz2DXxz7VD2cA7VAv4K+PYrxklXkgkMEj9V0M9EHQoFnCa5d21
|
|
||||||
M/TlT2ibEYnUJdE63XnV7l2DPZ9+KBbwUaN+OWinA4l0rilLf9Q4/puou6CzrbbKOTDraNmBROoG
|
|
||||||
YNoc69Sa2dJojiqADxsNT1FDXRKpNwZ59sPG8RejBuBcs2XLDIg2etIkUu9WcIbV/v6gjsMeDIBL
|
|
||||||
zMYyOsuBROrXCnqWGE3rIw5gqdVWeSNZPxLpglbwRuvU26UDjQUHCuBio/FFgGXRAyaRLhwLLjYa
|
|
||||||
1kQMwMlW++550qihzCeJNDArOE94yydLyxcRAO8zG1fRuh+JNCg57rMG0NT3QpUwOVKva9Y/u4Fq
|
|
||||||
PkmkwUlCBka5rq5qHY4FvNdoKmeMMp8k0qAdUcjT917o0M/+ART6XcK7kVoMkkhDQtBzl9n8zpAB
|
|
||||||
nGm2VZYAIXqQJNKQAFRLRMdHM/tbkugvrbnAavlXWnq4oKdvAjCi/CJj6IHIQJS/QEupbDpj7gVm
|
|
||||||
8+Zt2pif9v7vfSRhMqVed1L/7EaFthz156L7wd03Akp0M8Si/f3YQMgzwDNuiC7fwWrIYEodV2cB
|
|
||||||
GOmauNM3GAv4Q7PtQ4UxN0HWj6Vg6dfBcemK6L699t0Q3vKoAyitejiLtiJax3B1KXjotlQbKQpE
|
|
||||||
6w+Ff/8a7r56wDHg961T7wOcAOx7xJ6Go+iFqH+N2bgq+mGAaIOauzTq8An/fojgp6lX0MHSv2+2
|
|
||||||
bund6ejl7wpER3WpNGoIsj6tRSO0sasw2N3Pg/4evQ4i8El0B6w0AfViaAX3R38yaS4H457UGzAs
|
|
||||||
rVS0v18wUAC/a538z9R8UAN0PZWs70HJLo3+gG35t6i/Byla4Lx0TfQfm+WD1Z7CS1ry9Het9t0D
|
|
||||||
AvA71qlNtPbXjxzjnopN9N62PrrvQbRBy38KzFUY/XtpqQBjKTyps/TvWCc/uiCA2SJQUyqtRqKs
|
|
||||||
L9dz3OuIxlHFPeGrRFTXYKUJ5poMNe+OmDw7s3UDwFwpDGBaqWivyL4QgLcI759B2c9eMwhQRtwJ
|
|
||||||
Jeva2AzYaK/BSi8cRS/HxpK37wb1EQIgvbeIQE2/AM60vH9I7Zmqz0RFHhzjnogN64GaqCZfziSR
|
|
||||||
tFGxAbB5A8AopwA4Zwrvn/sGUFq+UqHvoZmqR6KiCY5xL8fs+8wT/yd6yRcZgOKeFZMkEgBIoxmW
|
|
||||||
fyuNKQBgrlKr/aM+AZwq/PvyGCVfeiQqYrFGds6IhXVqXVSTL46iF2M3mTRvTu3kSzcA1TwR2DUV
|
|
||||||
Qu8VwBnWqR2U/Tw/UeGYEJM1srPJig/BmCNKrmc9tMJVMUkinXE/2zZQQce5DLK0GZavqlcArxcd
|
|
||||||
OwBo9JTOdT0vWRHT74xaAbzwQxlxNxTPtNjdi3cXIFppIHUjMO164f+0J4DSaJ5OmarurqeW/0xM
|
|
||||||
1sjOfGVHdXRKtaQJcDcchY/G9BGaTa9T8qWHtOnCt70HgJPF6c89AKPn0+V6xnCN7MyAbdkUleSL
|
|
||||||
FE1wFL2JoRyfNeTvjEUZnT3jQI8MVZ9p2NQF4DeEbw/Ff2cGbEvM1sjOmj8d1qm3I/8OhD+2SaQz
|
|
||||||
k8m/UTlj3yPsGzLwZTcAp4rTf6X4D51rZAUvx2yN7OyAjUKpVuf6ZSyTSGfiv5Pv0ITep5xTxemD
|
|
||||||
3QCcIgK7yF2QASiZ86Dmzo35V5stayNeABGrQuse8LVVxmBnvZ3dUGWK6Kg6A6BL6nWTAIUejLSg
|
|
||||||
xajQuruXuB8Rb3wcw0LrnpMJtTLpH8C0SSLwqasLwEni9GdRW3uyles5bnXU9/j1OmAjvU8uTkkk
|
|
||||||
IPpldEkz3ozPJ0Ho4AAmCr0WQAoD2FVoHcM1srPg+2BFuueLbI99EqlrMolmGV0yGUHmmiiC9eAA
|
|
||||||
JsjAvtQtwI7TGtmZeKn5/YjuPpFWI9QxZTFPInVO6zHpX5MkCE6QgS+gArhSBA+nrisgmuAsrojp
|
|
||||||
Gln3eOmtyJVqdRZaxyOJBITL6EgDleNKodeCQ+jjYbWkps8u/FBzHkRv3apiYv3ad0e8VEu75Lm4
|
|
||||||
PU7qIzsYA+gaL/VD4NLyFUvhTU3XU82DNnZJ/AZsBPfJSase2rjX45JEAqJYRpe8KpahOqgy2Kgw
|
|
||||||
lnoL8NL6G5yXfRq/7zeaYfk/REQaH3cVWsdot37vrvQmSr4MygKqijQbi7g0WpByNaCiDVr+b8DT
|
|
||||||
iuM3YJs3Ryb50pVEitFu/d6fZ5TK6JJ+HLYWqjLUgJRaguhaI8u/K66XYbWui0jy5UwSKY4yU73j
|
|
||||||
2VDfnTQuVqXRDLDUqYKRogXOoi3xhc+7C5BegOUM25KruUvjlkQ6C+Ba6iM0FC+UaWO4tNqRMkXY
|
|
||||||
ohVawYr4rJF1cz/fGX7yJYYdrfsPP6NQRpc6COZxaTSkiOkLgKXfADV3Xnwvw2iG8L8bGUseh0Lr
|
|
||||||
HpNJ62akYhIvMnKM5jBTZA1QBmJymMoF5zxtFJxXdKbrh7pjQLRBy3s8LoXWPYbQuCegZN8HauY8
|
|
||||||
JOVwaabAgxOt4fKsOK2RnS+eVgzXhI/AtKLBQ9jpesY7iXSutLFL4Lj4dUirnpAa1GysjOTJb/lM
|
|
||||||
MOfVcSvP6ptCF5xXbgJzlgwKQila4Ch8MeEes5JdCscl5WQJBydP0gMoRRO0sU8m7PU5Ly8Pn7Ar
|
|
||||||
zQFNJop7Vtyznn1C6JkGrWAFQThwuZMbQGmCZ8yMeT+UQUM4vjy8LDGAyUQd81BC34uaOw/KiDsB
|
|
||||||
4Se8Luy8ZyQ5gF5o+fcn/GUybRTUvMcB0db/ZJI2La7VOwOVo/BRasY7MLmSF0BpAmphwrprPSxH
|
|
||||||
3h2AenHfrqj0Qs1/wCbJBQ1awdPUlPeCz0nVkhhAHWrOnfZySC76p75dUZ4T12LrQceDI2cAauHA
|
|
||||||
YtvUlZq0AErph5J9s62uWRk5A+C9lKfJAJQRt9lvdI2+H5DthFk/NjA5AZQmuGty3EvOhgRhdi8J
|
|
||||||
DHkayoj/ab97GTmDELvASE1SAHUonlvs6ZNkz4KUPTOIdollu03vSiZ4xo3khvYtM0ld0CC4e4o9
|
|
||||||
fRJXYfdNutIES7/Btm+Ce2aSG9q3jKQEUEodPH28fQdt5s1nq2OkDp4+2bb3orj/DlKGCLXepXPw
|
|
||||||
jOSLbJWCmB5CGXEAM64BpNX5pxB4xlX2fReuQgAWodZ7rqKDM8WTbDcFnn6trW+BOfIBBDuteajz
|
|
||||||
z/YVd06hOLB3+TmU7CR7OAaYo9DeAzatCFIaYRiZA8wx2t4TirMYgEG49ZQ3CS2gBaaOsPc9cNfZ
|
|
||||||
szpYmv03vFK3tL6MxUnOtIuSb3bi6UlwE2cBtHM8CwBMJQD7UCtPjsF6rkJg6kh7D1imhRtlSRNJ
|
|
||||||
kSRj2jlJJdI53toJztQRyfdwbN5iQ0qDBmxKKNTEmbMAQHKt00grGfaihcITieiw/62I0ynV+nIQ
|
|
||||||
auBMyQIgk+ieHICw+fHIQj+7eC1NQNo7Rg+3viT19HRCxzhz5p9JeSeH+6kg3O3bxvwFas9mQWU7
|
|
||||||
pNDtPdAC+5AyvWcHF+vXcaZkWpE8IDL+0iD0Q/YesPqXOHtcgITUj9l7QglWUePenrLAc2o5uKsG
|
|
||||||
al4STSsq5Okd9h6wHVXnxExOiMARG1vzGgAU//WcZc0apo0BB3CYOYqSqhpGSqPzxdt00Pq2nT1p
|
|
||||||
iCkQvl02vpcqJJeHFSkZh5mjCBzAIe66Esm0GM+YG6L9E3sOWP9+dNWBhm8mDcK3xbbvwjpVQQe3
|
|
||||||
9GolrEM8fRI4gGrmujS51p2YC9bJzba8dLN1M8B6FkdYXvtZQWk0QwQ+ofivV4WqmesScAAHuKuo
|
|
||||||
+6ybBHGgCH5qOzdUWj4I7+96HnTJsmC1vGe/yaTpXTo1t88wKXSAOy8GB7CPp4+HlHpS3SDjuTC/
|
|
||||||
Wm2vAdu4Ab0elspUWP4P7TWhCB1m66t0am7f2sdcheAAdHDXPqYUJNftMRWWb7NtBq20fDBbXu6z
|
|
||||||
oS3jHltNKEbDv5D16/Nlm/t42nU6AHS1pKjiGdOGflxWwlrBPBh1j9pjwB79df8DlqXB8m2G1b47
|
|
||||||
8Y1foAZm6ytk/fp+21U8/es4F8A9PGNKUhZly+ABmCc2JvRlWie3w/JVXHDAhieUf0z40jTj6DIw
|
|
||||||
nkec9WkBA3t4xt91A/AvPGMikioR0yWeDeOrZRAd1Yn5LoxmhOoWde+E1s+EAhlA6IvEPaAldHQ5
|
|
||||||
ZOgIZT77e+cy9BfuntgNwL087VIv4EzKG2ZKAUJf3ANpNCdcoiJ4eAEYzx3EzaRBdHwMo+HNhHvO
|
|
||||||
5omNsE5toINZ+peXKfl7u5pGn21LyF07mWtiUjfPCX52a0JBGDyyELCGcEQ4z4bZ/DzMxvWJ40a3
|
|
||||||
VcL46rGBWfLUdj938oxpZ1/lOf/0JyXrJiDJliO6u28mgodmxT0zKi0fgodugwweHHKigin5ME+U
|
|
||||||
IXT02YSwfKFjPyX4Bvby/8Qzp/cK4PZwN+lg8t48UwGWhuDnM2G2VMTH6+yoRvDgbEjj+PCzhDwH
|
|
||||||
wluO4JF/gLR8cYv5wpavgOAaUPzn3a54rjs7JKXsthm3Ud9XktfrCT3JJtEKln4DHOOejtkhLkbD
|
|
||||||
mzCbnwtnCCOZpJABQJ6GNnYVlOzSmE0koaMPAWYTxXwDVxN4Rr5rwrZeLSAAVHL37NRoospzIAN7
|
|
||||||
EDx4fTihEcXUvtW+G/qB6bBaXgtbikhnCFkawHNgHH8Awc8XRDXjKy0fQkeXI3hkDmB5Cb7BTZSV
|
|
||||||
Stbs7sPwvF/ZxrNmpM5hGp0D12p5DYF9l8M4vhJSr4uQidBhndwOvXomQrW3d3Y4c0d/UgkeQfDI
|
|
||||||
HAQ/mx8u4I7QxCI6qhGqXQb9wCSI9g+iM5EkPYCnt/Gsb3Ufgue5oNnSaG4NHrweKeGG9uLKSeEF
|
|
||||||
04qhjPgeuPsaKO5JA+7LKfU6WP7/hmjfDuH/GOHGSlnxGajS7JxIHeCZM8Ezp0PxXDdwd1vosPz7
|
|
||||||
IHx7YHkrII2acKUOVbcMYxZry3Fd/d9tOKfR8vkAAsB/Bg/dVhpOEqToDCfNzmxwEFLqYMwD5poI
|
|
||||||
po4GlBHnmwbIYA1E8NPwA2Xu8P63RHp2MhCeXGQIgAWmXQ7mKAJTPN37jooOSMsLGdgDKdrAWFoY
|
|
||||||
OIIuIu4nd990s6OorNtf9zZKPlBG3lpqNr0ApOpOZqZ23rsbrOv5BY9ABo+g943LWmKn4DshYmeC
|
|
||||||
Ui9k4FPIPu4FLI2ympEH8ANlxKyer6YXC1gg9brj+mc30EsgkSLmfraOdU38r/rzw5neDuisZ67C
|
|
||||||
SjpSikSKoPuZOa++t1xCXyfk/l4ZeWvyVsWQSDEF8PTvlex5vUcHvbigAJApLd9J/cDXFCovIpGG
|
|
||||||
JQvCP9I16dNeS5X6soA+pmS+xzNuIjeURBqe+/mekn1Xn3WCvJ//Wq6O+jEgvfQQSaSh8ie85UrO
|
|
||||||
XAwFwG2KZ9pBMOrrQSINjT7zIHdN3sbTiocEIACsV7J/DAg/PUwSadAAtq9XRy3q91f6SsJ0KUca
|
|
||||||
zc169bWM1gRJpMHhB9E6yjXpYGt/v3QhC9jKtFFrlMxbk65jGokUVQn/GiVnceuFfo0P4KPeUPMW
|
|
||||||
QgpKxpBIA1fwDXX0fEQCwL08Y0IFT7uOliRIpAE5n4EKnjlv70B2nvABfuSrat7/oiUJEmkg/Im2
|
|
||||||
V7WL7h/Q7w4UwErFM+1jqIVkBUmkfukzP1bccyqZqzCiAALASu2ifyIrSCL1a/1aVqpjBt44eTAA
|
|
||||||
blFGzthOVpBE6tP6bVfcs7b0t/A+HAAB4AWt4AlI0UIPm0TqYf2aXtAKHhnU/xksgH9UPNO2cuc1
|
|
||||||
ZAVJpG70BbYqWfP/ONDYb6gAAsBz2thfkxUkkbpZP+9z2tilg/5/QwFwF3df/TZtVSKROiX8b6s5
|
|
||||||
i3cNpcHzhWpB+1KR1Otq9M9uoBpRUsobP8hAseuqXbUDbV85XAsIALXMVfikmvMg7ZQgpbj1a31S
|
|
||||||
vejJIcE3HAvYyb5Rre+fWkLtyUmpafvMg0wbO8F55aYhfwQf1gUw7Zfa2BcgrUZ6GaTU40+0/FIb
|
|
||||||
Vzasz+DDvIbNSnZpOSVkSKnnevrL1ZzFmwez6B55FzSsMdJortarr/VQQoaUIvICmOCauLNhuB/E
|
|
||||||
I3AxDUwb9bB2URkg2ujVkJLf9bQaH9YKVzRE4rN4hK5pjTp6/ibmmkyuKCnZXc9Nyoh71ihZ10bk
|
|
||||||
4yLhgnapQBrN+/Tqb2ZTM19Scpo+sw2KZ5Jrwrb6SH0kj+Dl1TNt1M+1gpcpK0pKTv5Ey88dRa/V
|
|
||||||
R/IzeYSv8bdq7tzXlKzvURMnUpK5nm2vaXmP/3a4Wc9ouqDnTBXGX/UD/2NK+BvoGGOS3U1foIo5
|
|
||||||
S77uvLw84h/No3LBTLvPcdm7Uoomenkk2+MHaPc5L3srKh/Oo3TRVTyteKF2URnFgyR702fVL3Rc
|
|
||||||
uq5qqLWe8QIQANapo+evUEbcSQXbJJvC17hCu6hsHc+YELXviE4M2F3/ETx02xxpHKd4kGQfCf9W
|
|
||||||
njnz246isqh+TSwAzJaWb2ew+u9LwNLoxZJsYPoCB5mjeLrzio1RL+3iMbidNqZkLnBcttEvrXp6
|
|
||||||
uaQEh8/0A9oC5/gNMamr5DG6rb08rfh2R+E6EISkxAbQe7tz/Ma90Uq6xAtAINxXlDKjpMRlz6pf
|
|
||||||
6Lh045bBdjazC4AAsFYdPX+ZmrMYEK30xkmJBN8yx8VvruXuq2P6vTwO9/q8NnbJM9zzI9q+REoU
|
|
||||||
+J7RCl55Xskujfl3xyIL2pdeDNUu+4XwbQF4No0CUpzga3xJy39qqZp3R1y+P54AAsArodplDxCE
|
|
||||||
pDjBt0rLf+rBeMEXLxf0XD3oKCpbxTPnkjtKij18eY/HFb5EALALwpcIQlIMY76XtPynHlTz74r7
|
|
||||||
tfAEeSZLHUVlz3DPAsqOkqIN3zNawStL4235EiUGPF+PGPWry8yWl0FtLUhRgG+Zo3Dd88rIGQlz
|
|
||||||
TYkGIADca57Y+Jbx1TJQm0NSZMgzAdm+0FG8aW00dzYkC4AAMNdqq/xt6NhP3QQhaXjwBfyAdrtz
|
|
||||||
fGwrXOwOIABMFh3V5aGa20vAXLSViTR4Cf9B5rx8gXP8hpjVdg5WPIEf316eMWG6s6RyKxQPbeol
|
|
||||||
DRK+1q08c+Z05xUbExa+RAcQANqYNurbrgnbVvDMmZQhJQ3M67TqV6h5j3/bUVSW8OtaieyCnq97
|
|
||||||
zKZ33zIaH6dDQUl9xXsS0lqoXfLmukh1riYAu2uK6Kh+I/TFjztbHtIOe9IZl7OKuabc5yh+vYop
|
|
||||||
mba5bLsB2Pmw9dWh2qU/Ex3/F+A5NPhS2uqZkKLlNS3/qfsTZXE9+QEM63bzxMbfGF8ty2Y8j7Kk
|
|
||||||
KWn1/G1Q837uKHot4h2rCcCBqUAazStDX9x/mwweoB0VqWT4rMZNyog7lzjGPWHrHid2B7BLi8zG
|
|
||||||
9S8YTU95yBomvdXzgrke1satWmOXREsqAAgAY6ReVxaqe2yB1KsoNkzOWK9czVm8TBu7pCFZbiuZ
|
|
||||||
AOzSrWbLln82Gx4pAUunTGlSWL3Wg8xx1S8dl6zYnIjlZARgry9NfyJ0bMWT1qk1jNxS27qbEsz1
|
|
||||||
pFbw9PJ49GshAIevIqnX/Sp0/Nm7RcdHYDyXQLSFuxmAFN631dyHntbG/LQWTEvaW012ALs0zWrf
|
|
||||||
/ajZ8PwcGfobwDwEYsKC17ZVyZr/nDZ26S6mjUr6W04VALs02zq5/WHjq/89A2YdgZhYFm+7kjnv
|
|
||||||
BW3Mkj8mW5xHAPbUXKutconR+OKNBGLcLd7HSuatK7UxS7akEnipDmCXSi3vrsVm4yvzhL6XYsRY
|
|
||||||
SfgBBCu450evanl3VaYieARgd00W/v33GY2rF4mObYzxbFq+iLi1MwHZLqUMrVFzH3pDHT1/byrE
|
|
||||||
eATg4JQj9bp7jabyu0T7+yWQAYBlkVUcfnx3kDuvWa/k3rlWzZndmsxZTQIwYgPHmGm1715gNr/z
|
|
||||||
I9HxkcKYG9QaY+DQQQYsAO9xz4JydfQPttm1WJoAjL8ypdH8Q7N58/etU++XSqMGBGOf0AFAJc+c
|
|
||||||
+3tlxKzfKSOm+8jaEYCRVIEI1HxXeP/8HevUf5TK0N8AsNR1U2UAkKcBOCt55swPlBGz/l3xfLM+
|
|
||||||
kXuwEIDJo2xpNN9ieT+ZaZ3aWio6PspjTANYOgAtOYGUJiB1SOltYtrllUrW7G0861t/UDK/1kaW
|
|
||||||
jgCMd8w41fL91wzh23O98G2fLkPVHkACcNrTXZUmACOcRJEhL1Pyd/L0a//E3ddtV7Ku25PKSwcE
|
|
||||||
oB3Gr+WbjWy65QAAAPBJREFULDoOfkMGDk8VHVVTRMeOSVK0gTFXJ5RKYljKM6BZAEKQMgTA2sfT
|
|
||||||
plXx9K/v4elX/YWnX7GXgCMA7S6XtHyTZODLiUKvnSD1L64U+qHxMlRbDLNOkdIAY1o4poSjE1AM
|
|
||||||
HVJpdv5gdM0IAELhH2UIACzGc2uYNvYwcxYf4mkl1cw57gBzFe7jacU6vS4CMJWsZRGMk4XS9F4s
|
|
||||||
rfYxMlifJ43m0dL05sBsGCnNEx5ped0AMiA6XGEqoXbSKgF0mjHoADrAM/xMHeVl6uiTUHJbmeo5
|
|
||||||
wbRRTUwb1QAl4xh35NdBG1nLuAsUu8VX/x83CvbHNjG9MAAAAABJRU5ErkJggg==
|
|
||||||
"
|
|
||||||
preserveAspectRatio="none"
|
|
||||||
height="25.097618"
|
|
||||||
width="25.012953" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
@@ -1,36 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
||||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
||||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="225.000000pt" height="225.000000pt" viewBox="0 0 225.000000 225.000000"
|
|
||||||
preserveAspectRatio="xMidYMid meet">
|
|
||||||
|
|
||||||
<g transform="translate(0.000000,225.000000) scale(0.100000,-0.100000)"
|
|
||||||
fill="#000000" stroke="none">
|
|
||||||
<path d="M900 2009 c-98 -15 -251 -71 -342 -125 -137 -82 -277 -233 -350 -379
|
|
||||||
-41 -81 -78 -210 -89 -315 -43 -393 188 -786 551 -941 134 -57 210 -72 370
|
|
||||||
-72 174 0 205 8 205 48 l0 29 -185 1 c-181 0 -187 1 -280 33 -133 44 -238 109
|
|
||||||
-335 206 -171 171 -254 366 -255 599 0 323 178 615 465 759 166 84 388 111
|
|
||||||
569 69 259 -60 480 -240 588 -478 35 -78 68 -201 68 -254 0 -34 20 -69 39 -69
|
|
||||||
4 0 16 6 26 14 18 13 18 19 6 97 -17 110 -58 231 -112 325 -51 90 -176 226
|
|
||||||
-265 290 -84 60 -214 119 -315 144 -98 24 -267 33 -359 19z"/>
|
|
||||||
<path d="M1018 1839 c-17 -9 -18 -34 -18 -299 l0 -289 -29 -15 c-69 -36 -104
|
|
||||||
-115 -82 -185 l12 -36 -136 -131 c-74 -72 -135 -138 -135 -147 0 -19 25 -40
|
|
||||||
44 -35 8 2 75 60 148 129 110 104 137 125 153 118 39 -15 109 -10 143 11 99
|
|
||||||
61 97 219 -5 269 l-33 16 0 287 c0 247 -2 289 -16 302 -18 19 -23 19 -46 5z
|
|
||||||
m81 -695 c29 -37 26 -70 -9 -106 -26 -25 -36 -29 -63 -24 -97 19 -85 156 14
|
|
||||||
156 29 0 42 -6 58 -26z"/>
|
|
||||||
<path d="M1601 1014 c-212 -57 -350 -268 -314 -480 31 -178 160 -313 337 -351
|
|
||||||
66 -14 88 -15 148 -5 143 25 261 112 319 236 62 133 60 248 -6 383 -87 176
|
|
||||||
-293 269 -484 217z m234 -85 c73 -27 156 -104 192 -177 25 -50 28 -68 28 -152
|
|
||||||
0 -84 -3 -102 -28 -152 -105 -213 -385 -265 -555 -104 -78 73 -105 131 -110
|
|
||||||
236 -6 126 33 217 127 296 86 72 234 95 346 53z"/>
|
|
||||||
<path d="M1768 836 c-55 -15 -111 -55 -141 -102 -19 -29 -27 -34 -64 -34 -39
|
|
||||||
0 -73 -19 -73 -40 0 -18 33 -40 61 -40 26 0 29 -3 29 -30 0 -28 -3 -30 -35
|
|
||||||
-30 -39 0 -59 -24 -44 -52 7 -13 22 -18 57 -18 44 0 48 -3 69 -39 28 -48 101
|
|
||||||
-98 158 -106 65 -10 80 -4 80 30 0 27 -4 30 -42 37 -50 8 -91 28 -117 57 l-19
|
|
||||||
21 50 0 c56 0 79 16 68 50 -6 18 -15 20 -76 20 l-69 0 0 30 0 30 63 0 c65 0
|
|
||||||
87 11 87 42 0 23 -30 38 -77 38 l-38 1 32 29 c18 16 49 32 70 35 49 8 67 18
|
|
||||||
71 39 5 22 -16 46 -37 45 -9 0 -37 -6 -63 -13z"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
||||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
||||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="225.000000pt" height="225.000000pt" viewBox="0 0 225.000000 225.000000"
|
|
||||||
preserveAspectRatio="xMidYMid meet">
|
|
||||||
|
|
||||||
<g transform="translate(0.000000,225.000000) scale(0.100000,-0.100000)"
|
|
||||||
fill="#000000" stroke="none">
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 438 B |
@@ -1,46 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Actualiza la interfaz tras validar si un nif está duplicado.
|
|
||||||
function handleNIFResponse(xhr, status, args) {
|
|
||||||
if (args.formattedNIF) {
|
|
||||||
var nif = PF('nif');
|
|
||||||
nif.jq.val(args.formattedNIF);
|
|
||||||
}
|
|
||||||
|
|
||||||
var nifButton = PF('nifButton');
|
|
||||||
if (args.NIFisDupe == false) {
|
|
||||||
nifButton.jq.children(".ui-icon").removeClass("pi pi-times");
|
|
||||||
nifButton.jq.removeClass('red-button');
|
|
||||||
|
|
||||||
nifButton.jq.children(".ui-icon").addClass("pi pi-check");
|
|
||||||
nifButton.jq.addClass('green-button');
|
|
||||||
} else if (nifButton.jq.hasClass('red-button') == false) {
|
|
||||||
nifButton.jq.children(".ui-icon").removeClass("pi pi-check");
|
|
||||||
nifButton.jq.removeClass('green-button');
|
|
||||||
|
|
||||||
nifButton.jq.children(".ui-icon").addClass("pi pi-times");
|
|
||||||
nifButton.jq.addClass('red-button');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="TestForm">
|
|
||||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="frmListDoctors" header="Listado de médicos por Centro de Antención Primaria">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:outputLabel for="selPHC" value="Centro de atención primaria:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-6 ui-md-6">
|
|
||||||
<p:autoComplete id="selPHC" dropdown="true" value="#{listDoctors.primaryHealthCareCenter}" completeMethod="#{listDoctors.completePrimaryHealCareCenter}" var="phc"
|
|
||||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" required="true" requiredMessage="Por favor, seleccione un centro de antención primaria" placeholder="Seleccione un centro o escriba para buscar...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{listDoctors.primaryHealthCareCenterList}" />
|
|
||||||
<p:ajax event="itemSelect" update="dtDoctorList" onstart="PF('dtDoctorList').getPaginator().setPage(0);" />
|
|
||||||
<p:column headerText="Nombre">
|
|
||||||
<h:outputText value="#{phc.name}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Localización">
|
|
||||||
<h:outputText value="#{phc.location}" />
|
|
||||||
</p:column>
|
|
||||||
</p:autoComplete>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
|
|
||||||
<div class="ui-g-12">
|
|
||||||
<p:dataTable id="dtDoctorList" widgetVar="dtDoctorList" var="d" value="#{listDoctors.lazyDataModelDoctorList}" lazy="true" paginator="true" rows="10"
|
|
||||||
paginatorPosition="bottom" paginatorAlwaysVisible="true"
|
|
||||||
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,30,40"
|
|
||||||
emptyMessage="No existe ningún doctor para el centro seleccionado.">
|
|
||||||
|
|
||||||
<p:column headerText="Número Profesional" style="width:100px;">
|
|
||||||
<h:outputText value="#{d.professionalNumber}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Nombre" style="width:150px;">
|
|
||||||
<h:outputText value="#{d.name}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Apellidos" style="width:auto;">
|
|
||||||
<h:outputText value="#{d.surname}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Correo electrónico" style="width:auto;">
|
|
||||||
<h:outputText value="#{d.email}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Número de pacientes" style="width:100px; text-align: center;">
|
|
||||||
<h:outputText value="#{listDoctors.getPatientsByDoctor(d.id)}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<f:facet name="paginatorBottomLeft">
|
|
||||||
<p:commandButton type="button" icon="pi pi-refresh" onclick="PF('dtDoctorList').getPaginator().setPage(0);" />
|
|
||||||
</f:facet>
|
|
||||||
</p:dataTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="frmListCAPs">
|
|
||||||
<p:growl id="mesgsList" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="PanelCAPList" style="margin-bottom: 10px;" header="Gestión de Centros de Atención Primaria">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<p:dataTable widgetVar="dtCAP" var="cap" value="#{ManageHealthCareCenters.lazyDataModelCAPsList}" editable="true" lazy="true" paginator="true" rows="10" paginatorPosition="bottom" paginatorAlwaysVisible="true"
|
|
||||||
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,30,40">
|
|
||||||
|
|
||||||
<p:ajax event="rowEdit" listener="#{ManageHealthCareCenters.onRowEdit}" update=":frmListCAPs:mesgsList" />
|
|
||||||
<p:ajax event="rowEditCancel" listener="#{ManageHealthCareCenters.onRowCancel}" update=":frmListCAPs:mesgsList" />
|
|
||||||
|
|
||||||
<p:column headerText="Nombre">
|
|
||||||
<p:cellEditor>
|
|
||||||
<f:facet name="output"><h:outputText value="#{cap.name}" /></f:facet>
|
|
||||||
<f:facet name="input"><p:inputText value="#{cap.name}" style="width:100%" label="Nombre"/></f:facet>
|
|
||||||
</p:cellEditor>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Localización">
|
|
||||||
<p:cellEditor>
|
|
||||||
<f:facet name="output"><h:outputText value="#{cap.location}" /></f:facet>
|
|
||||||
<f:facet name="input"><p:inputText value="#{cap.location}" style="width:100%" label="Localización"/></f:facet>
|
|
||||||
</p:cellEditor>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column style="width:80px; text-align: center;" headerText="Editar">
|
|
||||||
<p:rowEditor />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column style="width:80px; text-align: center;" headerText="Eliminar">
|
|
||||||
<p:commandLink class="pi pi-trash" actionListener="#{ManageHealthCareCenters.deleteDataById(cap.id)}" update=":frmListCAPs:mesgsList frmListCAPs">
|
|
||||||
<p:confirm header="Eliminar" message="¿Está seguro de que quiere borrar el centro?" icon="pi pi-exclamation-triangle"/>
|
|
||||||
</p:commandLink>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<f:facet name="paginatorBottomLeft">
|
|
||||||
<p:commandButton type="button" icon="pi pi-refresh" onclick="PF('dtCAP').getPaginator().setPage(0);" />
|
|
||||||
</f:facet>
|
|
||||||
</p:dataTable>
|
|
||||||
|
|
||||||
<p:confirmDialog global="true">
|
|
||||||
<p:commandButton value="Sí" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check"/>
|
|
||||||
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times"/>
|
|
||||||
</p:confirmDialog>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
|
|
||||||
<h:form id="frmAddCAPs">
|
|
||||||
<p:growl id="mesgsAdd" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="PanelNewCAP" header="Alta de Centros de Atención Primaria">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
<div class="ui-g-1 ui-md-1">
|
|
||||||
<p:outputLabel value="Nombre: " for="nameNew" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:inputText id="nameNew" value="#{ManageHealthCareCenters.name}" readonly="false" required="ManageHealthCareCenters.medicalSpecialty.name eq null"
|
|
||||||
requiredMessage="Es necesario un nombre" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1 ui-md-1">
|
|
||||||
<p:outputLabel value="Localización: " for="locationNew" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-6 ui-md-6">
|
|
||||||
<p:inputText id="locationNew" value="#{ManageHealthCareCenters.location}" readonly="false" required="ManageHealthCareCenters.medicalSpecialty.location eq null"
|
|
||||||
requiredMessage="Es necesaria una localización" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2 ">
|
|
||||||
<p:commandButton validateClient="true" value="Crear" update="mesgsAdd frmListCAPs frmAddCAPs" action="#{ManageHealthCareCenters.insertData}" icon="pi pi-check" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -2,74 +2,54 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="frmEditSpecialties">
|
<h:form id="TestForm">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
|
<p:panel id="PanelUnderConstruction" header="Pagina en construcción de Administrador">
|
||||||
<p:commandButton value="Sí" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check" />
|
|
||||||
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times" />
|
|
||||||
</p:confirmDialog>
|
|
||||||
|
|
||||||
<p:growl id="mesgsEdit" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="PanelMS" style="margin-bottom: 10px;" header="Modificación y borrado de especialidades">
|
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:outputLabel for="ms" />
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:selectOneMenu id="ms" value="#{ManageSpecialities.medicalSpecialty}" converter="omnifaces.SelectItemsIndexConverter" effect="fold" editable="true" filter="true"
|
<p:outputLabel for="campo" value="Etiqueta para campo de formulario:" />
|
||||||
filterMatchMode="startsWith" placeholder="- Selecciona una especialidad -">
|
|
||||||
<f:selectItems value="#{ManageSpecialities.medicalSpecialtiesList}" var="ms" itemValue="#{ms}" itemLabel="#{ms.name}" />
|
|
||||||
<f:ajax render="name description" />
|
|
||||||
</p:selectOneMenu>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1 ui-md-1">
|
|
||||||
<p:outputLabel value="Nombre: " for="name" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:inputText id="name" value="#{ManageSpecialities.medicalSpecialty.name}" converter="omnifaces.TrimConverter" readonly="false" required="true"
|
|
||||||
requiredMessage="Es necesario un nombre" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1 ui-md-1">
|
|
||||||
<p:outputLabel value="Descripción: " for="description" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:inputText id="description" value="#{ManageSpecialities.medicalSpecialty.description}" converter="omnifaces.TrimConverter" readonly="false" required="true"
|
<p:inputText id="campo" value="Valor del campo del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
requiredMessage="Es necesaria una descripción" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-1 ui-md-1 ">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:commandButton validateClient="true" value="Guardar" update="frmEditSpecialties" action="#{ManageSpecialities.saveData}" icon="pi pi-save" />
|
<p:message for="campo" display="text" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-1 ui-md-1 ">
|
|
||||||
<p:commandButton validateClient="true" value="Borrar" update="frmEditSpecialties" action="#{ManageSpecialities.deleteData}" icon="fa fa-remove">
|
|
||||||
<p:confirm header="Confirme la eliminación" message="¿Está seguro de que desea eliminar la especialidad?" icon="pi pi-exclamation-triangle" />
|
|
||||||
</p:commandButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
|
|
||||||
<h:form id="frmAddSpecialties">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:growl id="mesgsAdd" showDetail="true" closable="true" autoupdate="true" />
|
<p:outputLabel for="campo2" value="Etiqueta para campo 2 de formulario:" />
|
||||||
<p:panel id="PanelNewMS" header="Alta de especialidades">
|
</div>
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<div class="ui-g-1 ui-md-1">
|
<p:inputText id="campo2" value="Valor del campo 2 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
<p:outputLabel value="Nombre: " for="nameNew" />
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:message for="campo" display="text" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:outputLabel for="campo3" value="Etiqueta para campo 3 de formulario:" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:inputText id="campo3" value="Valor del campo 3 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4">
|
||||||
|
<p:message for="campo" display="text" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:inputText id="nameNew" value="#{ManageSpecialities.name}" readonly="false" required="ManageSpecialities.medicalSpecialty.name eq null"
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
requiredMessage="Es necesario un nombre" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-1 ui-md-1">
|
<div class="ui-g-4 ui-md-4" />
|
||||||
<p:outputLabel value="Descripción: " for="descriptionNew" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-6 ui-md-6">
|
|
||||||
<p:inputText id="descriptionNew" value="#{ManageSpecialities.description}" readonly="false" required="ManageSpecialities.medicalSpecialty.description eq null"
|
|
||||||
requiredMessage="Es necesaria una descripción" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2 ">
|
|
||||||
<p:commandButton validateClient="true" value="Crear" update="mesgsAdd frmAddSpecialties frmEditSpecialties" action="#{ManageSpecialities.insertData}" icon="pi pi-check" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="visitForm">
|
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="panelVisit" header="Detalles de la visita">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="paciente" value="Paciente:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputText id="paciente" value="#{AddVisit.patient.displayName}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="paciente" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="medico" value="Médico de familia:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputText id="medico" value="#{AddVisit.familyDoctor.displayName}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="medico" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="fecha" value="Fecha:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<div class="ui-inputgroup">
|
|
||||||
<p:datePicker id="fecha" widgetVar="fecha" value="#{AddVisit.date}" pattern="dd/MM/yyyy" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la fecha de la visita.">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:message for="fecha" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="hora" value="Hora:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:datePicker id="hora" value="#{AddVisit.time}" timeOnly="true" pattern="HH:mm" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la hora de la visita." validatorMessage="Especifique una hora en el rango de las 06:00 a las 22:00 horas">
|
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:message for="hora" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="observaciones" value="Observaciones:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputTextarea id="observaciones" value="#{AddVisit.observations}" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="observaciones" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<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="visitForm" action="#{AddVisit.saveData}" icon="pi pi-check" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="frmPatientVisitList">
|
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="PanelUnderConstruction" header="Próximas visitas agendadas">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="fecha" value="Ver agenda del día:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-3">
|
|
||||||
<div class="ui-inputgroup">
|
|
||||||
<p:datePicker id="fecha" value="#{PatientVisitList.selectedDate}" pattern="dd/MM/yyyy" showIcon="true" showButtonBar="true" autocomplete="true">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
<p:ajax event="dateSelect" listener="#{PatientVisitList.showData}" update="frmPatientVisitList" />
|
|
||||||
</p:datePicker>
|
|
||||||
<p:commandButton value="Mostrar" update="frmPatientVisitList" action="#{PatientVisitList.showData}" icon="fa calendar-alt" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-1" />
|
|
||||||
<div class="ui-g-2">Paciente:</div>
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<h:outputText rendered="#{not PatientVisitList.admin}" value="#{PatientVisitList.patient.displayName}" style="font-weight: bold;" />
|
|
||||||
<p:autoComplete rendered="#{PatientVisitList.admin}" id="filterPatient" dropdown="true" value="#{PatientVisitList.patient}"
|
|
||||||
completeMethod="#{PatientVisitList.completePatient}" var="p" itemLabel="#{p.displayName}" itemValue="#{p}" forceSelection="true"
|
|
||||||
placeholder="Seleccione un paciente o teclee para buscar...">
|
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{PatientVisitList.patientList}" />
|
|
||||||
<p:column headerText="Num. Prof.">
|
|
||||||
<h:outputText value="#{p.personalIdentificationCode}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Nombre">
|
|
||||||
<h:outputText value="#{p.name}" />
|
|
||||||
</p:column>
|
|
||||||
<p:column headerText="Apellidos">
|
|
||||||
<h:outputText value="#{p.surname}" />
|
|
||||||
</p:column>
|
|
||||||
<p:ajax event="itemSelect" listener="#{PatientVisitList.showData}" update="frmPatientVisitList" />
|
|
||||||
</p:autoComplete>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p:dataTable id="dtPatientVisitList" widgetVar="dtPatientVisitList" var="v" value="#{PatientVisitList.lazyDataModelVisitList}" lazy="true" paginator="true" rows="10"
|
|
||||||
paginatorPosition="bottom" paginatorAlwaysVisible="true"
|
|
||||||
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,30,40"
|
|
||||||
emptyMessage="No existen datos para los filtros seleccionados.">
|
|
||||||
|
|
||||||
<p:column headerText="Fecha" width="90">
|
|
||||||
<h:outputText value="#{v.date}">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
</h:outputText>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Hora" width="60">
|
|
||||||
<h:outputText value="#{v.time}">
|
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
|
||||||
</h:outputText>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Paciente" width="auto">
|
|
||||||
<h:outputText value="#{v.patient.displayName}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Observaciones" width="auto">
|
|
||||||
<h:outputText value="#{v.observations}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Resultado" width="auto">
|
|
||||||
<h:outputText value="#{v.result}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Anular" width="90">
|
|
||||||
<p:commandButton value="Anular" action="#{PatientVisitList.removeVisit(v.id)}" update="frmPatientVisitList" icon="pi pi-calendar-times" styleClass="red-button" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Modificar" width="100">
|
|
||||||
<p:commandButton value="Modificar" action="#{PatientVisitList.editVisit(v.id)}" update="frmPatientVisitList" icon="pi pi-pencil" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<f:facet name="paginatorBottomLeft">
|
|
||||||
<p:commandButton update="dtPatientVisitList" action="#{PatientVisitList.showData}" icon="pi pi-refresh" />
|
|
||||||
</f:facet>
|
|
||||||
</p:dataTable>
|
|
||||||
|
|
||||||
<div class="ui-g-12 ui-g-nopad">
|
|
||||||
<div class="ui-g-4 ui-md-5" />
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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:viewParam name="id" value="#{UpdateVisit.id}" required="true" />
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="visitForm">
|
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="panelVisit" header="Actualizar detalles de la visita">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="paciente" value="Paciente:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<p:inputText id="paciente" value="#{UpdateVisit.patient.displayName}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-6">
|
|
||||||
<p:message for="paciente" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="medico" value="Médico de familia:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4">
|
|
||||||
<p:inputText id="medico" value="#{UpdateVisit.familyDoctor.displayName}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-6">
|
|
||||||
<p:message for="medico" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="fecha" value="Fecha:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<div class="ui-inputgroup">
|
|
||||||
<p:datePicker id="fecha" value="#{UpdateVisit.date}" pattern="dd/MM/yyyy" disabled="#{UpdateVisit.onlyResult}" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la fecha de la visita." readonly="#{UpdateVisit.onlyResult}">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" timeStyle="short" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:message for="fecha" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="hora" value="Hora:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:datePicker id="hora" value="#{UpdateVisit.time}" timeOnly="true" pattern="HH:mm" disabled="#{UpdateVisit.onlyResult}" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la hora de la visita." readonly="#{UpdateVisit.onlyResult}">
|
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" timeStyle="Short" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:message for="hora" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="observaciones" value="Observaciones:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputTextarea id="observaciones" value="#{UpdateVisit.observations}" readonly="#{UpdateVisit.onlyResult}" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="observaciones" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="resultado" value="Resultado:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputTextarea id="resultado" value="#{UpdateVisit.result}" readonly="#{not UpdateVisit.onlyResult}" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="resultado" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<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="visitForm" action="#{UpdateVisit.saveData}" icon="pi pi-check" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:button value="Volver" outcome="#{UpdateVisit.fromPage}" icon="pi pi-home" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="frmVisitList">
|
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
|
||||||
<p:panel id="PanelUnderConstruction" header="Consultar agenda del día">
|
|
||||||
<div class="ui-g ui-fluid">
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="fecha" value="Ver agenda del día:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-3">
|
|
||||||
<div class="ui-inputgroup">
|
|
||||||
<p:datePicker id="fecha" value="#{VisitList.selectedDate}" pattern="dd/MM/yyyy" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique una fecha para realizar la consulta.">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
<p:ajax event="dateSelect" listener="#{VisitList.showData}" update="frmVisitList" />
|
|
||||||
</p:datePicker>
|
|
||||||
<p:commandButton value="Mostrar" update="frmVisitList" action="#{VisitList.showData}" icon="fa calendar-alt" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2" />
|
|
||||||
<div class="ui-g-5">
|
|
||||||
Médico de familia:
|
|
||||||
<h:outputText value="#{VisitList.familyDoctorDisplayName}" style="font-weight: bold;" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p:dataTable id="dtVisitList" widgetVar="dtVisitList" var="v" value="#{VisitList.lazyDataModelVisitList}" lazy="true" paginator="true" rows="10" paginatorPosition="bottom"
|
|
||||||
paginatorAlwaysVisible="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
|
|
||||||
rowsPerPageTemplate="10,20,30,40" emptyMessage="No existen datos para los filtros seleccionados.">
|
|
||||||
|
|
||||||
<p:column headerText="Fecha" width="90">
|
|
||||||
<h:outputText value="#{v.date}">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
</h:outputText>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Hora" width="60">
|
|
||||||
<h:outputText value="#{v.time}">
|
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
|
||||||
</h:outputText>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Paciente" width="auto">
|
|
||||||
<h:outputText value="#{v.patient.displayName}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Observaciones" width="auto">
|
|
||||||
<h:outputText value="#{v.observations}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Resultado" width="auto">
|
|
||||||
<h:outputText value="#{v.result}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Ver" width="80px;">
|
|
||||||
<p:commandButton value="Ver" action="#{VisitList.showVisit(v.id)}" icon="pi pi-check" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Modificar" width="100px;">
|
|
||||||
<p:commandButton value="Modificar" action="#{VisitList.editVisit(v.id)}" icon="pi pi-check" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<f:facet name="paginatorBottomLeft">
|
|
||||||
<p:commandButton update="dtVisitList" action="#{VisitList.showData}" icon="pi pi-refresh" />
|
|
||||||
</f:facet>
|
|
||||||
</p:dataTable>
|
|
||||||
|
|
||||||
<div class="ui-g-12 ui-g-nopad">
|
|
||||||
<div class="ui-g-4 ui-md-5" />
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
|
||||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p:panel>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -2,91 +2,52 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<f:viewParam name="id" value="#{VisitView.id}" required="true" />
|
|
||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="visitForm">
|
<h:form id="TestForm">
|
||||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
<p:panel id="panelVisit" header="Detalles de la visita">
|
<p:panel id="PanelUnderConstruction" header="Pagina en construcción de Visitas">
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel for="paciente" value="Paciente:" />
|
<p:outputLabel for="campo" value="Etiqueta para campo de formulario:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-8">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:inputText id="paciente" value="#{VisitView.patient.displayName}" readonly="true" />
|
<p:inputText id="campo" value="Valor del campo del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:message for="paciente" display="text" />
|
<p:message for="campo" display="text" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel for="medico" value="Médico de familia:" />
|
<p:outputLabel for="campo2" value="Etiqueta para campo 2 de formulario:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-8">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:inputText id="medico" value="#{VisitView.familyDoctor.displayName}" readonly="true" />
|
<p:inputText id="campo2" value="Valor del campo 2 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:message for="medico" display="text" />
|
<p:message for="campo" display="text" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:outputLabel for="fecha" value="Fecha:" />
|
<p:outputLabel for="campo3" value="Etiqueta para campo 3 de formulario:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<div class="ui-inputgroup">
|
<p:inputText id="campo3" value="Valor del campo 3 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||||
<p:datePicker id="fecha" value="#{VisitView.date}" pattern="dd/MM/yyyy" showIcon="true" disabled="true" showButtonBar="true" autocomplete="true" required="true"
|
|
||||||
requiredMessage="Especifique la fecha de la visita.">
|
|
||||||
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="ui-g-4 ui-md-4">
|
||||||
<div class="ui-g-8">
|
<p:message for="campo" display="text" />
|
||||||
<p:message for="fecha" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="hora" value="Hora:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:datePicker id="hora" value="#{VisitView.time}" timeOnly="true" pattern="HH:mm" showIcon="true" showButtonBar="true" autocomplete="true" disabled="true" required="true"
|
|
||||||
requiredMessage="Especifique la hora de la visita.">
|
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
|
||||||
</p:datePicker>
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:message for="hora" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="observaciones" value="Observaciones:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputTextarea id="observaciones" value="#{VisitView.observations}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="observaciones" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="resultado" value="Resultado:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputTextarea id="resultado" value="#{VisitView.result}" readonly="true" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="resultado" display="text" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-12 ui-g-nopad">
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
<div class="ui-g-4 ui-md-4" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
<div class="ui-g-2 ui-md-2 ">
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
<p:commandButton value="Editar" action="#{VisitView.editVisit(VisitView.id)}" icon="pi pi-time" />
|
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{BeanName.actionMethod}" icon="pi pi-check" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:button value="Volver" outcome="#{VisitView.fromPage}" icon="pi pi-home" />
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-4 ui-md-4" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"apps" : [{
|
|
||||||
"name": "ANT",
|
|
||||||
"script": "start.sh",
|
|
||||||
"cwd": "./",
|
|
||||||
"ignore_watch": ["*.ear", "*.jar", "*.war", "./build/*", "./dist/*", "ecosystem.json"],
|
|
||||||
"watch": true
|
|
||||||
},{
|
|
||||||
"name": "Widlfly",
|
|
||||||
"script": "standalone.sh",
|
|
||||||
"cwd": "/opt/wildfly/bin/"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<application>
|
||||||
<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>
|
<display-name>MyHealth</display-name>
|
||||||
<module>
|
<module>
|
||||||
<web>
|
<web>
|
||||||
@@ -13,3 +10,4 @@
|
|||||||
<ejb>MyHealth.jar</ejb>
|
<ejb>MyHealth.jar</ejb>
|
||||||
</module>
|
</module>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class FamilyDoctorTO implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
return String.format("[%s] %s %s", this.professionalNumber, this.name, this.surname);
|
return String.format("[%d] %s %s", this.id, this.name, this.surname);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO getPrimaryHealthCareCenter() {
|
public PrimaryHealthCareCenterTO getPrimaryHealthCareCenter() {
|
||||||
|
|||||||
@@ -18,19 +18,18 @@ public class LoggedUserTO implements Serializable {
|
|||||||
private String id;
|
private String id;
|
||||||
private String password;
|
private String password;
|
||||||
private String name;
|
private String name;
|
||||||
private String displayName;
|
|
||||||
private UserType userType;
|
private UserType userType;
|
||||||
|
|
||||||
public LoggedUserTO() {
|
public LoggedUserTO() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoggedUserTO(String usrId, String usrName, String usrPwd, UserType usrType, String dispName) {
|
public LoggedUserTO(String usrId, String usrName, String usrPwd, UserType usrType) {
|
||||||
id = usrId;
|
id = usrId;
|
||||||
name = usrName;
|
name = usrName;
|
||||||
password = usrPwd;
|
password = usrPwd;
|
||||||
userType = usrType;
|
userType = usrType;
|
||||||
displayName = dispName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@@ -61,16 +60,8 @@ public class LoggedUserTO implements Serializable {
|
|||||||
return userType;
|
return userType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserType(UserType value) {
|
public void setUserType(UserType userType) {
|
||||||
this.userType = value;
|
this.userType = userType;
|
||||||
}
|
|
||||||
|
|
||||||
public String getDisplayName() {
|
|
||||||
return displayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDisplayName(String displayName) {
|
|
||||||
this.displayName = displayName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "medicalSpecialty")
|
@XmlRootElement(name = "medicalspeciality")
|
||||||
public class MedicalSpecialtyTO implements Serializable {
|
public class MedicalSpecialtyTO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
package TO;
|
package TO;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import common.MedicalTestType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Roberto Orden Erena <rorden@uoc.edu>
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "MedicalTest")
|
@XmlRootElement(name = "MedicalTest")
|
||||||
@@ -18,102 +14,10 @@ public class MedicalTestTO implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private int id;
|
|
||||||
private LocalDate date;
|
|
||||||
private LocalTime time;
|
|
||||||
private String observations;
|
|
||||||
private String highresimage;
|
|
||||||
private MedicalTestType type;
|
|
||||||
private PatientTO patient;
|
|
||||||
private SpecialistDoctorTO specialistDoctor;
|
|
||||||
|
|
||||||
|
|
||||||
public MedicalTestTO() {
|
public MedicalTestTO() {
|
||||||
super();
|
super();
|
||||||
this.date = LocalDate.now();
|
|
||||||
this.time = LocalTime.now();
|
|
||||||
this.patient = new PatientTO();
|
|
||||||
this.specialistDoctor = new SpecialistDoctorTO();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MedicalTestTO(int id, LocalDate date, LocalTime time, String observations, String highresimage, MedicalTestType type,
|
|
||||||
PatientTO patiend, SpecialistDoctorTO specialistDoctor) {
|
|
||||||
this.setId(id);
|
|
||||||
this.setDate(date);
|
|
||||||
this.setTime(time);
|
|
||||||
this.setObservations(observations);
|
|
||||||
this.setHighresimage(highresimage);
|
|
||||||
this.setType(type);
|
|
||||||
this.setPatient(patiend);
|
|
||||||
this.setSpecialistDoctor(specialistDoctor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getDate() {
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(LocalDate date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalTime getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(LocalTime time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getObservations() {
|
|
||||||
return observations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setObservations(String observations) {
|
|
||||||
this.observations = observations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHighresimage() {
|
|
||||||
return highresimage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHighresimage(String highresimage) {
|
|
||||||
this.highresimage = highresimage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalTestType getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(MedicalTestType type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientTO getPatient() {
|
|
||||||
return patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatient(PatientTO patient) {
|
|
||||||
this.patient = patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpecialistDoctorTO getSpecialistDoctor() {
|
|
||||||
return specialistDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpecialistDoctor(SpecialistDoctorTO specialistDoctor) {
|
|
||||||
this.specialistDoctor = specialistDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return Integer.toString(this.getId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import jpa.FamilyDoctorJPA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
@@ -88,10 +90,6 @@ public class PatientTO implements Serializable {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
|
||||||
return String.format("[%s] %s %s", this.personalIdentificationCode, this.name, this.surname);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyDoctorTO getFamilyDoctor() {
|
public FamilyDoctorTO getFamilyDoctor() {
|
||||||
return familyDoctor;
|
return familyDoctor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,118 +0,0 @@
|
|||||||
package TO;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
import common.QuestionStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Roberto Orden Erena <rorden@uoc.edu>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@XmlRootElement(name = "Question")
|
|
||||||
public class QuestionTO implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private int id;
|
|
||||||
private String title;
|
|
||||||
private String message;
|
|
||||||
private QuestionStatus status;
|
|
||||||
private String response;
|
|
||||||
private PatientTO patient;
|
|
||||||
private FamilyDoctorTO fdoctor;
|
|
||||||
|
|
||||||
|
|
||||||
public QuestionTO() {
|
|
||||||
super();
|
|
||||||
this.patient = new PatientTO();
|
|
||||||
this.fdoctor = new FamilyDoctorTO();
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuestionTO(int id, String title, String message, QuestionStatus status, PatientTO patient,
|
|
||||||
FamilyDoctorTO fdoctor, String response) {
|
|
||||||
super();
|
|
||||||
this.id = id;
|
|
||||||
this.title = title;
|
|
||||||
this.message = message;
|
|
||||||
this.status = status;
|
|
||||||
this.patient = patient;
|
|
||||||
this.fdoctor = fdoctor;
|
|
||||||
this.response = response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitle(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuestionStatus getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(QuestionStatus status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientTO getPatient() {
|
|
||||||
return patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatient(PatientTO patient) {
|
|
||||||
this.patient = patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyDoctorTO getDoctor() {
|
|
||||||
return fdoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoctor(FamilyDoctorTO fdoctor) {
|
|
||||||
this.fdoctor = fdoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResponse() {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResponse(String response) {
|
|
||||||
this.response = response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return "{"
|
|
||||||
+ "ObjectID" + super.toString()
|
|
||||||
+ ",id" + this.getId()
|
|
||||||
+ ",title" + this.getTitle()
|
|
||||||
+ ",message" + this.getMessage()
|
|
||||||
+ ",response" + this.getResponse()
|
|
||||||
+ ",status" + this.getStatus()
|
|
||||||
+ ",patient-id" + this.getPatient().getId()
|
|
||||||
+ ",patient-name-surname" + this.getPatient().getName() + " " + this.getPatient().getSurname()
|
|
||||||
+ ",fdoctor-id" + this.getDoctor().getId()
|
|
||||||
+ ",fdoctor-name-surname" + this.getDoctor().getName() + " " + this.getDoctor().getSurname()
|
|
||||||
+ "}";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -85,10 +85,6 @@ public class SpecialistDoctorTO implements Serializable {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
|
||||||
return String.format("[%s] %s %s", this.professionalNumber, this.name, this.surname);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalSpecialtyTO getMedicalSpecialty() {
|
public MedicalSpecialtyTO getMedicalSpecialty() {
|
||||||
return medicalSpecialty;
|
return medicalSpecialty;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
package TO;
|
package TO;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.sql.Time;
|
||||||
import java.time.LocalTime;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transfer object (TO) MedicalSpecialtyTO Para el intercambio de datos entre la capa de interfaz y la capa de negocio
|
* Transfer object (TO) MedicalSpecialtyTO Para el intercambio de datos entre la
|
||||||
|
* capa de interfaz y la capa de negocio
|
||||||
*
|
*
|
||||||
* Además esta clase facilita la implementación futura de una Capa SOA (Se define la anotación para la serialización de esta clase: @XmlRootElement(name = "medicalspeciality")
|
* Además esta clase facilita la implementación futura de una Capa SOA (Se
|
||||||
|
* define la anotación para la serialización de esta clase: @XmlRootElement(name
|
||||||
|
* = "medicalspeciality")
|
||||||
*
|
*
|
||||||
* @author mark
|
* @author mark
|
||||||
*
|
*
|
||||||
@@ -17,10 +20,12 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
@XmlRootElement(name = "Visit")
|
@XmlRootElement(name = "Visit")
|
||||||
public class VisitTO implements Serializable {
|
public class VisitTO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private LocalDate date;
|
private Date date;
|
||||||
private LocalTime time;
|
private Time time;
|
||||||
private String observations;
|
private String observations;
|
||||||
private String result;
|
private String result;
|
||||||
private FamilyDoctorTO familyDoctor;
|
private FamilyDoctorTO familyDoctor;
|
||||||
@@ -29,17 +34,11 @@ public class VisitTO implements Serializable {
|
|||||||
public VisitTO() {
|
public VisitTO() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
public VisitTO(Integer id, Date date, Time time, String observation, String result) {
|
||||||
public VisitTO(Integer Id, LocalDate date, LocalTime time, String observations, String result, FamilyDoctorTO fd, PatientTO pat) {
|
this.setId(id);
|
||||||
this.id = Id;
|
|
||||||
this.date=date;
|
this.date=date;
|
||||||
this.time = time;
|
//this.time
|
||||||
this.observations = observations;
|
|
||||||
this.result = result;
|
|
||||||
this.familyDoctor = fd;
|
|
||||||
this.patient = pat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
@@ -48,19 +47,19 @@ public class VisitTO implements Serializable {
|
|||||||
this.id=id;
|
this.id=id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalDate getDate() {
|
public Date getDate() {
|
||||||
return this.date;
|
return this.date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDate(LocalDate date) {
|
public void setDate(Date date) {
|
||||||
this.date=date;
|
this.date=date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalTime getTime() {
|
public Time getTime() {
|
||||||
return this.time;
|
return this.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTime(LocalTime time) {
|
public void setTime(Time time) {
|
||||||
this.time=time;
|
this.time=time;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,28 +71,5 @@ public class VisitTO implements Serializable {
|
|||||||
this.observations=observations;
|
this.observations=observations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getResult() {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResult(String result) {
|
|
||||||
this.result = result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyDoctorTO getFamilyDoctor() {
|
|
||||||
return familyDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFamilyDoctor(FamilyDoctorTO familyDoctor) {
|
|
||||||
this.familyDoctor = familyDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientTO getPatient() {
|
|
||||||
return patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatient(PatientTO patient) {
|
|
||||||
this.patient = patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ package common;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int MAX_ITEMS_AUTOCOMPLETE_SEARCH = 20;
|
public static final int MAX_ITEMS_AUTOCOMPLETE_SEARCH = 200;
|
||||||
public static final String PROFESSIONAL_NUMBER_PREFIX = "PRO#";
|
public static final String PROFESSIONAL_NUMBER_PREFIX = "PRO#";
|
||||||
public static final String PERSONAL_IDENTIFICATION_CODE_PREFIX = "PAT#";
|
public static final String PERSONAL_IDENTIFICATION_CODE_PREFIX = "PAT#";
|
||||||
|
|
||||||
public static final int DEFAULT_TABLE_GRID_PAGE_SIZE = 20;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package common;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum QuestionStatus {
|
public enum QuestionStatus {
|
||||||
ANSWERED("Respondida"), PENDING("Pendiente"), NEW("New");
|
ANSWERED("Respondida"), PENDING("Pendiente");
|
||||||
|
|
||||||
private String questionStatusName;
|
private String questionStatusName;
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ package common;
|
|||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum MedicalTestType {
|
public enum TestType {
|
||||||
MAGNETIC_RESONANCE_IMAGING("Imagen por Resonancia Magnética"), CT_SCAN("Tomografía Áxial Computerizada"), BLOOD_TEST("Análisis de sangre");
|
MAGNETIC_RESONANCE_IMAGING("Imagen por Resonancia Magnética"), CT_SCAN("Tomografía Áxial Computerizada"), BLOOD_TEST("Análisis de sangre");
|
||||||
|
|
||||||
private String testTypeName;
|
private String testTypeName;
|
||||||
|
|
||||||
private MedicalTestType(String typeName) {
|
private TestType(String typeName) {
|
||||||
this.testTypeName = typeName;
|
this.testTypeName = typeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package common;
|
package common;
|
||||||
|
|
||||||
import java.text.Normalizer;
|
import java.text.Normalizer;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -17,13 +16,4 @@ public class Utils {
|
|||||||
//return stripAccents(input).toLowerCase();
|
//return stripAccents(input).toLowerCase();
|
||||||
return input.toLowerCase();
|
return input.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Throwable getExceptionRootCause(Throwable throwable) {
|
|
||||||
Objects.requireNonNull(throwable);
|
|
||||||
Throwable rootCause = throwable;
|
|
||||||
while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
|
|
||||||
rootCause = rootCause.getCause();
|
|
||||||
}
|
|
||||||
return rootCause;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,31 +6,23 @@ import java.util.List;
|
|||||||
import javax.ejb.Stateless;
|
import javax.ejb.Stateless;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import javax.persistence.PersistenceContext;
|
||||||
|
import javax.persistence.Query;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
|
|
||||||
|
import org.jboss.security.auth.spi.Users.User;
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
import TO.FamilyDoctorTO;
|
||||||
import TO.MedicalSpecialtyTO;
|
import TO.MedicalSpecialtyTO;
|
||||||
import TO.MedicalTestTO;
|
|
||||||
import TO.PatientTO;
|
import TO.PatientTO;
|
||||||
import TO.PrimaryHealthCareCenterTO;
|
import TO.PrimaryHealthCareCenterTO;
|
||||||
import TO.QuestionTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
import TO.SpecialistDoctorTO;
|
||||||
import TO.VisitTO;
|
|
||||||
import common.Utils;
|
import common.Utils;
|
||||||
import jpa.FamilyDoctorJPA;
|
import jpa.FamilyDoctorJPA;
|
||||||
import jpa.MedicalSpecialtyJPA;
|
import jpa.MedicalSpecialtyJPA;
|
||||||
import jpa.MedicalTestJPA;
|
|
||||||
import jpa.PatientJPA;
|
import jpa.PatientJPA;
|
||||||
import jpa.PrimaryHealthCareCenterJPA;
|
import jpa.PrimaryHealthCareCenterJPA;
|
||||||
import jpa.QuestionJPA;
|
|
||||||
import jpa.SpecialistDoctorJPA;
|
import jpa.SpecialistDoctorJPA;
|
||||||
import jpa.VisitJPA;
|
|
||||||
|
|
||||||
/***
|
|
||||||
*
|
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Stateless
|
@Stateless
|
||||||
public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||||
// Persistence Unit Context
|
// Persistence Unit Context
|
||||||
@@ -38,10 +30,7 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
private EntityManager entman;
|
private EntityManager entman;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metodo que devuelve todas las especialidades medicas registradas en el
|
* Metodo que devuelve todas las especialidades medicas
|
||||||
* sistema
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
|
|
||||||
*/
|
*/
|
||||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialities() {
|
public List<MedicalSpecialtyTO> listAllMedicalSpecialities() {
|
||||||
return this.listMedicalSpecialitiesPaged(0, 0);
|
return this.listMedicalSpecialitiesPaged(0, 0);
|
||||||
@@ -51,30 +40,13 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
* Metodo que devuelve las especialidades médicas de forma paginada
|
* Metodo que devuelve las especialidades médicas de forma paginada
|
||||||
*
|
*
|
||||||
* Acepta como parametro la página (comenzando en 0) y el número de elementos de
|
* Acepta como parametro la página (comenzando en 0) y el número de elementos de
|
||||||
* cada página.
|
* cada página
|
||||||
*
|
*
|
||||||
* si pageSize == 0, entonces se devuelven todas las especialidades registradas
|
|
||||||
* (Se ignora el parámetro).
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
|
|
||||||
*/
|
*/
|
||||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize) {
|
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize) {
|
||||||
return listMedicalSpecialitiesFiltered(null, pageNumber, pageSize);
|
return listMedicalSpecialitiesFiltered(null, pageNumber, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista de espcialidades médicas que tienen una
|
|
||||||
* coincidencia parcial en el nombre o en la descripción con el termino de
|
|
||||||
* búsqueda (searchTerm) especificado.
|
|
||||||
*
|
|
||||||
* Además permite la paginacción de datos. Si pageSize == 0 no se realiza
|
|
||||||
* paginación y se devuelven todos los resultados.
|
|
||||||
*
|
|
||||||
* Si serachTerm es nulo o cadena vacía entonces no se tiene en cuenta el
|
|
||||||
* parámetro y devuelven todas las especialidades existentes.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize) {
|
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize) {
|
||||||
String strQuery = "SELECT ms from MedicalSpecialtyJPA ms %s order by ms.name, ms.description";
|
String strQuery = "SELECT ms from MedicalSpecialtyJPA ms %s order by ms.name, ms.description";
|
||||||
String strFilter = "";
|
String strFilter = "";
|
||||||
@@ -87,8 +59,7 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
strFilter = "WHERE lower(ms.name) LIKE :searchTerm OR lower(ms.description) LIKE :searchTerm";
|
strFilter = "WHERE lower(ms.name) LIKE :searchTerm OR lower(ms.description) LIKE :searchTerm";
|
||||||
}
|
}
|
||||||
|
|
||||||
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery(String.format(strQuery, strFilter),
|
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery(String.format(strQuery, strFilter), MedicalSpecialtyJPA.class);
|
||||||
MedicalSpecialtyJPA.class);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0)
|
if (searchTerm.length() > 0)
|
||||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
||||||
@@ -108,41 +79,14 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
return allSpecialities;
|
return allSpecialities;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve todos los CAPs registrados en el sistema
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<PrimaryHealthCareCenterTO> listAllCAPs() {
|
public List<PrimaryHealthCareCenterTO> listAllCAPs() {
|
||||||
return this.listCAPsPaged(0, 0);
|
return this.listCAPsPaged(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista de CAPs (Centros de Atención Primarios) de
|
|
||||||
* forma paginada
|
|
||||||
*
|
|
||||||
* Si pageSize == 0 no se realiza paginación y se devuelven todos los
|
|
||||||
* resultados.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<PrimaryHealthCareCenterTO> listCAPsPaged(int pageNumber, int pageSize) {
|
public List<PrimaryHealthCareCenterTO> listCAPsPaged(int pageNumber, int pageSize) {
|
||||||
return this.listCAPsFiltered(null, pageNumber, pageSize);
|
return this.listCAPsFiltered(null, pageNumber, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista de CAPs (Centros de Atención Primarios) que
|
|
||||||
* tienen una coincidencia parcial en el nombre o en la localización con el
|
|
||||||
* termino de búsqueda (searchTerm) especificado.
|
|
||||||
*
|
|
||||||
* Además permite la paginacción de datos. Si pageSize == 0 no se realiza
|
|
||||||
* paginación y se devuelven todos los resultados.
|
|
||||||
*
|
|
||||||
* Si serachTerm es nulo o cadena vacía entonces no se tiene en cuenta el
|
|
||||||
* parámetro y devuelven todos los CAPs existentes.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de PrimaryHealthCareCenterTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<PrimaryHealthCareCenterTO> listCAPsFiltered(String searchTerm, int pageNumber, int pageSize) {
|
public List<PrimaryHealthCareCenterTO> listCAPsFiltered(String searchTerm, int pageNumber, int pageSize) {
|
||||||
String strQuery = "SELECT phc from PrimaryHealthCareCenterJPA phc %s order by phc.name, phc.location";
|
String strQuery = "SELECT phc from PrimaryHealthCareCenterJPA phc %s order by phc.name, phc.location";
|
||||||
String strFilter = "";
|
String strFilter = "";
|
||||||
@@ -155,8 +99,7 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
strFilter = "WHERE lower(phc.name) LIKE :searchTerm OR lower(phc.location) LIKE :searchTerm";
|
strFilter = "WHERE lower(phc.name) LIKE :searchTerm OR lower(phc.location) LIKE :searchTerm";
|
||||||
}
|
}
|
||||||
|
|
||||||
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery(String.format(strQuery, strFilter),
|
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery(String.format(strQuery, strFilter), PrimaryHealthCareCenterJPA.class);
|
||||||
PrimaryHealthCareCenterJPA.class);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0)
|
if (searchTerm.length() > 0)
|
||||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
||||||
@@ -176,42 +119,14 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
return allCAPs;
|
return allCAPs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista con todos los médicos de familia registrados en
|
|
||||||
* el sistema.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de FamilyDoctorTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<FamilyDoctorTO> listAllFamilyDoctors() {
|
public List<FamilyDoctorTO> listAllFamilyDoctors() {
|
||||||
return this.listFamilyDoctorsPaged(0, 0);
|
return this.listFamilyDoctorsPaged(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista con todos los médicos de familia registrados en
|
|
||||||
* el sistema de forma paginada.
|
|
||||||
*
|
|
||||||
* Si pageSize == 0 no se realiza paginación y se devuelven todos los
|
|
||||||
* resultados.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de FamilyDoctorTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<FamilyDoctorTO> listFamilyDoctorsPaged(int pageNumber, int pageSize) {
|
public List<FamilyDoctorTO> listFamilyDoctorsPaged(int pageNumber, int pageSize) {
|
||||||
return this.listFamilyDoctorsFiltered(null, pageNumber, pageSize);
|
return this.listFamilyDoctorsFiltered(null, pageNumber, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista de médicos de familia que tienen una
|
|
||||||
* coincidencia parcial en el nombre o en los apellidos con el termino de
|
|
||||||
* búsqueda (searchTerm) especificado.
|
|
||||||
*
|
|
||||||
* Además permite la paginacción de datos. Si pageSize == 0 no se realiza
|
|
||||||
* paginación y se devuelven todos los resultados.
|
|
||||||
*
|
|
||||||
* Si serachTerm es nulo o cadena vacía entonces no se tiene en cuenta el
|
|
||||||
* parámetro y devuelven todos los registros existentes.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de FamilyDoctorTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<FamilyDoctorTO> listFamilyDoctorsFiltered(String searchTerm, int pageNumber, int pageSize) {
|
public List<FamilyDoctorTO> listFamilyDoctorsFiltered(String searchTerm, int pageNumber, int pageSize) {
|
||||||
String strQuery = "SELECT fd FROM FamilyDoctorJPA fd %s order by fd.name, fd.surname";
|
String strQuery = "SELECT fd FROM FamilyDoctorJPA fd %s order by fd.name, fd.surname";
|
||||||
String strFilter = "";
|
String strFilter = "";
|
||||||
@@ -224,8 +139,7 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
strFilter = "WHERE lower(fd.name) LIKE :searchTerm OR lower(fd.surname) LIKE :searchTerm";
|
strFilter = "WHERE lower(fd.name) LIKE :searchTerm OR lower(fd.surname) LIKE :searchTerm";
|
||||||
}
|
}
|
||||||
|
|
||||||
TypedQuery<FamilyDoctorJPA> query = entman.createQuery(String.format(strQuery, strFilter),
|
TypedQuery<FamilyDoctorJPA> query = entman.createQuery(String.format(strQuery, strFilter), FamilyDoctorJPA.class);
|
||||||
FamilyDoctorJPA.class);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0)
|
if (searchTerm.length() > 0)
|
||||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
||||||
@@ -245,64 +159,6 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
return allFDTOs;
|
return allFDTOs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista con todos los pacientes registrados en el sistema de forma paginada.
|
|
||||||
*
|
|
||||||
* Si pageSize == 0 no se realiza paginación y se devuelven todos los resultados.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de PatientTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<PatientTO> listPatientsPaged(int pageNumber, int pageSize) {
|
|
||||||
return this.listPatientsFiltered(null, pageNumber, pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que devuelve una lista de pacientes que tienen una coincidencia parcial en el nombre o en los apellidos con el termino de búsqueda (searchTerm) especificado.
|
|
||||||
*
|
|
||||||
* Además permite la paginacción de datos. Si pageSize == 0 no se realiza paginación y se devuelven todos los resultados.
|
|
||||||
*
|
|
||||||
* Si serachTerm es nulo o cadena vacía entonces no se tiene en cuenta el parámetro y devuelven todos los registros existentes.
|
|
||||||
*
|
|
||||||
* @return Devuelve una Lista de PatientTO (Transfer Objects).
|
|
||||||
*/
|
|
||||||
public List<PatientTO> listPatientsFiltered(String searchTerm, int pageNumber, int pageSize) {
|
|
||||||
String strQuery = "SELECT p FROM PatientJPA p %s order by p.name, p.surname";
|
|
||||||
String strFilter = "";
|
|
||||||
if (searchTerm == null)
|
|
||||||
searchTerm = "";
|
|
||||||
else
|
|
||||||
searchTerm = Utils.normalizeTerm(searchTerm);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0) {
|
|
||||||
strFilter = "WHERE lower(p.name) LIKE :searchTerm OR lower(p.surname) LIKE :searchTerm";
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedQuery<PatientJPA> query = entman.createQuery(String.format(strQuery, strFilter), PatientJPA.class);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0)
|
|
||||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PatientJPA> allPAsJPA = query.getResultList();
|
|
||||||
List<PatientTO> allPATOs = new ArrayList<PatientTO>();
|
|
||||||
|
|
||||||
for (PatientJPA item : allPAsJPA) {
|
|
||||||
allPATOs.add(this.getPOJOforPatientJPA(item, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return allPATOs;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que convierte un objecto de tipo MedicalSpecialtyJPA (JPA) a su
|
|
||||||
* equivalente MedicalSpecialtyTO (Tranfer Object)
|
|
||||||
*
|
|
||||||
* @return MedicalSpecialtyTO (Transfer Object de una especialidad médica)
|
|
||||||
*/
|
|
||||||
public MedicalSpecialtyTO getPOJOforMedicalSpecialtyJPA(MedicalSpecialtyJPA ms) {
|
public MedicalSpecialtyTO getPOJOforMedicalSpecialtyJPA(MedicalSpecialtyJPA ms) {
|
||||||
MedicalSpecialtyTO msTO = null;
|
MedicalSpecialtyTO msTO = null;
|
||||||
|
|
||||||
@@ -313,12 +169,6 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
return msTO;
|
return msTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que convierte un objecto de tipo PrimaryHealthCareCenterJPA (JPA) a su
|
|
||||||
* equivalente PrimaryHealthCareCenterTO (Tranfer Object)
|
|
||||||
*
|
|
||||||
* @return PrimaryHealthCareCenterTO (Transfer Object de un CAP)
|
|
||||||
*/
|
|
||||||
public PrimaryHealthCareCenterTO getPOJOforPrimaryHealthCareCenterJPA(PrimaryHealthCareCenterJPA phc) {
|
public PrimaryHealthCareCenterTO getPOJOforPrimaryHealthCareCenterJPA(PrimaryHealthCareCenterJPA phc) {
|
||||||
PrimaryHealthCareCenterTO phcTO = null;
|
PrimaryHealthCareCenterTO phcTO = null;
|
||||||
|
|
||||||
@@ -329,18 +179,6 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
return phcTO;
|
return phcTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que convierte un objecto de tipo SpecialistDoctorJPA (JPA) a su
|
|
||||||
* equivalente SpecialistDoctorTO (Tranfer Object)
|
|
||||||
*
|
|
||||||
* El parámetro nestedProps es un valor entero que indica a que nivel de
|
|
||||||
* profundidad se debe navegar a través de las propiedades relacionadas para
|
|
||||||
* convertirlas de JPA a TO. Un valor 0 indica que no se convertirá ninguna
|
|
||||||
* propiedad que tenga un entidad JPA relacionada (tendrá valor null en el
|
|
||||||
* objeto TO).
|
|
||||||
*
|
|
||||||
* @return SpecialistDoctorTO (Transfer Object de un médico especialista)
|
|
||||||
*/
|
|
||||||
public SpecialistDoctorTO getPOJOforSpecialistDoctorJPA(SpecialistDoctorJPA sd, int nestedProps) {
|
public SpecialistDoctorTO getPOJOforSpecialistDoctorJPA(SpecialistDoctorJPA sd, int nestedProps) {
|
||||||
SpecialistDoctorTO sdTO = null;
|
SpecialistDoctorTO sdTO = null;
|
||||||
|
|
||||||
@@ -350,25 +188,12 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
ms = sd.getMedicalSpecialty();
|
ms = sd.getMedicalSpecialty();
|
||||||
|
|
||||||
nestedProps--;
|
nestedProps--;
|
||||||
sdTO = new SpecialistDoctorTO(sd.getId(), sd.getProfessionalNumber(), sd.getNif(), sd.getName(),
|
sdTO = new SpecialistDoctorTO(sd.getId(), sd.getProfessionalNumber(), sd.getNif(), sd.getName(), sd.getSurname(), sd.getPassword(), sd.getEmail(), this.getPOJOforMedicalSpecialtyJPA(ms));
|
||||||
sd.getSurname(), sd.getPassword(), sd.getEmail(), this.getPOJOforMedicalSpecialtyJPA(ms));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return sdTO;
|
return sdTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que convierte un objecto de tipo FamilyDoctorJPA (JPA) a su
|
|
||||||
* equivalente FamilyDoctorTO (Tranfer Object)
|
|
||||||
*
|
|
||||||
* El parámetro nestedProps es un valor entero que indica a que nivel de
|
|
||||||
* profundidad se debe navegar a través de las propiedades relacionadas para
|
|
||||||
* convertirlas de JPA a TO. Un valor 0 indica que no se convertirá ninguna
|
|
||||||
* propiedad que tenga un entidad JPA relacionada (tendrá valor null en el
|
|
||||||
* objeto TO).
|
|
||||||
*
|
|
||||||
* @return FamilyDoctorTO (Transfer Object de un médico especialista)
|
|
||||||
*/
|
|
||||||
public FamilyDoctorTO getPOJOforFamilyDoctorJPA(FamilyDoctorJPA fd, int nestedProps) {
|
public FamilyDoctorTO getPOJOforFamilyDoctorJPA(FamilyDoctorJPA fd, int nestedProps) {
|
||||||
FamilyDoctorTO fdTO = null;
|
FamilyDoctorTO fdTO = null;
|
||||||
|
|
||||||
@@ -378,25 +203,12 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
phc = fd.getPrimaryHealthCareCenter();
|
phc = fd.getPrimaryHealthCareCenter();
|
||||||
|
|
||||||
nestedProps--;
|
nestedProps--;
|
||||||
fdTO = new FamilyDoctorTO(fd.getId(), fd.getProfessionalNumber(), fd.getNif(), fd.getName(),
|
fdTO = new FamilyDoctorTO(fd.getId(), fd.getProfessionalNumber(), fd.getNif(), fd.getName(), fd.getSurname(), fd.getPassword(), fd.getEmail(), this.getPOJOforPrimaryHealthCareCenterJPA(phc));
|
||||||
fd.getSurname(), fd.getPassword(), fd.getEmail(), this.getPOJOforPrimaryHealthCareCenterJPA(phc));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fdTO;
|
return fdTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que convierte un objecto de tipo PatientJPA (JPA) a su equivalente
|
|
||||||
* PatientTO (Tranfer Object)
|
|
||||||
*
|
|
||||||
* El parámetro nestedProps es un valor entero que indica a que nivel de
|
|
||||||
* profundidad se debe navegar a través de las propiedades relacionadas para
|
|
||||||
* convertirlas de JPA a TO. Un valor 0 indica que no se convertirá ninguna
|
|
||||||
* propiedad que tenga un entidad JPA relacionada (tendrá valor null en el
|
|
||||||
* objeto TO).
|
|
||||||
*
|
|
||||||
* @return PatientTO (Transfer Object de un médico especialista)
|
|
||||||
*/
|
|
||||||
public PatientTO getPOJOforPatientJPA(PatientJPA pat, int nestedProps) {
|
public PatientTO getPOJOforPatientJPA(PatientJPA pat, int nestedProps) {
|
||||||
PatientTO paTO = null;
|
PatientTO paTO = null;
|
||||||
|
|
||||||
@@ -406,235 +218,58 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
fd = pat.getFamilyDoctor();
|
fd = pat.getFamilyDoctor();
|
||||||
|
|
||||||
nestedProps--;
|
nestedProps--;
|
||||||
paTO = new PatientTO(pat.getId(), pat.getPersonalIdentificationCode(), pat.getNif(), pat.getName(),
|
paTO = new PatientTO(pat.getId(), pat.getPersonalIdentificationCode(), pat.getNif(), pat.getName(), pat.getSurname(), pat.getPassword(), pat.getEmail(), this.getPOJOforFamilyDoctorJPA(fd, nestedProps));
|
||||||
pat.getSurname(), pat.getPassword(), pat.getEmail(),
|
|
||||||
this.getPOJOforFamilyDoctorJPA(fd, nestedProps));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return paTO;
|
return paTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un paciente a partir de su Identificador (Id) de base de
|
|
||||||
* datos.
|
|
||||||
*
|
|
||||||
* @return PatientTO (Transfer Object del objeto recuperado) o null si no se
|
|
||||||
* encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public PatientTO findPatientById(int patientId) {
|
public PatientTO findPatientById(int patientId) {
|
||||||
// Recuperamos propiedades anidadas 1 nivel!
|
// Recuperamos propiedades anidadas 1 nivel!
|
||||||
return this.getPOJOforPatientJPA(entman.find(PatientJPA.class, patientId), 1);
|
return this.getPOJOforPatientJPA(entman.find(PatientJPA.class, patientId), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un paciente a partir de su CIP (Código de Identificación
|
public PatientJPA findPatientByCode(String code) {
|
||||||
* de Paciente)
|
TypedQuery<PatientJPA> query = entman.createQuery("from PatientJPA pat where pat.personalIdentificationCode=:code", PatientJPA.class);
|
||||||
*
|
|
||||||
* @return PatientTO (Transfer Object del objeto recuperado) o null si no se
|
|
||||||
* encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public PatientTO findPatientByCode(String code) {
|
|
||||||
TypedQuery<PatientJPA> query = entman
|
|
||||||
.createQuery("from PatientJPA pat where pat.personalIdentificationCode=:code", PatientJPA.class);
|
|
||||||
query.setMaxResults(1);
|
|
||||||
query.setParameter("code", code);
|
query.setParameter("code", code);
|
||||||
|
|
||||||
List<PatientJPA> results = query.getResultList();
|
List<PatientJPA> results = query.getResultList();
|
||||||
if (results.size() > 0)
|
if (results.size() > 0)
|
||||||
return this.getPOJOforPatientJPA(results.get(0), 1);
|
return results.get(0);
|
||||||
else
|
else
|
||||||
return null;
|
return null; }
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un paciente a partir de su NIF
|
|
||||||
*
|
|
||||||
* @return PatientTO (Transfer Object del objeto recuperado) o null si no se
|
|
||||||
* encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public PatientTO findPatientByNif(String searchedNIF) {
|
|
||||||
TypedQuery<PatientJPA> query = entman.createQuery("from PatientJPA pat where pat.nif=:nif", PatientJPA.class);
|
|
||||||
query.setMaxResults(1);
|
|
||||||
query.setParameter("nif", searchedNIF);
|
|
||||||
|
|
||||||
List<PatientJPA> results = query.getResultList();
|
|
||||||
if (results.size() > 0)
|
|
||||||
return this.getPOJOforPatientJPA(results.get(0), 1);
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un médico de familia a partir de su Identificador (Id) de
|
|
||||||
* base de datos.
|
|
||||||
*
|
|
||||||
* @return FamilyDoctorTO (Transfer Object del objeto recuperado) o null si no
|
|
||||||
* se encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId) {
|
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId) {
|
||||||
return this.getPOJOforFamilyDoctorJPA(entman.find(FamilyDoctorJPA.class, ProfessionalNumberId), 1);
|
return this.getPOJOforFamilyDoctorJPA(entman.find(FamilyDoctorJPA.class, ProfessionalNumberId), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public FamilyDoctorJPA findFamilyDoctorByCode(String code) {
|
||||||
* Método que recupera un médico de familia a partir de su NP (Número de
|
TypedQuery<FamilyDoctorJPA> query = entman.createQuery("from FamilyDoctorJPA d where d.professionalNumber=:code", FamilyDoctorJPA.class);
|
||||||
* profesional)
|
|
||||||
*
|
|
||||||
* @return FamilyDoctorTO (Transfer Object del objeto recuperado) o null si no
|
|
||||||
* se encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public FamilyDoctorTO findFamilyDoctorByCode(String code) {
|
|
||||||
TypedQuery<FamilyDoctorJPA> query = entman
|
|
||||||
.createQuery("from FamilyDoctorJPA d where d.professionalNumber=:code", FamilyDoctorJPA.class);
|
|
||||||
|
|
||||||
query.setParameter("code", code);
|
query.setParameter("code", code);
|
||||||
|
|
||||||
List<FamilyDoctorJPA> results = query.getResultList();
|
List<FamilyDoctorJPA> results = query.getResultList();
|
||||||
if (results.size() > 0)
|
if (results.size() > 0)
|
||||||
return this.getPOJOforFamilyDoctorJPA(results.get(0), 1);
|
return results.get(0);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un médico de familia a partir de su NIF
|
|
||||||
*
|
|
||||||
* @return FamilyDoctorTO (Transfer Object del objeto recuperado) o null si no
|
|
||||||
* se encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public FamilyDoctorTO findFamilyDoctorByNif(String searchedNIF) {
|
|
||||||
TypedQuery<FamilyDoctorJPA> query = entman.createQuery("from FamilyDoctorJPA d where d.nif=:nif",
|
|
||||||
FamilyDoctorJPA.class);
|
|
||||||
query.setMaxResults(1);
|
|
||||||
query.setParameter("nif", searchedNIF);
|
|
||||||
|
|
||||||
List<FamilyDoctorJPA> results = query.getResultList();
|
|
||||||
if (results.size() > 0)
|
|
||||||
return this.getPOJOforFamilyDoctorJPA(results.get(0), 1);
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un médico especialista a partir de su Identificador (Id)
|
|
||||||
* de base de datos.
|
|
||||||
*
|
|
||||||
* @return SpecialistDoctorTO (Transfer Object del objeto recuperado) o null si
|
|
||||||
* no se encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId) {
|
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId) {
|
||||||
return this.getPOJOforSpecialistDoctorJPA(entman.find(SpecialistDoctorJPA.class, ProfessionalNumberId), 1);
|
return this.getPOJOforSpecialistDoctorJPA(entman.find(SpecialistDoctorJPA.class, ProfessionalNumberId), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public SpecialistDoctorJPA findSpecialistDoctorByCode(String code) {
|
||||||
* Método que recupera un médico especialista a partir de su NP (Número de
|
TypedQuery<SpecialistDoctorJPA> query = entman.createQuery("from SpecialistDoctorJPA d where d.professionalNumber=:code", SpecialistDoctorJPA.class);
|
||||||
* profesional)
|
|
||||||
*
|
|
||||||
* @return SpecialistDoctorTO (Transfer Object del objeto recuperado) o null si
|
|
||||||
* no se encuentra el objeto buscado
|
|
||||||
*/
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorByCode(String code) {
|
|
||||||
TypedQuery<SpecialistDoctorJPA> query = entman
|
|
||||||
.createQuery("from SpecialistDoctorJPA d where d.professionalNumber=:code", SpecialistDoctorJPA.class);
|
|
||||||
|
|
||||||
query.setParameter("code", code);
|
query.setParameter("code", code);
|
||||||
|
|
||||||
List<SpecialistDoctorJPA> results = query.getResultList();
|
List<SpecialistDoctorJPA> results = query.getResultList();
|
||||||
if (results.size() > 0)
|
if (results.size() > 0)
|
||||||
return this.getPOJOforSpecialistDoctorJPA(results.get(0), 1);
|
return results.get(0);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que recupera un médico especialista a partir de su NIF
|
|
||||||
*
|
|
||||||
* @return SpecialistDoctorTO (Transfer Object del objeto recuperado) o null si el objeto JPA es nulo
|
|
||||||
*/
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorByNif(String searchedNIF) {
|
|
||||||
TypedQuery<SpecialistDoctorJPA> query = entman.createQuery("from SpecialistDoctorJPA d where d.nif=:nif",
|
|
||||||
SpecialistDoctorJPA.class);
|
|
||||||
query.setMaxResults(1);
|
|
||||||
query.setParameter("nif", searchedNIF);
|
|
||||||
|
|
||||||
List<SpecialistDoctorJPA> results = query.getResultList();
|
|
||||||
if (results.size() > 0)
|
|
||||||
return this.getPOJOforSpecialistDoctorJPA(results.get(0), 1);
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que convierte un objecto de tipo QuestionJPA (JPA) a su equivalente
|
|
||||||
* QuestionTO (Tranfer Object)
|
|
||||||
*
|
|
||||||
* El parámetro nestedProps es un valor entero que indica a que nivel de profundidad se debe navegar a través de las propiedades relacionadas para convertirlas de JPA a TO. Un
|
|
||||||
* valor 0 indica que no se convertirá ninguna propiedad que tenga un entidad JPA relacionada (tendrá valor null en el objeto TO).
|
|
||||||
*
|
|
||||||
* @return QuestionTO (Transfer Object del objeto recuperado) o null si el objeto JPA es nulo
|
|
||||||
*/
|
|
||||||
public QuestionTO getPOJOforQuestionJPA(QuestionJPA qs, int nestedProps) {
|
|
||||||
QuestionTO qsTO = null;
|
|
||||||
|
|
||||||
if (qs != null) {
|
|
||||||
FamilyDoctorJPA fd = null;
|
|
||||||
PatientJPA pat = null;
|
|
||||||
if (nestedProps > 0) {
|
|
||||||
fd = qs.getFamilyDoctor();
|
|
||||||
pat = qs.getPatient();
|
|
||||||
}
|
|
||||||
|
|
||||||
nestedProps--;
|
|
||||||
qsTO = new QuestionTO(qs.getId(), qs.getTitle(), qs.getMessage(), qs.getStatus(),
|
|
||||||
this.getPOJOforPatientJPA(pat, nestedProps), this.getPOJOforFamilyDoctorJPA(fd, nestedProps),
|
|
||||||
qs.getResponse());
|
|
||||||
}
|
|
||||||
|
|
||||||
return qsTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que converite un objeto de tipo VisitJPA a su equivalente VisitTO (Transfer Object)
|
|
||||||
*
|
|
||||||
* El parámetro nestedProps es un valor entero que indica a que nivel de profundidad se debe navegar a través de las propiedades relacionadas para convertirlas de JPA a TO. Un
|
|
||||||
* valor 0 indica que no se convertirá ninguna propiedad que tenga un entidad JPA relacionada (tendrá valor null en el objeto TO).
|
|
||||||
*
|
|
||||||
* @return VisitTO (Transfer Object del objeto recuperado) o null si el objeto JPA es nulo
|
|
||||||
*/
|
|
||||||
public VisitTO getPOJOforVisitJPA(VisitJPA vi, int nestedProps) {
|
|
||||||
VisitTO qsTO = null;
|
|
||||||
|
|
||||||
if (vi != null) {
|
|
||||||
FamilyDoctorJPA fd = null;
|
|
||||||
PatientJPA pat = null;
|
|
||||||
if (nestedProps > 0) {
|
|
||||||
fd = vi.getFamilyDoctor();
|
|
||||||
pat = vi.getPatient();
|
|
||||||
}
|
|
||||||
|
|
||||||
nestedProps--;
|
|
||||||
qsTO = new VisitTO(vi.getId(), vi.getDate(), vi.getTime(), vi.getObservations(), vi.getResult(),
|
|
||||||
this.getPOJOforFamilyDoctorJPA(fd, nestedProps), this.getPOJOforPatientJPA(pat, nestedProps));
|
|
||||||
}
|
|
||||||
|
|
||||||
return qsTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalTestTO getPOJOforMedicalTestJPA(MedicalTestJPA mt, int nestedProps) {
|
|
||||||
MedicalTestTO qsTO = null;
|
|
||||||
|
|
||||||
if (mt != null) {
|
|
||||||
SpecialistDoctorJPA fd = null;
|
|
||||||
PatientJPA pat = null;
|
|
||||||
if (nestedProps > 0) {
|
|
||||||
fd = mt.getSpecialistDoctor();
|
|
||||||
pat = mt.getPatient();
|
|
||||||
}
|
|
||||||
|
|
||||||
nestedProps--;
|
|
||||||
qsTO = new MedicalTestTO(mt.getId(), mt.getDate(), mt.getTime(), mt.getObservations(), mt.getHighresimage(), mt.getType(),
|
|
||||||
this.getPOJOforPatientJPA(pat, nestedProps), this.getPOJOforSpecialistDoctorJPA(fd, nestedProps));
|
|
||||||
}
|
|
||||||
|
|
||||||
return qsTO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,20 @@
|
|||||||
package ejb.common;
|
package ejb.common;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
import TO.FamilyDoctorTO;
|
||||||
import TO.MedicalSpecialtyTO;
|
import TO.MedicalSpecialtyTO;
|
||||||
import TO.MedicalTestTO;
|
|
||||||
import TO.PatientTO;
|
import TO.PatientTO;
|
||||||
import TO.PrimaryHealthCareCenterTO;
|
import TO.PrimaryHealthCareCenterTO;
|
||||||
import TO.QuestionTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
import TO.SpecialistDoctorTO;
|
||||||
import TO.VisitTO;
|
|
||||||
import jpa.FamilyDoctorJPA;
|
import jpa.FamilyDoctorJPA;
|
||||||
import jpa.MedicalSpecialtyJPA;
|
import jpa.MedicalSpecialtyJPA;
|
||||||
import jpa.MedicalTestJPA;
|
|
||||||
import jpa.PatientJPA;
|
import jpa.PatientJPA;
|
||||||
import jpa.PrimaryHealthCareCenterJPA;
|
import jpa.PrimaryHealthCareCenterJPA;
|
||||||
import jpa.QuestionJPA;
|
|
||||||
import jpa.SpecialistDoctorJPA;
|
import jpa.SpecialistDoctorJPA;
|
||||||
import jpa.VisitJPA;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -47,27 +42,17 @@ public interface CommonFacadeLocal {
|
|||||||
|
|
||||||
public List<FamilyDoctorTO> listFamilyDoctorsFiltered(String searchTerm, int pageNumber, int pageSize);
|
public List<FamilyDoctorTO> listFamilyDoctorsFiltered(String searchTerm, int pageNumber, int pageSize);
|
||||||
|
|
||||||
public List<PatientTO> listPatientsPaged(int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public List<PatientTO> listPatientsFiltered(String searchTerm, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public PatientTO findPatientById(int patientId);
|
public PatientTO findPatientById(int patientId);
|
||||||
|
|
||||||
public PatientTO findPatientByCode(String code);
|
public PatientJPA findPatientByCode(String code);
|
||||||
|
|
||||||
public PatientTO findPatientByNif(String searchValue);
|
|
||||||
|
|
||||||
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId);
|
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId);
|
||||||
|
|
||||||
public FamilyDoctorTO findFamilyDoctorByCode(String code);
|
public FamilyDoctorJPA findFamilyDoctorByCode(String code);
|
||||||
|
|
||||||
public FamilyDoctorTO findFamilyDoctorByNif(String searchValue);
|
|
||||||
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId);
|
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId);
|
||||||
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorByCode(String code);
|
public SpecialistDoctorJPA findSpecialistDoctorByCode(String code);
|
||||||
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorByNif(String searchValue);
|
|
||||||
|
|
||||||
public MedicalSpecialtyTO getPOJOforMedicalSpecialtyJPA(MedicalSpecialtyJPA ms);
|
public MedicalSpecialtyTO getPOJOforMedicalSpecialtyJPA(MedicalSpecialtyJPA ms);
|
||||||
|
|
||||||
@@ -79,9 +64,4 @@ public interface CommonFacadeLocal {
|
|||||||
|
|
||||||
public PatientTO getPOJOforPatientJPA(PatientJPA pat, int nestedProps);
|
public PatientTO getPOJOforPatientJPA(PatientJPA pat, int nestedProps);
|
||||||
|
|
||||||
public QuestionTO getPOJOforQuestionJPA(QuestionJPA qs, int nestedProps);
|
|
||||||
|
|
||||||
public MedicalTestTO getPOJOforMedicalTestJPA(MedicalTestJPA mt, int nestedProps);
|
|
||||||
|
|
||||||
public VisitTO getPOJOforVisitJPA(VisitJPA qs, int nestedProps);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package ejb.common;
|
package ejb.common;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.ejb.Remote;
|
import javax.ejb.Remote;
|
||||||
@@ -9,6 +10,9 @@ import TO.MedicalSpecialtyTO;
|
|||||||
import TO.PatientTO;
|
import TO.PatientTO;
|
||||||
import TO.PrimaryHealthCareCenterTO;
|
import TO.PrimaryHealthCareCenterTO;
|
||||||
import TO.SpecialistDoctorTO;
|
import TO.SpecialistDoctorTO;
|
||||||
|
import jpa.FamilyDoctorJPA;
|
||||||
|
import jpa.PatientJPA;
|
||||||
|
import jpa.SpecialistDoctorJPA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -36,26 +40,16 @@ public interface CommonFacadeRemote {
|
|||||||
|
|
||||||
public List<FamilyDoctorTO> listFamilyDoctorsFiltered(String searchTerm, int pageNumber, int pageSize);
|
public List<FamilyDoctorTO> listFamilyDoctorsFiltered(String searchTerm, int pageNumber, int pageSize);
|
||||||
|
|
||||||
public List<PatientTO> listPatientsPaged(int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public List<PatientTO> listPatientsFiltered(String searchTerm, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public PatientTO findPatientById(int patientId);
|
public PatientTO findPatientById(int patientId);
|
||||||
|
|
||||||
public PatientTO findPatientByCode(String code);
|
public PatientJPA findPatientByCode(String code);
|
||||||
|
|
||||||
public PatientTO findPatientByNif(String searchValue);
|
|
||||||
|
|
||||||
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId);
|
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId);
|
||||||
|
|
||||||
public FamilyDoctorTO findFamilyDoctorByCode(String code);
|
public FamilyDoctorJPA findFamilyDoctorByCode(String code);
|
||||||
|
|
||||||
public FamilyDoctorTO findFamilyDoctorByNif(String searchValue);
|
|
||||||
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId);
|
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId);
|
||||||
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorByCode(String code);
|
public SpecialistDoctorJPA findSpecialistDoctorByCode(String code);
|
||||||
|
|
||||||
public SpecialistDoctorTO findSpecialistDoctorByNif(String searchValue);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,408 +1,26 @@
|
|||||||
package ejb.medicalTest;
|
package ejb.medicalTest;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.EJB;
|
|
||||||
import javax.ejb.Stateless;
|
import javax.ejb.Stateless;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import javax.persistence.PersistenceContext;
|
||||||
import javax.persistence.TypedQuery;
|
|
||||||
|
|
||||||
import TO.MedicalTestTO;
|
|
||||||
import TO.PatientTO;
|
|
||||||
import TO.QuestionTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
|
||||||
import common.MedicalTestType;
|
|
||||||
import common.QuestionStatus;
|
|
||||||
import common.Utils;
|
|
||||||
import ejb.common.CommonFacadeLocal;
|
|
||||||
import jpa.MedicalTestJPA;
|
|
||||||
import jpa.PatientJPA;
|
|
||||||
import jpa.QuestionJPA;
|
|
||||||
import jpa.SpecialistDoctorJPA;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EJB Session Bean Class para la Practica 2, Ejercicio 1 (ISCSD) Implementa los métodos de la capa de negocio que implementan la logica de negocio y la interacción con la capa de
|
* EJB Session Bean Class para la Practica 2, Ejercicio 1 (ISCSD) Implementa los
|
||||||
* persistencia.
|
* métodos de la capa de negocio que implementan la logica de negocio y la
|
||||||
|
* interacción con la capa de persistencia.
|
||||||
*
|
*
|
||||||
* Tanto los pacientes como los médicos deben acceder a la vista de pruebas médicas.
|
* @author mark
|
||||||
*
|
|
||||||
* @author rorden
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Stateless
|
@Stateless
|
||||||
public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
|
public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
|
||||||
|
|
||||||
// Persistence Unit Context
|
// Persistence Unit Context
|
||||||
@PersistenceContext(unitName = "MyHealth")
|
@PersistenceContext(unitName = "MyHealth")
|
||||||
EntityManager entman;
|
private EntityManager entman;
|
||||||
|
|
||||||
@EJB
|
public void ejbMethod(String parameter) {
|
||||||
CommonFacadeLocal commonServices;
|
|
||||||
|
|
||||||
// *********************************************************************
|
|
||||||
// QUESTION_RESPONSE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Realizar una pregunta al médico por un paciente
|
|
||||||
*
|
|
||||||
* @param professionalNumber
|
|
||||||
* @param title
|
|
||||||
* @param message
|
|
||||||
*/
|
|
||||||
public String askQuestion(int userId, String title, String message) {
|
|
||||||
|
|
||||||
PatientJPA pat = entman.find(PatientJPA.class, userId);
|
|
||||||
|
|
||||||
if (pat.getFamilyDoctor() != null) {
|
|
||||||
|
|
||||||
QuestionJPA qjpa = new QuestionJPA();
|
|
||||||
qjpa.setId(0);
|
|
||||||
qjpa.setTitle(title);
|
|
||||||
qjpa.setMessage(message);
|
|
||||||
qjpa.setStatus(QuestionStatus.PENDING);
|
|
||||||
|
|
||||||
qjpa.setPatient(pat);
|
|
||||||
qjpa.setFamilyDoctor(pat.getFamilyDoctor());
|
|
||||||
|
|
||||||
entman.persist(qjpa);
|
|
||||||
|
|
||||||
return "ok";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return "No tienes médico de familia elegido, por favor acude a la sección 'Gestionar Perfil' -> 'Cambiar médico de familia'";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* El médico responde a una pregunta
|
|
||||||
*
|
|
||||||
* @param question
|
|
||||||
* @param response
|
|
||||||
*/
|
|
||||||
public void answerQuestion(int questionId, String response) {
|
|
||||||
QuestionJPA qjpa;
|
|
||||||
qjpa = entman.find(QuestionJPA.class, questionId);
|
|
||||||
qjpa.setResponse(response);
|
|
||||||
qjpa.setStatus(QuestionStatus.ANSWERED);
|
|
||||||
|
|
||||||
entman.persist(qjpa);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<QuestionTO> listAllPendingQuestions(int familyDoctorId) {
|
|
||||||
// TypedQuery<QuestionJPA> query = entman.createQuery("SELECT q from QuestionJPA
|
|
||||||
// q where q.status=:status and q.familyDoctor.id=:docId order by q.title",
|
|
||||||
// QuestionJPA.class);
|
|
||||||
TypedQuery<QuestionJPA> query = entman.createQuery("SELECT q from QuestionJPA q where q.familyDoctor.id=:docId order by q.status desc, q.title asc", QuestionJPA.class);
|
|
||||||
// query.setParameter("status", QuestionStatus.PENDING);
|
|
||||||
query.setParameter("docId", familyDoctorId);
|
|
||||||
|
|
||||||
List<QuestionJPA> allJPA = query.getResultList();
|
|
||||||
List<QuestionTO> pendingQuestions = new ArrayList<QuestionTO>();
|
|
||||||
|
|
||||||
for (QuestionJPA item : allJPA) {
|
|
||||||
pendingQuestions.add(commonServices.getPOJOforQuestionJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return pendingQuestions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<QuestionTO> listAllMyQuestions(int userId) {
|
|
||||||
List<QuestionTO> pendingQuestions = new ArrayList<QuestionTO>();
|
|
||||||
// TypedQuery<QuestionJPA> query = entman.createQuery("SELECT q from QuestionJPA
|
|
||||||
// q where q.status=:status and q.familyDoctor.id=:docId order by q.title",
|
|
||||||
// QuestionJPA.class);
|
|
||||||
TypedQuery<QuestionJPA> query = entman.createQuery("SELECT q from QuestionJPA q where q.patient.id=:patientId order by q.status desc, q.title asc", QuestionJPA.class);
|
|
||||||
// query.setParameter("status", QuestionStatus.PENDING);
|
|
||||||
query.setParameter("patientId", userId);
|
|
||||||
|
|
||||||
List<QuestionJPA> allJPA = query.getResultList();
|
|
||||||
|
|
||||||
for (QuestionJPA item : allJPA) {
|
|
||||||
pendingQuestions.add(commonServices.getPOJOforQuestionJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return pendingQuestions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recuperar una pregunta por su identificador
|
|
||||||
*
|
|
||||||
* @param question
|
|
||||||
*/
|
|
||||||
public QuestionTO getQuestion(int idQuestion) {
|
|
||||||
QuestionTO resp = new QuestionTO();
|
|
||||||
|
|
||||||
TypedQuery<QuestionJPA> query = entman.createQuery("SELECT q from QuestionJPA q where q.id=:idquestion", QuestionJPA.class);
|
|
||||||
|
|
||||||
query.setParameter("idquestion", idQuestion);
|
|
||||||
|
|
||||||
resp = commonServices.getPOJOforQuestionJPA(query.getSingleResult(), 1);
|
|
||||||
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// *********************************************************************
|
|
||||||
// MEDICAL_TEST
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Añadir pruebas médicas a una cita
|
|
||||||
*
|
|
||||||
* Dado que será añadida por el médico especialista en sesión no hace falta más información.
|
|
||||||
*
|
|
||||||
* @param patientiID
|
|
||||||
* @param date
|
|
||||||
* @param time
|
|
||||||
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias magnéticas y TAC
|
|
||||||
* @param observations
|
|
||||||
*/
|
|
||||||
public MedicalTestTO addMedicalTest(int patientID, int doctorSpecialistID, LocalDate date, LocalTime time, MedicalTestType testType, String observations) throws Exception {
|
|
||||||
SpecialistDoctorJPA specDoctor = entman.find(SpecialistDoctorJPA.class, doctorSpecialistID);
|
|
||||||
PatientJPA pat = entman.find(PatientJPA.class, patientID);
|
|
||||||
|
|
||||||
MedicalTestJPA mt = new MedicalTestJPA(date, time, observations, null, testType, pat, specDoctor);
|
|
||||||
|
|
||||||
entman.persist(mt);
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforMedicalTestJPA(mt, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recuperar una prueba médica por ID
|
|
||||||
*
|
|
||||||
* Pueden ser consultas por médicos de familia
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
*/
|
|
||||||
public MedicalTestTO getMedicalTest(int idMedicalTest) {
|
|
||||||
MedicalTestTO resp = new MedicalTestTO();
|
|
||||||
|
|
||||||
resp = commonServices.getPOJOforMedicalTestJPA(this.getMedicalTestJPA(idMedicalTest), 1);
|
|
||||||
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
private MedicalTestJPA getMedicalTestJPA(int idMedicalTest) {
|
|
||||||
TypedQuery<MedicalTestJPA> query = entman.createQuery("SELECT q from MedicalTestJPA q where q.id=:idMedicalTest", MedicalTestJPA.class);
|
|
||||||
query.setParameter("idMedicalTest", idMedicalTest);
|
|
||||||
return query.getSingleResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Añadir una imagen a una prueba médica
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
* @param image
|
|
||||||
*/
|
|
||||||
public void addImage(int idMedicalTest, String image) {
|
|
||||||
MedicalTestJPA mt = this.getMedicalTestJPA(idMedicalTest);
|
|
||||||
mt.setHighresimage(image);
|
|
||||||
|
|
||||||
entman.persist(mt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Actualizar/Pisar una imagen a una prueba médica
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
* @param image
|
|
||||||
*/
|
|
||||||
public void updateImage(int idMedicalTest, String image) {
|
|
||||||
this.addImage(idMedicalTest, image);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Eliminar una imagen a una prueba médica
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
*/
|
|
||||||
public void removeImage(int idMedicalTest) {
|
|
||||||
MedicalTestJPA mt = this.getMedicalTestJPA(idMedicalTest);
|
|
||||||
mt.setHighresimage(null);
|
|
||||||
|
|
||||||
entman.persist(mt);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getSpecialistDoctorByMedicalSpecialityCount(int specialityId) {
|
|
||||||
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from SpecialistDoctorJPA q where q.medicalSpecialty.id=:specId", Long.class);
|
|
||||||
query.setParameter("specId", specialityId);
|
|
||||||
|
|
||||||
return query.getSingleResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Listar médicos con una especialidad concreta
|
|
||||||
*
|
|
||||||
* @param speciality
|
|
||||||
*/
|
|
||||||
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpeciality(int specialityId, int pageNumber, int pageSize) {
|
|
||||||
List<SpecialistDoctorTO> pendingQuestions = new ArrayList<SpecialistDoctorTO>();
|
|
||||||
|
|
||||||
TypedQuery<SpecialistDoctorJPA> query = entman.createQuery(
|
|
||||||
"SELECT q from SpecialistDoctorJPA q where q.medicalSpecialty.id=:specId order by q.medicalSpecialty.name asc, q.surname asc", SpecialistDoctorJPA.class);
|
|
||||||
query.setParameter("specId", specialityId);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SpecialistDoctorJPA> allJPA = query.getResultList();
|
|
||||||
|
|
||||||
for (SpecialistDoctorJPA item : allJPA) {
|
|
||||||
pendingQuestions.add(commonServices.getPOJOforSpecialistDoctorJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return pendingQuestions;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForPatient(int patientID) {
|
|
||||||
List<MedicalTestTO> medicalTests = new ArrayList<MedicalTestTO>();
|
|
||||||
|
|
||||||
TypedQuery<MedicalTestJPA> query = entman.createQuery("SELECT q from MedicalTestJPA q where q.patient.id=:patientId order by q.id desc", MedicalTestJPA.class);
|
|
||||||
|
|
||||||
query.setParameter("patientId", patientID);
|
|
||||||
|
|
||||||
List<MedicalTestJPA> allJPA = query.getResultList();
|
|
||||||
|
|
||||||
for (MedicalTestJPA item : allJPA) {
|
|
||||||
medicalTests.add(commonServices.getPOJOforMedicalTestJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return medicalTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForFamilyDoctor(int familyDoctorID) {
|
|
||||||
return this.loadMedicalTestForFamilyDoctor(familyDoctorID, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForSpecialistDoctor(int specialistDoctorID) {
|
|
||||||
return this.loadMedicalTestForSpecialistDoctor(specialistDoctorID, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForFamilyDoctor(int familyDoctorID, int patientID) {
|
|
||||||
List<MedicalTestTO> medicalTests = new ArrayList<MedicalTestTO>();
|
|
||||||
String extraQuery = "";
|
|
||||||
|
|
||||||
if (patientID >= 0) {
|
|
||||||
extraQuery = " and q.patient.id=:patientID";
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedQuery<MedicalTestJPA> query = entman
|
|
||||||
.createQuery("SELECT q from MedicalTestJPA q where q.patient.familyDoctor.id=:familyDoctorID " + extraQuery + " order by q.id desc", MedicalTestJPA.class);
|
|
||||||
if (patientID >= 0) {
|
|
||||||
query.setParameter("patientID", patientID);
|
|
||||||
}
|
|
||||||
query.setParameter("familyDoctorID", familyDoctorID);
|
|
||||||
|
|
||||||
List<MedicalTestJPA> allJPA = query.getResultList();
|
|
||||||
|
|
||||||
for (MedicalTestJPA item : allJPA) {
|
|
||||||
medicalTests.add(commonServices.getPOJOforMedicalTestJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return medicalTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForSpecialistDoctor(int specialistDoctorID, int patientID) {
|
|
||||||
List<MedicalTestTO> medicalTests = new ArrayList<MedicalTestTO>();
|
|
||||||
String extraQuery = "";
|
|
||||||
|
|
||||||
if (patientID >= 0) {
|
|
||||||
extraQuery = " and q.patient.id=:patientID";
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedQuery<MedicalTestJPA> query = entman
|
|
||||||
.createQuery("SELECT q from MedicalTestJPA q where q.specialistDoctor.id=:specialistDoctorID " + extraQuery + " order by q.id desc", MedicalTestJPA.class);
|
|
||||||
|
|
||||||
if (patientID >= 0) {
|
|
||||||
query.setParameter("patientID", patientID);
|
|
||||||
}
|
|
||||||
query.setParameter("specialistDoctorID", specialistDoctorID);
|
|
||||||
|
|
||||||
List<MedicalTestJPA> allJPA = query.getResultList();
|
|
||||||
|
|
||||||
for (MedicalTestJPA item : allJPA) {
|
|
||||||
medicalTests.add(commonServices.getPOJOforMedicalTestJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return medicalTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PatientTO> loadPatientsForSpecialistDoctor(int specialistDoctorID, String searchTerm, int pageNumber, int pageSize) {
|
|
||||||
String strQuery = "SELECT distinct q.patient from MedicalTestJPA q where q.specialistDoctor.id=:specialistDoctorID %s order by q.patient.name, q.patient.surname";
|
|
||||||
String strFilter = "";
|
|
||||||
if (searchTerm == null)
|
|
||||||
searchTerm = "";
|
|
||||||
else
|
|
||||||
searchTerm = Utils.normalizeTerm(searchTerm);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0) {
|
|
||||||
strFilter = "and (lower(q.patient.name) LIKE :searchTerm OR lower(q.patient.surname) LIKE :searchTerm)";
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedQuery<PatientJPA> query = entman.createQuery(String.format(strQuery, strFilter), PatientJPA.class);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0)
|
|
||||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
|
||||||
|
|
||||||
query.setParameter("specialistDoctorID", specialistDoctorID);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PatientJPA> allJPA = query.getResultList();
|
|
||||||
List<PatientTO> patsTO = new ArrayList<PatientTO>();
|
|
||||||
|
|
||||||
for (PatientJPA item : allJPA) {
|
|
||||||
patsTO.add(commonServices.getPOJOforPatientJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return patsTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PatientTO> loadPatientsForFamilyDoctor(int familyDoctorID, String searchTerm, int pageNumber, int pageSize) {
|
|
||||||
String strQuery = "SELECT distinct q.patient from MedicalTestJPA q where q.patient.familyDoctor.id=:familyDoctorID %s order by q.patient.name, q.patient.surname";
|
|
||||||
|
|
||||||
String strFilter = "";
|
|
||||||
if (searchTerm == null)
|
|
||||||
searchTerm = "";
|
|
||||||
else
|
|
||||||
searchTerm = Utils.normalizeTerm(searchTerm);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0) {
|
|
||||||
strFilter = "and (lower(q.patient.name) LIKE :searchTerm OR lower(q.patient.surname) LIKE :searchTerm)";
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedQuery<PatientJPA> query = entman.createQuery(String.format(strQuery, strFilter), PatientJPA.class);
|
|
||||||
|
|
||||||
if (searchTerm.length() > 0)
|
|
||||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
|
||||||
|
|
||||||
query.setParameter("familyDoctorID", familyDoctorID);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PatientJPA> allJPA = query.getResultList();
|
|
||||||
List<PatientTO> patsTO = new ArrayList<PatientTO>();
|
|
||||||
|
|
||||||
for (PatientJPA item : allJPA) {
|
|
||||||
patsTO.add(commonServices.getPOJOforPatientJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return patsTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,137 +1,18 @@
|
|||||||
package ejb.medicalTest;
|
package ejb.medicalTest;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.Remote;
|
import javax.ejb.Remote;
|
||||||
|
|
||||||
import TO.MedicalTestTO;
|
|
||||||
import TO.PatientTO;
|
|
||||||
import TO.QuestionTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
|
||||||
import common.MedicalTestType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaz remota del EJB Definimos los métodos que estarán disponibles para los clientes del EJB
|
* Interfaz remota del EJB Definimos los métodos que estarán disponibles para
|
||||||
|
* los clientes del EJB
|
||||||
*
|
*
|
||||||
* @author rorden
|
* @author mark
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Remote
|
@Remote
|
||||||
public interface MedicalTestFacadeRemote {
|
public interface MedicalTestFacadeRemote {
|
||||||
|
|
||||||
// *********************************************************************
|
|
||||||
// QUESTION RESPONSE
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Realizar una pregunta al médico por un paciente
|
* Definimos la interfaz remota
|
||||||
*
|
|
||||||
* @param userID Este parámetro en el enunciado era del doctor, se ha cambiado al del paciente ya que los EJB
|
|
||||||
* no tienen el contexto de la sesión y de esta forma se puede conseguir el médico al que se realiza la
|
|
||||||
* pregunta.
|
|
||||||
* @param title
|
|
||||||
* @param message
|
|
||||||
*/
|
*/
|
||||||
public String askQuestion(int userID, String title, String message);
|
public void ejbMethod(String parameter);
|
||||||
|
|
||||||
/**
|
|
||||||
* El médico responde a una pregunta
|
|
||||||
*
|
|
||||||
* @param questionId Se ha cambiado a questionID ya que es más directa la identificación de la pregunta
|
|
||||||
* a la que se va a responder
|
|
||||||
* @param response
|
|
||||||
*/
|
|
||||||
public void answerQuestion(int questionId, String response);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recuperar las preguntas sin respuesta para un médico
|
|
||||||
*
|
|
||||||
* De utilidad para paciente y médico de familia. No para médico especialista.
|
|
||||||
*
|
|
||||||
* @param familydoctorid
|
|
||||||
*/
|
|
||||||
public List<QuestionTO> listAllPendingQuestions(int familyDoctorId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recuperar las preguntas hechas por un paciente
|
|
||||||
*
|
|
||||||
* NEW
|
|
||||||
*/
|
|
||||||
public List<QuestionTO> listAllMyQuestions(int userId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recuperar una pregunta por su String
|
|
||||||
*
|
|
||||||
* @param idQuestion Se ha cambiado al identificador de la pregunta, ya que es más directa
|
|
||||||
* su identificación.
|
|
||||||
*/
|
|
||||||
public QuestionTO getQuestion(int idQuestion);
|
|
||||||
|
|
||||||
// ********************************************************************* MEDICAL
|
|
||||||
// TEST
|
|
||||||
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForPatient(int patientID);
|
|
||||||
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForFamilyDoctor(int familyDoctorID);
|
|
||||||
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForSpecialistDoctor(int specialistDoctorID);
|
|
||||||
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForFamilyDoctor(int familyDoctorID, int patientID);
|
|
||||||
|
|
||||||
public List<MedicalTestTO> loadMedicalTestForSpecialistDoctor(int specialistDoctorID, int patientID);
|
|
||||||
|
|
||||||
public List<PatientTO> loadPatientsForSpecialistDoctor(int specialistDoctorID, String searchTerm, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public List<PatientTO> loadPatientsForFamilyDoctor(int familyDoctorID, String searchTerm, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Añadir una prueba médica a un paciente Dado que será añadida por el médico especialista en sesión no hace falta más información.
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
* @param date
|
|
||||||
* @param time
|
|
||||||
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias magnéticas y TAC
|
|
||||||
* @param observations
|
|
||||||
*/
|
|
||||||
public MedicalTestTO addMedicalTest(int patientID, int doctorSpecialistID, LocalDate date, LocalTime time, MedicalTestType testType, String observations) throws Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recuperar una prueba médica por ID
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
*/
|
|
||||||
public MedicalTestTO getMedicalTest(int idPatient);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Añadir una imagen a una prueba médica
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
* @param image
|
|
||||||
*/
|
|
||||||
public void addImage(int idMedicalTest, String image);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Actualizar/Pisar una imagen a una prueba médica
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
* @param image
|
|
||||||
*/
|
|
||||||
public void updateImage(int idMedicalTest, String image);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Eliminar una imagen a una prueba médica
|
|
||||||
*
|
|
||||||
* @param idMedicalTest
|
|
||||||
*/
|
|
||||||
public void removeImage(int idMedicalTest);
|
|
||||||
|
|
||||||
public Long getSpecialistDoctorByMedicalSpecialityCount(int specialityId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Listar médicos con una especialidad concreta
|
|
||||||
*
|
|
||||||
* @param speciality
|
|
||||||
*/
|
|
||||||
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpeciality(int specialityId, int pageNumber, int pageSize);
|
|
||||||
}
|
}
|
||||||
@@ -32,42 +32,19 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
@PersistenceContext(unitName = "MyHealth")
|
@PersistenceContext(unitName = "MyHealth")
|
||||||
private EntityManager entman;
|
private EntityManager entman;
|
||||||
|
|
||||||
//Propiedad que permite el acceso local a los métodos del EJB de servicios comunes (para recuperar entidades, etc).
|
|
||||||
@EJB
|
@EJB
|
||||||
CommonFacadeLocal commonServices;
|
CommonFacadeLocal commonServices;
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que genera un nuevo número de profesional, basando en la secuencia de base de datos. Los números de profesional son únicos y comunes para médicos de familia y médicos
|
|
||||||
* especialistas.
|
|
||||||
*
|
|
||||||
* Si un número de profesional no se utiliza no se vuelve a reutilizar, por lo que pueden existir huecos en la númeración.
|
|
||||||
*
|
|
||||||
* @return String con el número número de profesional generado.
|
|
||||||
*/
|
|
||||||
private String getNextProfessionalNumber() {
|
private String getNextProfessionalNumber() {
|
||||||
Query q = entman.createNativeQuery("select nextval('myhealth.profesionalnumber')");
|
Query q = entman.createNativeQuery("select nextval('myhealth.profesionalnumber')");
|
||||||
return Constants.PROFESSIONAL_NUMBER_PREFIX.concat(String.valueOf(q.getSingleResult()));
|
return Constants.PROFESSIONAL_NUMBER_PREFIX.concat(String.valueOf(q.getSingleResult()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que genera un nuevo Código de Identificación de Paciente (CIP) basado en una secuencia de base de datos. Los códigos CIP son únicos, y si un CIP no se utiliza tras
|
|
||||||
* haber sido generado, no se vuelve a reutilizar.
|
|
||||||
*
|
|
||||||
* @return String con el CIP gnerado
|
|
||||||
*/
|
|
||||||
private String getNextPersonalIdentificationCode() {
|
private String getNextPersonalIdentificationCode() {
|
||||||
Query q = entman.createNativeQuery("select nextval('myhealth.codigoidentificacionpaciente')");
|
Query q = entman.createNativeQuery("select nextval('myhealth.profesionalnumber')");
|
||||||
return Constants.PERSONAL_IDENTIFICATION_CODE_PREFIX.concat(String.valueOf(q.getSingleResult()));
|
return Constants.PERSONAL_IDENTIFICATION_CODE_PREFIX.concat(String.valueOf(q.getSingleResult()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Cambia el médico de familia asignado a un paciente. Recibe como parametros el identificador del paciente y el identificador del nuevo médico de familia
|
|
||||||
*
|
|
||||||
* Si el identificador de paciente no corresponde a ningún paciente registrado se lanza una excepción. Si el identificador del médico de familia no corresponde a ningún médico
|
|
||||||
* de familia se lanza una excepción.
|
|
||||||
*
|
|
||||||
* @return PatientTO (Transfer Object del paciente al que se la ha cambiado el médico de familia).
|
|
||||||
*/
|
|
||||||
public PatientTO changeFamilyDoctor(int patientId, int newDoctor) throws Exception {
|
public PatientTO changeFamilyDoctor(int patientId, int newDoctor) throws Exception {
|
||||||
PatientJPA pat = entman.find(PatientJPA.class, patientId);
|
PatientJPA pat = entman.find(PatientJPA.class, patientId);
|
||||||
if (pat == null) {
|
if (pat == null) {
|
||||||
@@ -86,37 +63,15 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Registra un nuevo paciente en el sistema Recibe como parametros el nif del paciente, el nombre, los apellidos, la contraseña y la dirección de correo electronico.
|
|
||||||
*
|
|
||||||
* El método genera un nuevo CIP (código de identificación de paciente) y lo asigna al nuevo paciente. El médico se familia queda está establecido a null, y deberá ser
|
|
||||||
* seleccionado por el paciente una vez registrado en el sistema.
|
|
||||||
*
|
|
||||||
* La contraseña recibida se encrypta con el algoritmo MD5.
|
|
||||||
*
|
|
||||||
* @return PatientTO Transfer Object correspondiente al paciente registrado.
|
|
||||||
*/
|
|
||||||
public PatientTO registerPatient(int id, String nif, String name, String surname, String password, String email) {
|
public PatientTO registerPatient(int id, String nif, String name, String surname, String password, String email) {
|
||||||
|
PatientTO paTO = null;
|
||||||
|
|
||||||
PatientJPA pat = new PatientJPA(this.getNextPersonalIdentificationCode(), nif, name, surname, HashUtils.hashMD5(password), email, null);
|
PatientJPA pat = new PatientJPA(this.getNextPersonalIdentificationCode(), nif, name, surname, HashUtils.hashMD5(password), email, null);
|
||||||
entman.persist(pat);
|
entman.persist(pat);
|
||||||
|
|
||||||
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Registra un nuevo médico especialista en el sistema.
|
|
||||||
*
|
|
||||||
* Recibe como parametros el nif, el nombre, los apellidos, la contraseña, la dirección de correo electronico y la especialidad.
|
|
||||||
*
|
|
||||||
* El método genera un nuevo NIP (Número de Identificación de Profesional) y lo asigna al nuevo médico.
|
|
||||||
*
|
|
||||||
* La contraseña recibida se encrypta con el algoritmo MD5.
|
|
||||||
*
|
|
||||||
* El médoto comprueba que la especialidad médica recibida exista en el sistema en el momento de asignarla al nuevo médico, si la especialidad especificada no se encuentra se
|
|
||||||
* lanza una excepción.
|
|
||||||
*
|
|
||||||
* @return SpecialistDoctorTO Transfer Object correspondiente al médico especialista registrado.
|
|
||||||
*/
|
|
||||||
public SpecialistDoctorTO registerSpecialistDoctor(int id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty)
|
public SpecialistDoctorTO registerSpecialistDoctor(int id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, specialty.getId());
|
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, specialty.getId());
|
||||||
@@ -130,20 +85,9 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
return this.commonServices.getPOJOforSpecialistDoctorJPA(sd, 1);
|
return this.commonServices.getPOJOforSpecialistDoctorJPA(sd, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Registra un nuevo médico de familia en el sistema.
|
|
||||||
*
|
|
||||||
* Recibe como parametros el nif, el nombre, los apellidos, la contraseña, la dirección de correo electronico y el CAP (Centro Médico de Primaria).
|
|
||||||
*
|
|
||||||
* El método genera un nuevo NIP (Número de Identificación de Profesional) y lo asigna al nuevo médico.
|
|
||||||
*
|
|
||||||
* La contraseña recibida se encrypta con el algoritmo MD5.
|
|
||||||
*
|
|
||||||
* El médoto comprueba que el CAP recibido exista en el sistema en el momento de asignarlo al nuevo médico, si el CAP no se encuentra se lanza una excepción.
|
|
||||||
*
|
|
||||||
* @return FamilyDoctorTO Transfer Object correspondiente al médico de familia registrado.
|
|
||||||
*/
|
|
||||||
public FamilyDoctorTO registerFamilyDoctor(int id, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO cap) throws Exception {
|
public FamilyDoctorTO registerFamilyDoctor(int id, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO cap) throws Exception {
|
||||||
|
FamilyDoctorTO fdTO = null;
|
||||||
|
|
||||||
PrimaryHealthCareCenterJPA phcC = entman.find(PrimaryHealthCareCenterJPA.class, cap.getId());
|
PrimaryHealthCareCenterJPA phcC = entman.find(PrimaryHealthCareCenterJPA.class, cap.getId());
|
||||||
if (phcC == null) {
|
if (phcC == null) {
|
||||||
throw new Exception("No se encuentra el centro de atención primaria con identificador: " + cap.getName());
|
throw new Exception("No se encuentra el centro de atención primaria con identificador: " + cap.getName());
|
||||||
@@ -155,18 +99,6 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
return commonServices.getPOJOforFamilyDoctorJPA(fd, 1);
|
return commonServices.getPOJOforFamilyDoctorJPA(fd, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Actualiza los datos personales de un paciente
|
|
||||||
*
|
|
||||||
* Recibe como parametros el id del paciente a actualizar, el nif, el nombre, los apellidos, *la contraseña, la dirección de correo electronico (El medico de familia asignado
|
|
||||||
* no se modifica).
|
|
||||||
*
|
|
||||||
* El id de paciente recibido se busca en el sistema para realizar la actualización de datos, sino se encuentra se lanza una excepción.
|
|
||||||
*
|
|
||||||
* La contraseña recibida solo se actualiza si se recibe el parámetro (no es nulo ni cadena vacía). La contraseña recibida se encrypta con el algoritmo MD5
|
|
||||||
*
|
|
||||||
* @return PatientTO Transfer Object correspondiente al paciente actualizado..
|
|
||||||
*/
|
|
||||||
public PatientTO updatePatientData(int id, String nif, String name, String surname, String password, String email) throws Exception {
|
public PatientTO updatePatientData(int id, String nif, String name, String surname, String password, String email) throws Exception {
|
||||||
PatientJPA pat = entman.find(PatientJPA.class, id);
|
PatientJPA pat = entman.find(PatientJPA.class, id);
|
||||||
|
|
||||||
@@ -187,20 +119,6 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Actualiza los datos personales de un médico especialista
|
|
||||||
*
|
|
||||||
* Recibe como parametros el id del médico a actualizar, nif, el nombre, los apellidos, *la contraseña, la dirección de correo electronico y la especialidad médcia que se debe
|
|
||||||
* asignar.
|
|
||||||
*
|
|
||||||
* El id del médico recibido se busca en el sistema para realizar la actualización de datos, sino se encuentra se lanza una excepción.
|
|
||||||
*
|
|
||||||
* La contraseña recibida solo se actualiza si se recibe el parámetro (no es nulo ni cadena vacía). La contraseña recibida se encrypta con el algoritmo MD5
|
|
||||||
*
|
|
||||||
* El método comprueba que la especialidad recibida existe en el sistema, en caso contrario lanza una excepción.
|
|
||||||
*
|
|
||||||
* @return SpecialistDoctorTO Transfer Object correspondiente al médico especialista que se ha actualizado.
|
|
||||||
*/
|
|
||||||
public SpecialistDoctorTO updateSpecialistDoctorData(int id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty)
|
public SpecialistDoctorTO updateSpecialistDoctorData(int id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
SpecialistDoctorJPA sd = entman.find(SpecialistDoctorJPA.class, id);
|
SpecialistDoctorJPA sd = entman.find(SpecialistDoctorJPA.class, id);
|
||||||
@@ -227,20 +145,6 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
return this.commonServices.getPOJOforSpecialistDoctorJPA(sd, 1);
|
return this.commonServices.getPOJOforSpecialistDoctorJPA(sd, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Actualiza los datos personales de un médico de familia
|
|
||||||
*
|
|
||||||
* Recibe como parametros el id del médico a actualizar, nif, el nombre, los apellidos, *la contraseña, la dirección de correo electronico, y el CAP al cual está asignado el
|
|
||||||
* médico de familia.
|
|
||||||
*
|
|
||||||
* El id del médico recibido se busca en el sistema para realizar la actualización de datos, sino se encuentra se lanza una excepción.
|
|
||||||
*
|
|
||||||
* La contraseña recibida solo se actualiza si se recibe el parámetro (no es nulo ni cadena vacía). La contraseña recibida se encrypta con el algoritmo MD5
|
|
||||||
*
|
|
||||||
* El método comprueba que el CAP recibida existe en el sistema, en caso contrario lanza una excepción.
|
|
||||||
*
|
|
||||||
* @return FamilyDoctorTO Transfer Object correspondiente al médico de familia que se ha actualizado.
|
|
||||||
*/
|
|
||||||
public FamilyDoctorTO updateFamilyDoctorData(int id, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO phcTO) throws Exception {
|
public FamilyDoctorTO updateFamilyDoctorData(int id, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO phcTO) throws Exception {
|
||||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, id);
|
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, id);
|
||||||
if (fd == null) {
|
if (fd == null) {
|
||||||
@@ -266,18 +170,9 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
|||||||
return this.commonServices.getPOJOforFamilyDoctorJPA(fd, 1);
|
return this.commonServices.getPOJOforFamilyDoctorJPA(fd, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
|
||||||
* Cambia el CAP (Centro de Atención Primaria) asignado a un médico de familia.
|
|
||||||
*
|
|
||||||
* Recibe como parametros el identificador del médico y el identificador del nuevo CAP a asginar.
|
|
||||||
*
|
|
||||||
* Si el identificador del médico no corresponde a ningún médico de familia registrado se lanza una excepción.
|
|
||||||
*
|
|
||||||
* Si el identificador del CAP no corresponde a ningún CAP registrado en el sistema se lanza una excpeción.
|
|
||||||
*
|
|
||||||
* @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 {
|
public FamilyDoctorTO changePrimaryHealthCareCenter(int professionalId, PrimaryHealthCareCenterTO newCenter) throws Exception {
|
||||||
|
FamilyDoctorTO fdTO = null;
|
||||||
|
|
||||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, professionalId);
|
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, professionalId);
|
||||||
if (fd == null) {
|
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));
|
throw new Exception("No se encuentra en la base de datos ningún médico de familia con id: " + String.valueOf(professionalId));
|
||||||
|
|||||||
@@ -1,28 +1,19 @@
|
|||||||
package ejb.systemAdmin;
|
package ejb.systemAdmin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.EJB;
|
import javax.ejb.EJB;
|
||||||
import javax.ejb.Stateless;
|
import javax.ejb.Stateless;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import javax.persistence.PersistenceContext;
|
||||||
import javax.persistence.TypedQuery;
|
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
|
||||||
import TO.LoggedUserTO;
|
import TO.LoggedUserTO;
|
||||||
import TO.MedicalSpecialtyTO;
|
|
||||||
import TO.PatientTO;
|
|
||||||
import TO.PrimaryHealthCareCenterTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
|
||||||
import common.Constants;
|
import common.Constants;
|
||||||
import common.HashUtils;
|
import common.HashUtils;
|
||||||
import common.UserType;
|
import common.UserType;
|
||||||
import ejb.common.CommonFacadeLocal;
|
import ejb.common.CommonFacadeLocal;
|
||||||
import jpa.AdministratorJPA;
|
import jpa.AdministratorJPA;
|
||||||
import jpa.FamilyDoctorJPA;
|
import jpa.FamilyDoctorJPA;
|
||||||
import jpa.MedicalSpecialtyJPA;
|
import jpa.PatientJPA;
|
||||||
import jpa.PrimaryHealthCareCenterJPA;
|
import jpa.SpecialistDoctorJPA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -40,23 +31,29 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
|||||||
CommonFacadeLocal commonServices;
|
CommonFacadeLocal commonServices;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Si la autenticación no es correcgta devuelve null, sino devuelve un POJO con datos del usuario logeado.
|
* Si la autenticación no es correcgta devuelve null, sino devuelve un POJO con
|
||||||
|
* datos del usuario logeado.
|
||||||
*
|
*
|
||||||
* La autenticación se realiza en 2 pasos:
|
* La autenticación se realiza en 2 pasos:
|
||||||
*
|
*
|
||||||
* Paso 1. Se intenta localizar un registro de usuario, por orden:
|
* Paso 1. Se intenta localizar un registro de usuario, por orden:
|
||||||
*
|
*
|
||||||
* a. Primero Paciente, si el identificador comienza por los caracteres correctos.
|
* a. Primero Paciente, si el identificador comienza por los caracteres
|
||||||
|
* correctos.
|
||||||
*
|
*
|
||||||
* b.Después médico de familia, si el identificador es de profesional
|
* b.Después médico de familia, si el identificador es de profesional
|
||||||
*
|
*
|
||||||
* c. Si no lo localizamos buscamos el identificador en la tabla de médicos especialistas (el identificador es de profesional)
|
* c. Si no lo localizamos buscamos el identificador en la tabla de médicos
|
||||||
|
* especialistas (el identificador es de profesional)
|
||||||
*
|
*
|
||||||
* d. Si no hemos localizado aún al usuario, lo buscamos en la tabla de administradores, aún cuando el identificador comience por cualquier carácter (podría ser una dirección
|
* d. Si no hemos localizado aún al usuario, lo buscamos en la tabla de
|
||||||
* de email que comienza por caracteres del identificaodr de paciente o profesional)
|
* administradores, aún cuando el identificador comience por cualquier carácter
|
||||||
|
* (podría ser una dirección de email que comienza por caracteres del
|
||||||
|
* identificaodr de paciente o profesional)
|
||||||
*
|
*
|
||||||
* Paso 2. Si hemos localizado un registro de usuario, verificamos si el password recibido coincide con el de la base de datos, en tal caso la autenticación se compelta y es
|
* Paso 2. Si hemos localizado un registro de usuario, verificamos si el
|
||||||
* correcta.
|
* password recibido coincide con el de la base de datos, en tal caso la
|
||||||
|
* autenticación se compelta y es correcta.
|
||||||
*/
|
*/
|
||||||
public LoggedUserTO login(String userCode, String pwd) {
|
public LoggedUserTO login(String userCode, String pwd) {
|
||||||
LoggedUserTO usr = null;
|
LoggedUserTO usr = null;
|
||||||
@@ -64,23 +61,23 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
|||||||
if (userCode.startsWith(Constants.PERSONAL_IDENTIFICATION_CODE_PREFIX)) {
|
if (userCode.startsWith(Constants.PERSONAL_IDENTIFICATION_CODE_PREFIX)) {
|
||||||
// Si el identificador de usuario es de tipo paciente, intentamos realizar el
|
// Si el identificador de usuario es de tipo paciente, intentamos realizar el
|
||||||
// login.
|
// login.
|
||||||
PatientTO pat = this.commonServices.findPatientByCode(userCode);
|
PatientJPA pat = this.commonServices.findPatientByCode(userCode);
|
||||||
if (pat != null) {
|
if (pat != null) {
|
||||||
usr = new LoggedUserTO(String.valueOf(pat.getId()), pat.getName(), pat.getPassword(), UserType.PATIENT, pat.getDisplayName());
|
usr = new LoggedUserTO(String.valueOf(pat.getId()), pat.getName(), pat.getPassword(), UserType.PATIENT);
|
||||||
}
|
}
|
||||||
} else if (userCode.startsWith(Constants.PROFESSIONAL_NUMBER_PREFIX)) {
|
} else if (userCode.startsWith(Constants.PROFESSIONAL_NUMBER_PREFIX)) {
|
||||||
// Si el identificador de usuario es de tipo profesional, intentamos realizar el
|
// Si el identificador de usuario es de tipo profesional, intentamos realizar el
|
||||||
// login, primero como médico de familia, después como especialista
|
// login, primero como médico de familia, después como especialista
|
||||||
FamilyDoctorTO fd = this.commonServices.findFamilyDoctorByCode(userCode);
|
FamilyDoctorJPA fd = this.commonServices.findFamilyDoctorByCode(userCode);
|
||||||
|
|
||||||
if (fd != null) {
|
if (fd != null) {
|
||||||
usr = new LoggedUserTO(String.valueOf(fd.getId()), fd.getName(), fd.getPassword(), UserType.FAMILY_DOCTOR, fd.getDisplayName());
|
usr = new LoggedUserTO(String.valueOf(fd.getId()), fd.getName(), fd.getPassword(), UserType.FAMILY_DOCTOR);
|
||||||
} else {
|
} else {
|
||||||
// No era un código de médico de familia, intenamos logearlo como especialista
|
// No era un código de médico de familia, intenamos logearlo como especialista
|
||||||
SpecialistDoctorTO sd = this.commonServices.findSpecialistDoctorByCode(userCode);
|
SpecialistDoctorJPA sd = this.commonServices.findSpecialistDoctorByCode(userCode);
|
||||||
|
|
||||||
if (sd != null) {
|
if (sd != null) {
|
||||||
usr = new LoggedUserTO(String.valueOf(sd.getId()), sd.getName(), sd.getPassword(), UserType.SPECIALIST_DOCTOR, sd.getDisplayName());
|
usr = new LoggedUserTO(String.valueOf(sd.getId()), sd.getName(), sd.getPassword(), UserType.SPECIALIST_DOCTOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +91,7 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
|||||||
AdministratorJPA adm = entman.find(AdministratorJPA.class, userCode);
|
AdministratorJPA adm = entman.find(AdministratorJPA.class, userCode);
|
||||||
|
|
||||||
if (adm != null) {
|
if (adm != null) {
|
||||||
usr = new LoggedUserTO(adm.getEmail(), adm.getEmail(), adm.getPassword(), UserType.ADMINISTRATOR, adm.getEmail());
|
usr = new LoggedUserTO(adm.getEmail(), adm.getEmail(), adm.getPassword(), UserType.ADMINISTRATOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,150 +107,4 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
|||||||
|
|
||||||
return usr;
|
return usr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MedicalSpecialtyTO updateSpecialty(int id, String name, String description) throws Exception {
|
|
||||||
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, id);
|
|
||||||
|
|
||||||
if (ms == null) {
|
|
||||||
throw new Exception("No se pueden actualizar los datos de la especialidad porque no se encuentra en la base de datos ningún registro con id: " + String.valueOf(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
ms.setName(name);
|
|
||||||
ms.setDescription(description);
|
|
||||||
|
|
||||||
entman.persist(ms);
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforMedicalSpecialtyJPA(ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalSpecialtyTO findSpecialtyByName(String searchedName) {
|
|
||||||
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery("from MedicalSpecialtyJPA ms where ms.name=:name", MedicalSpecialtyJPA.class);
|
|
||||||
query.setMaxResults(1);
|
|
||||||
query.setParameter("name", searchedName);
|
|
||||||
|
|
||||||
List<MedicalSpecialtyJPA> results = query.getResultList();
|
|
||||||
if (results.size() > 0)
|
|
||||||
return this.commonServices.getPOJOforMedicalSpecialtyJPA(results.get(0));
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteSpecialty(int id) throws Exception {
|
|
||||||
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, id);
|
|
||||||
|
|
||||||
if (ms == null) {
|
|
||||||
throw new Exception("No se puede borrar la especialidad porque no se encuentra en la base de datos ningún registro con id: " + String.valueOf(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
entman.remove(ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MedicalSpecialtyTO insertSpecialty(String name, String description) throws Exception {
|
|
||||||
MedicalSpecialtyJPA ms = new MedicalSpecialtyJPA(name, description);
|
|
||||||
entman.persist(ms);
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforMedicalSpecialtyJPA(ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PrimaryHealthCareCenterTO updateHealthCareCenter(int id, String name, String location) throws Exception {
|
|
||||||
PrimaryHealthCareCenterJPA ms = entman.find(PrimaryHealthCareCenterJPA.class, id);
|
|
||||||
|
|
||||||
if (ms == null) {
|
|
||||||
throw new Exception("No se pueden actualizar los datos del CAP porque no se encuentra en la base de datos ningún registro con id: " + String.valueOf(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
ms.setName(name);
|
|
||||||
ms.setLocation(location);
|
|
||||||
|
|
||||||
entman.persist(ms);
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforPrimaryHealthCareCenterJPA(ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO findHealthCareCenterByName(String searchedName) {
|
|
||||||
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery("from PrimaryHealthCareCenterJPA cap where cap.name=:name", PrimaryHealthCareCenterJPA.class);
|
|
||||||
query.setMaxResults(1);
|
|
||||||
query.setParameter("name", searchedName);
|
|
||||||
|
|
||||||
List<PrimaryHealthCareCenterJPA> results = query.getResultList();
|
|
||||||
if (results.size() > 0)
|
|
||||||
return this.commonServices.getPOJOforPrimaryHealthCareCenterJPA(results.get(0));
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteHealthCareCenter(int id) throws Exception {
|
|
||||||
PrimaryHealthCareCenterJPA cap = entman.find(PrimaryHealthCareCenterJPA.class, id);
|
|
||||||
|
|
||||||
if (cap == null) {
|
|
||||||
throw new Exception("No se puede borrar el CAP porque no se encuentra en la base de datos ningún registro con id: " + String.valueOf(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
entman.remove(cap);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PrimaryHealthCareCenterTO insertHealthCareCenter(String name, String location) throws Exception {
|
|
||||||
PrimaryHealthCareCenterJPA cap = new PrimaryHealthCareCenterJPA(name, location);
|
|
||||||
entman.persist(cap);
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforPrimaryHealthCareCenterJPA(cap);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCAPCount() {
|
|
||||||
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from PrimaryHealthCareCenterJPA", Long.class);
|
|
||||||
|
|
||||||
return query.getSingleResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PrimaryHealthCareCenterTO> listCAPsPaged(int pageNumber, int pageSize) {
|
|
||||||
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery("SELECT c from PrimaryHealthCareCenterJPA c order by c.name", PrimaryHealthCareCenterJPA.class);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PrimaryHealthCareCenterJPA> allJPA = query.getResultList();
|
|
||||||
List<PrimaryHealthCareCenterTO> caps = new ArrayList<PrimaryHealthCareCenterTO>();
|
|
||||||
|
|
||||||
for (PrimaryHealthCareCenterJPA item : allJPA) {
|
|
||||||
caps.add(commonServices.getPOJOforPrimaryHealthCareCenterJPA(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
return caps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<FamilyDoctorTO> listAllFamilyDoctorsByCAPPaged(int primaryHealthCareCenterId, int pageNumber, int pageSize) {
|
|
||||||
List<FamilyDoctorTO> familyDoctorsByCAP = new ArrayList<FamilyDoctorTO>();
|
|
||||||
|
|
||||||
TypedQuery<FamilyDoctorJPA> query = entman.createQuery("SELECT d from FamilyDoctorJPA d where d.primaryHealthCareCenter.id=:capId order by d.name asc, d.surname asc",
|
|
||||||
FamilyDoctorJPA.class);
|
|
||||||
query.setParameter("capId", primaryHealthCareCenterId);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<FamilyDoctorJPA> allJPA = query.getResultList();
|
|
||||||
|
|
||||||
for (FamilyDoctorJPA item : allJPA) {
|
|
||||||
familyDoctorsByCAP.add(commonServices.getPOJOforFamilyDoctorJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return familyDoctorsByCAP;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getPatientCount(int familyDoctorId) {
|
|
||||||
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from PatientJPA p where p.familyDoctor.id=:familyDoctorId", Long.class);
|
|
||||||
query.setParameter("familyDoctorId", familyDoctorId);
|
|
||||||
|
|
||||||
return query.getSingleResult();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package ejb.systemAdmin;
|
package ejb.systemAdmin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.Collection;
|
||||||
|
|
||||||
import javax.ejb.Remote;
|
import javax.ejb.Remote;
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
|
||||||
import TO.LoggedUserTO;
|
import TO.LoggedUserTO;
|
||||||
import TO.MedicalSpecialtyTO;
|
import TO.MedicalSpecialtyTO;
|
||||||
import TO.PrimaryHealthCareCenterTO;
|
import TO.PrimaryHealthCareCenterTO;
|
||||||
@@ -20,29 +19,6 @@ public interface SystemAdminFacadeRemote {
|
|||||||
* Definimos la interfaz remota
|
* Definimos la interfaz remota
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public LoggedUserTO login(String id, String pwd);
|
public LoggedUserTO login(String id, String pwd);
|
||||||
|
|
||||||
public MedicalSpecialtyTO updateSpecialty(int id, String name, String description) throws Exception;
|
|
||||||
|
|
||||||
public MedicalSpecialtyTO findSpecialtyByName(String name);
|
|
||||||
|
|
||||||
public void deleteSpecialty(int id) throws Exception;
|
|
||||||
|
|
||||||
public MedicalSpecialtyTO insertSpecialty(String name, String description) throws Exception;
|
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO updateHealthCareCenter(int id, String name, String location) throws Exception;
|
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO findHealthCareCenterByName(String name);
|
|
||||||
|
|
||||||
public void deleteHealthCareCenter(int id) throws Exception;
|
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO insertHealthCareCenter(String name, String location) throws Exception;
|
|
||||||
|
|
||||||
public Long getCAPCount();
|
|
||||||
|
|
||||||
public List<PrimaryHealthCareCenterTO> listCAPsPaged(int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public List<FamilyDoctorTO> listAllFamilyDoctorsByCAPPaged(int primaryHealthCareCenterId, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public Long getPatientCount(int familyDoctorId);
|
|
||||||
}
|
}
|
||||||
@@ -1,158 +1,28 @@
|
|||||||
package ejb.visit;
|
package ejb.visit;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.EJB;
|
|
||||||
import javax.ejb.Stateless;
|
import javax.ejb.Stateless;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import javax.persistence.PersistenceContext;
|
||||||
import javax.persistence.TypedQuery;
|
|
||||||
|
|
||||||
import TO.VisitTO;
|
|
||||||
import ejb.common.CommonFacadeLocal;
|
|
||||||
import jpa.PatientJPA;
|
|
||||||
import jpa.VisitJPA;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EJB Session Bean Class para la Practica 2, Ejercicio 1 (ISCSD) Implementa los métodos de la capa de negocio que implementan la logica de negocio y la interacción con la capa de
|
* EJB Session Bean Class para la Practica 2, Ejercicio 1 (ISCSD) Implementa los
|
||||||
* persistencia.
|
* métodos de la capa de negocio que implementan la logica de negocio y la
|
||||||
|
* interacción con la capa de persistencia.
|
||||||
*
|
*
|
||||||
* @author mark
|
* @author mark
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Stateless
|
@Stateless
|
||||||
public class VisitFacadeBean implements VisitFacadeRemote {
|
public class VisitFacadeBean implements VisitFacadeRemote {
|
||||||
|
|
||||||
// Persistence Unit Context
|
// Persistence Unit Context
|
||||||
@PersistenceContext(unitName = "MyHealth")
|
@PersistenceContext(unitName = "MyHealth")
|
||||||
EntityManager entman;
|
private EntityManager entman;
|
||||||
|
|
||||||
@EJB
|
public void ejbMethod(String parameter)
|
||||||
CommonFacadeLocal commonServices;
|
{
|
||||||
|
|
||||||
public Long getScheduledVisitsCount(int familyDoctorId, LocalDate date) {
|
|
||||||
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from VisitJPA v where v.date=:date and v.familyDoctor.id=:docId", Long.class);
|
|
||||||
query.setParameter("date", date);
|
|
||||||
query.setParameter("docId", familyDoctorId);
|
|
||||||
|
|
||||||
return query.getSingleResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<VisitTO> listAllScheduledVisitsPaged(int familyDoctorId, LocalDate date, int pageNumber, int pageSize) {
|
|
||||||
TypedQuery<VisitJPA> query = entman.createQuery("SELECT v from VisitJPA v where v.date=:date and v.familyDoctor.id=:docId order by v.date, v.time", VisitJPA.class);
|
|
||||||
query.setParameter("date", date);
|
|
||||||
query.setParameter("docId", familyDoctorId);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<VisitJPA> allJPA = query.getResultList();
|
|
||||||
List<VisitTO> listTO = new ArrayList<VisitTO>();
|
|
||||||
|
|
||||||
for (VisitJPA item : allJPA) {
|
|
||||||
listTO.add(commonServices.getPOJOforVisitJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return listTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getVisitsCount(Integer patientId, LocalDate date) {
|
|
||||||
String strQuery = "SELECT count(1) from VisitJPA v %s";
|
|
||||||
String strFilter = "";
|
|
||||||
if (patientId != null)
|
|
||||||
strFilter = " and v.patient.id=:patientId ";
|
|
||||||
if (date != null)
|
|
||||||
strFilter += " and v.date=:date ";
|
|
||||||
|
|
||||||
if (strFilter.length() > 0) {
|
|
||||||
strFilter = "WHERE 1=1 " + strFilter;
|
|
||||||
}
|
|
||||||
strQuery = String.format(strQuery, strFilter);
|
|
||||||
|
|
||||||
TypedQuery<Long> query = entman.createQuery(strQuery, Long.class);
|
|
||||||
|
|
||||||
if (patientId != null)
|
|
||||||
query.setParameter("patientId", patientId);
|
|
||||||
if (date != null)
|
|
||||||
query.setParameter("date", date);
|
|
||||||
|
|
||||||
return query.getSingleResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<VisitTO> listVisitsPaged(Integer patientId, LocalDate date, int pageNumber, int pageSize) {
|
|
||||||
String strQuery = "SELECT v from VisitJPA v %s order by v.patient, v.date";
|
|
||||||
String strFilter = "";
|
|
||||||
if (patientId != null)
|
|
||||||
strFilter = " and v.patient.id=:patientId ";
|
|
||||||
if (date != null)
|
|
||||||
strFilter += " and v.date=:date ";
|
|
||||||
|
|
||||||
if (strFilter.length() > 0) {
|
|
||||||
strFilter = "WHERE 1=1 " + strFilter;
|
|
||||||
}
|
|
||||||
strQuery = String.format(strQuery, strFilter);
|
|
||||||
|
|
||||||
TypedQuery<VisitJPA> query = entman.createQuery(strQuery, VisitJPA.class);
|
|
||||||
|
|
||||||
if (patientId != null)
|
|
||||||
query.setParameter("patientId", patientId);
|
|
||||||
if (date != null)
|
|
||||||
query.setParameter("date", date);
|
|
||||||
|
|
||||||
if (pageSize > 0) {
|
|
||||||
query.setFirstResult(pageNumber * pageSize);
|
|
||||||
query.setMaxResults(pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<VisitJPA> allJPA = query.getResultList();
|
|
||||||
List<VisitTO> listTO = new ArrayList<VisitTO>();
|
|
||||||
|
|
||||||
for (VisitJPA item : allJPA) {
|
|
||||||
listTO.add(commonServices.getPOJOforVisitJPA(item, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return listTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VisitTO getVisit(int id) throws Exception {
|
|
||||||
VisitJPA vi = entman.find(VisitJPA.class, id);
|
|
||||||
if (vi == null) {
|
|
||||||
throw new Exception("No se encuentra la visita con identificador: " + String.valueOf(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforVisitJPA(vi, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addResultToVisit(int id, String result) {
|
|
||||||
VisitJPA vi = entman.find(VisitJPA.class, id);
|
|
||||||
|
|
||||||
vi.setResult(result);
|
|
||||||
entman.persist(vi);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeVisit(int id) {
|
|
||||||
VisitJPA vi = entman.find(VisitJPA.class, id);
|
|
||||||
entman.remove(vi);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateVisit(int id, LocalDate date, LocalTime time) {
|
|
||||||
VisitJPA vi = entman.find(VisitJPA.class, id);
|
|
||||||
vi.setDate(date);
|
|
||||||
vi.setTime(time);
|
|
||||||
entman.persist(vi);
|
|
||||||
}
|
|
||||||
|
|
||||||
public VisitTO addVisit(int patientId, LocalDate date, LocalTime time, String observations) {
|
|
||||||
|
|
||||||
PatientJPA pat = entman.find(PatientJPA.class, patientId);
|
|
||||||
|
|
||||||
VisitJPA vi = new VisitJPA(date, time, observations, "", pat, pat.getFamilyDoctor());
|
|
||||||
entman.persist(vi);
|
|
||||||
|
|
||||||
return this.commonServices.getPOJOforVisitJPA(vi, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
package ejb.visit;
|
package ejb.visit;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.Remote;
|
import javax.ejb.Remote;
|
||||||
|
|
||||||
import TO.VisitTO;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaz remota del EJB Definimos los métodos que estarán disponibles para los clientes del EJB
|
* Interfaz remota del EJB Definimos los métodos que estarán disponibles para
|
||||||
|
* los clientes del EJB
|
||||||
*
|
*
|
||||||
* @author alina
|
* @author mark
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Remote
|
@Remote
|
||||||
@@ -19,23 +14,5 @@ public interface VisitFacadeRemote {
|
|||||||
/**
|
/**
|
||||||
* Definimos la interfaz remota
|
* Definimos la interfaz remota
|
||||||
*/
|
*/
|
||||||
|
public void ejbMethod(String parameter);
|
||||||
public Long getScheduledVisitsCount(int familyDoctorId, LocalDate date);
|
|
||||||
|
|
||||||
public List<VisitTO> listAllScheduledVisitsPaged(int familyDoctorId, LocalDate date, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public Long getVisitsCount(Integer patientId, LocalDate date);
|
|
||||||
|
|
||||||
public List<VisitTO> listVisitsPaged(Integer patientId, LocalDate date, int pageNumber, int pageSize);
|
|
||||||
|
|
||||||
public VisitTO getVisit(int id) throws Exception;
|
|
||||||
|
|
||||||
public void addResultToVisit(int id, String result);
|
|
||||||
|
|
||||||
public void removeVisit(int id);
|
|
||||||
|
|
||||||
public void updateVisit(int id, LocalDate date, LocalTime time);
|
|
||||||
|
|
||||||
public VisitTO addVisit(int patientId, LocalDate date, LocalTime time, String observations);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package jpa;
|
package jpa;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.Collection;
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -39,7 +39,7 @@ public class FamilyDoctorJPA implements Serializable {
|
|||||||
private String email;
|
private String email;
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "FamilyDoctorId")
|
@JoinColumn(name = "FamilyDoctorId")
|
||||||
private List<PatientJPA> patients;
|
private Collection<PatientJPA> patients;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn (name="PrimaryHealthCareCenterId")
|
@JoinColumn (name="PrimaryHealthCareCenterId")
|
||||||
private PrimaryHealthCareCenterJPA primaryHealthCareCenter;
|
private PrimaryHealthCareCenterJPA primaryHealthCareCenter;
|
||||||
@@ -111,21 +111,19 @@ public class FamilyDoctorJPA implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Metodos para get/set de relaciones (pacientes)
|
* Metodos para get/set de relaciones (pacientes)
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<PatientJPA> getPatients() {
|
public Collection<PatientJPA> getPatients() {
|
||||||
return patients;
|
return patients;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPatients(List<PatientJPA> patients) {
|
public void setPatients(Collection<PatientJPA> patients) {
|
||||||
this.patients = patients;
|
this.patients = patients;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() {
|
public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() {
|
||||||
return primaryHealthCareCenter;
|
return primaryHealthCareCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
|
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
|
||||||
this.primaryHealthCareCenter = center;
|
this.primaryHealthCareCenter = center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +0,0 @@
|
|||||||
package jpa;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.EnumType;
|
|
||||||
import javax.persistence.Enumerated;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.GenerationType;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.ManyToOne;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import common.MedicalTestType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Los nombres de los decortadores relacionados con la BBDD pueden estar en
|
|
||||||
* camelCase, snakeCase o como se quiera, puesto que en persistence.xml se tiene
|
|
||||||
* dicho que se convierta a minúsculas.
|
|
||||||
*
|
|
||||||
* Lo uso en minúsculas para mejorar la trazabilidad de los campos.
|
|
||||||
*
|
|
||||||
* @author Roberto Orden Erena <rorden@uoc.edu>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Entity
|
|
||||||
@Table(name = "myhealth.medicaltest")
|
|
||||||
public class MedicalTestJPA implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
private int id;
|
|
||||||
private LocalDate date;
|
|
||||||
private LocalTime time;
|
|
||||||
private String observations;
|
|
||||||
private String highresimage;
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
@Column(name = "type") // Con esto podríamos cambiar los nombres de las propiedades de la clase y
|
|
||||||
// mantener la relación con la BBDD a través de JPA
|
|
||||||
private MedicalTestType type;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
@JoinColumn(name = "patientid")
|
|
||||||
private PatientJPA patient;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
@JoinColumn(name = "specialistdoctorid")
|
|
||||||
private SpecialistDoctorJPA specialistDoctor;
|
|
||||||
|
|
||||||
public MedicalTestJPA() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalTestJPA(LocalDate date, LocalTime time, String observations, String highresimage, MedicalTestType type, PatientJPA patient, SpecialistDoctorJPA specialistDoctor) {
|
|
||||||
this.date = date;
|
|
||||||
this.time = time;
|
|
||||||
this.observations = observations;
|
|
||||||
this.highresimage = highresimage;
|
|
||||||
this.type = type;
|
|
||||||
this.patient = patient;
|
|
||||||
this.specialistDoctor = specialistDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getDate() {
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(LocalDate date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalTime getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(LocalTime time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getObservations() {
|
|
||||||
return observations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setObservations(String observations) {
|
|
||||||
this.observations = observations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHighresimage() {
|
|
||||||
return highresimage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHighresimage(String highresimage) {
|
|
||||||
this.highresimage = highresimage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalTestType getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(MedicalTestType type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientJPA getPatient() {
|
|
||||||
return patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatient(PatientJPA patient) {
|
|
||||||
this.patient = patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpecialistDoctorJPA getSpecialistDoctor() {
|
|
||||||
return specialistDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpecialistDoctor(SpecialistDoctorJPA specialistDoctor) {
|
|
||||||
this.specialistDoctor = specialistDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
package jpa;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.EnumType;
|
|
||||||
import javax.persistence.Enumerated;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.GenerationType;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.ManyToOne;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import common.QuestionStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
|
||||||
* @author Roberto Orden Erena <rorden@uoc.edu>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Entity
|
|
||||||
@Table(name = "MyHealth.Question")
|
|
||||||
public class QuestionJPA implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
private int id;
|
|
||||||
private String title;
|
|
||||||
private String message;
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private QuestionStatus status;
|
|
||||||
private String response;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
@JoinColumn(name = "patientid")
|
|
||||||
private PatientJPA patient;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
@JoinColumn(name = "familydoctorid")
|
|
||||||
private FamilyDoctorJPA familyDoctor;
|
|
||||||
|
|
||||||
public QuestionJPA() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuestionJPA(int id, String title, String message, QuestionStatus status, PatientJPA patient, FamilyDoctorJPA familydoctor, String response) {
|
|
||||||
this.id = id;
|
|
||||||
this.title = title;
|
|
||||||
this.message = message;
|
|
||||||
this.status = status;
|
|
||||||
this.patient = patient;
|
|
||||||
this.familyDoctor = familydoctor;
|
|
||||||
this.response = response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitle(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientJPA getPatient() {
|
|
||||||
return patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatient(PatientJPA patient) {
|
|
||||||
this.patient = patient;
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuestionStatus getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(QuestionStatus status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyDoctorJPA getFamilyDoctor() {
|
|
||||||
return familyDoctor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
|
|
||||||
this.familyDoctor = familyDoc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResponse() {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResponse(String response) {
|
|
||||||
this.response = response;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package jpa;
|
package jpa;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.sql.Time;
|
||||||
import java.time.LocalTime;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -28,15 +28,13 @@ public class VisitJPA implements Serializable {
|
|||||||
@Column(updatable = false)
|
@Column(updatable = false)
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private LocalDate date;
|
private Date date;
|
||||||
private LocalTime time;
|
private Time time;
|
||||||
private String observations;
|
private String observations;
|
||||||
private String result;
|
private String result;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "FamilyDoctorId")
|
@JoinColumn(name = "FamilyDoctorId")
|
||||||
private FamilyDoctorJPA familyDoctor;
|
private FamilyDoctorJPA familyDoctor;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "PatientId")
|
@JoinColumn(name = "PatientId")
|
||||||
private PatientJPA patient;
|
private PatientJPA patient;
|
||||||
@@ -48,15 +46,16 @@ public class VisitJPA implements Serializable {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public VisitJPA(LocalDate date, LocalTime time, String observations, String result, PatientJPA patient, FamilyDoctorJPA familydoctor) {
|
public VisitJPA(Integer id, Date date, Time time, String observations, String result) {
|
||||||
|
this.id = id;
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.observations = observations;
|
this.observations = observations;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.patient = patient;
|
|
||||||
this.familyDoctor = familydoctor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -65,19 +64,19 @@ public class VisitJPA implements Serializable {
|
|||||||
this.id = value;
|
this.id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalDate getDate() {
|
public Date getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDate(LocalDate value) {
|
public void setDate(Date value) {
|
||||||
this.date = value;
|
this.date = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalTime getTime() {
|
public Time getTime() {
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTime(LocalTime value) {
|
public void setTime(Time value) {
|
||||||
this.time = value;
|
this.time = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,8 +84,8 @@ public class VisitJPA implements Serializable {
|
|||||||
return observations;
|
return observations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setObservations(String value) {
|
public void setObservations(String observation) {
|
||||||
this.observations = value;
|
this.observations = observations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,12 +106,4 @@ public class VisitJPA implements Serializable {
|
|||||||
public void setPatient(PatientJPA pat) {
|
public void setPatient(PatientJPA pat) {
|
||||||
this.patient = pat;
|
this.patient = pat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getResult() {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResult(String value) {
|
|
||||||
this.result = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package managedbean.common;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import javax.faces.application.FacesMessage;
|
|
||||||
import javax.persistence.PersistenceException;
|
|
||||||
import javax.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import javax.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import javax.servlet.FilterConfig;
|
import javax.servlet.FilterConfig;
|
||||||
@@ -16,12 +14,6 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.omnifaces.util.Exceptions;
|
|
||||||
|
|
||||||
import common.UserType;
|
|
||||||
import common.Utils;
|
|
||||||
import managedbean.systemAdmin.LoginMBean;
|
|
||||||
|
|
||||||
@WebFilter(filterName = "AuthFilter", urlPatterns = { "*.xhtml" })
|
@WebFilter(filterName = "AuthFilter", urlPatterns = { "*.xhtml" })
|
||||||
public class AuthorizationFilter implements Filter {
|
public class AuthorizationFilter implements Filter {
|
||||||
|
|
||||||
@@ -33,170 +25,27 @@ public class AuthorizationFilter implements Filter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAJAXRequest(HttpServletRequest request) {
|
|
||||||
boolean check = false;
|
|
||||||
String facesRequest = request.getHeader("Faces-Request");
|
|
||||||
if (facesRequest != null && facesRequest.equals("partial/ajax")) {
|
|
||||||
check = true;
|
|
||||||
}
|
|
||||||
return check;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||||
HttpServletRequest req = null;
|
|
||||||
HttpServletResponse resp = null;
|
|
||||||
HttpSession ses = null;
|
|
||||||
|
|
||||||
// Si establecemos esta variable a true se realiza el autologin
|
|
||||||
// TODO: Eliminar esta variable al terminar el desarrollo
|
|
||||||
boolean Debug = false;
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
req = (HttpServletRequest) request;
|
HttpServletRequest req = (HttpServletRequest) request;
|
||||||
|
HttpServletResponse resp = (HttpServletResponse) response;
|
||||||
|
HttpSession ses = req.getSession(false);
|
||||||
|
|
||||||
String reqURI = req.getRequestURI();
|
String reqURI = req.getRequestURI();
|
||||||
|
if (reqURI.indexOf("/login.xhtml") >= 0 || reqURI.indexOf("/RegisterUser.xhtml") >= 0 || reqURI.indexOf("/home.xhtml") >= 0 || reqURI.indexOf("/public/") >= 0
|
||||||
resp = (HttpServletResponse) response;
|
|| reqURI.contains("javax.faces.resource") || SessionUtils.isLogedIn(ses) == true)
|
||||||
|
chain.doFilter(request, response);
|
||||||
// TODO: Eliminar este código al terminar el desarrollo.
|
|
||||||
// Realizamos un login automatico (para agilizar el desarrollo.
|
|
||||||
if (Debug == true) {
|
|
||||||
ses = req.getSession(true);
|
|
||||||
|
|
||||||
if (SessionUtils.isLogedIn(ses) == false) {
|
|
||||||
LoginMBean login = new LoginMBean();
|
|
||||||
login.setUsername("PRO#100");
|
|
||||||
login.setPassword("asdf");
|
|
||||||
boolean result = login.autoLogin(ses);
|
|
||||||
|
|
||||||
if (result == true)
|
|
||||||
SessionUtils.addMessage(ses, FacesMessage.SEVERITY_ERROR, "Login automático correcto", "Se ha realizado un login automático correctamente.");
|
|
||||||
else
|
else
|
||||||
SessionUtils.addMessage(ses, FacesMessage.SEVERITY_ERROR, "El login automático ha fallado.", "No se ha podido realizar el login automático.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
ses = req.getSession(false);
|
|
||||||
|
|
||||||
// Para recursos publicos permitimos el acceso exista sesión o no.
|
|
||||||
if (reqURI.indexOf("/login.xhtml") >= 0 || reqURI.indexOf("/profile/RegisterUser.xhtml") >= 0 || reqURI.indexOf("/home.xhtml") >= 0
|
|
||||||
|| reqURI.indexOf("/error.xhtml") >= 0 || reqURI.indexOf("/public/") >= 0 || reqURI.contains("javax.faces.resource")) {
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isAJAXRequest(req) == true) {
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sesión expirada
|
|
||||||
if (req.isRequestedSessionIdValid() == false && req.getRequestedSessionId() != null) {
|
|
||||||
resp.sendRedirect(req.getContextPath() + "/error.xhtml?type=expired");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Si el usuario está logeado comprobamos si está autorizado a ver la página solicitada.
|
|
||||||
if (SessionUtils.isLogedIn(ses) == true) {
|
|
||||||
UserType tipoUsuario = SessionUtils.getUserType(ses);
|
|
||||||
boolean authorized = false;
|
|
||||||
|
|
||||||
switch (tipoUsuario) {
|
|
||||||
case ADMINISTRATOR:
|
|
||||||
if (reqURI.indexOf("/systemAdmin/ManageSpecialties") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/systemAdmin/ManageHealthCareCenters") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/systemAdmin/ListDoctorsByCenter") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/PatientVisitList") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/UpdateVisit") > 0)
|
|
||||||
authorized = true;
|
|
||||||
break;
|
|
||||||
case PATIENT:
|
|
||||||
if (reqURI.indexOf("/visit/VisitView") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/AddVisit") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/UpdateVisit") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/PatientVisitList") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/Questions") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/ViewMedicalTest") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/MedicalTests") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/SearchSpecialist") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/profile/UpdateProfile") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/profile/ChangeFamilyDoctor") > 0)
|
|
||||||
authorized = true;
|
|
||||||
break;
|
|
||||||
case FAMILY_DOCTOR:
|
|
||||||
if (reqURI.indexOf("/visit/VisitView") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/UpdateVisit") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/visit/VisitList") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/MedicalTests") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/Questions") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/ViewMedicalTest") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/profile/UpdateProfile") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/profile/ChangePrimaryHealthCareCenter") > 0)
|
|
||||||
authorized = true;
|
|
||||||
break;
|
|
||||||
case SPECIALIST_DOCTOR:
|
|
||||||
if (reqURI.indexOf("/medicaltest/MedicalTests") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/AddMedicalTest") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/ViewMedicalTest") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/medicaltest/AddImageToMedicalTest") > 0)
|
|
||||||
authorized = true;
|
|
||||||
if (reqURI.indexOf("/profile/UpdateProfile") > 0)
|
|
||||||
authorized = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (authorized == true) {
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
SessionUtils.addMessage(ses, FacesMessage.SEVERITY_ERROR,
|
|
||||||
"No está autorizado a acceder a la página solicitada. Por favor, utilice el menú principal de la aplicación.",
|
|
||||||
String.format("Se ha producido una expción de autorización, su usuario no está autorizado a acceder a la página: (%s).", reqURI));
|
|
||||||
resp.sendRedirect(req.getContextPath() + "/error.xhtml?type=auth");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
resp.sendRedirect(req.getContextPath() + "/login.xhtml");
|
resp.sendRedirect(req.getContextPath() + "/login.xhtml");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (Exceptions.is(e, PersistenceException.class) == true) {
|
System.out.println(e.getMessage());
|
||||||
if (ses != null)
|
|
||||||
SessionUtils.addMessage(ses, FacesMessage.SEVERITY_ERROR, "Error al intentar acceder a la base de datos", Utils.getExceptionRootCause(e).getLocalizedMessage());
|
|
||||||
|
|
||||||
resp.sendRedirect(req.getContextPath() + "/error.xhtml?type=sql");
|
|
||||||
} else {
|
|
||||||
SessionUtils.addMessage(ses, FacesMessage.SEVERITY_ERROR, "Error interno del servidor", Utils.getExceptionRootCause(e).getLocalizedMessage());
|
|
||||||
resp.sendRedirect(req.getContextPath() + "/error.xhtml");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
System.out.println("Sessión destruida");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package managedbean.common;
|
package managedbean.common;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.ejb.EJB;
|
import javax.ejb.EJB;
|
||||||
import javax.faces.application.FacesMessage;
|
import javax.faces.application.FacesMessage;
|
||||||
import javax.faces.application.ViewExpiredException;
|
|
||||||
import javax.faces.context.ExternalContext;
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.naming.Context;
|
import javax.naming.Context;
|
||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
@@ -98,49 +95,20 @@ public class ManagedBeanBase {
|
|||||||
protected void addFacesMessageKeep(FacesMessage.Severity severity, String summary, String detail) {
|
protected void addFacesMessageKeep(FacesMessage.Severity severity, String summary, String detail) {
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
|
||||||
this.addFacesMessage(FacesContext.getCurrentInstance(), null, severity, summary, detail);
|
this.addFacesMessage(FacesContext.getCurrentInstance(), severity, summary, detail);
|
||||||
|
|
||||||
context.getExternalContext().getFlash().setKeepMessages(true);
|
context.getExternalContext().getFlash().setKeepMessages(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addFacesMessage(FacesMessage.Severity severity, String summary, String detail) {
|
protected void addFacesMessage(FacesMessage.Severity severity, String summary, String detail) {
|
||||||
this.addFacesMessage(FacesContext.getCurrentInstance(), null, severity, summary, detail);
|
this.addFacesMessage(FacesContext.getCurrentInstance(), severity, summary, detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addFacesMessage(String clientId, FacesMessage.Severity severity, String summary, String detail) {
|
protected void addFacesMessage(FacesContext context, FacesMessage.Severity severity, String summary, String detail) {
|
||||||
this.addFacesMessage(FacesContext.getCurrentInstance(), clientId, severity, summary, detail);
|
context.addMessage(null, new FacesMessage(severity, summary, detail));
|
||||||
}
|
|
||||||
|
|
||||||
protected void addFacesMessage(FacesContext context, String clientId, FacesMessage.Severity severity, String summary, String detail) {
|
|
||||||
this.addFacesMessage(context, clientId, new FacesMessage(severity, summary, detail));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void addFacesMessage(FacesMessage facesMsg, String clientId) {
|
|
||||||
this.addFacesMessage(FacesContext.getCurrentInstance(), clientId, facesMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void addFacesMessage(FacesContext context, String clientId, FacesMessage facesMsg) {
|
|
||||||
context.addMessage(clientId, facesMsg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void manageException(Exception ex) {
|
protected void manageException(Exception ex) {
|
||||||
String strType = "";
|
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Se ha producido un error inesperado", "Descripción del error: " + ex.getLocalizedMessage());
|
||||||
|
|
||||||
if (ex.getClass().equals(ViewExpiredException.class)) {
|
|
||||||
// Sessión expirada
|
|
||||||
strType = "expired";
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Su sesión ha caducado", "Su sesión ha caducado, vuelva a logarse en el sistema.");
|
|
||||||
} else {
|
|
||||||
this.addFacesMessageKeep(FacesMessage.SEVERITY_ERROR, "Se ha producido un error inesperado", "Descripción del error: " + ex.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
|
|
||||||
|
|
||||||
ctx.redirect(ctx.getApplicationContextPath() + "/error.xhtml?type=" + strType);
|
|
||||||
} catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
|
import javax.faces.context.FacesContext;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import org.primefaces.model.menu.DefaultMenuItem;
|
import org.primefaces.model.menu.DefaultMenuItem;
|
||||||
@@ -39,12 +41,12 @@ public class MenuMBean implements Serializable {
|
|||||||
|
|
||||||
// Administracion Sistema
|
// Administracion Sistema
|
||||||
if (tipoUsuario == UserType.ADMINISTRATOR) {
|
if (tipoUsuario == UserType.ADMINISTRATOR) {
|
||||||
subMenu = new DefaultSubMenu("Administración del sistema", "fa fa-wrench");
|
subMenu = new DefaultSubMenu("Administración del sistema", "fa-wrench");
|
||||||
|
|
||||||
subMenu.addElement(createMenuItem("Gestionar especialidades", "fa fa-file-text-o", "/systemAdmin/ManageSpecialties", null));
|
subMenu.addElement(createMenuItem("Gestionar especialidades", "fa fa-file-text-o", "/systemAdmin/ManageSpecialties", null));
|
||||||
subMenu.addElement(createMenuItem("Centros At. Primaria", "fa fa-hospital-o", "/systemAdmin/ManageHealthCareCenters", null));
|
subMenu.addElement(createMenuItem("Centros At. Primaria", "fa fa-hospital-o", "/systemAdmin/ManageSpecialties", null));
|
||||||
subMenu.addElement(new DefaultSeparator());
|
subMenu.addElement(new DefaultSeparator());
|
||||||
subMenu.addElement(createMenuItem("Ver médicos de un CAP", "fa fa-medkit", "/systemAdmin/ListDoctorsByCenter", null));
|
subMenu.addElement(createMenuItem("Ver médicos de un CAP", "fa fa-medkit", "/systemAdmin/ManageSpecialties", null));
|
||||||
subMenu.addElement(new DefaultSeparator());
|
subMenu.addElement(new DefaultSeparator());
|
||||||
subMenu.addElement(createMenuItem("Añadir usuario Admin", "fa fa-user-secret", "/systemAdmin/ManageSpecialties", null));
|
subMenu.addElement(createMenuItem("Añadir usuario Admin", "fa fa-user-secret", "/systemAdmin/ManageSpecialties", null));
|
||||||
|
|
||||||
@@ -56,15 +58,15 @@ public class MenuMBean implements Serializable {
|
|||||||
subMenu = new DefaultSubMenu("Visitas", "fa fa-calendar");
|
subMenu = new DefaultSubMenu("Visitas", "fa fa-calendar");
|
||||||
|
|
||||||
if (tipoUsuario == UserType.PATIENT)
|
if (tipoUsuario == UserType.PATIENT)
|
||||||
subMenu.addElement(createMenuItem("Solicitar nueva", "fa fa-calendar-o", "/visit/AddVisit", null));
|
subMenu.addElement(createMenuItem("Solicitar nueva", "fa fa-calendar-o", "/visit/VisitView", null));
|
||||||
if (tipoUsuario == UserType.PATIENT || tipoUsuario == UserType.ADMINISTRATOR)
|
if (tipoUsuario == UserType.PATIENT || tipoUsuario == UserType.ADMINISTRATOR)
|
||||||
subMenu.addElement(createMenuItem("Modificar fecha/hora", "fa fa-briefcase", "/visit/PatientVisitList", null));
|
subMenu.addElement(createMenuItem("Modificar fecha/hora", "fa fa-briefcase", "/visit/VisitView", null));
|
||||||
if (tipoUsuario == UserType.PATIENT)
|
if (tipoUsuario == UserType.PATIENT)
|
||||||
subMenu.addElement(createMenuItem("Anular visita", "fa fa-remove", "/visit/PatientVisitList", null));
|
subMenu.addElement(createMenuItem("Anular visita", "fa fa-remove", "/visit/VisitView", null));
|
||||||
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
||||||
subMenu.addElement(createMenuItem("Añadir resultado", "fa fa-align-left", "/visit/VisitList", null));
|
subMenu.addElement(createMenuItem("Añadir resultado", "fa fa-align-left", "/visit/VisitView", null));
|
||||||
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
||||||
subMenu.addElement(createMenuItem("Ver agenda del día", "fa fa-repeat", "/visit/VisitList", null));
|
subMenu.addElement(createMenuItem("Ver agenda del día", "fa fa-repeat", "/visit/VisitView", null));
|
||||||
|
|
||||||
model.addElement(subMenu);
|
model.addElement(subMenu);
|
||||||
}
|
}
|
||||||
@@ -86,14 +88,25 @@ public class MenuMBean implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tipoUsuario == UserType.PATIENT)
|
if (tipoUsuario == UserType.PATIENT)
|
||||||
subMenu.addElement(createMenuItem("Buscar especialista...", "fa fa-heartbeat", "/medicaltest/SearchSpecialist", null));
|
subMenu.addElement(createMenuItem("Buscar especialista...", "fa fa-heartbeat", "/medicaltest/MedicalTests", null));
|
||||||
|
|
||||||
model.addElement(subMenu);
|
model.addElement(subMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preguntas médicas
|
// Preguntas médicas
|
||||||
if (tipoUsuario == UserType.PATIENT || tipoUsuario == UserType.FAMILY_DOCTOR) {
|
if (tipoUsuario == UserType.PATIENT || tipoUsuario == UserType.FAMILY_DOCTOR) {
|
||||||
model.addElement(createMenuItem("Preguntas", "fa fa-comment-o", "/medicaltest/Questions", null));
|
subMenu = new DefaultSubMenu("Preguntas", "fa fa-question-circle");
|
||||||
|
|
||||||
|
if (tipoUsuario == UserType.PATIENT)
|
||||||
|
subMenu.addElement(createMenuItem("Hacer pregunta", "fa fa-comment-o", "/medicaltest/MedicalTests", null));
|
||||||
|
|
||||||
|
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
||||||
|
subMenu.addElement(createMenuItem("Responder pregunta", "fa fa-comments", "/medicaltest/MedicalTests", null));
|
||||||
|
|
||||||
|
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
||||||
|
subMenu.addElement(createMenuItem("Ver preguntas pendientes", "fa fa-comments-o", "/medicaltest/MedicalTests", null));
|
||||||
|
|
||||||
|
model.addElement(subMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,9 +114,9 @@ public class MenuMBean implements Serializable {
|
|||||||
subMenu = new DefaultSubMenu("Gestionar perfil", "fa fa-gears");
|
subMenu = new DefaultSubMenu("Gestionar perfil", "fa fa-gears");
|
||||||
if (SessionUtils.isLogedIn() == false) {
|
if (SessionUtils.isLogedIn() == false) {
|
||||||
subMenu.addElement(createMenuItem("Registro de usuario", "fa fa-user-plus", "/profile/RegisterUser", null));
|
subMenu.addElement(createMenuItem("Registro de usuario", "fa fa-user-plus", "/profile/RegisterUser", null));
|
||||||
// subMenu.addElement(createMenuItem("Registro de paciente", "fa fa-user-plus", "/profile/AddPatient", null));
|
subMenu.addElement(createMenuItem("Registro de paciente", "fa fa-user-plus", "/profile/AddPatient", null));
|
||||||
// subMenu.addElement(createMenuItem("Registro de médico", "fa fa-user-md", "/profile/AddFamilyDoctor", null));
|
subMenu.addElement(createMenuItem("Registro de médico", "fa fa-user-md", "/profile/AddFamilyDoctor", null));
|
||||||
// subMenu.addElement(createMenuItem("Registro de especialista", "fa fa-user-md", "/profile/AddSpecialistDoctor", null));
|
subMenu.addElement(createMenuItem("Registro de especialista", "fa fa-user-md", "/profile/AddSpecialistDoctor", null));
|
||||||
|
|
||||||
model.addElement(subMenu);
|
model.addElement(subMenu);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
package managedbean.common;
|
package managedbean.common;
|
||||||
|
|
||||||
import javax.faces.application.FacesMessage;
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -15,18 +14,13 @@ public class SessionUtils {
|
|||||||
public static final String SESSION_VAR_USERID = "userId";
|
public static final String SESSION_VAR_USERID = "userId";
|
||||||
public static final String SESSION_VAR_USERTYPE = "userType";
|
public static final String SESSION_VAR_USERTYPE = "userType";
|
||||||
public static final String SESSION_VAR_USER = "loggedOnUser";
|
public static final String SESSION_VAR_USER = "loggedOnUser";
|
||||||
public static final String SESSION_VAR_MESSAGE = "facesMessage";
|
|
||||||
|
|
||||||
public static HttpSession getSession(boolean create) {
|
|
||||||
FacesContext ctx = FacesContext.getCurrentInstance();
|
|
||||||
if (ctx != null)
|
|
||||||
return (HttpSession) ctx.getExternalContext().getSession(create);
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HttpSession getSession() {
|
public static HttpSession getSession() {
|
||||||
return getSession(false);
|
FacesContext ctx = FacesContext.getCurrentInstance();
|
||||||
|
if (ctx != null)
|
||||||
|
return (HttpSession) ctx.getExternalContext().getSession(false);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HttpServletRequest getRequest() {
|
public static HttpServletRequest getRequest() {
|
||||||
@@ -37,14 +31,8 @@ public class SessionUtils {
|
|||||||
return ((HttpServletRequest) request).getSession(false);
|
return ((HttpServletRequest) request).getSession(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createOrUpdateSession(LoggedUserTO usr) {
|
public static void CreateSession(LoggedUserTO usr) {
|
||||||
createOrUpdateSession(getSession(true), usr);
|
HttpSession ses = getSession();
|
||||||
}
|
|
||||||
|
|
||||||
public static void createOrUpdateSession(HttpSession ses, LoggedUserTO usr) {
|
|
||||||
if (ses == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ses.setAttribute(SessionUtils.SESSION_VAR_USERNAME, usr.getName());
|
ses.setAttribute(SessionUtils.SESSION_VAR_USERNAME, usr.getName());
|
||||||
ses.setAttribute(SessionUtils.SESSION_VAR_USERID, usr.getId());
|
ses.setAttribute(SessionUtils.SESSION_VAR_USERID, usr.getId());
|
||||||
ses.setAttribute(SessionUtils.SESSION_VAR_USERTYPE, usr.getUserType());
|
ses.setAttribute(SessionUtils.SESSION_VAR_USERTYPE, usr.getUserType());
|
||||||
@@ -83,21 +71,8 @@ public class SessionUtils {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUserDisplayName() {
|
|
||||||
HttpSession session = getSession();
|
|
||||||
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_USER) != null) {
|
|
||||||
LoggedUserTO usr = LoggedUserTO.class.cast(session.getAttribute(SessionUtils.SESSION_VAR_USER));
|
|
||||||
|
|
||||||
return usr.getDisplayName();
|
|
||||||
} else
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UserType getUserType() {
|
public static UserType getUserType() {
|
||||||
return getUserType(getSession());
|
HttpSession session = getSession();
|
||||||
}
|
|
||||||
|
|
||||||
public static UserType getUserType(HttpSession session) {
|
|
||||||
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_USERTYPE) != null)
|
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_USERTYPE) != null)
|
||||||
return UserType.class.cast(session.getAttribute(SessionUtils.SESSION_VAR_USERTYPE));
|
return UserType.class.cast(session.getAttribute(SessionUtils.SESSION_VAR_USERTYPE));
|
||||||
else
|
else
|
||||||
@@ -111,24 +86,4 @@ public class SessionUtils {
|
|||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FacesMessage getMessage() {
|
|
||||||
HttpSession session = getSession();
|
|
||||||
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_MESSAGE) != null) {
|
|
||||||
FacesMessage msg = FacesMessage.class.cast(session.getAttribute(SessionUtils.SESSION_VAR_MESSAGE));
|
|
||||||
session.removeAttribute(SessionUtils.SESSION_VAR_MESSAGE);
|
|
||||||
return msg;
|
|
||||||
} else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addMessage(FacesMessage.Severity severity, String summary, String detail) {
|
|
||||||
addMessage(getSession(), severity, summary, detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addMessage(HttpSession session, FacesMessage.Severity severity, String summary, String detail) {
|
|
||||||
if (session != null)
|
|
||||||
session.setAttribute(SessionUtils.SESSION_VAR_MESSAGE, new FacesMessage(severity, summary, detail));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package managedbean.common;
|
package managedbean.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ThemeService implements Serializable {
|
public class ThemeService {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public static final String DEFAULT_THEME = "nova-light";
|
public static final String DEFAULT_THEME = "nova-light";
|
||||||
public static final List<Theme> THEMES = new ArrayList<Theme>() {
|
public static final List<Theme> THEMES = new ArrayList<Theme>() {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
add(new Theme(i++, "afterdark", "afterdark"));
|
add(new Theme(i++, "afterdark", "afterdark"));
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
package managedbean.common;
|
package managedbean.common;
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
|
||||||
import TO.PatientTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
|
||||||
import common.UserType;
|
|
||||||
import ejb.common.CommonFacadeRemote;
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
@@ -15,9 +9,6 @@ public class ValidationUtils {
|
|||||||
static final String NIF_LETTERS = "TRWAGMYFPDXBNJZSQVHLCKE";
|
static final String NIF_LETTERS = "TRWAGMYFPDXBNJZSQVHLCKE";
|
||||||
static final String NIE_LETTERS = "XYZ";
|
static final String NIE_LETTERS = "XYZ";
|
||||||
|
|
||||||
public static String normalizeNIF(String nif) {
|
|
||||||
return nif.toUpperCase().replace("-", "").replace(".", "");
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param nif NIF a validar
|
* @param nif NIF a validar
|
||||||
@@ -27,7 +18,7 @@ public class ValidationUtils {
|
|||||||
if (nif == null)
|
if (nif == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
nif = normalizeNIF(nif);
|
nif = nif.toUpperCase().replace("-", "").replace(".", "");
|
||||||
|
|
||||||
if (nif.length() < 2 || nif.length() > 9)
|
if (nif.length() < 2 || nif.length() > 9)
|
||||||
return false;
|
return false;
|
||||||
@@ -56,54 +47,4 @@ public class ValidationUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Comprueba si un NIF existe para un tipo de usuario. * No se permite que el
|
|
||||||
* mismo NIF esté registrado como médico de familia y como especialista. * Se
|
|
||||||
* permite que el mismo NIF esté registrado como paciente y como médico (de
|
|
||||||
* familia o especialista)
|
|
||||||
*
|
|
||||||
* @param remoteSvc Servicio Remoto para recuperar datos.
|
|
||||||
* @param userType Tipo de usuario a comprobar
|
|
||||||
* @param nif NIF a comprobar.
|
|
||||||
* @param id Parámetro opcional, id del usuario actual (si encuentra el
|
|
||||||
* mismo nif y el usuario coincide no se devuelve la
|
|
||||||
* coincidencia)
|
|
||||||
* @return true si el NIF ya estaba registrado para un usuario diferente.
|
|
||||||
*/
|
|
||||||
public static boolean checkIfNifAlreadyRegistered(CommonFacadeRemote remoteSvc, UserType userType, String nif, Integer id) {
|
|
||||||
boolean nifExists = false;
|
|
||||||
|
|
||||||
if (userType == null || remoteSvc == null)
|
|
||||||
return nifExists;
|
|
||||||
|
|
||||||
switch (userType) {
|
|
||||||
case ADMINISTRATOR:
|
|
||||||
break;
|
|
||||||
case FAMILY_DOCTOR:
|
|
||||||
case SPECIALIST_DOCTOR:
|
|
||||||
FamilyDoctorTO fd = remoteSvc.findFamilyDoctorByNif(nif);
|
|
||||||
|
|
||||||
if (fd == null) {
|
|
||||||
// Si el nif no está en uso para un médico de familia, reivsamos si está en uso
|
|
||||||
// para los especialistas
|
|
||||||
SpecialistDoctorTO sd = remoteSvc.findSpecialistDoctorByNif(nif);
|
|
||||||
|
|
||||||
if (sd != null && (id == null || sd.getId().equals(id) == false))
|
|
||||||
nifExists = true;
|
|
||||||
} else if (id == null || fd.getId().equals(id) == false )
|
|
||||||
// Si se trata de un usuario diferente, entonces está repetido
|
|
||||||
nifExists = true;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case PATIENT:
|
|
||||||
PatientTO pat = remoteSvc.findPatientByNif(nif);
|
|
||||||
|
|
||||||
// Si se trata de un usuario diferente, entonces está repetido
|
|
||||||
if (pat != null && (id == null || pat.getId().equals(id) == false))
|
|
||||||
nifExists = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nifExists;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import java.io.Serializable;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.faces.application.FacesMessage;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.faces.view.ViewScoped;
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import common.UserType;
|
import common.UserType;
|
||||||
@@ -16,29 +15,22 @@ import common.UserType;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Named("home")
|
@Named("home")
|
||||||
@ViewScoped
|
@RequestScoped
|
||||||
public class homeMBean extends ManagedBeanBase implements Serializable {
|
public class homeMBean implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private boolean isLogedIn;
|
private boolean isLogedIn;
|
||||||
private String userId;
|
private String userId;
|
||||||
private String userName;
|
private String userName;
|
||||||
private String userDisplayName;
|
|
||||||
private UserType userType;
|
private UserType userType;
|
||||||
|
private int refresh;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
this.isLogedIn = SessionUtils.isLogedIn();
|
isLogedIn = SessionUtils.isLogedIn();
|
||||||
this.userName = SessionUtils.getUserName();
|
userName = SessionUtils.getUserName();
|
||||||
this.userDisplayName = SessionUtils.getUserDisplayName();
|
userId = SessionUtils.getUserId();
|
||||||
this.userId = SessionUtils.getUserId();
|
userType = SessionUtils.getUserType();
|
||||||
this.userType = SessionUtils.getUserType();
|
|
||||||
|
|
||||||
FacesMessage message = SessionUtils.getMessage();
|
|
||||||
|
|
||||||
if (message != null) {
|
|
||||||
this.addFacesMessage(message, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Theme> getThemes() {
|
public List<Theme> getThemes() {
|
||||||
@@ -56,13 +48,6 @@ public class homeMBean extends ManagedBeanBase implements Serializable {
|
|||||||
return this.userName;
|
return this.userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserDisplayName() {
|
|
||||||
if (this.isLogedIn == false)
|
|
||||||
return "Invitado";
|
|
||||||
else
|
|
||||||
return this.userDisplayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
return this.userId;
|
return this.userId;
|
||||||
}
|
}
|
||||||
@@ -71,6 +56,14 @@ public class homeMBean extends ManagedBeanBase implements Serializable {
|
|||||||
return this.userType.getUserTypename();
|
return this.userType.getUserTypename();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRefresh() {
|
||||||
|
return refresh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefresh(int refresh) {
|
||||||
|
this.refresh = refresh;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isPatient() {
|
public boolean isPatient() {
|
||||||
return (this.userType == UserType.PATIENT);
|
return (this.userType == UserType.PATIENT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,322 +1,51 @@
|
|||||||
package managedbean.medicalTest;
|
package managedbean.medicalTest;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.util.Properties;
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.ejb.EJB;
|
||||||
import javax.faces.application.FacesMessage;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.faces.event.AjaxBehaviorEvent;
|
|
||||||
import javax.faces.view.ViewScoped;
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
import org.primefaces.event.SelectEvent;
|
import ejb.medicalTest.MedicalTestFacadeRemote;
|
||||||
import org.primefaces.model.UploadedFile;
|
|
||||||
|
|
||||||
import TO.MedicalTestTO;
|
/**
|
||||||
import TO.PatientTO;
|
* ManagedBEan que gestiona la edición y actualización de una especialidad
|
||||||
import common.Constants;
|
* médica.
|
||||||
import common.MedicalTestType;
|
*
|
||||||
import common.UserType;
|
* @author mark
|
||||||
import managedbean.common.ManagedBeanBase;
|
*
|
||||||
import managedbean.common.SessionUtils;
|
*/
|
||||||
|
@Named("MedicalTestMBean")
|
||||||
@Named("mt")
|
@RequestScoped
|
||||||
@ViewScoped
|
public class MedicalTestMBean implements Serializable {
|
||||||
public class MedicalTestMBean extends ManagedBeanBase implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private int userID;
|
@EJB
|
||||||
private UserType userType;
|
private MedicalTestFacadeRemote remoteManager;
|
||||||
private List<MedicalTestTO> medicalTests;
|
|
||||||
private MedicalTestTO selected;
|
|
||||||
private PatientTO patSelected;
|
|
||||||
private PatientTO patientFilterSelected;
|
|
||||||
private boolean addNewMode = false;
|
|
||||||
private UploadedFile imageUpload;
|
|
||||||
private List<PatientTO> patientList;
|
|
||||||
private List<PatientTO> patientWithTestList;
|
|
||||||
private String lastUIQuery;
|
|
||||||
private String lastUIQueryPatFilter;
|
|
||||||
private List<MedicalTestType> medicalTestTypes;
|
|
||||||
private LocalDate testDate;
|
|
||||||
private LocalTime testTime;
|
|
||||||
private String testObservations;
|
|
||||||
private MedicalTestType testType;
|
|
||||||
|
|
||||||
public MedicalTestMBean() {
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public MedicalTestMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
/**
|
||||||
public void init() {
|
* Inicializa la conexión con el EJB Remoto
|
||||||
this.userType = SessionUtils.getUserType();
|
*
|
||||||
this.userID = Integer.valueOf(SessionUtils.getUserId());
|
* @throws Exception
|
||||||
|
*/
|
||||||
this.medicalTestTypes = new ArrayList<MedicalTestType>();
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
this.medicalTestTypes.add(MedicalTestType.BLOOD_TEST);
|
Properties props = System.getProperties();
|
||||||
this.medicalTestTypes.add(MedicalTestType.CT_SCAN);
|
Context ctx = new InitialContext(props);
|
||||||
this.medicalTestTypes.add(MedicalTestType.MAGNETIC_RESONANCE_IMAGING);
|
remoteManager = (MedicalTestFacadeRemote) ctx
|
||||||
|
.lookup("java:app/myHealth.jar/MedicalTestFacadeBean!ejb.component.MedicalTestFacadeRemote");
|
||||||
this.selected = null;
|
|
||||||
this.patSelected = null;
|
|
||||||
this.lastUIQuery = "";
|
|
||||||
this.lastUIQueryPatFilter = "";
|
|
||||||
|
|
||||||
switch (userType) {
|
|
||||||
case ADMINISTRATOR:
|
|
||||||
case PATIENT:
|
|
||||||
this.patientList = null;
|
|
||||||
this.patientWithTestList = null;
|
|
||||||
break;
|
|
||||||
case SPECIALIST_DOCTOR:
|
|
||||||
this.patientList = this.getRemoteManagerCommon().listPatientsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
this.patientWithTestList = this.getRemoteManagerMedicalTest().loadPatientsForSpecialistDoctor(userID, null, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
break;
|
|
||||||
case FAMILY_DOCTOR:
|
|
||||||
this.patientList = null;
|
|
||||||
this.patientWithTestList = this.getRemoteManagerMedicalTest().loadPatientsForFamilyDoctor(userID, null, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loadMedicalTests();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addImage() {
|
|
||||||
if (this.imageUpload != null) {
|
|
||||||
String content = "data:" + imageUpload.getContentType() + ";base64," + Base64.getEncoder().encodeToString(imageUpload.getContents());
|
|
||||||
System.out.println("FILE Content base64: ");
|
|
||||||
System.out.println(content);
|
|
||||||
this.selected.setHighresimage(content);
|
|
||||||
getRemoteManagerMedicalTest().addImage(this.selected.getId(), content);
|
|
||||||
this.loadMedicalTests();
|
|
||||||
this.imageUpload = null;
|
|
||||||
} else {
|
|
||||||
System.out.println("IMAGEN SUBIDA ES NULA");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public UploadedFile getImageUpload() {
|
|
||||||
return imageUpload;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImageUpload(UploadedFile imageUpload) {
|
|
||||||
this.imageUpload = imageUpload;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeImage() {
|
|
||||||
this.selected.setHighresimage(null);
|
|
||||||
getRemoteManagerMedicalTest().removeImage(this.selected.getId());
|
|
||||||
this.loadMedicalTests();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalTestTO getSelected() {
|
|
||||||
return this.selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelected(MedicalTestTO selected) {
|
|
||||||
this.selected = selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientTO getPatSelected() {
|
|
||||||
return this.patSelected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatSelected(PatientTO s) {
|
|
||||||
this.patSelected = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadMedicalTests() {
|
|
||||||
Integer patId = -1;
|
|
||||||
if (this.patientFilterSelected != null)
|
|
||||||
patId = this.patientFilterSelected.getId();
|
|
||||||
|
|
||||||
switch (userType) {
|
|
||||||
case PATIENT:
|
|
||||||
// Cargar las pruebas para el paciente en sesión
|
|
||||||
this.medicalTests = getRemoteManagerMedicalTest().loadMedicalTestForPatient(userID);
|
|
||||||
break;
|
|
||||||
case SPECIALIST_DOCTOR:
|
|
||||||
// Cargar las pruebas que el doctor especialista ha creado
|
|
||||||
this.medicalTests = getRemoteManagerMedicalTest().loadMedicalTestForSpecialistDoctor(userID, patId);
|
|
||||||
break;
|
|
||||||
case FAMILY_DOCTOR:
|
|
||||||
// Cargar las pruebas para los pacientes del doctor de familia en sesión
|
|
||||||
this.medicalTests = getRemoteManagerMedicalTest().loadMedicalTestForFamilyDoctor(userID, patId);
|
|
||||||
break;
|
|
||||||
case ADMINISTRATOR:
|
|
||||||
this.medicalTests = null;
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Operación no válida para el tipo de usuario actual.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PatientTO> completePatient(String query) {
|
|
||||||
if (query != null && query.equals(this.lastUIQuery) == false) {
|
|
||||||
this.lastUIQuery = query;
|
|
||||||
// Recuperamos las xxx primeras coincidencias
|
|
||||||
this.patientList = this.getRemoteManagerCommon().listPatientsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
}
|
|
||||||
return this.patientList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PatientTO> completePatientFilter(String query) {
|
|
||||||
if (query != null && query.equals(this.lastUIQueryPatFilter) == false) {
|
|
||||||
this.lastUIQueryPatFilter = query;
|
|
||||||
|
|
||||||
switch (userType) {
|
|
||||||
case SPECIALIST_DOCTOR:
|
|
||||||
// Cargar los pacientes a los que ha añadido pruebas médicas el médico especialista
|
|
||||||
this.patientWithTestList = this.getRemoteManagerMedicalTest().loadPatientsForSpecialistDoctor(userID, query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
break;
|
|
||||||
case FAMILY_DOCTOR:
|
|
||||||
// Cargar los pacientes del médico de familia que tiene pruebas médicas hechas
|
|
||||||
this.patientWithTestList = this.getRemoteManagerMedicalTest().loadPatientsForFamilyDoctor(userID, query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
break;
|
|
||||||
case ADMINISTRATOR:
|
|
||||||
case PATIENT:
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Operación no válida para el tipo de usuario actual.");
|
|
||||||
this.patientWithTestList = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this.patientWithTestList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PatientTO> getPatientList() {
|
|
||||||
return patientList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PatientTO> getPatientWithTestList() {
|
|
||||||
return patientWithTestList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MedicalTestTO> getMedicalTests() {
|
|
||||||
return this.medicalTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMedicalTests(List<MedicalTestTO> list) {
|
|
||||||
// Nothing to do
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSpecialistDoctor() {
|
|
||||||
return this.userType == UserType.SPECIALIST_DOCTOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPatSelector() {
|
|
||||||
return !(userType == UserType.PATIENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearFilteredPatient() {
|
|
||||||
this.addNewMode = false;
|
|
||||||
this.selected = null;
|
|
||||||
this.patientFilterSelected = null;
|
|
||||||
this.loadMedicalTests();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onChangePatient(AjaxBehaviorEvent event) {
|
|
||||||
this.selected = null;
|
|
||||||
this.loadMedicalTests();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSelectPatient(SelectEvent event) {
|
|
||||||
this.selected = null;
|
|
||||||
this.patientFilterSelected = (PatientTO) event.getObject();
|
|
||||||
this.loadMedicalTests();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSelectMT(SelectEvent event) {
|
|
||||||
this.selected = (MedicalTestTO) event.getObject();
|
|
||||||
this.addNewMode = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addMT() {
|
|
||||||
// Si hay un paciente filtrado en la busqueda de pruebas, lo seleccionamos para la prueba a añadir.
|
|
||||||
//this.patSelected = this.patientFilterSelected;
|
|
||||||
this.testDate = LocalDate.now();
|
|
||||||
this.testTime = LocalTime.now();
|
|
||||||
this.testObservations = "";
|
|
||||||
this.testType = MedicalTestType.BLOOD_TEST;
|
|
||||||
this.addNewMode = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAddNewMode() {
|
|
||||||
return addNewMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddNewMode(boolean addNewMode) {
|
|
||||||
this.addNewMode = addNewMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getViewCreate() {
|
|
||||||
return addNewMode && userType == UserType.SPECIALIST_DOCTOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getViewEdit() {
|
|
||||||
return !addNewMode && this.selected != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MedicalTestType> getMedicalTestTypes() {
|
|
||||||
return this.medicalTestTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save() {
|
|
||||||
try {
|
|
||||||
|
|
||||||
MedicalTestTO mt = this.getRemoteManagerMedicalTest().addMedicalTest(this.patSelected.getId(), this.userID, this.testDate, this.testTime, this.testType,
|
|
||||||
this.testObservations);
|
|
||||||
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Éxito", String.format("La prueba médica se ha guardado correctamente, el identificador asignado es: %d", mt.getId()));
|
|
||||||
|
|
||||||
// Volvemos al modo añadir (limpiamos el formulario).
|
|
||||||
this.addMT();
|
|
||||||
|
|
||||||
this.loadMedicalTests();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
this.manageException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public PatientTO getPatientFilterSelected() {
|
|
||||||
return patientFilterSelected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatientFilterSelected(PatientTO patientFilterSelected) {
|
|
||||||
this.patientFilterSelected = patientFilterSelected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getTestDate() {
|
|
||||||
return testDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestDate(LocalDate testDate) {
|
|
||||||
this.testDate = testDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalTime getTestTime() {
|
|
||||||
return testTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestTime(LocalTime testTime) {
|
|
||||||
this.testTime = testTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTestObservations() {
|
|
||||||
return testObservations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestObservations(String testObservations) {
|
|
||||||
this.testObservations = testObservations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalTestType getTestType() {
|
|
||||||
return testType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestType(MedicalTestType testType) {
|
|
||||||
this.testType = testType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,137 +0,0 @@
|
|||||||
package managedbean.medicalTest;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.faces.application.FacesMessage;
|
|
||||||
import javax.faces.view.ViewScoped;
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import org.primefaces.event.SelectEvent;
|
|
||||||
|
|
||||||
import TO.QuestionTO;
|
|
||||||
import common.QuestionStatus;
|
|
||||||
import common.UserType;
|
|
||||||
import managedbean.common.ManagedBeanBase;
|
|
||||||
import managedbean.common.SessionUtils;
|
|
||||||
|
|
||||||
@Named("Questions")
|
|
||||||
@ViewScoped
|
|
||||||
public class QuestionsMBean extends ManagedBeanBase implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private int userID;
|
|
||||||
private UserType userType;
|
|
||||||
private List<QuestionTO> pendingQuestions;
|
|
||||||
private QuestionTO selected;
|
|
||||||
private boolean addNewMode;
|
|
||||||
|
|
||||||
public QuestionsMBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
// Inicialización de variables y propiedades van aquí.
|
|
||||||
this.userType = SessionUtils.getUserType();
|
|
||||||
this.userID = Integer.valueOf(SessionUtils.getUserId());
|
|
||||||
|
|
||||||
this.addNewMode = false;
|
|
||||||
this.selected = null;
|
|
||||||
|
|
||||||
this.loadQuestions();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<QuestionTO> getPendingQuestions() {
|
|
||||||
return pendingQuestions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPendingQuestions(List<QuestionTO> value) {
|
|
||||||
this.pendingQuestions = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cargará las preguntas enviadas al médico o escritas por el paciente, esto irá en función del tipo de usuario en sesión
|
|
||||||
*/
|
|
||||||
private void loadQuestions() {
|
|
||||||
if (this.userType == UserType.FAMILY_DOCTOR) {
|
|
||||||
// Listar las preguntas destinadas a él
|
|
||||||
// El método disponible del API básico es referente al doctor
|
|
||||||
this.pendingQuestions = getRemoteManagerMedicalTest().listAllPendingQuestions(userID);
|
|
||||||
} else if (this.userType == UserType.PATIENT) {
|
|
||||||
// Listar las preguntas realiadas por él
|
|
||||||
// Para reutilizar la misma view, necesitaremos nuevos métodos para el API de
|
|
||||||
// cara a recoger sus preguntas realizadas.
|
|
||||||
this.pendingQuestions = getRemoteManagerMedicalTest().listAllMyQuestions(userID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
|
||||||
this.addNewMode = false;
|
|
||||||
this.selected = (QuestionTO) event.getObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onUnSelect(SelectEvent event) {
|
|
||||||
this.selected = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelected(QuestionTO selected) {
|
|
||||||
this.selected = selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuestionTO getSelected() {
|
|
||||||
return this.selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save() {
|
|
||||||
getRemoteManagerMedicalTest().answerQuestion(this.selected.getId(), this.selected.getResponse());
|
|
||||||
this.loadQuestions();
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Datos guardados", "La respuesta se registrado correctamente en el sistema.");
|
|
||||||
this.selected = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void create() {
|
|
||||||
this.addNewMode = true;
|
|
||||||
this.selected = new QuestionTO();
|
|
||||||
this.selected.setId(-1);
|
|
||||||
this.selected.setTitle("");
|
|
||||||
this.selected.setMessage("");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addNewQuestion() {
|
|
||||||
String result = getRemoteManagerMedicalTest().askQuestion(userID, this.selected.getTitle(), this.selected.getMessage());
|
|
||||||
if(result == "ok") {
|
|
||||||
this.create();
|
|
||||||
this.loadQuestions();
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Datos guardados", "La pregunta se registrado correctamente en el sistema.");
|
|
||||||
} else {
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Error", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowPanelDetail() {
|
|
||||||
return this.selected != null && this.addNewMode == false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPatient() {
|
|
||||||
return (this.userType == UserType.PATIENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFamilyDoctor() {
|
|
||||||
return (this.userType == UserType.FAMILY_DOCTOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAddNewMode() {
|
|
||||||
return addNewMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRespuestaEditable() {
|
|
||||||
return (this.userType == UserType.FAMILY_DOCTOR && this.selected != null && this.selected.getStatus() == QuestionStatus.PENDING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddNewMode(boolean addNewMode) {
|
|
||||||
this.addNewMode = addNewMode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
package managedbean.medicalTest;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.faces.view.ViewScoped;
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import org.primefaces.model.LazyDataModel;
|
|
||||||
import org.primefaces.model.SortOrder;
|
|
||||||
|
|
||||||
import TO.MedicalSpecialtyTO;
|
|
||||||
import TO.SpecialistDoctorTO;
|
|
||||||
import common.Constants;
|
|
||||||
import managedbean.common.ManagedBeanBase;
|
|
||||||
|
|
||||||
@Named("sspec")
|
|
||||||
@ViewScoped
|
|
||||||
public class SearchSpecialistMBean extends ManagedBeanBase implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
|
|
||||||
private MedicalSpecialtyTO medicalSpeciality;
|
|
||||||
private String lastUIQueryMS;
|
|
||||||
private LazyDataModel<SpecialistDoctorTO> lazyDataModelDoctorList;
|
|
||||||
|
|
||||||
public SearchSpecialistMBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
// Inicialización de variables y propiedades van aquí.
|
|
||||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
this.medicalSpeciality = null;
|
|
||||||
this.lastUIQueryMS = "";
|
|
||||||
|
|
||||||
this.lazyDataModelDoctorList = new LazyDataModel<SpecialistDoctorTO>() {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<SpecialistDoctorTO> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
|
|
||||||
if (medicalSpeciality == null) {
|
|
||||||
this.setRowCount(0);
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialityCount(medicalSpeciality.getId());
|
|
||||||
this.setRowCount(totalRowCount.intValue());
|
|
||||||
|
|
||||||
return getRemoteManagerMedicalTest().findSpecialistDoctorByMedicalSpeciality(medicalSpeciality.getId(), (first / pageSize), pageSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public LazyDataModel<SpecialistDoctorTO> getLazyDataModelDoctorList() {
|
|
||||||
return lazyDataModelDoctorList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showData() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MedicalSpecialtyTO> completeMedicalSpeciality(String query) {
|
|
||||||
if (query != null && query.equals(this.lastUIQueryMS) == false) {
|
|
||||||
this.lastUIQueryMS = query;
|
|
||||||
// Recuperamos las 200 primeras coincidencias
|
|
||||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
}
|
|
||||||
return this.medicalSpecialitiesList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MedicalSpecialtyTO> getMedicalSpecialitiesList() {
|
|
||||||
return medicalSpecialitiesList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMedicalSpecialitiesList(List<MedicalSpecialtyTO> medicalSpecialitiesList) {
|
|
||||||
this.medicalSpecialitiesList = medicalSpecialitiesList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MedicalSpecialtyTO getMedicalSpeciality() {
|
|
||||||
return medicalSpeciality;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMedicalSpeciality(MedicalSpecialtyTO medicalSpecialty) {
|
|
||||||
this.medicalSpeciality = medicalSpecialty;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named("AddFamilyDoctorMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class AddFamilyDoctorMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public AddFamilyDoctorMBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
112
1.sources/MyHealth/src/managedbean/profile/AddPatientMBean.java
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
|
import javax.faces.context.FacesContext;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ManagedBEan que gestiona la edición y actualización de una especialidad
|
||||||
|
* médica.
|
||||||
|
*
|
||||||
|
* @author mark
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named("addPatientMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class AddPatientMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String nif;
|
||||||
|
private String name;
|
||||||
|
private String surname;
|
||||||
|
private String password;
|
||||||
|
private String passwordRepeat;
|
||||||
|
private String email;
|
||||||
|
private String primaryHealthCareCenter;
|
||||||
|
private String medicalSpecialty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public AddPatientMBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSurname() {
|
||||||
|
return surname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSurname(String surname) {
|
||||||
|
this.surname = surname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNif() {
|
||||||
|
return nif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNif(String nif) {
|
||||||
|
this.nif = nif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save() {
|
||||||
|
FacesMessage msg;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Alta realizada", "El usuario " + name + " " + surname + " se ha registrado correctamente.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Se ha producido un error inesperado: " + e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
FacesContext.getCurrentInstance().addMessage(null, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordRepeat() {
|
||||||
|
return passwordRepeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPasswordRepeat(String passwordRepeat) {
|
||||||
|
this.passwordRepeat = passwordRepeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named( "AddSpecialistDoctorMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class AddSpecialistDoctorMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public AddSpecialistDoctorMBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,7 +17,6 @@ import managedbean.common.ManagedBeanBase;
|
|||||||
import managedbean.common.SessionUtils;
|
import managedbean.common.SessionUtils;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* ManageBean que gestiona la vista para el cambio de médico de familia para un paciente
|
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
@@ -37,14 +36,6 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Inicializa el managed Bean
|
|
||||||
*
|
|
||||||
* Si el usuario logeado es nulo devuelve un error indicando que la sesión actual no es válida.
|
|
||||||
*
|
|
||||||
* Recupera el id del usuario actual desde la sesión. Dado que solo los pacientes pueden seleccionar un médico de familia, si el usuario es de otro tipo se muestra un mensaje
|
|
||||||
* de error.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
// Recuperamos el usuario logeado actual
|
// Recuperamos el usuario logeado actual
|
||||||
@@ -63,9 +54,8 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
|||||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
|
|
||||||
PatientTO pat = this.getRemoteManagerCommon().findPatientById(this.id);
|
PatientTO pat = this.getRemoteManagerCommon().findPatientById(this.id);
|
||||||
this.currentFamilyDoctor = pat.getFamilyDoctor();
|
this.setCurrentFamilyDoctor(pat.getFamilyDoctor());
|
||||||
} else
|
}
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Perfil no válido", "Su tipo de usuario no permite que pueda tener acceso a esta página.");
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.manageException(e);
|
this.manageException(e);
|
||||||
@@ -73,58 +63,33 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Devuelve la lista de médicos de familia para el combo de selección.
|
|
||||||
*
|
|
||||||
* @return Lista de médicos de familia.
|
|
||||||
*/
|
|
||||||
public List<FamilyDoctorTO> getFamilyDoctorList() {
|
public List<FamilyDoctorTO> getFamilyDoctorList() {
|
||||||
return familyDoctorList;
|
return familyDoctorList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que permite relizar búsqueda de tipo "typeAhead" en la lista de selección de médico.
|
|
||||||
*
|
|
||||||
* Recibe como parámetro el testo tecleado por el usuario
|
|
||||||
*
|
|
||||||
* @param query Texto tecleado por el usuario
|
|
||||||
* @return Retorna la lista de médicos de familia coincidentes con el termino buscado.
|
|
||||||
*/
|
|
||||||
public List<FamilyDoctorTO> completeFamilyDoctor(String query) {
|
public List<FamilyDoctorTO> completeFamilyDoctor(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQuery) == false) {
|
if (query != null && query.equals(this.lastUIQuery) == false) {
|
||||||
this.lastUIQuery = query;
|
this.lastUIQuery = query;
|
||||||
// Recuperamos las primeras ~30 coincidencias, según constante
|
// Recuperamos las 200 primeras coincidencias
|
||||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
}
|
}
|
||||||
return this.familyDoctorList;
|
return this.familyDoctorList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Id del usuario actual, obtenido de la sessión del usuario logeado.
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que realiza la persistencia del cambio de médico de familia. a través de la invocación al método EJB correspondiente.
|
|
||||||
*
|
|
||||||
* Se realizan 2 comprobaciones adicionales:
|
|
||||||
*
|
|
||||||
* 1. Se ha seleccionado un nuevo médico de familia
|
|
||||||
*
|
|
||||||
* 2. El médico de familia nuevo es diferente al actual
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
if (this.getNewFamilyDoctor() == null) {
|
if (this.getNewFamilyDoctor() == null) {
|
||||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado",
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado", "Por favor, especifique un nuevvo médico de familia.");
|
||||||
"Por favor, especifique un nuevvo médico de familia.");
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getCurrentFamilyDoctor() != null && this.getNewFamilyDoctor().getId() == this.getCurrentFamilyDoctor().getId()) {
|
if (this.getCurrentFamilyDoctor() != null && this.getNewFamilyDoctor().getId() == this.getCurrentFamilyDoctor().getId()) {
|
||||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
this.addFacesMessage(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.");
|
"Por favor, seleccione un médico de familia diferente al que tiene actualmente asignado.");
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package managedbean.profile;
|
package managedbean.profile;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
@@ -17,7 +18,6 @@ import managedbean.common.ManagedBeanBase;
|
|||||||
import managedbean.common.SessionUtils;
|
import managedbean.common.SessionUtils;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* ManagedBean que gestiona la vista para el cambio del centro de atención primaria para los médicos de familia
|
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
@@ -37,12 +37,6 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Inicializa el managed Bean.
|
|
||||||
*
|
|
||||||
* Si el usuario atual no se puede recupear de la sesión o si no es un perfil de tipo médicos de familia se muestra un mensaje de error.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
// Recuperamos el usuario logeado actual
|
// Recuperamos el usuario logeado actual
|
||||||
@@ -59,13 +53,11 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
|||||||
this.id = Integer.valueOf(usr.getId());
|
this.id = Integer.valueOf(usr.getId());
|
||||||
|
|
||||||
if (usr.getUserType() == UserType.FAMILY_DOCTOR) {
|
if (usr.getUserType() == UserType.FAMILY_DOCTOR) {
|
||||||
// Recupera la lista de CAPs inicial desde el EJB.
|
|
||||||
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
|
|
||||||
FamilyDoctorTO fd = this.getRemoteManagerCommon().findFamilyDoctorById(this.id);
|
FamilyDoctorTO fd = this.getRemoteManagerCommon().findFamilyDoctorById(this.id);
|
||||||
this.setCurrentCenter(fd.getPrimaryHealthCareCenter());
|
this.setCurrentCenter(fd.getPrimaryHealthCareCenter());
|
||||||
} else
|
}
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Perfil no válido", "Su tipo de usuario no permite que pueda tener acceso a esta página.");
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.manageException(e);
|
this.manageException(e);
|
||||||
@@ -77,12 +69,6 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
|||||||
return primaryHealthCareCentersList;
|
return primaryHealthCareCentersList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que implementa la búsqueda de un CAP a través del termino tecleado por el usuario en la lista de selección
|
|
||||||
*
|
|
||||||
* @param query Termino tecleado por el usuario
|
|
||||||
* @return Lista de CAPs que coinciden con el termino búscado por el usuario.
|
|
||||||
*/
|
|
||||||
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQuery) == false) {
|
if (query != null && query.equals(this.lastUIQuery) == false) {
|
||||||
this.lastUIQuery = query;
|
this.lastUIQuery = query;
|
||||||
@@ -96,24 +82,16 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que realiza el guardado de los cambios a través de la invocación del método del EJB correspondiente.
|
|
||||||
*
|
|
||||||
* El método realiza dos verificaciones previas: Que se haya seleccionado un CAP y que este sea diferente del asignado actualmente.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
if (this.getNewCenter() == null) {
|
if (this.getNewCenter() == null) {
|
||||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado",
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un nuevvo centro de atención primaria.");
|
||||||
"Por favor, especifique un nuevvo centro de atención primaria.");
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getNewCenter().getName().equals(this.getCurrentCenter().getName())) {
|
if (this.getNewCenter().getName().equals(this.getCurrentCenter().getName())) {
|
||||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente",
|
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.");
|
||||||
"Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import managedbean.common.ManagedBeanBase;
|
|||||||
import managedbean.common.ValidationUtils;
|
import managedbean.common.ValidationUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ManagedBEan que gestiona el registro de usuarios: Usuarios de tipo "Paciente" Usuarios de tipo "Médico de Familia" usuarios de tipo "Médico especialista"
|
* ManagedBEan que gestiona el registro de usuarios: Usuarios de tipo "Paciente"
|
||||||
|
* Usuarios de tipo "Médico de Familia" usuarios de tipo "Médico especialista"
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
@@ -58,11 +59,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Inicializa el managedBean actual.
|
|
||||||
*
|
|
||||||
* Carga los tipos de usuario disponibles. Carga la lista de CAPs. Carga la lista de especialidades médicas.
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
this.availableUserTypes = new ArrayList<UserType>();
|
this.availableUserTypes = new ArrayList<UserType>();
|
||||||
@@ -83,17 +79,10 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
return availableUserTypes;
|
return availableUserTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gestiona el evento de cambio de tipo de usuario. El usuario que está intentando registrarse en el sistema ha cambiado el tipo de perfil (usuario) con el cual desea
|
|
||||||
* registrarse.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void onUserTypeChange() {
|
public void onUserTypeChange() {
|
||||||
switch (this.userType) {
|
switch (this.userType) {
|
||||||
case SPECIALIST_DOCTOR:
|
case SPECIALIST_DOCTOR:
|
||||||
try {
|
try {
|
||||||
// El usuario queire registrarse como médico especialista, lanzamos un evento AJAX de cliente para que la interfaz refleje el cambio en el tipo de usuario
|
|
||||||
// seleccionado: Se muestra la lista de especialidades médicas para obligar a seleccionar una.
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("specs", true);
|
PrimeFaces.current().ajax().addCallbackParam("specs", true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.manageException(e);
|
this.manageException(e);
|
||||||
@@ -101,8 +90,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
break;
|
break;
|
||||||
case FAMILY_DOCTOR:
|
case FAMILY_DOCTOR:
|
||||||
try {
|
try {
|
||||||
// El usuario queire registrarse como médico especialista, lanzamos un evento AJAX de cliente para que la interfaz refleje el cambio en el tipo de usuario
|
|
||||||
// seleccionado: Se muestra la lista de CAPs para obligar a seleccionar uno.
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("caps", true);
|
PrimeFaces.current().ajax().addCallbackParam("caps", true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.manageException(e);
|
this.manageException(e);
|
||||||
@@ -110,8 +97,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
break;
|
break;
|
||||||
case ADMINISTRATOR:
|
case ADMINISTRATOR:
|
||||||
case PATIENT:
|
case PATIENT:
|
||||||
// El usuario queire registrarse como médico especialista, lanzamos un evento AJAX de cliente para que la interfaz refleje el cambio en el tipo de usuario
|
|
||||||
// seleccionado: Se ocultará la lista de selección de CAP o Especialidad médica
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("pats", true);
|
PrimeFaces.current().ajax().addCallbackParam("pats", true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -125,12 +110,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
return primaryHealthCareCentersList;
|
return primaryHealthCareCentersList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que implementa la búsqueda de un CAP a través del termino tecleado por el usuario en la lista de selección
|
|
||||||
*
|
|
||||||
* @param query Termino tecleado por el usuario
|
|
||||||
* @return Lista de CAPs que coinciden con el termino búscado por el usuario.
|
|
||||||
*/
|
|
||||||
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQueryPH) == false) {
|
if (query != null && query.equals(this.lastUIQueryPH) == false) {
|
||||||
this.lastUIQueryPH = query;
|
this.lastUIQueryPH = query;
|
||||||
@@ -140,12 +119,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
return this.primaryHealthCareCentersList;
|
return this.primaryHealthCareCentersList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que implementa la búsqueda de una especialidad a través del termino tecleado por el usuario en la lista de selección
|
|
||||||
*
|
|
||||||
* @param query Termino tecleado por el usuario
|
|
||||||
* @return Lista de especialidades que coinciden con el termino búscado por el usuario.
|
|
||||||
*/
|
|
||||||
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
|
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQueryMS) == false) {
|
if (query != null && query.equals(this.lastUIQueryMS) == false) {
|
||||||
this.lastUIQueryMS = query;
|
this.lastUIQueryMS = query;
|
||||||
@@ -155,25 +128,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
return this.medicalSpecialitiesList;
|
return this.medicalSpecialitiesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gestióna el evento de modficación del NIF del usuario actual. Búsca si el NIF ya está en uso para otro usuario. Solo se permite que el mismo NIF se refistro como paciente y
|
|
||||||
* como médico (especialista o de familia, pero no como ambos).
|
|
||||||
*
|
|
||||||
* Un Médico puede estar registrado como paciente con el mismo NIF, pero como médico de familia y especialista al mismo tiempo.
|
|
||||||
*/
|
|
||||||
public void handleNIFValueChange() {
|
|
||||||
boolean isDupe = false;
|
|
||||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
|
||||||
|
|
||||||
if (ValidationUtils.checkIfNifAlreadyRegistered(this.getRemoteManagerCommon(), this.userType, this.nif, null) == true) {
|
|
||||||
isDupe = true;
|
|
||||||
this.addFacesMessage("frmRegisterUser:nif", FacesMessage.SEVERITY_WARN, "NIF duplicado", "El nif indicado pertenece a otro usuario previamente registrado");
|
|
||||||
}
|
|
||||||
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("NIFisDupe", isDupe);
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("formattedNIF", this.nif);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPatient() {
|
public boolean isPatient() {
|
||||||
return (this.userType == UserType.PATIENT);
|
return (this.userType == UserType.PATIENT);
|
||||||
}
|
}
|
||||||
@@ -230,43 +184,21 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
|||||||
this.nif = nif;
|
this.nif = nif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que realiza la persistencia de los datos en la base de datos a través de la invocación de los métodos del EJB correspondiente.
|
|
||||||
*
|
|
||||||
* Se realizan comprobaciones adicionales para asegurar que:
|
|
||||||
*
|
|
||||||
* Si el tipo de usuario que se está registrando es un méidco de familia, obliga a seleccionar un CAP para el usuario.
|
|
||||||
*
|
|
||||||
* Si el tipo de usuario que está registrando es un médico especialista, obliga a seleccionar una especialidad médica al usuario.
|
|
||||||
*
|
|
||||||
* Si el tipo de usuario que está registrando es un paciente, no obliga a seleccionar un médicos de familia (puede ser nulo) será necesario que el usuario lo seleccione a
|
|
||||||
* posteriori, una vez logeado en el sistema, a través de la opción de menú correspondiente.
|
|
||||||
*
|
|
||||||
* No se permite el registro de administradores a través de la página de registro pública.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void addNewUser() {
|
public void addNewUser() {
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
|
||||||
|
|
||||||
if (this.isFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
if (this.isFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
||||||
this.addFacesMessage("frmRegisterUser:selPHC", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado",
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un centro de atención primaria.");
|
||||||
"Por favor, especifique un centro de atención primaria.");
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
if (this.isSpecialistDoctor() && this.medicalSpecialty == null) {
|
if (this.isSpecialistDoctor() && this.medicalSpecialty == null) {
|
||||||
this.addFacesMessage("frmRegisterUser:selMS", FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
if (ValidationUtils.isValid(nif) == false) {
|
if (ValidationUtils.isValid(nif) == false) {
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El NIF indicado no es válido", "Por favor, especifique un NIF válido.");
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El NIF indicado no es válido", "Por favor, especifique un NIF válido.");
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
if (ValidationUtils.checkIfNifAlreadyRegistered(this.getRemoteManagerCommon(), this.userType, this.nif, null) == true) {
|
|
||||||
this.addFacesMessage("frmRegisterUser:nif", FacesMessage.SEVERITY_WARN, "NIF duplicado", "El nif indicado pertenece a otro usuario previamente registrado");
|
|
||||||
error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named( "ShowFamilyDoctorMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class ShowFamilyDoctorMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public ShowFamilyDoctorMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx
|
||||||
|
.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named("ShowPatientMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class ShowPatientMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public ShowPatientMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named( "ShowSpecialistDoctorMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class ShowSpecialistDoctorMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public ShowSpecialistDoctorMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx
|
||||||
|
.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named("UpdateFamilyDoctorMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class UpdateFamilyDoctorMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public UpdateFamilyDoctorMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named("UpdatePatientMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class UpdatePatientMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public UpdatePatientMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -26,7 +26,8 @@ import managedbean.common.SessionUtils;
|
|||||||
import managedbean.common.ValidationUtils;
|
import managedbean.common.ValidationUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ManagedBEan que gestiona el registro de usuarios: Usuarios de tipo "Paciente" Usuarios de tipo "Médico de Familia" usuarios de tipo "Médico especialista"
|
* ManagedBEan que gestiona el registro de usuarios: Usuarios de tipo "Paciente"
|
||||||
|
* Usuarios de tipo "Médico de Familia" usuarios de tipo "Médico especialista"
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
*
|
*
|
||||||
@@ -63,12 +64,6 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Inicializa el Bean:
|
|
||||||
*
|
|
||||||
* Carga la lsita de tipos de usuario (perfiles) Recupera los datos del usuario logeado actualmente, y los asigna a las propiedades del managedBean.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
this.userTypes = new ArrayList<UserType>();
|
this.userTypes = new ArrayList<UserType>();
|
||||||
@@ -106,7 +101,6 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
case ADMINISTRATOR:
|
case ADMINISTRATOR:
|
||||||
// TODO: Recuperar usuario administrador para editar su perfil ¿?
|
// TODO: Recuperar usuario administrador para editar su perfil ¿?
|
||||||
// this.getRemoteManagerProfile().retrievePatient(usr.getId());
|
// this.getRemoteManagerProfile().retrievePatient(usr.getId());
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Usuario sin perfil", "Usted es un usuario de tipo administrador y no puede editar su perfil de usuario.");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,48 +109,33 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Establece los valores de las propiedades del managedBean a partir de los datos de un Transfer Object de un paciente
|
|
||||||
*
|
|
||||||
* @param pat Paciente que está editando su perfil, y cuyos datos deben mostrarse en la vista.
|
|
||||||
*/
|
|
||||||
private void setPatientData(PatientTO pat) {
|
private void setPatientData(PatientTO pat) {
|
||||||
this.id = pat.getId();
|
this.id = pat.getId();
|
||||||
this.cipCode = pat.getPersonalIdentificationCode();
|
this.cipCode = pat.getPersonalIdentificationCode();
|
||||||
this.name = pat.getName();
|
this.name = pat.getName();
|
||||||
this.surname = pat.getSurname();
|
this.surname = pat.getName();
|
||||||
this.nif = pat.getNif();
|
this.nif = pat.getNif();
|
||||||
this.email = pat.getEmail();
|
this.email = pat.getEmail();
|
||||||
this.currentPassword = pat.getPassword();
|
this.currentPassword = pat.getPassword();
|
||||||
this.familyDoctor = pat.getFamilyDoctor();
|
this.familyDoctor = pat.getFamilyDoctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Establece los valores de las propiedades del managedBean a partir de los datos de un Transfer Object de un médico de familia
|
|
||||||
*
|
|
||||||
* @param fd FamilyDoctor que está editando su perfil, y cuyos datos deben mostrarse en la vista.
|
|
||||||
*/
|
|
||||||
private void setFamilyDoctorData(FamilyDoctorTO fd) {
|
private void setFamilyDoctorData(FamilyDoctorTO fd) {
|
||||||
this.id = fd.getId();
|
this.id = fd.getId();
|
||||||
this.cipCode = fd.getProfessionalNumber();
|
this.cipCode = fd.getProfessionalNumber();
|
||||||
this.name = fd.getName();
|
this.name = fd.getName();
|
||||||
this.surname = fd.getSurname();
|
this.surname = fd.getName();
|
||||||
this.nif = fd.getNif();
|
this.nif = fd.getNif();
|
||||||
this.email = fd.getEmail();
|
this.email = fd.getEmail();
|
||||||
this.currentPassword = fd.getPassword();
|
this.currentPassword = fd.getPassword();
|
||||||
this.primaryHealthCareCenter = fd.getPrimaryHealthCareCenter();
|
this.primaryHealthCareCenter = fd.getPrimaryHealthCareCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Establece los valores de las propiedades del managedBean a partir de los datos de un Transfer Object de un médico especialista
|
|
||||||
*
|
|
||||||
* @param sd SpecialistDoctor que está editando su perfil, y cuyos datos deben mostrarse en la vista.
|
|
||||||
*/
|
|
||||||
private void setSpecialistDoctorData(SpecialistDoctorTO sd) {
|
private void setSpecialistDoctorData(SpecialistDoctorTO sd) {
|
||||||
this.id = sd.getId();
|
this.id = sd.getId();
|
||||||
this.cipCode = sd.getProfessionalNumber();
|
this.cipCode = sd.getProfessionalNumber();
|
||||||
this.name = sd.getName();
|
this.name = sd.getName();
|
||||||
this.surname = sd.getSurname();
|
this.surname = sd.getName();
|
||||||
this.nif = sd.getNif();
|
this.nif = sd.getNif();
|
||||||
this.email = sd.getEmail();
|
this.email = sd.getEmail();
|
||||||
this.currentPassword = sd.getPassword();
|
this.currentPassword = sd.getPassword();
|
||||||
@@ -175,65 +154,28 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
return primaryHealthCareCentersList;
|
return primaryHealthCareCentersList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que implementa la búsqueda de un CAP a través del termino tecleado por el usuario en la lista de selección
|
|
||||||
*
|
|
||||||
* @param query Termino tecleado por el usuario
|
|
||||||
* @return Lista de CAPs que coinciden con el termino búscado por el usuario.
|
|
||||||
*/
|
|
||||||
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQueryPH) == false) {
|
if (query != null && query.equals(this.lastUIQueryPH) == false) {
|
||||||
this.lastUIQueryPH = query;
|
this.lastUIQueryPH = query;
|
||||||
// Recuperamos las XXX primeras coincidencias
|
// Recuperamos las 200 primeras coincidencias
|
||||||
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
}
|
}
|
||||||
return this.primaryHealthCareCentersList;
|
return this.primaryHealthCareCentersList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que implementa la búsqueda de una especialidad a través del termino tecleado por el usuario en la lista de selección
|
|
||||||
*
|
|
||||||
* @param query Termino tecleado por el usuario
|
|
||||||
* @return Lista de especialidades que coinciden con el termino búscado por el usuario.
|
|
||||||
*/
|
|
||||||
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
|
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQueryMS) == false) {
|
if (query != null && query.equals(this.lastUIQueryMS) == false) {
|
||||||
this.lastUIQueryMS = query;
|
this.lastUIQueryMS = query;
|
||||||
// Recuperamos las XXX primeras coincidencias
|
// Recuperamos las 200 primeras coincidencias
|
||||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
}
|
}
|
||||||
return this.medicalSpecialitiesList;
|
return this.medicalSpecialitiesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gestióna el evento de modficación del NIF del usuario actual. Búsca si el NIF ya está en uso para otro usuario. Solo se permite que el mismo NIF se refistro como paciente y
|
|
||||||
* como médico (especialista o de familia, pero no como ambos).
|
|
||||||
*
|
|
||||||
* Un Médico puede estar registrado como paciente con el mismo NIF, pero como médico de familia y especialista al mismo tiempo.
|
|
||||||
*/
|
|
||||||
public void handleNIFValueChange() {
|
|
||||||
boolean isDupe = false;
|
|
||||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
|
||||||
|
|
||||||
if (ValidationUtils.checkIfNifAlreadyRegistered(this.getRemoteManagerCommon(), this.userType, this.nif, this.id) == true) {
|
|
||||||
isDupe = true;
|
|
||||||
this.addFacesMessage("frmUpdateProfile:nif", FacesMessage.SEVERITY_WARN, "NIF duplicado", "El nif indicado pertenece a otro usuario previamente registrado");
|
|
||||||
}
|
|
||||||
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("NIFisDupe", isDupe);
|
|
||||||
PrimeFaces.current().ajax().addCallbackParam("formattedNIF", this.nif);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<FamilyDoctorTO> getFamilyDoctorList() {
|
public List<FamilyDoctorTO> getFamilyDoctorList() {
|
||||||
return familyDoctorList;
|
return familyDoctorList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que implementa la búsqueda de un médico de familia a través del termino tecleado por el usuario en la lista de selección
|
|
||||||
*
|
|
||||||
* @param query Termino tecleado por el usuario
|
|
||||||
* @return Lista de médicos de familia que coinciden con el termino búscado por el usuario.
|
|
||||||
*/
|
|
||||||
public List<FamilyDoctorTO> completeFamilyDoctor(String query) {
|
public List<FamilyDoctorTO> completeFamilyDoctor(String query) {
|
||||||
if (query != null && query.equals(this.lastUIQueryFD) == false) {
|
if (query != null && query.equals(this.lastUIQueryFD) == false) {
|
||||||
this.lastUIQueryFD = query;
|
this.lastUIQueryFD = query;
|
||||||
@@ -303,27 +245,8 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Método que guarda los datos realizados en la modificación del perfil.
|
|
||||||
* Tiene en cuenta el tipo de usuario que está editando su perfil.
|
|
||||||
*
|
|
||||||
* Si el usuario es un médico de familia requiere que se seleccione un CAP para el usuario.
|
|
||||||
* Si el usuario es un médico especialista requiere que se seleccione una especialidad médica para el usuario.
|
|
||||||
* Se comprueba que el NIF especificado sea válido y no pertenezca a otro usuario registrado (ver relgas de NIF permitidos para usuarios en el método handleNIFValueChange)
|
|
||||||
*
|
|
||||||
* Si se especifica una nueva contraseña, entonces se realiz un cambio de contraseña, y se requiere además: Que la nueva contraseña sea diferente a la anterior.
|
|
||||||
*
|
|
||||||
* Después de guardar los datos, se actualizan los datos guardados en la sesión actual para reflejar un posible cambio de nombre y/o apellidos.
|
|
||||||
*/
|
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
// Si no hay tipo de usuario, es que algo raro ha pasado (sesión caducada?). salimos.
|
|
||||||
if (this.userType == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
|
||||||
|
|
||||||
boolean changePassword = (this.oldPassword != null && this.oldPassword.equals("") == false) || (this.password != null && this.password.equals("") == false);
|
boolean changePassword = (this.oldPassword != null && this.oldPassword.equals("") == false) || (this.password != null && this.password.equals("") == false);
|
||||||
|
|
||||||
if (this.isUserTypeFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
if (this.isUserTypeFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
||||||
@@ -338,10 +261,6 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El NIF indicado no es válido", "Por favor, especifique un NIF válido.");
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El NIF indicado no es válido", "Por favor, especifique un NIF válido.");
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
if (ValidationUtils.checkIfNifAlreadyRegistered(this.getRemoteManagerCommon(), this.userType, this.nif, this.id) == true) {
|
|
||||||
this.addFacesMessage("frmUpdateProfile:nif", FacesMessage.SEVERITY_WARN, "NIF duplicado", "El nif indicado pertenece a otro usuario previamente registrado");
|
|
||||||
error++;
|
|
||||||
}
|
|
||||||
if (changePassword == true) {
|
if (changePassword == true) {
|
||||||
// el usuario queire cambiar el password Comprobamos que el password
|
// el usuario queire cambiar el password Comprobamos que el password
|
||||||
// especificado coincide con el guardado
|
// especificado coincide con el guardado
|
||||||
@@ -357,25 +276,20 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
try {
|
try {
|
||||||
LoggedUserTO usr = null;
|
|
||||||
|
|
||||||
switch (this.userType) {
|
switch (this.userType) {
|
||||||
case PATIENT:
|
case PATIENT:
|
||||||
PatientTO pat = this.getRemoteManagerProfile().updatePatientData(id, nif, name, surname, password, email);
|
PatientTO pat = this.getRemoteManagerProfile().updatePatientData(id, nif, name, surname, password, email);
|
||||||
this.setPatientData(pat);
|
this.setPatientData(pat);
|
||||||
usr = new LoggedUserTO(pat.getId().toString(), pat.getName(), pat.getPassword(), this.userType, pat.getDisplayName());
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case FAMILY_DOCTOR:
|
case FAMILY_DOCTOR:
|
||||||
FamilyDoctorTO fd = this.getRemoteManagerProfile().updateFamilyDoctorData(id, nif, name, surname, password, email, this.primaryHealthCareCenter);
|
FamilyDoctorTO fd = this.getRemoteManagerProfile().updateFamilyDoctorData(id, nif, name, surname, password, email, this.primaryHealthCareCenter);
|
||||||
this.setFamilyDoctorData(fd);
|
this.setFamilyDoctorData(fd);
|
||||||
usr = new LoggedUserTO(fd.getId().toString(), fd.getName(), fd.getPassword(), this.userType, fd.getDisplayName());
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SPECIALIST_DOCTOR:
|
case SPECIALIST_DOCTOR:
|
||||||
SpecialistDoctorTO sd = this.getRemoteManagerProfile().updateSpecialistDoctorData(id, nif, name, surname, password, email, this.medicalSpecialty);
|
SpecialistDoctorTO sd = this.getRemoteManagerProfile().updateSpecialistDoctorData(id, nif, name, surname, password, email, this.medicalSpecialty);
|
||||||
this.setSpecialistDoctorData(sd);
|
this.setSpecialistDoctorData(sd);
|
||||||
usr = new LoggedUserTO(sd.getId().toString(), sd.getName(), sd.getPassword(), this.userType, sd.getDisplayName());
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ADMINISTRATOR:
|
case ADMINISTRATOR:
|
||||||
@@ -388,9 +302,6 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
|||||||
this.oldPassword = "";
|
this.oldPassword = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualizamos la sessión del usuario actual por si ha cambiado el nombre de usuario.
|
|
||||||
SessionUtils.createOrUpdateSession(usr);
|
|
||||||
|
|
||||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los datos se han guardado", "Los datos de su perfil se han guardado correctamente.");
|
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los datos se han guardado", "Los datos de su perfil se han guardado correctamente.");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.manageException(e);
|
this.manageException(e);
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Named("UpdateSpecialistDoctorMBean")
|
||||||
|
@RequestScoped
|
||||||
|
public class UpdateSpecialistDoctorMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
private ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public UpdateSpecialistDoctorMBean() throws Exception {
|
||||||
|
initializeAdminFacadeRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa la conexión con el EJB Remoto
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void initializeAdminFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
package managedbean.systemAdmin;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.faces.view.ViewScoped;
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import org.primefaces.model.LazyDataModel;
|
|
||||||
import org.primefaces.model.SortOrder;
|
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
|
||||||
import TO.PrimaryHealthCareCenterTO;
|
|
||||||
import common.Constants;
|
|
||||||
import managedbean.common.ManagedBeanBase;
|
|
||||||
|
|
||||||
@Named("listDoctors")
|
|
||||||
@ViewScoped
|
|
||||||
public class ListDoctorsByCenterMBean extends ManagedBeanBase implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private List<PrimaryHealthCareCenterTO> primaryHealthCareCenterList;
|
|
||||||
private PrimaryHealthCareCenterTO primaryHealthCareCenter;
|
|
||||||
private String lastUIQueryPH;
|
|
||||||
private LazyDataModel<FamilyDoctorTO> lazyDataModelDoctorList;
|
|
||||||
|
|
||||||
public ListDoctorsByCenterMBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
this.primaryHealthCareCenterList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
this.primaryHealthCareCenter = null;
|
|
||||||
this.lastUIQueryPH = "";
|
|
||||||
|
|
||||||
this.lazyDataModelDoctorList = new LazyDataModel<FamilyDoctorTO>() {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<FamilyDoctorTO> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
|
|
||||||
if (primaryHealthCareCenter == null) {
|
|
||||||
this.setRowCount(0);
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialityCount(primaryHealthCareCenter.getId());
|
|
||||||
this.setRowCount(totalRowCount.intValue());
|
|
||||||
|
|
||||||
return getRemoteManagerSystemAdmin().listAllFamilyDoctorsByCAPPaged(primaryHealthCareCenter.getId(), (first / pageSize), pageSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public LazyDataModel<FamilyDoctorTO> getLazyDataModelDoctorList() {
|
|
||||||
return lazyDataModelDoctorList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
|
|
||||||
if (query != null && query.equals(this.lastUIQueryPH) == false) {
|
|
||||||
this.lastUIQueryPH = query;
|
|
||||||
this.primaryHealthCareCenterList = this.getRemoteManagerCommon().listCAPsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
|
||||||
}
|
|
||||||
return this.primaryHealthCareCenterList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PrimaryHealthCareCenterTO> getPrimaryHealthCareCenterList() {
|
|
||||||
return primaryHealthCareCenterList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrimaryHealthCareCenterList(List<PrimaryHealthCareCenterTO> value) {
|
|
||||||
this.primaryHealthCareCenterList = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO getPrimaryHealthCareCenter() {
|
|
||||||
return primaryHealthCareCenter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterTO value) {
|
|
||||||
this.primaryHealthCareCenter = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getPatientsByDoctor(int familyDoctorId) {
|
|
||||||
return getRemoteManagerSystemAdmin().getPatientCount(familyDoctorId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||