Compare commits
293 Commits
unique_ind
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fd9b3fbc2 | ||
|
|
a969e742d6 | ||
|
|
dab756a969 | ||
|
|
6f50dca04d | ||
|
|
9d05680313 | ||
|
|
6c24016662 | ||
|
|
369b3d032a | ||
|
|
c70a4c43cd | ||
|
|
68d6d4a160 | ||
|
|
167f52d062 | ||
|
|
7153a2bd31 | ||
|
|
04080056c4 | ||
|
|
d9dfbe2fc0 | ||
|
|
a45893292c | ||
|
|
59d13b3552 | ||
|
|
1eed84eed1 | ||
|
|
2fe3f77c8f | ||
|
|
9fa31c56b7 | ||
|
|
49eeccfc25 | ||
|
|
ac0b4e9704 | ||
|
|
81b962c50f | ||
|
|
cbe1d3dd55 | ||
|
|
20c445e200 | ||
|
|
45988b9c83 | ||
|
|
e8e06e3ec5 | ||
|
|
1614059eb3 | ||
|
|
f242fecb3d | ||
|
|
3aa971c8a2 | ||
|
|
f81e3011e8 | ||
|
|
52d9ed37e0 | ||
|
|
d57be9d95b | ||
|
|
ec6fa64eb6 | ||
|
|
0891d58146 | ||
|
|
7971350815 | ||
|
|
1c718c1142 | ||
|
|
79ace76c0c | ||
|
|
ebacc50ed1 | ||
|
|
db0bfeb41f | ||
|
|
d9ddc20779 | ||
|
|
68b3e990b9 | ||
|
|
b7a8d25f35 | ||
|
|
8171f761d3 | ||
|
|
1786711c14 | ||
|
|
423ab38a51 | ||
|
|
b12f3497fc | ||
|
|
2fbd8cb08f | ||
|
|
24617e7451 | ||
|
|
3026f7ca40 | ||
|
|
ee52770483 | ||
|
|
d224cdf5f2 | ||
|
|
4079c50f8a | ||
|
|
75ed5e2635 | ||
|
|
7e04274255 | ||
|
|
2d09aa8da8 | ||
|
|
10059aacdb | ||
|
|
3f681a7589 | ||
|
|
e80177be1a | ||
|
|
117feb7754 | ||
|
|
91faac6b63 | ||
|
|
4d6aedd863 | ||
|
|
8aa0db0777 | ||
|
|
7680a6acec | ||
|
|
ea142e1241 | ||
|
|
354560ab37 | ||
|
|
9e543045f9 | ||
|
|
4bb197a3c9 | ||
|
|
303b0abfa1 | ||
|
|
44f61ee745 | ||
|
|
e3174faf34 | ||
|
|
893431851b | ||
|
|
875f664586 | ||
|
|
4d22327267 | ||
|
|
eb0366c7e7 | ||
|
|
e07ed75132 | ||
|
|
e9f103123d | ||
|
|
37be658b42 | ||
|
|
1dbd8ef883 | ||
|
|
9435964e9e | ||
|
|
2c55a78bc8 | ||
|
|
756c6dff84 | ||
|
|
501a07df31 | ||
|
|
5269237787 | ||
|
|
a7ec876ca7 | ||
|
|
f80ad15f01 | ||
|
|
ba4a4e123c | ||
|
|
d0e41c5d5f | ||
|
|
b6e4116d0f | ||
|
|
ea5f0a4352 | ||
|
|
20e6ccd184 | ||
|
|
7f886a0922 | ||
|
|
1b377f2f38 | ||
|
|
d1ac1fe6ba | ||
|
|
b305c59054 | ||
|
|
4442100826 | ||
|
|
5fa3d1525a | ||
|
|
9cd602f8cf | ||
|
|
8dc561f876 | ||
|
|
47caa1fc54 | ||
|
|
2e0cc8bf36 | ||
|
|
be08aaff6e | ||
|
|
d889bdbd6c | ||
|
|
627ee49afa | ||
|
|
b2258e7ba0 | ||
|
|
74bef5814a | ||
|
|
e7d995aa60 | ||
|
|
8bfad1cea5 | ||
|
|
316b42f1f4 | ||
|
|
c7b302c695 | ||
|
|
2fe4176ef9 | ||
|
|
af0a2cf98c | ||
|
|
308fa17eba | ||
|
|
1ee2c3be90 | ||
|
|
9f3dc38744 | ||
|
|
1bd894fda1 | ||
|
|
3f944207cc | ||
|
|
8321d770a0 | ||
|
|
a3a3a410c6 | ||
|
|
069bd78520 | ||
|
|
6fae518032 | ||
|
|
ccf1137fd4 | ||
|
|
697a8e9cf7 | ||
|
|
974b524006 | ||
|
|
2b89caf1ba | ||
|
|
bf05547827 | ||
|
|
ac3d81fe07 | ||
|
|
553cc1550e | ||
|
|
b7697b7bd5 | ||
|
|
01b0615d68 | ||
|
|
43b2793494 | ||
|
|
3d5be6849c | ||
|
|
ec3b1dc1cd | ||
|
|
1d0118bcc8 | ||
|
|
e8df59352f | ||
|
|
bd243631f5 | ||
|
|
7f36ca323c | ||
|
|
c3da3bdc95 | ||
|
|
a851f139f7 | ||
|
|
c27a28f3a5 | ||
|
|
85f2cd100c | ||
|
|
0e861e01c6 | ||
|
|
c8b16d7295 | ||
|
|
0a9b2180cb | ||
|
|
6fd9e7ca6c | ||
|
|
85f6cf9644 | ||
|
|
87da9ccbf1 | ||
|
|
c7de5401ad | ||
|
|
2726d2564a | ||
|
|
066ddeba51 | ||
|
|
b2f5cf88e4 | ||
|
|
e6aef82ba1 | ||
|
|
6c8fb202ce | ||
|
|
a35d7fe7fe | ||
|
|
a5eb912504 | ||
|
|
3aa63a8cd1 | ||
|
|
0e309052ee | ||
|
|
3bd6399340 | ||
|
|
ed54eb8905 | ||
|
|
017d685538 | ||
|
|
244bb76eec | ||
|
|
61932f6a18 | ||
|
|
31b794e4c9 | ||
|
|
aa50eccbac | ||
|
|
b37fe33906 | ||
|
|
96e19feb00 | ||
|
|
c9cfbb3b7e | ||
|
|
de70fa1e8c | ||
|
|
592a0a0f97 | ||
|
|
06e42a6189 | ||
|
|
3fe7a211ce | ||
|
|
d861796289 | ||
|
|
eac96114e6 | ||
|
|
4e8cd37a3c | ||
|
|
74d4162a99 | ||
|
|
a329ed6a32 | ||
|
|
7af0d261ab | ||
|
|
524b3bb8c7 | ||
|
|
b0f5c69a47 | ||
|
|
74ec842f54 | ||
|
|
7cf4a93c2c | ||
|
|
000e2a8721 | ||
|
|
9bc06ccedd | ||
|
|
94fde1e93b | ||
|
|
4f5c5943e7 | ||
|
|
3555348f71 | ||
|
|
1d341cdf90 | ||
|
|
5a04f0bd4f | ||
|
|
ed1938f44a | ||
|
|
4aeec0c31b | ||
|
|
917e128d7e | ||
|
|
a65e7fb885 | ||
|
|
18f2524412 | ||
|
|
26c3ec6a33 | ||
|
|
b75199840e | ||
|
|
a8dd4f2674 | ||
|
|
06388f9449 | ||
|
|
f62f4df779 | ||
|
|
14f4ac42ac | ||
|
|
aee0f9deaf | ||
|
|
6a413357e5 | ||
|
|
45c9de6546 | ||
|
|
03f34d4a83 | ||
|
|
b6d68df139 | ||
|
|
b815680649 | ||
|
|
992fc3e25a | ||
|
|
ed78633291 | ||
|
|
c8a3f1e933 | ||
|
|
02ea97195f | ||
|
|
ebc33396c7 | ||
|
|
2dc7c9b8b7 | ||
|
|
83e3fb9867 | ||
|
|
a83b273955 | ||
|
|
d179280321 | ||
|
|
310aae76ef | ||
|
|
06114b7e2f | ||
|
|
952417c6ce | ||
|
|
1dff9b09e8 | ||
|
|
aeb1d300a4 | ||
|
|
66a00616e5 | ||
|
|
318680d5c0 | ||
|
|
8482b660c1 | ||
|
|
e789cb57d2 | ||
|
|
904976f2cb | ||
|
|
3adff14da6 | ||
|
|
bece7c58d2 | ||
|
|
cf2140d6c7 | ||
|
|
ffe56f3c68 | ||
|
|
b2e55231ea | ||
|
|
1e3886cc54 | ||
|
|
492ddad057 | ||
|
|
7891777ecf | ||
|
|
01f0f5627f | ||
|
|
25a4896426 | ||
|
|
310578241e | ||
|
|
cc4415968b | ||
|
|
48d182abdd | ||
|
|
b61c57d290 | ||
|
|
96a2c3dcf6 | ||
|
|
42d0041b30 | ||
|
|
5d0dc435e8 | ||
|
|
528f099891 | ||
|
|
0741c7d766 | ||
|
|
e07117adf0 | ||
|
|
3b0640304e | ||
|
|
2a0ee44ffa | ||
|
|
16ed46f6cd | ||
|
|
df127c89fd | ||
|
|
c3e1fbe9ae | ||
|
|
ea98690703 | ||
|
|
e04bbf6f35 | ||
|
|
63101a301b | ||
|
|
9bfdebbea4 | ||
|
|
dcbebe5253 | ||
|
|
48c04a6681 | ||
|
|
2e5ae9bb6c | ||
|
|
ae79658a23 | ||
|
|
bc1e05ab36 | ||
|
|
fbe7b34a32 | ||
|
|
91f6bc396b | ||
|
|
a71df2baa9 | ||
|
|
f55ebe3bb9 | ||
|
|
5a3ed35c16 | ||
|
|
7193ffd250 | ||
|
|
6eb1bda423 | ||
|
|
e5900a8d0f | ||
|
|
1bfd7317e6 | ||
|
|
b5a41958a2 | ||
|
|
4dc6828257 | ||
|
|
697a4d3c17 | ||
|
|
d39a82718e | ||
|
|
f776128be0 | ||
|
|
598e4cce71 | ||
|
|
5276ff017e | ||
|
|
516a5d0701 | ||
|
|
16d7cea829 | ||
|
|
5098e51496 | ||
|
|
4c2c991e7c | ||
|
|
92af30a5f3 | ||
|
|
d4c1e18ab1 | ||
|
|
7854ca85bc | ||
|
|
ad8cd521c6 | ||
|
|
301d1de126 | ||
|
|
ddf9145718 | ||
|
|
9136d53f2c | ||
|
|
2b1ab687ae | ||
|
|
b64a8de964 | ||
|
|
8140eb19aa | ||
|
|
f31803f4f4 | ||
|
|
d28b0fdc81 | ||
|
|
c33bbf0de6 | ||
|
|
18cb6daebd | ||
|
|
239e9b7640 | ||
|
|
2542b3c170 | ||
|
|
e27bd81d38 |
@@ -14,7 +14,7 @@ ci_build:
|
||||
script:
|
||||
- cd 1.sources/MyHealth
|
||||
- ant clean
|
||||
- ant all
|
||||
- ant ear
|
||||
|
||||
ci_test:
|
||||
stage: test
|
||||
@@ -25,9 +25,12 @@ ci_test:
|
||||
deploy_pre:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Eliminamos archivo ear anterior..."
|
||||
- rm -f $JBOSS_HOME/standalone/deployments/MyHealth.*
|
||||
- echo "Despliegue al servidor de PRE"
|
||||
- cd 1.sources/MyHealth
|
||||
- ant deployear
|
||||
|
||||
|
||||
environment:
|
||||
name: pre
|
||||
@@ -38,6 +41,8 @@ deploy_pre:
|
||||
deploy_pro:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Eliminamos archivo ear anterior..."
|
||||
- rm -f $JBOSS_HOME/standalone/deployments/MyHealth.*
|
||||
- echo "Despliegue al servidor de PRO"
|
||||
- cd 1.sources/MyHealth
|
||||
- ant deployear
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<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="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" sourcepath="C:/Users/mark/.m2/repository/org/omnifaces/omnifaces/3.4.1/omnifaces-3.4.1-sources.jar"/>
|
||||
<classpathentry kind="lib" path="docroot/WEB-INF/lib/primefaces-7.0.jar" />
|
||||
<classpathentry kind="lib" path="docroot/WEB-INF/lib/omnifaces-3.4.1.jar" />
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<fileset dir="docroot/WEB-INF" flatten="false" inWorkspace="true" includes="**/*">
|
||||
<properties/>
|
||||
</fileset>
|
||||
<folder name="classes\managedbean">
|
||||
<folder name="classes/managedbean">
|
||||
<fileset dir="bin/managedbean" flatten="false" inWorkspace="true" includes="**">
|
||||
<properties/>
|
||||
</fileset>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,13 +1,13 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<property environment="env" />
|
||||
<property name="jboss.home" value="${env.JBOSS_HOME}" />
|
||||
<property name="source" value="." />
|
||||
<property name="java.encoding" value="UTF-8" />
|
||||
<property name="sourcesrc" value="${source}/src" />
|
||||
<property name="build" value="${source}/build" />
|
||||
<property name="buildjar" value="${build}/jar" />
|
||||
@@ -27,7 +28,7 @@
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<target name="all" depends="clean, init, ear" />
|
||||
<target name="all" depends="clean, init, deployear" />
|
||||
|
||||
<target name="init" description="inicialitzacions is relevant: the structure created
|
||||
copy files and directories there. xml ">
|
||||
@@ -48,7 +49,17 @@
|
||||
<target name="compileEjb" depends="init">
|
||||
<copy file="${sourcesrc}/META-INF/persistence.xml" todir="${buildjar}/META-INF" />
|
||||
<copy file="${sourcesrc}/log4j.properties" todir="${buildjar}" />
|
||||
<javac srcdir="${sourcesrc}" destdir="${buildjar}" includes="ejb/**/*.java, jpa/**/*.java, TO/**/*.java" classpathref="jboss.classpath" includeantruntime="true" />
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildjar}" includeantruntime="true" source="1.8" target="1.8">
|
||||
<classpath>
|
||||
<path refid="jboss.classpath" />
|
||||
</classpath>
|
||||
<include name="ejb/**/*.java" />
|
||||
<include name="jpa/**/*.java" />
|
||||
<include name="TO/**/*.java" />
|
||||
<include name="common/**/*.java" />
|
||||
<exclude name="managedbean/**/*.java" />
|
||||
</javac>
|
||||
<delete verbose="true" dir="${buildjar}/managedbean" />
|
||||
</target>
|
||||
|
||||
<!-- Update the EJB jar file and create if not exist -->
|
||||
@@ -61,15 +72,21 @@
|
||||
<copy todir="${buildwar}">
|
||||
<fileset dir="${docroot}" />
|
||||
</copy>
|
||||
<javac srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includes="managedbean/**/*.java" includeantruntime="true">
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includeantruntime="true" source="1.8" target="1.8">
|
||||
<classpath>
|
||||
<path refid="jboss.classpath" />
|
||||
<path refid="lib.dir" />
|
||||
</classpath>
|
||||
<include name="managedbean/**/*.java" />
|
||||
<exclude name="ejb/**/*.java" />
|
||||
<exclude name="jpa/**/*.java" />
|
||||
<exclude name="TO/**/*.java" />
|
||||
<exclude name="common/**/*.java" />
|
||||
</javac>
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/ejb" />
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/jpa" />
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/TO" />
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/common" />
|
||||
</target>
|
||||
<!-- <war destfile="${build.dir}/CrunchifyRESTJerseyExample.war" webxml="WebContent/WEB-INF/web.xml"> -->
|
||||
<!-- <classes dir="${build.dir}" /> -->
|
||||
@@ -79,7 +96,8 @@
|
||||
|
||||
<!-- Update the WAR file and create if not exist -->
|
||||
<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/*.*" update="yes" />
|
||||
<jar jarfile="${dist}/MyHealth.war" basedir="${buildwar}" excludes="/WEB-INF/classes/ejb/*.*, /WEB-INF/classes/jpa/*.*, /WEB-INF/classes/TO/*.*, /WEB-INF/classes/common/*.*"
|
||||
update="yes" />
|
||||
</target>
|
||||
|
||||
<!-- Update the application ear file and created if not exist -->
|
||||
|
||||
@@ -2,4 +2,7 @@
|
||||
<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">
|
||||
|
||||
<factory>
|
||||
<exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory>
|
||||
</factory>
|
||||
</faces-config>
|
||||
|
||||
@@ -18,7 +18,14 @@
|
||||
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
|
||||
<param-value>true</param-value>
|
||||
</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>server</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
|
||||
<param-value>.xhtml</param-value>
|
||||
@@ -27,13 +34,11 @@
|
||||
<param-name>primefaces.FONT_AWESOME</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<context-param>
|
||||
<param-name>primefaces.THEME</param-name>
|
||||
<param-value>#{sessionPreferences.currentTheme}</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<!-- JSF mapping -->
|
||||
<servlet>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
@@ -42,23 +47,12 @@
|
||||
</servlet>
|
||||
|
||||
<!-- 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-name>Faces Servlet</servlet-name>
|
||||
<url-pattern>*.xhtml</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- Error pages mapping -->
|
||||
<error-page>
|
||||
<error-code>500</error-code>
|
||||
<location>/error.xhtml</location>
|
||||
@@ -66,12 +60,11 @@
|
||||
|
||||
<session-config>
|
||||
<session-timeout>30</session-timeout>
|
||||
|
||||
</session-config>
|
||||
|
||||
<!-- The Welcome File List -->
|
||||
<welcome-file-list>
|
||||
<welcome-file>home.xhtml</welcome-file>
|
||||
<welcome-file>/home.xhtml</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
||||
|
||||
@@ -1,7 +1,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">
|
||||
|
||||
<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:fn="http://xmlns.jcp.org/jsp/jstl/functions" xmlns:of="http://omnifaces.org/functions">
|
||||
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
@@ -9,24 +10,45 @@
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-2 ui-md-2" />
|
||||
<div class="ui-g-8 ui-md-8">
|
||||
<p:panel id="ErrorPanel" header="Se ha producido un error inesperado">
|
||||
<p:panel id="ErrorPanel">
|
||||
<f:facet name="header">
|
||||
<p:outputLabel rendered="#{error.errorType == 'sql'}" value="No se puede conectar con la base de datos" />
|
||||
<p:outputLabel rendered="#{error.errorType == 'auth'}" value="Se ha producido un error de autorización" />
|
||||
<p:outputLabel rendered="#{error.errorType == 'expired'}" value="Su sesión ha caducado" />
|
||||
<p:outputLabel rendered="#{error.errorType == 'runtime'}" value="Se producido un error en tiempo de ejecución" />
|
||||
</f:facet>
|
||||
<div class="ui-g ui-fluid">
|
||||
<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
|
||||
pueda comunicarlo al equipo de soporte.</div>
|
||||
|
||||
<div class="ui-g-12" style="font-weight: bold;">
|
||||
Descripción del error
|
||||
</div>
|
||||
|
||||
<div class="ui-g-12">
|
||||
<h:messages fatalClass="ErrorMessage" showDetail="true" showSummary="true" globalOnly="true" />
|
||||
<p:outputLabel rendered="#{error.errorType == 'sql'}"
|
||||
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="#{error.errorType == 'auth'}"
|
||||
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." />
|
||||
<p:outputLabel rendered="#{error.errorType == 'expired'}" value="Su sesión ha caducado. Por favor, incie sesión de nuevo en el sistema." />
|
||||
<p:outputLabel rendered="#{error.errorType == '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." />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-5" />
|
||||
<div class="ui-g-2">
|
||||
<p:button value="Ir a la página principal" outcome="home" icon="pi pi-home" />
|
||||
<div class="ui-g-12">
|
||||
<p:messages id="errorMessage" showDetail="true" closable="false" autoupdate="true" showSummary="true" showIcon="true" />
|
||||
</div>
|
||||
<div class="ui-g-5" />
|
||||
|
||||
<ui:fragment rendered="#{error.renderBack == false}">
|
||||
<div class="ui-g-4" />
|
||||
<div class="ui-g-4">
|
||||
<p:button value="Ir a la página principal" outcome="home" icon="pi pi-home" />
|
||||
</div>
|
||||
<div class="ui-g-4" />
|
||||
</ui:fragment>
|
||||
<ui:fragment rendered="#{error.renderBack == true}">
|
||||
<div class="ui-g-2" />
|
||||
<div class="ui-g-4">
|
||||
<p:button value="Ir a la página principal" outcome="home" icon="pi pi-home" />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<p:button rendered="#{error.renderBack}" value="Volver atrás" href="#{error.requestURI}" icon="pi pi-chevron-left" />
|
||||
</div>
|
||||
<div class="ui-g-2" />
|
||||
</ui:fragment>
|
||||
</div>
|
||||
</p:panel>
|
||||
</div>
|
||||
|
||||
@@ -2,45 +2,35 @@
|
||||
<!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:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
|
||||
<h:head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>MyHealth Online Services</title>
|
||||
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
|
||||
<h:outputStylesheet library="css" name="estilos.css" />
|
||||
<h:outputScript library="js" name="common.js" />
|
||||
</h:head>
|
||||
<h:outputScript>
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if(args.validationFailed || !args.loggedIn) {
|
||||
PF('dlgLogin').jq.effect("shake", {times:5}, 100);
|
||||
//PF('Login').attr("disabled", false);
|
||||
}
|
||||
else {
|
||||
PF('dlgLogin').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function startLogin() {
|
||||
//PF('Login').attr("disabled", true);
|
||||
}
|
||||
// Si hay un error AJAX, lo más probable es que la sesión expirase, vamos a la página de error
|
||||
function onAjaxError() {
|
||||
window.location.href = "#{request.contextPath}/error.xhtml?type=expired";
|
||||
}
|
||||
</h:outputScript>
|
||||
<h:body>
|
||||
<p:growl id="messages" globalOnly="true" sticky="false" showDetail="true" life="15000" />
|
||||
<div id="layout">
|
||||
<div id="top" class="top">
|
||||
<!-- <h1 class="Titulo">myHealth Site</h1> -->
|
||||
<h:graphicImage library="images" name="logo-small.png" />
|
||||
<h:graphicImage library="images" name="logo-small.png" height="116" alt="MyHealth by Grupo 2" />
|
||||
</div>
|
||||
<hr />
|
||||
<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">
|
||||
<div id="menuDiv" style="padding: 8px;">
|
||||
<p:ajaxStatus style="width:32px; height:32px; position:fixed; right:48px; bottom:48px" onerror="onAjaxError()">
|
||||
<f:facet name="start">
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em"></i>
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em" />
|
||||
</f:facet>
|
||||
|
||||
<f:facet name="complete">
|
||||
<h:outputText value="" />
|
||||
<f:facet name="error">
|
||||
<i class="pi pi-exclamation-triangle" style="font-size: 3em" />
|
||||
</f:facet>
|
||||
</p:ajaxStatus>
|
||||
|
||||
@@ -49,40 +39,28 @@
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12">
|
||||
<h:outputLabel for="username" value="Usuario:" />
|
||||
<p:inputText id="username" value="#{loginView.username}" />
|
||||
<p:inputText id="username" value="#{loginView.username}" placeholder="Escriba su código CIP o NP" />
|
||||
</div>
|
||||
<div class="ui-g-12">
|
||||
|
||||
<h:outputLabel for="password" value="Contraseña:" />
|
||||
<p:password id="password" value="#{loginView.password}" />
|
||||
<p:password id="password" value="#{loginView.password}" placeholder="Contraseña" />
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
<p:commandButton value="Login" update="frmMenu, messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
||||
<p:commandButton widgetVar="btnLogin" value="Entrar" update="messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
||||
oncomplete="handleLoginRequest(xhr, status, args)" />
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
<p:commandButton value="Cancel" icon="pi pi-ban" onclick="PF('dlgLogin').hide();" />
|
||||
<p:commandButton value="Cancelar" icon="pi pi-ban" onclick="PF('dlgLogin').hide();" />
|
||||
</div>
|
||||
</div>
|
||||
</p:dialog>
|
||||
</h:form>
|
||||
<h:form id="frmMenu">
|
||||
<p:menubar model="#{menuView.model}">
|
||||
<f:facet name="options">
|
||||
<ui:fragment rendered="#{home.logedIn}">
|
||||
<h:outputText value="logeado como #{home.userName} (#{home.userType}) " />
|
||||
<p:commandButton value="Logout" icon="pi pi-sign-out" action="#{loginView.logout}" />
|
||||
</ui:fragment>
|
||||
<ui:fragment rendered="#{not home.logedIn}">
|
||||
<h:outputText value="hola, invitado " />
|
||||
<p:commandButton value="login" icon="pi pi-sign-in" onclick="PF('dlgLogin').show();" title="login" />
|
||||
<p:button value="Registrarse" icon="pi pi-user-plus" outcome="/profile/RegisterUser" />
|
||||
</ui:fragment>
|
||||
</f:facet>
|
||||
</p:menubar>
|
||||
<p:menubar model="#{menuView.model}" />
|
||||
</h:form>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="content" style="padding-left: 8px; padding-right: 8px;">
|
||||
<ui:insert name="content">Content</ui:insert>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,44 +2,31 @@
|
||||
<!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">
|
||||
<f:metadata>
|
||||
<f:viewParam name="refresh" value="#{home.refresh}" />
|
||||
</f:metadata>
|
||||
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form>
|
||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
|
||||
<p:panel header="Pagina principal">
|
||||
<p:panelGrid>
|
||||
<p:outputLabel for="selectorTema" value="Cambio de tema" />
|
||||
<p:themeSwitcher id="selectorTema" style="width:165px" value="#{sessionPreferences.currentTheme}">
|
||||
<f:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
|
||||
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
|
||||
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
|
||||
</p:themeSwitcher>
|
||||
</p:panelGrid>
|
||||
<h:panelGrid columns="2">
|
||||
<h:outputLabel value="Fecha" />
|
||||
<p:calendar pattern="dd/MM/yyyy" />
|
||||
<h:outputLabel value="Rich Text Editor" />
|
||||
<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>
|
||||
<div class="ui-g ui-fluid">
|
||||
<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" />
|
||||
</div>
|
||||
<div class="ui-g-3 ui-md-3">
|
||||
<p:themeSwitcher id="selectorTema" style="width:300px" value="#{sessionPreferences.currentTheme}">
|
||||
<f:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
|
||||
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
|
||||
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
|
||||
</p:themeSwitcher>
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:commandButton value="Usar tema" update="messages" action="#{sessionPreferences.updateCurrentTheme}" icon="pi pi-save" />
|
||||
</div>
|
||||
<div class="ui-g-5 ui-md-5" />
|
||||
</div>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
|
||||
@@ -2,24 +2,7 @@
|
||||
<!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">
|
||||
|
||||
<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>
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form>
|
||||
@@ -39,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ui-g-6">
|
||||
<p:commandButton value="Login" update="frmMenu, messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
||||
<p:commandButton value="Entrar" update="frmMenu, messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
||||
oncomplete="handleLoginRequest(xhr, status, args)" />
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
|
||||
@@ -2,58 +2,190 @@
|
||||
<!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: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="PanelUnderConstruction" header="Pagina en construcción de Pruebas médicas">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<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 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>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<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" locale="es" />
|
||||
</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 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 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-9">
|
||||
<p:fileUpload rendered="#{mt.specialistDoctor}" value="#{mt.imageUpload}" fileUploadListener="#{mt.uploadDataListener}" update="frmImage" multiple="false" fileLimit="1"
|
||||
fileLimitMessage="Solo se puede subir una imagen" previewWidth="80" mode="advanced" skinSimple="true" uploadLabel="Subir" cancelLabel="Cancelar" label="Seleccionar" />
|
||||
</div>
|
||||
<div class="ui-g-2" />
|
||||
<div class="ui-g-8" style="align-content: center; text-align: center;">
|
||||
<h:graphicImage rendered="#{mt.selected.highresimage != null}" value="#{mt.selected.highresimage}" alt="Imagen de la prueba mécica" width="400" />
|
||||
<h:outputText rendered="#{mt.selected.highresimage == null}" value="Esta prueba no tiene ninguna imagen asociada" style="font-weight: bold;" />
|
||||
</div>
|
||||
<div class="ui-g-2">
|
||||
<p:commandButton rendered="#{mt.specialistDoctor and mt.selected.highresimage != null}" value="Eliminar" icon="pi pi-trash" action="#{mt.removeImage}" 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>
|
||||
<p />
|
||||
<p:commandButton rendered="#{mt.selected.highresimage != null}" ajax="false" value="Descargar" icon="pi pi-download">
|
||||
<p:fileDownload value="#{mt.imageDownload}" />
|
||||
</p:commandButton>
|
||||
</div>
|
||||
</div>
|
||||
</p:outputPanel>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||
</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" locale="es" 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" locale="es" 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">
|
||||
<p:commandButton value="Guardar" action="#{mt.save}" icon="pi pi-save" update="frmMT,frmImage,frmNEW" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</div>
|
||||
</div>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
</html>
|
||||
87
1.sources/MyHealth/docroot/medicaltest/Questions.xhtml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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" />
|
||||
<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 headerText="" style="width: 30px;">
|
||||
<h:graphicImage name="images/#{pq.status}.png" alt="#{pq.status}" styleClass="ui-theme" />
|
||||
</p:column>
|
||||
<p:column headerText="Título" width="auto">
|
||||
<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>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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.medicalSpecialty}" completeMethod="#{sspec.completeMedicalSpecialty}" 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="#{sspec.medicalSpecialtiesList}" />
|
||||
<p:ajax event="itemSelect" update="dtDoctorList" oncomplete="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" currentPageReportTemplate="Página {currentPage} de {totalPages}" 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>
|
||||
@@ -1,51 +0,0 @@
|
||||
<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>
|
||||
@@ -1,39 +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="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>
|
||||
@@ -1,38 +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="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>
|
||||
@@ -1,37 +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="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:define name="content">
|
||||
<h:form id="frmChangeFD">
|
||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="badProfile" rendered="#{not home.patient}">
|
||||
<div class="ui-g-3 ui-md-3" />
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
@@ -31,23 +31,24 @@
|
||||
<p:panel id="PanelPHC" header="Cambiar médico de familia asignado" rendered="#{home.patient}">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Médico de familia actualmente asignado:" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeFD.currentFamilyDoctor.displayName}" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-6" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Nuevo médico de familia:" for="newFamilyDocAC" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:autoComplete id="newFamilyDocAC" dropdown="true" required="true" value="#{ChangeFD.newFamilyDoctor}" completeMethod="#{ChangeFD.completeFamilyDoctor}" var="fd"
|
||||
itemLabel="#{fd.displayName}" itemValue="#{fd}" forceSelection="true" requiredMessage="Por favor, selecciona un médico de familia">
|
||||
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}" />
|
||||
<p:column headerText="Num. Prof.">
|
||||
<h:outputText value="#{fd.id}" />
|
||||
<h:outputText value="#{fd.professionalNumber}" />
|
||||
</p:column>
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{fd.name}" />
|
||||
@@ -57,7 +58,7 @@
|
||||
</p:column>
|
||||
</p:autoComplete>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-6">
|
||||
<p:message for="newFamilyDocAC" />
|
||||
</div>
|
||||
|
||||
@@ -72,7 +73,6 @@
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<ui:composition template="../header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form id="frmChangePHCC">
|
||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="badProfile" rendered="#{not home.familyDoctor}">
|
||||
<div class="ui-g-3 ui-md-3" />
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
@@ -31,26 +31,31 @@
|
||||
<p:panel id="PanelPHC" header="Cambiar centro de antención primaria asignado" rendered="#{home.familyDoctor}">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel value="Centro de antención primaria actualmente asignado:" />
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Centro de antención primaria actual:" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeCAP.currentCenter.displayName}" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-6" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Nuevo centro de atención primaria:" for="newCenter" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:autoComplete id="newCenter" dropdown="true" required="true" value="#{ChangeCAP.newCenter}" completeMethod="#{ChangeCAP.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
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}" />
|
||||
<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>
|
||||
<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-6">
|
||||
<p:message for="newCenter" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<div class="ui-g-6">
|
||||
<p:button value="Ir a la página principal" outcome="/home" icon="pi pi-home" />
|
||||
</div>
|
||||
<div class="ui-g-3"></div>
|
||||
<div class="ui-g-3" />
|
||||
</div>
|
||||
|
||||
</p:panel>
|
||||
@@ -44,36 +44,18 @@
|
||||
</h:form>
|
||||
|
||||
<h:form id="frmRegisterUser" rendered="#{not RegisterUser.registered}">
|
||||
<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:growl id="mesgs" globalOnly="true" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="tipoUsuario" header="Especifique el tipo de usuario que desea registrarse">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:outputLabel value="Tipo de usuario:" for="selUsertype" />
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<div class="ui-g-10 ui-md-10">
|
||||
<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}" />
|
||||
<p:ajax listener="#{RegisterUser.onUserTypeChange}" update="panCombos" oncomplete="handleRequest(xhr, status, args)" />
|
||||
<p:ajax listener="#{RegisterUser.onUserTypeChange}" update="panCombos" oncomplete="nifCheckClick();" />
|
||||
</p:selectOneButton>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
</p:panel>
|
||||
<br />
|
||||
@@ -83,10 +65,20 @@
|
||||
<p:outputLabel value="NIF:" for="nif" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:inputText id="nif" value="#{RegisterUser.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF" />
|
||||
<div class="ui-inputgroup">
|
||||
<p:inputText id="nif" widgetVar="nif" value="#{RegisterUser.nif}" validator="nifValidator" binding="#{nif}" maxlength="20" required="true"
|
||||
requiredMessage="Por favor, indque su NIF">
|
||||
<f:validator validatorId="nifValidator" for="nif">
|
||||
<f:attribute name="managedBean" value="#{RegisterUser}" />
|
||||
</f:validator>
|
||||
<p:ajax event="change" update="nifmsg,nifButton" />
|
||||
</p:inputText>
|
||||
<p:commandButton id="nifButton" widgetVar="nifButton" onclick="nifCheckClick();" icon="pi #{nif.valid ? 'pi-check' : 'pi-times'}"
|
||||
styleClass="#{nif.valid ? 'green-button' : 'red-button'}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<p:message for="nif" display="text" showDetail="true" showSummary="true" />
|
||||
<p:message id="nifmsg" for="nif" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
@@ -114,12 +106,12 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:inputText id="email" value="#{RegisterUser.email}" required="true" maxlength="120" validator="emailValidator"
|
||||
validatorMessage="La dirección #{RegisterUser.email} no es válida" requiredMessage="Por favor, especifique su correo electrónico">
|
||||
validatorMessage="La dirección de correo electrónico #{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]" />
|
||||
</p:inputText>
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<p:message for="email" display="text" showDetail="true" showSummary="true" />
|
||||
<p:message for="email" />
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:outputLabel value="Contraseña" for="password" />
|
||||
@@ -148,8 +140,9 @@
|
||||
<p:outputLabel value="Centro:" for="selPHC" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selPHC" dropdown="true" value="#{RegisterUser.primaryHealthCareCenter}" completeMethod="#{RegisterUser.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
<p:autoComplete id="selPHC" dropdown="true" required="true" value="#{RegisterUser.primaryHealthCareCenter}" completeMethod="#{RegisterUser.completePrimaryHealCareCenter}"
|
||||
var="phc" itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria"
|
||||
placeholder="Seleccione una CAP o teclee para buscar...">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.phcList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{phc.name}" />
|
||||
@@ -169,8 +162,9 @@
|
||||
<p:outputLabel value="Especialidad médica:" for="selMS" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<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">
|
||||
<p:autoComplete id="selMS" dropdown="true" required="true" value="#{RegisterUser.medicalSpecialty}" completeMethod="#{RegisterUser.completeMedicalSpecialty}" 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:column headerText="Nombre">
|
||||
<h:outputText value="#{ms.name}" />
|
||||
|
||||
@@ -1,38 +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="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>
|
||||
@@ -1,38 +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="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>
|
||||
@@ -1,38 +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="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>
|
||||
@@ -1,39 +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="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>
|
||||
@@ -1,39 +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="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,20 +7,19 @@
|
||||
<ui:composition template="../header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form id="frmUpdateProfile">
|
||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
|
||||
<p:panel id="tipoUsuario" header="Tipo de usuario registrado">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:outputLabel value="Tipo de usuario:" for="selUsertype" />
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<div class="ui-g-10 ui-md-10">
|
||||
<p:selectOneButton id="selUsertype" value="#{UpdateProfile.userType}" disabled="true" required="true" unselectable="false"
|
||||
requiredMessage="Debe especificar un tipo de usuario">
|
||||
<f:selectItems value="#{UpdateProfile.userTypes}" var="item" itemLabel="#{item.userTypename}" itemValue="#{item.name}" />
|
||||
</p:selectOneButton>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4"></div>
|
||||
</div>
|
||||
</p:panel>
|
||||
<br />
|
||||
@@ -31,7 +30,7 @@
|
||||
<p:outputLabel value="Número de Profesional:" rendered="#{UpdateProfile.userTypeDoctor}" for="cipCode" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:inputText id="cipCode" value="#{UpdateProfile.cipCode}" disabled="true" required="true" requiredMessage="Es necesario un código de identificación" />
|
||||
<p:inputText id="cipCode" value="#{UpdateProfile.cipCode}" readonly="true" required="true" requiredMessage="Es necesario un código de identificación" />
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<p:message for="cipCode" display="text" />
|
||||
@@ -41,10 +40,19 @@
|
||||
<p:outputLabel value="NIF:" for="nif" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:inputText id="nif" value="#{UpdateProfile.nif}" validator="nifValidator" required="true" maxlength="50" requiredMessage="Por favor, indque su NIF" />
|
||||
<div class="ui-inputgroup">
|
||||
<p:inputText id="nif" widgetVar="nif" value="#{UpdateProfile.nif}" validator="nifValidator" binding="#{nif}" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
||||
<f:validator validatorId="nifValidator" for="nif">
|
||||
<f:attribute name="managedBean" value="#{UpdateProfile}" />
|
||||
</f:validator>
|
||||
<p:ajax event="change" update="nifmsg,nifButton" />
|
||||
</p:inputText>
|
||||
<p:commandButton id="nifButton" widgetVar="nifButton" onclick="nifCheckClick();" icon="pi #{nif.valid ? 'pi-check' : 'pi-times'}"
|
||||
styleClass="#{nif.valid ? 'green-button' : 'red-button'}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<p:message for="nif" display="text" />
|
||||
<p:message id="nifmsg" for="nif" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
@@ -71,8 +79,8 @@
|
||||
<p:outputLabel value="Correo electrónico:" for="email" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:inputText id="email" value="#{UpdateProfile.email}" required="true" maxlength="120" validator="emailValidator" validatorMessage="La dirección #{RegisterUser.email} no es válida"
|
||||
requiredMessage="Por favor, especifique su correo electrónico">
|
||||
<p:inputText id="email" value="#{UpdateProfile.email}" required="true" maxlength="120" validator="emailValidator"
|
||||
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]" />
|
||||
</p:inputText>
|
||||
</div>
|
||||
@@ -92,7 +100,7 @@
|
||||
<p:outputLabel value="Nueva contraseña" for="password" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:password id="password" value="#{UpdateProfile.password}" match="passwordRepeat" required="false" maxlength="100" requiredMessage="Por favor, especifique una contraseña"
|
||||
<p:password id="password" value="#{UpdateProfile.password}" match="passwordRepeat" required="false" maxlength="100" requiredMessage="Por favor, especifique una contraseña"
|
||||
feedback="true" promptLabel="Especifique una contraseña segura" weakLabel="La contraseña es débil" goodLabel="La contraseña es buena" strongLabel="La contraseña es segura"
|
||||
validatorMessage="La contraseña y su verificación deben ser iguales" />
|
||||
</div>
|
||||
@@ -103,7 +111,7 @@
|
||||
<p:outputLabel value="Verificación de contraseña:" for="passwordRepeat" />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<p:password id="passwordRepeat" value="#{UpdateProfile.password}" required="false" maxlength="100" requiredMessage="Por favor, escriba la verificación de su contraseña" />
|
||||
<p:password id="passwordRepeat" value="#{UpdateProfile.password}" required="false" maxlength="100" requiredMessage="Por favor, escriba la verificación de su contraseña" />
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
<p:message for="passwordRepeat" />
|
||||
@@ -115,7 +123,7 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selPHC" dropdown="true" value="#{UpdateProfile.primaryHealthCareCenter}" completeMethod="#{UpdateProfile.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.phcList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{phc.name}" />
|
||||
@@ -136,12 +144,12 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selMS" dropdown="true" value="#{UpdateProfile.medicalSpecialty}" completeMethod="#{UpdateProfile.completeMedicalSpecialty}" var="ms"
|
||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.medicalSpecialtiesList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{ms.name}" />
|
||||
</p:column>
|
||||
<p:column headerText="Localización">
|
||||
<p:column headerText="Descripción">
|
||||
<h:outputText value="#{ms.description}" />
|
||||
</p:column>
|
||||
</p:autoComplete>
|
||||
@@ -156,11 +164,12 @@
|
||||
<p:outputLabel value="Médico de familia:" for="FamilyDoc" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<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">
|
||||
<p:autoComplete id="FamilyDoc" readonly="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"
|
||||
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}" />
|
||||
<p:column headerText="Num. Prof.">
|
||||
<h:outputText value="#{fd.id}" />
|
||||
<h:outputText value="#{fd.professionalNumber}" />
|
||||
</p:column>
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{fd.name}" />
|
||||
@@ -171,6 +180,7 @@
|
||||
</p:autoComplete>
|
||||
</div>
|
||||
<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" />
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
@@ -178,7 +188,7 @@
|
||||
<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="frmUpdateProfile" action="#{UpdateProfile.saveData}" icon="pi pi-check" />
|
||||
<p:commandButton validateClient="true" value="Guardar" update="frmUpdateProfile,frmMenu" action="#{UpdateProfile.saveData}" icon="pi pi-check" />
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||
|
||||
@@ -1,38 +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="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,12 +1,57 @@
|
||||
BODY {
|
||||
body {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 1280px !important;
|
||||
min-height: 800px !important;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.background-light-blue {
|
||||
background-image: url("#{resource['images/fondo.png']}");
|
||||
}
|
||||
|
||||
.nopadding {
|
||||
padding: 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;
|
||||
}
|
||||
BIN
1.sources/MyHealth/docroot/resources/images/ANSWERED.png
Normal file
|
After Width: | Height: | Size: 775 B |
9
1.sources/MyHealth/docroot/resources/images/ANSWERED.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?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>
|
||||
|
After Width: | Height: | Size: 696 B |
BIN
1.sources/MyHealth/docroot/resources/images/PENDING.png
Normal file
|
After Width: | Height: | Size: 909 B |
248
1.sources/MyHealth/docroot/resources/images/PENDING.svg
Normal file
@@ -0,0 +1,248 @@
|
||||
<?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>
|
||||
|
After Width: | Height: | Size: 17 KiB |
BIN
1.sources/MyHealth/docroot/resources/images/clock.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
36
1.sources/MyHealth/docroot/resources/images/clock.svg
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
1.sources/MyHealth/docroot/resources/images/fondo.png
Normal file
|
After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 28 KiB |
BIN
1.sources/MyHealth/docroot/resources/images/quote.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
11
1.sources/MyHealth/docroot/resources/images/quote.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?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>
|
||||
|
After Width: | Height: | Size: 438 B |
157
1.sources/MyHealth/docroot/resources/js/common.js
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* Funciones comunes JavaScript para el proyecto MyHealth
|
||||
*/
|
||||
|
||||
/* Configuración de locales para los componentes interfaz de primefaces. Descargado de: https://github.com/primefaces/primefaces/wiki/Locales */
|
||||
/** ******************************************************************************************************************************************* */
|
||||
PrimeFaces.locales['es'] = {
|
||||
closeText : 'Cerrar',
|
||||
prevText : 'Anterior',
|
||||
nextText : 'Siguiente',
|
||||
monthNames : [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ],
|
||||
monthNamesShort : [ 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ],
|
||||
dayNames : [ 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo' ],
|
||||
dayNamesShort : [ 'Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab' ],
|
||||
dayNamesMin : [ 'D', 'L', 'M', 'X', 'J', 'V', 'S' ],
|
||||
weekHeader : 'Semana',
|
||||
firstDayOfWeek : 1,
|
||||
firstDay : 1,
|
||||
isRTL : false,
|
||||
showMonthAfterYear : false,
|
||||
yearSuffix : '',
|
||||
timeOnlyTitle : 'Sólo hora',
|
||||
timeText : 'Tiempo',
|
||||
hourText : 'Hora',
|
||||
minuteText : 'Minuto',
|
||||
secondText : 'Segundo',
|
||||
currentText : 'Fecha actual',
|
||||
today : "Hoy",
|
||||
clear : "Limpiar",
|
||||
ampm : false,
|
||||
month : 'Mes',
|
||||
week : 'Semana',
|
||||
day : 'Día',
|
||||
allDayText : 'Todo el día',
|
||||
messages : { // optional for Client Side Validation
|
||||
'javax.faces.component.UIInput.REQUIRED' : '{0}: Error de validación: se necesita un valor.',
|
||||
'javax.faces.converter.IntegerConverter.INTEGER' : '{2}: \'{0}\' debe ser un número formado por uno o varios dígitos.',
|
||||
'javax.faces.converter.IntegerConverter.INTEGER_detail' : '{2}: \'{0}\' debe ser un número entre -2147483648 y 2147483647. Ejemplo: {1}',
|
||||
'javax.faces.converter.DoubleConverter.DOUBLE' : '{2}: \'{0}\' debe ser un número formado por uno o varios dígitos.',
|
||||
'javax.faces.converter.DoubleConverter.DOUBLE_detail' : '{2}: \'{0}\' debe ser un número entre 4.9E-324 y 1.7976931348623157E308 Ejemplo: {1}',
|
||||
'javax.faces.converter.BigDecimalConverter.DECIMAL' : '{2}: \'{0}\' debe ser un número decimal positivo o negativo.',
|
||||
'javax.faces.converter.BigDecimalConverter.DECIMAL_detail' : '{2}: \'{0}\' debe ser un número decimal positivo o negativo formado por cero o más dígitos, que pueden incluir a continuación una coma decimal y una fracción. Ejemplo: {1}',
|
||||
'javax.faces.converter.BigIntegerConverter.BIGINTEGER' : '{2}: \'{0}\' debe ser un número formado por uno o varios dígitos.',
|
||||
'javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail' : '{2}: \'{0}\' debe ser un número formado por uno o varios dígitos. Ejemplo: {1}',
|
||||
'javax.faces.converter.ByteConverter.BYTE' : '{2}: \'{0}\' debe ser un número entre 0 y 255.',
|
||||
'javax.faces.converter.ByteConverter.BYTE_detail' : '{2}: \'{0}\' debe ser un número entre 0 y 255. Ejemplo: {1}',
|
||||
'javax.faces.converter.CharacterConverter.CHARACTER' : '{1}: \'{0}\' debe ser un carácter válido.',
|
||||
'javax.faces.converter.CharacterConverter.CHARACTER_detail' : '{1}: \'{0}\' debe ser un carácter ASCII válido.',
|
||||
'javax.faces.converter.ShortConverter.SHORT' : '{2}: \'{0}\' debe ser un número formado por uno o varios dígitos.',
|
||||
'javax.faces.converter.ShortConverter.SHORT_detail' : '{2}: \'{0}\' debe ser un número entre -32768 y 32767 Ejemplo: {1}',
|
||||
'javax.faces.converter.BooleanConverter.BOOLEAN' : '{1}: \'{0}\' debe ser \'true\' o \'false\'',
|
||||
'javax.faces.converter.BooleanConverter.BOOLEAN_detail' : '{1}: \'{0}\' debe ser \'true\' o \'false\'. Cualquier valor diferente a \'true\' se evaluará como \'false\'.',
|
||||
'javax.faces.validator.LongRangeValidator.MAXIMUM' : '{1}: Error de validación: el valor es mayor que el máximo permitido de \'{0}\'',
|
||||
'javax.faces.validator.LongRangeValidator.MINIMUM' : '{1}: Error de validación: el valor es inferior que el mínimo permitido de \'{0}\'',
|
||||
'javax.faces.validator.LongRangeValidator.NOT_IN_RANGE' : '{2}: Error de validación: el atributo especificado no está entre los valores esperados {0} y {1}.',
|
||||
'javax.faces.validator.LongRangeValidator.TYPE={0}' : 'Error de validación: el valor no tiene el tipo correcto.',
|
||||
'javax.faces.validator.DoubleRangeValidator.MAXIMUM' : '{1}: Error de validación: el valor es mayor que el máximo permitido de \'{0}\'',
|
||||
'javax.faces.validator.DoubleRangeValidator.MINIMUM' : '{1}: Error de validación: el valor es inferior que el mínimo permitido de \'{0}\'',
|
||||
'javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE' : '{2}: Error de validación: el atributo especificado no está entre los valores esperados {0} y {1}',
|
||||
'javax.faces.validator.DoubleRangeValidator.TYPE={0}' : 'Error de validación: el valor no tiene el tipo correcto.',
|
||||
'javax.faces.converter.FloatConverter.FLOAT' : '{2}: \'{0}\' debe ser un número formado por uno o varios dígitos.',
|
||||
'javax.faces.converter.FloatConverter.FLOAT_detail' : '{2}: \'{0}\' debe ser un número entre 1.4E-45 y 3.4028235E38 Ejemplo: {1}',
|
||||
'javax.faces.converter.DateTimeConverter.DATE' : '{2}: \'{0}\' no se ha podido reconocer como fecha.',
|
||||
'javax.faces.converter.DateTimeConverter.DATE_detail' : '{2}: \'{0}\' no se ha podido reconocer como fecha. Ejemplo: {1}',
|
||||
'javax.faces.converter.DateTimeConverter.TIME' : '{2}: \'{0}\' no se ha podido reconocer como hora.',
|
||||
'javax.faces.converter.DateTimeConverter.TIME_detail' : '{2}: \'{0}\' no se ha podido reconocer como hora. Ejemplo: {1}',
|
||||
'javax.faces.converter.DateTimeConverter.DATETIME' : '{2}: \'{0}\' no se ha podido reconocer como fecha y hora.',
|
||||
'javax.faces.converter.DateTimeConverter.DATETIME_detail' : '{2}: \'{0}\' no se ha podido reconocer como fecha y hora. Ejemplo: {1}',
|
||||
'javax.faces.converter.DateTimeConverter.PATTERN_TYPE' : '{1}: debe especificarse el atributo \'pattern\' o \'type\' para convertir el valor \'{0}\'',
|
||||
'javax.faces.converter.NumberConverter.CURRENCY' : '{2}: \'{0}\' no se ha podido reconocer como un valor de divisa.',
|
||||
'javax.faces.converter.NumberConverter.CURRENCY_detail' : '{2}: \'{0}\' no se ha podido reconocer como un valor de divisa. Ejemplo: {1}',
|
||||
'javax.faces.converter.NumberConverter.PERCENT' : '{2}: \'{0}\' no se ha podido reconocer como porcentaje.',
|
||||
'javax.faces.converter.NumberConverter.PERCENT_detail' : '{2}: \'{0}\' no se ha podido reconocer como porcentaje. Ejemplo: {1}',
|
||||
'javax.faces.converter.NumberConverter.NUMBER' : '{2}: \'{0}\' no se ha podido reconocer como fecha.',
|
||||
'javax.faces.converter.NumberConverter.NUMBER_detail' : '{2}: \'{0}\' no es un número. Ejemplo: {1}',
|
||||
'javax.faces.converter.NumberConverter.PATTERN' : '{2}: \'{0}\' no es un patrón numérico.',
|
||||
'javax.faces.converter.NumberConverter.PATTERN_detail' : '{2}: \'{0}\' no es un patrón numérico. Ejemplo: {1}',
|
||||
'javax.faces.validator.LengthValidator.MINIMUM' : '{1}: Error de validación: el largo es inferior que el mínimo permitido de \'{0}\'',
|
||||
'javax.faces.validator.LengthValidator.MAXIMUM' : '{1}: Error de validación: el largo es mayor que el máximo permitido de \'{0}\'',
|
||||
'javax.faces.validator.RegexValidator.PATTERN_NOT_SET' : 'Se debe establecer el patrón de Regex.',
|
||||
'javax.faces.validator.RegexValidator.PATTERN_NOT_SET_detail' : 'El patrón Regex debe establecerse en un valor no vacío.',
|
||||
'javax.faces.validator.RegexValidator.NOT_MATCHED' : 'El patrón Regex no coincide',
|
||||
'javax.faces.validator.RegexValidator.NOT_MATCHED_detail' : 'El patrón Regex de \'{0}\' no coincide',
|
||||
'javax.faces.validator.RegexValidator.MATCH_EXCEPTION' : 'Error en expresión regular.',
|
||||
'javax.faces.validator.RegexValidator.MATCH_EXCEPTION_detail' : 'Error en expresión regular, \'{0}\'',
|
||||
// optional for bean validation integration in client side validation
|
||||
'javax.faces.validator.BeanValidator.MESSAGE' : '{0}',
|
||||
'javax.validation.constraints.AssertFalse.message' : 'debe ser falso',
|
||||
'javax.validation.constraints.AssertTrue.message' : 'debe ser verdadero',
|
||||
'javax.validation.constraints.DecimalMax.message' : 'debe ser menor que o igual a {0}',
|
||||
'javax.validation.constraints.DecimalMin.message' : 'debe ser mayor que o igual a {0}',
|
||||
'javax.validation.constraints.Digits.message' : 'valor numérico fuera de los límites (se esperaba (<{0} digitos>.<{1} digitos>)',
|
||||
'javax.validation.constraints.Future.message' : 'debe ser una fecha futura',
|
||||
'javax.validation.constraints.Max.message' : 'debe ser menor que o igual a {0}',
|
||||
'javax.validation.constraints.Min.message' : 'debe ser mayor que o igual a {0}',
|
||||
'javax.validation.constraints.NotNull.message' : 'no debe ser nulo',
|
||||
'javax.validation.constraints.Null.message' : 'debe ser nulo',
|
||||
'javax.validation.constraints.Past.message' : 'debe ser una fecha pasada',
|
||||
'javax.validation.constraints.Pattern.message' : 'debe coincidir con "{0}"',
|
||||
'javax.validation.constraints.Size.message' : 'el tamaño debe estar entre {0} y {1}'
|
||||
}
|
||||
};
|
||||
/** * Fin configuración locale de Primefaces ** */
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
function nifCheckClick() {
|
||||
var nif = PF('nif');
|
||||
nif.jq.change();
|
||||
}
|
||||
|
||||
// Actualiza la interfaz tras validar si un nif está duplicado.
|
||||
function handleNIFResponse(xhr, status, args) {
|
||||
var isValid = false;
|
||||
return;
|
||||
|
||||
if (typeof args.validationFailed != "undefined")
|
||||
isValid = !args.validationFailed;
|
||||
else if (typeof args.NIFisValid != "undefined")
|
||||
isValid = args.NIFisValid;
|
||||
|
||||
if (args.formattedNIF) {
|
||||
var nif = PF('nif');
|
||||
nif.jq.val(args.formattedNIF);
|
||||
}
|
||||
|
||||
var nifButton = PF('nifButton');
|
||||
if (isValid == true) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
65
1.sources/MyHealth/docroot/systemAdmin/AddAdmin.xhtml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?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="frmAddAdmin">
|
||||
<p:growl id="mesgsAdd" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="PanelNewAdmin" header="Alta de administradores">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Correo electrónico: " for="email" />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<p:inputText id="email" value="#{AddAdmin.email}" required="true" maxlength="120" validator="emailValidator" 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:validator validatorId="emailValidator" for="email">
|
||||
<f:attribute name="managedBean" value="#{AddAdmin}" />
|
||||
</f:validator>
|
||||
</p:inputText>
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
<p:message for="email" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Contraseña: " for="password" />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<p:password id="password" value="#{AddAdmin.password}" match="passwordRepeat" required="true" maxlength="100" requiredMessage="Por favor, especifique una contraseña"
|
||||
feedback="true" promptLabel="Especifique una contraseña segura" weakLabel="La contraseña es débil" goodLabel="La contraseña es buena" strongLabel="La contraseña es segura"
|
||||
validatorMessage="La contraseña y su verificación deben ser iguales" />
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
<p:message for="password" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Verificación de contraseña: " for="passwordRepeat" />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<p:password id="passwordRepeat" value="#{AddAdmin.password}" required="true" maxlength="100" requiredMessage="Por favor, escriba la verificación de su contraseña" />
|
||||
</div>
|
||||
<div class="ui-g-6">
|
||||
<p:message for="passwordRepeat" />
|
||||
</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="Crear" update="frmAddAdmin" action="#{AddAdmin.insertData}" 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,69 @@
|
||||
<?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" currentPageReportTemplate="Página {currentPage} de {totalPages}"
|
||||
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>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?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 id="CAPsTable" widgetVar="dtCAP" var="cap" value="#{ManageHealthCareCenters.lazyDataModelCAPsList}" editable="true" lazy="true" paginator="true" rows="10"
|
||||
paginatorPosition="bottom" paginatorAlwaysVisible="true" currentPageReportTemplate="Página {currentPage} de {totalPages}"
|
||||
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,30,40">
|
||||
|
||||
<p:ajax event="rowEdit" listener="#{ManageHealthCareCenters.onRowEdit}" update=":frmListCAPs:mesgsList" oncomplete="updateDataTable()"/>
|
||||
<p:ajax event="rowEditCancel" listener="#{ManageHealthCareCenters.onRowCancel}" update=":frmListCAPs:mesgsList" oncomplete="updateDataTable()"/>
|
||||
|
||||
<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:remoteCommand name="updateDataTable" update="CAPsTable" />
|
||||
|
||||
<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,58 +2,84 @@
|
||||
<!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: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="PanelUnderConstruction" header="Pagina en construcción de Administrador">
|
||||
<h:form id="frmListSpecialties">
|
||||
<p:growl id="mesgsList" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="PanelSpecialtiesList" style="margin-bottom: 10px;" header="Gestión de Especialidades">
|
||||
<div class="ui-g ui-fluid">
|
||||
<p:dataTable id="specialtiesTable" widgetVar="dtSpecialty" var="specialty" value="#{ManageSpecialities.lazyDataModelSpecialtiesList}" editable="true" lazy="true" paginator="true" rows="10"
|
||||
paginatorPosition="bottom" paginatorAlwaysVisible="true" currentPageReportTemplate="Página {currentPage} de {totalPages}"
|
||||
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,30,40">
|
||||
|
||||
<p:ajax event="rowEdit" listener="#{ManageSpecialities.onRowEdit}" update=":frmListSpecialties:mesgsList" oncomplete="updateDataTable()"/>
|
||||
<p:ajax event="rowEditCancel" listener="#{ManageSpecialities.onRowCancel}" update=":frmListSpecialties:mesgsList" oncomplete="updateDataTable()"/>
|
||||
|
||||
<p:column headerText="Nombre">
|
||||
<p:cellEditor>
|
||||
<f:facet name="output"><h:outputText value="#{specialty.name}" /></f:facet>
|
||||
<f:facet name="input"><p:inputText value="#{specialty.name}" style="width:100%" label="Nombre"/></f:facet>
|
||||
</p:cellEditor>
|
||||
</p:column>
|
||||
|
||||
<p:column headerText="Descripción">
|
||||
<p:cellEditor>
|
||||
<f:facet name="output"><h:outputText value="#{specialty.description}" /></f:facet>
|
||||
<f:facet name="input"><p:inputText value="#{specialty.description}" style="width:100%" label="Descripció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="#{ManageSpecialities.deleteDataById(specialty.id)}" update=":frmListSpecialties:mesgsList frmListSpecialties">
|
||||
<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('dtSpecialty').getPaginator().setPage(0);" />
|
||||
</f:facet>
|
||||
</p:dataTable>
|
||||
|
||||
<p:remoteCommand name="updateDataTable" update="specialtiesTable" />
|
||||
|
||||
<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>
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel for="campo" value="Etiqueta para campo de formulario:" />
|
||||
<h:form id="frmAddSpecialties">
|
||||
<p:growl id="mesgsAdd" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="PanelNewSpecialty" header="Alta de Especialidades">
|
||||
<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-4 ui-md-4">
|
||||
<p:inputText id="campo" value="Valor del campo del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:inputText id="nameNew" value="#{ManageSpecialities.name}" readonly="false" required="ManageSpecialities.medicalSpecialty.name eq null"
|
||||
requiredMessage="Es necesario un nombre" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:message for="campo" display="text" />
|
||||
<div class="ui-g-1 ui-md-1">
|
||||
<p:outputLabel value="Descripción: " for="descriptionNew" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel for="campo2" value="Etiqueta para campo 2 de formulario:" />
|
||||
<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-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 class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-2 ui-md-2 ">
|
||||
<p:commandButton validateClient="true" value="Crear" update="mesgsAdd frmListSpecialties frmAddSpecialties" action="#{ManageSpecialities.insertData}" icon="pi pi-check" />
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
</html>
|
||||
87
1.sources/MyHealth/docroot/visit/AddVisit.xhtml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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-6">
|
||||
<p:inputText id="paciente" value="#{AddVisit.patient.displayName}" readonly="true" />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<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-6">
|
||||
<p:inputText id="medico" value="#{AddVisit.familyDoctorDisplayName}" readonly="true" required="true" requiredMessage="Dese tener asignado un médico de familia. Por favor, cambie su médico de familia." />
|
||||
</div>
|
||||
<div class="ui-g-4">
|
||||
<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" locale="es" 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" locale="es" 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>
|
||||
107
1.sources/MyHealth/docroot/visit/PatientVisitList.xhtml
Normal file
@@ -0,0 +1,107 @@
|
||||
<?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: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>
|
||||
<p:panel id="panelAgenda" 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" locale="es" 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" currentPageReportTemplate="Página {currentPage} de {totalPages}"
|
||||
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" rendered="#{not PatientVisitList.admin}">
|
||||
<p:commandButton value="Anular" action="#{PatientVisitList.removeVisit(v.id)}" update="frmPatientVisitList" icon="pi pi-calendar-times" styleClass="red-button">
|
||||
<p:confirm header="Eliminar" message="¿Está seguro de que quiere eliminar la visita?" icon="pi pi-exclamation-triangle" />
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
|
||||
<p:column headerText="Editar" width="100">
|
||||
<p:commandButton value="Editar" 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>
|
||||
101
1.sources/MyHealth/docroot/visit/UpdateVisit.xhtml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?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">
|
||||
<p:outputPanel rendered="#{UpdateVisit.infoMessage != null}" styleClass="ui-g-12">
|
||||
<p:staticMessage rendered="#{UpdateVisit.infoMessage != null}" summary="Información adicional:" detail="#{UpdateVisit.infoMessage}" severity="info" />
|
||||
</p:outputPanel>
|
||||
|
||||
<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" locale="es" disabled="#{UpdateVisit.readOnly}" showIcon="true" showButtonBar="true"
|
||||
autocomplete="true" required="true" requiredMessage="Especifique la fecha de la visita." readonly="#{UpdateVisit.readOnly}">
|
||||
<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" locale="es" disabled="#{UpdateVisit.readOnly}" showIcon="true" showButtonBar="true"
|
||||
autocomplete="true" required="true" requiredMessage="Especifique la hora de la visita." readonly="#{UpdateVisit.readOnly}">
|
||||
<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="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="#{UpdateVisit.result}" readonly="#{UpdateVisit.resultReadOnly}" />
|
||||
</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>
|
||||
87
1.sources/MyHealth/docroot/visit/VisitList.xhtml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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="panelAngenda" 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" locale="es" 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" currentPageReportTemplate="Página {currentPage} de {totalPages}"
|
||||
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="Editar" width="100px;">
|
||||
<p:commandButton value="Editar" 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,52 +2,91 @@
|
||||
<!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:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
|
||||
<f:viewParam name="id" value="#{VisitView.id}" required="true" />
|
||||
<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="PanelUnderConstruction" header="Pagina en construcción de Visitas">
|
||||
<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-4 ui-md-4">
|
||||
<p:outputLabel for="campo" value="Etiqueta para campo de formulario:" />
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel for="paciente" value="Paciente:" />
|
||||
</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 class="ui-g-8">
|
||||
<p:inputText id="paciente" value="#{VisitView.patient.displayName}" readonly="true" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:message for="campo" display="text" />
|
||||
<div class="ui-g-2">
|
||||
<p:message for="paciente" display="text" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel for="campo2" value="Etiqueta para campo 2 de formulario:" />
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel for="medico" value="Médico de familia:" />
|
||||
</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 class="ui-g-8">
|
||||
<p:inputText id="medico" value="#{VisitView.familyDoctor.displayName}" readonly="true" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:message for="campo" display="text" />
|
||||
<div class="ui-g-2">
|
||||
<p:message for="medico" display="text" />
|
||||
</div>
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel for="campo3" value="Etiqueta para campo 3 de formulario:" />
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel for="fecha" value="Fecha:" />
|
||||
</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 class="ui-g-2">
|
||||
<div class="ui-inputgroup">
|
||||
<p:datePicker id="fecha" value="#{VisitView.date}" pattern="dd/MM/yyyy" locale="es" 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 class="ui-g-4 ui-md-4">
|
||||
<p:message for="campo" display="text" />
|
||||
<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="#{VisitView.time}" timeOnly="true" locale="es" 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 class="ui-g-12 ui-g-nopad">
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-2 ui-md-2 ">
|
||||
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{BeanName.actionMethod}" icon="pi pi-check" />
|
||||
<p:commandButton value="Editar" action="#{VisitView.editVisit(VisitView.id)}" icon="pi pi-time" />
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||
<p:button value="Volver" outcome="#{VisitView.fromPage}" icon="pi pi-home" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
|
||||
13
1.sources/MyHealth/ecosystem.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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,13 +1,15 @@
|
||||
<application>
|
||||
<display-name>MyHealth</display-name>
|
||||
<module>
|
||||
<web>
|
||||
<web-uri>MyHealth.war</web-uri>
|
||||
<context-root>/MyHealth</context-root>
|
||||
</web>
|
||||
</module>
|
||||
<module>
|
||||
<ejb>MyHealth.jar</ejb>
|
||||
</module>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
|
||||
<application-name>MyHealth</application-name>
|
||||
<display-name>MyHealth</display-name>
|
||||
<module>
|
||||
<web>
|
||||
<web-uri>MyHealth.war</web-uri>
|
||||
<context-root>/MyHealth</context-root>
|
||||
</web>
|
||||
</module>
|
||||
<module>
|
||||
<ejb>MyHealth.jar</ejb>
|
||||
</module>
|
||||
</application>
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class FamilyDoctorTO implements Serializable {
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return String.format("[%d] %s %s", this.id, this.name, this.surname);
|
||||
return String.format("[%s] %s %s", this.professionalNumber, this.name, this.surname);
|
||||
}
|
||||
|
||||
public PrimaryHealthCareCenterTO getPrimaryHealthCareCenter() {
|
||||
|
||||
@@ -18,20 +18,21 @@ public class LoggedUserTO implements Serializable {
|
||||
private String id;
|
||||
private String password;
|
||||
private String name;
|
||||
private String displayName;
|
||||
private UserType userType;
|
||||
|
||||
public LoggedUserTO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public LoggedUserTO(String usrId, String usrName, String usrPwd, UserType usrType) {
|
||||
|
||||
public LoggedUserTO(String usrId, String usrName, String usrPwd, UserType usrType, String dispName) {
|
||||
id = usrId;
|
||||
name = usrName;
|
||||
password = usrPwd;
|
||||
userType = usrType;
|
||||
|
||||
displayName = dispName;
|
||||
}
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -60,8 +61,16 @@ public class LoggedUserTO implements Serializable {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(UserType userType) {
|
||||
this.userType = userType;
|
||||
public void setUserType(UserType value) {
|
||||
this.userType = value;
|
||||
}
|
||||
|
||||
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)
|
||||
*
|
||||
*/
|
||||
@XmlRootElement(name = "medicalspeciality")
|
||||
@XmlRootElement(name = "medicalSpecialty")
|
||||
public class MedicalSpecialtyTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package TO;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import common.MedicalTestType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
* @author Roberto Orden Erena <rorden@uoc.edu>
|
||||
*
|
||||
*/
|
||||
@XmlRootElement(name = "MedicalTest")
|
||||
@@ -14,10 +18,102 @@ public class MedicalTestTO implements Serializable {
|
||||
|
||||
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() {
|
||||
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,8 +4,6 @@ import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import jpa.FamilyDoctorJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
@@ -90,6 +88,10 @@ public class PatientTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return String.format("[%s] %s %s", this.personalIdentificationCode, this.name, this.surname);
|
||||
}
|
||||
|
||||
public FamilyDoctorTO getFamilyDoctor() {
|
||||
return familyDoctor;
|
||||
}
|
||||
|
||||
118
1.sources/MyHealth/src/TO/QuestionTO.java
Normal file
@@ -0,0 +1,118 @@
|
||||
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,6 +85,10 @@ public class SpecialistDoctorTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return String.format("[%s] %s %s", this.professionalNumber, this.name, this.surname);
|
||||
}
|
||||
|
||||
public MedicalSpecialtyTO getMedicalSpecialty() {
|
||||
return medicalSpecialty;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
*
|
||||
* 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")
|
||||
* = "medicalspecialty")
|
||||
*
|
||||
* @author mark
|
||||
*
|
||||
@@ -19,11 +19,33 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
public class SystemAdminTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String email;
|
||||
private String password;
|
||||
|
||||
public SystemAdminTO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SystemAdminTO(String email, String password) {
|
||||
this.email = email;
|
||||
this.setPassword(password);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
package TO;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
|
||||
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 = "medicalspecialty")
|
||||
*
|
||||
* @author mark
|
||||
*
|
||||
*/
|
||||
@XmlRootElement(name = "Visit")
|
||||
public class VisitTO implements Serializable {
|
||||
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Integer id;
|
||||
private Date date;
|
||||
private Time time;
|
||||
private LocalDate date;
|
||||
private LocalTime time;
|
||||
private String observations;
|
||||
private String result;
|
||||
private FamilyDoctorTO familyDoctor;
|
||||
@@ -34,42 +29,71 @@ public class VisitTO implements Serializable {
|
||||
public VisitTO() {
|
||||
super();
|
||||
}
|
||||
public VisitTO(Integer id, Date date, Time time, String observation, String result) {
|
||||
this.setId(id);
|
||||
this.date=date;
|
||||
//this.time
|
||||
|
||||
public VisitTO(Integer Id, LocalDate date, LocalTime time, String observations, String result, FamilyDoctorTO fd, PatientTO pat) {
|
||||
this.id = Id;
|
||||
this.date = date;
|
||||
this.time = time;
|
||||
this.observations = observations;
|
||||
this.result = result;
|
||||
this.familyDoctor = fd;
|
||||
this.patient = pat;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id=id;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
|
||||
public LocalDate getDate() {
|
||||
return this.date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date=date;
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public Time getTime() {
|
||||
|
||||
public LocalTime getTime() {
|
||||
return this.time;
|
||||
}
|
||||
|
||||
public void setTime(Time time) {
|
||||
this.time=time;
|
||||
|
||||
public void setTime(LocalTime time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
|
||||
public String getObservations() {
|
||||
return this.observations;
|
||||
}
|
||||
|
||||
|
||||
public void setObservations(String observations) {
|
||||
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,7 +6,9 @@ package common;
|
||||
*
|
||||
*/
|
||||
public class Constants {
|
||||
public static final int MAX_ITEMS_AUTOCOMPLETE_SEARCH = 200;
|
||||
public static final int MAX_ITEMS_AUTOCOMPLETE_SEARCH = 20;
|
||||
public static final String PROFESSIONAL_NUMBER_PREFIX = "PRO#";
|
||||
public static final String PERSONAL_IDENTIFICATION_CODE_PREFIX = "PAT#";
|
||||
|
||||
public static final int DEFAULT_TABLE_GRID_PAGE_SIZE = 20;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package common;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
@@ -18,8 +19,8 @@ public class HashUtils {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(stringValue.getBytes());
|
||||
digest = md.digest();
|
||||
} catch (Exception ex) {
|
||||
// TODO: Register exception to log.
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
return (DatatypeConverter.printHexBinary(digest).toUpperCase());
|
||||
|
||||
@@ -5,12 +5,12 @@ package common;
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
*
|
||||
*/
|
||||
public enum TestType {
|
||||
public enum MedicalTestType {
|
||||
MAGNETIC_RESONANCE_IMAGING("Imagen por Resonancia Magnética"), CT_SCAN("Tomografía Áxial Computerizada"), BLOOD_TEST("Análisis de sangre");
|
||||
|
||||
private String testTypeName;
|
||||
|
||||
private TestType(String typeName) {
|
||||
private MedicalTestType(String typeName) {
|
||||
this.testTypeName = typeName;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package common;
|
||||
*
|
||||
*/
|
||||
public enum QuestionStatus {
|
||||
ANSWERED("Respondida"), PENDING("Pendiente");
|
||||
ANSWERED("Respondida"), PENDING("Pendiente"), NEW("New");
|
||||
|
||||
private String questionStatusName;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package common;
|
||||
|
||||
import java.text.Normalizer;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -11,9 +12,18 @@ public class Utils {
|
||||
public static String stripAccents(String input) {
|
||||
return input == null ? null : Normalizer.normalize(input, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
|
||||
}
|
||||
|
||||
|
||||
public static String normalizeTerm(String input) {
|
||||
//return stripAccents(input).toLowerCase();
|
||||
// return stripAccents(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,23 +6,33 @@ import java.util.List;
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.jboss.security.auth.spi.Users.User;
|
||||
|
||||
import TO.FamilyDoctorTO;
|
||||
import TO.MedicalSpecialtyTO;
|
||||
import TO.MedicalTestTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.QuestionTO;
|
||||
import TO.SpecialistDoctorTO;
|
||||
import TO.SystemAdminTO;
|
||||
import TO.VisitTO;
|
||||
import common.Utils;
|
||||
import jpa.FamilyDoctorJPA;
|
||||
import jpa.MedicalSpecialtyJPA;
|
||||
import jpa.MedicalTestJPA;
|
||||
import jpa.PatientJPA;
|
||||
import jpa.PrimaryHealthCareCenterJPA;
|
||||
import jpa.QuestionJPA;
|
||||
import jpa.SpecialistDoctorJPA;
|
||||
import jpa.SystemAdminJPA;
|
||||
import jpa.VisitJPA;
|
||||
|
||||
/***
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
*
|
||||
*/
|
||||
@Stateless
|
||||
public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
// Persistence Unit Context
|
||||
@@ -30,24 +40,44 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
private EntityManager entman;
|
||||
|
||||
/**
|
||||
* Metodo que devuelve todas las especialidades medicas
|
||||
* Metodo que devuelve todas las especialidades medicas registradas en el
|
||||
* sistema
|
||||
*
|
||||
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
|
||||
*/
|
||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialities() {
|
||||
return this.listMedicalSpecialitiesPaged(0, 0);
|
||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialties() {
|
||||
return this.listMedicalSpecialtiesPaged(0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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) {
|
||||
return listMedicalSpecialitiesFiltered(null, pageNumber, pageSize);
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialtiesPaged(int pageNumber, int pageSize) {
|
||||
return listMedicalSpecialtiesFiltered(null, pageNumber, pageSize);
|
||||
}
|
||||
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int 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> listMedicalSpecialtiesFiltered(String searchTerm, int pageNumber, int pageSize) {
|
||||
String strQuery = "SELECT ms from MedicalSpecialtyJPA ms %s order by ms.name, ms.description";
|
||||
String strFilter = "";
|
||||
if (searchTerm == null)
|
||||
@@ -59,7 +89,8 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
strFilter = "WHERE lower(ms.name) LIKE :searchTerm OR lower(ms.description) LIKE :searchTerm";
|
||||
}
|
||||
|
||||
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery(String.format(strQuery, strFilter), MedicalSpecialtyJPA.class);
|
||||
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery(String.format(strQuery, strFilter),
|
||||
MedicalSpecialtyJPA.class);
|
||||
|
||||
if (searchTerm.length() > 0)
|
||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
||||
@@ -79,14 +110,41 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
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() {
|
||||
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) {
|
||||
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) {
|
||||
String strQuery = "SELECT phc from PrimaryHealthCareCenterJPA phc %s order by phc.name, phc.location";
|
||||
String strFilter = "";
|
||||
@@ -99,7 +157,8 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
strFilter = "WHERE lower(phc.name) LIKE :searchTerm OR lower(phc.location) LIKE :searchTerm";
|
||||
}
|
||||
|
||||
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery(String.format(strQuery, strFilter), PrimaryHealthCareCenterJPA.class);
|
||||
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery(String.format(strQuery, strFilter),
|
||||
PrimaryHealthCareCenterJPA.class);
|
||||
|
||||
if (searchTerm.length() > 0)
|
||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
||||
@@ -119,14 +178,42 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
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() {
|
||||
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) {
|
||||
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) {
|
||||
String strQuery = "SELECT fd FROM FamilyDoctorJPA fd %s order by fd.name, fd.surname";
|
||||
String strFilter = "";
|
||||
@@ -139,7 +226,8 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
strFilter = "WHERE lower(fd.name) LIKE :searchTerm OR lower(fd.surname) LIKE :searchTerm";
|
||||
}
|
||||
|
||||
TypedQuery<FamilyDoctorJPA> query = entman.createQuery(String.format(strQuery, strFilter), FamilyDoctorJPA.class);
|
||||
TypedQuery<FamilyDoctorJPA> query = entman.createQuery(String.format(strQuery, strFilter),
|
||||
FamilyDoctorJPA.class);
|
||||
|
||||
if (searchTerm.length() > 0)
|
||||
query.setParameter("searchTerm", "%" + searchTerm + "%");
|
||||
@@ -158,118 +246,408 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
||||
|
||||
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) {
|
||||
MedicalSpecialtyTO msTO = null;
|
||||
|
||||
|
||||
if (ms != null) {
|
||||
msTO = new MedicalSpecialtyTO(ms.getId(), ms.getName(), ms.getDescription());
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
PrimaryHealthCareCenterTO phcTO = null;
|
||||
|
||||
|
||||
if (phc != null) {
|
||||
phcTO = new PrimaryHealthCareCenterTO(phc.getId(), phc.getName(), phc.getLocation());
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
SpecialistDoctorTO sdTO = null;
|
||||
|
||||
|
||||
if (sd != null) {
|
||||
MedicalSpecialtyJPA ms = null;
|
||||
if (nestedProps > 0)
|
||||
ms = sd.getMedicalSpecialty();
|
||||
|
||||
nestedProps--;
|
||||
sdTO = new SpecialistDoctorTO(sd.getId(), sd.getProfessionalNumber(), sd.getNif(), sd.getName(), sd.getSurname(), sd.getPassword(), sd.getEmail(), this.getPOJOforMedicalSpecialtyJPA(ms));
|
||||
|
||||
nestedProps--;
|
||||
sdTO = new SpecialistDoctorTO(sd.getId(), sd.getProfessionalNumber(), sd.getNif(), sd.getName(),
|
||||
sd.getSurname(), sd.getPassword(), sd.getEmail(), this.getPOJOforMedicalSpecialtyJPA(ms));
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
|
||||
if (fd != null) {
|
||||
PrimaryHealthCareCenterJPA phc = null;
|
||||
if (nestedProps > 0)
|
||||
phc = fd.getPrimaryHealthCareCenter();
|
||||
|
||||
|
||||
nestedProps--;
|
||||
fdTO = new FamilyDoctorTO(fd.getId(), fd.getProfessionalNumber(), fd.getNif(), fd.getName(), fd.getSurname(), fd.getPassword(), fd.getEmail(), this.getPOJOforPrimaryHealthCareCenterJPA(phc));
|
||||
fdTO = new FamilyDoctorTO(fd.getId(), fd.getProfessionalNumber(), fd.getNif(), fd.getName(),
|
||||
fd.getSurname(), fd.getPassword(), fd.getEmail(), this.getPOJOforPrimaryHealthCareCenterJPA(phc));
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
PatientTO paTO = null;
|
||||
|
||||
|
||||
if (pat != null) {
|
||||
FamilyDoctorJPA fd = null;
|
||||
if (nestedProps > 0)
|
||||
fd = pat.getFamilyDoctor();
|
||||
|
||||
|
||||
nestedProps--;
|
||||
paTO = new PatientTO(pat.getId(), pat.getPersonalIdentificationCode(), pat.getNif(), pat.getName(), pat.getSurname(), pat.getPassword(), pat.getEmail(), this.getPOJOforFamilyDoctorJPA(fd, nestedProps));
|
||||
paTO = new PatientTO(pat.getId(), pat.getPersonalIdentificationCode(), pat.getNif(), pat.getName(),
|
||||
pat.getSurname(), pat.getPassword(), pat.getEmail(),
|
||||
this.getPOJOforFamilyDoctorJPA(fd, nestedProps));
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
// Recuperamos propiedades anidadas 1 nivel!
|
||||
return this.getPOJOforPatientJPA(entman.find(PatientJPA.class, patientId), 1);
|
||||
}
|
||||
|
||||
|
||||
public PatientJPA findPatientByCode(String code) {
|
||||
TypedQuery<PatientJPA> query = entman.createQuery("from PatientJPA pat where pat.personalIdentificationCode=:code", PatientJPA.class);
|
||||
|
||||
/**
|
||||
* Método que recupera un paciente a partir de su CIP (Código de Identificación
|
||||
* de Paciente)
|
||||
*
|
||||
* @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);
|
||||
|
||||
|
||||
List<PatientJPA> results = query.getResultList();
|
||||
if (results.size() > 0)
|
||||
return results.get(0);
|
||||
return this.getPOJOforPatientJPA(results.get(0), 1);
|
||||
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) {
|
||||
return this.getPOJOforFamilyDoctorJPA(entman.find(FamilyDoctorJPA.class, ProfessionalNumberId), 1);
|
||||
}
|
||||
|
||||
public FamilyDoctorJPA findFamilyDoctorByCode(String code) {
|
||||
TypedQuery<FamilyDoctorJPA> query = entman.createQuery("from FamilyDoctorJPA d where d.professionalNumber=:code", FamilyDoctorJPA.class);
|
||||
|
||||
/**
|
||||
* Método que recupera un médico de familia a partir de su NP (Número de
|
||||
* 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);
|
||||
|
||||
|
||||
List<FamilyDoctorJPA> results = query.getResultList();
|
||||
if (results.size() > 0)
|
||||
return results.get(0);
|
||||
return this.getPOJOforFamilyDoctorJPA(results.get(0), 1);
|
||||
else
|
||||
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) {
|
||||
return this.getPOJOforSpecialistDoctorJPA(entman.find(SpecialistDoctorJPA.class, ProfessionalNumberId), 1);
|
||||
}
|
||||
|
||||
public SpecialistDoctorJPA findSpecialistDoctorByCode(String code) {
|
||||
TypedQuery<SpecialistDoctorJPA> query = entman.createQuery("from SpecialistDoctorJPA d where d.professionalNumber=:code", SpecialistDoctorJPA.class);
|
||||
|
||||
/**
|
||||
* Método que recupera un médico especialista a partir de su NP (Número de
|
||||
* 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);
|
||||
|
||||
|
||||
List<SpecialistDoctorJPA> results = query.getResultList();
|
||||
if (results.size() > 0)
|
||||
return results.get(0);
|
||||
return this.getPOJOforSpecialistDoctorJPA(results.get(0), 1);
|
||||
else
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemAdminTO getPOJOforSystemAdminJPA(SystemAdminJPA admin) {
|
||||
SystemAdminTO adminTO = null;
|
||||
|
||||
if (admin != null) {
|
||||
adminTO = new SystemAdminTO(admin.getEmail(), admin.getPassword());
|
||||
}
|
||||
|
||||
return adminTO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
package ejb.common;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import TO.FamilyDoctorTO;
|
||||
import TO.MedicalSpecialtyTO;
|
||||
import TO.MedicalTestTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.QuestionTO;
|
||||
import TO.SpecialistDoctorTO;
|
||||
import TO.SystemAdminTO;
|
||||
import TO.VisitTO;
|
||||
import jpa.SystemAdminJPA;
|
||||
import jpa.FamilyDoctorJPA;
|
||||
import jpa.MedicalSpecialtyJPA;
|
||||
import jpa.MedicalTestJPA;
|
||||
import jpa.PatientJPA;
|
||||
import jpa.PrimaryHealthCareCenterJPA;
|
||||
import jpa.QuestionJPA;
|
||||
import jpa.SpecialistDoctorJPA;
|
||||
import jpa.VisitJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -24,11 +31,11 @@ import jpa.SpecialistDoctorJPA;
|
||||
@Local
|
||||
public interface CommonFacadeLocal {
|
||||
|
||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialities();
|
||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialties();
|
||||
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize);
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialtiesPaged(int pageNumber, int pageSize);
|
||||
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize);
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialtiesFiltered(String searchTerm, int pageNumber, int pageSize);
|
||||
|
||||
public List<PrimaryHealthCareCenterTO> listAllCAPs();
|
||||
|
||||
@@ -42,17 +49,27 @@ public interface CommonFacadeLocal {
|
||||
|
||||
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 PatientJPA findPatientByCode(String code);
|
||||
public PatientTO findPatientByCode(String code);
|
||||
|
||||
public PatientTO findPatientByNif(String searchValue);
|
||||
|
||||
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId);
|
||||
|
||||
public FamilyDoctorJPA findFamilyDoctorByCode(String code);
|
||||
public FamilyDoctorTO findFamilyDoctorByCode(String code);
|
||||
|
||||
public FamilyDoctorTO findFamilyDoctorByNif(String searchValue);
|
||||
|
||||
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId);
|
||||
|
||||
public SpecialistDoctorJPA findSpecialistDoctorByCode(String code);
|
||||
public SpecialistDoctorTO findSpecialistDoctorByCode(String code);
|
||||
|
||||
public SpecialistDoctorTO findSpecialistDoctorByNif(String searchValue);
|
||||
|
||||
public MedicalSpecialtyTO getPOJOforMedicalSpecialtyJPA(MedicalSpecialtyJPA ms);
|
||||
|
||||
@@ -64,4 +81,11 @@ public interface CommonFacadeLocal {
|
||||
|
||||
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);
|
||||
|
||||
public SystemAdminTO getPOJOforSystemAdminJPA(SystemAdminJPA admin);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package ejb.common;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
@@ -10,9 +9,6 @@ import TO.MedicalSpecialtyTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.SpecialistDoctorTO;
|
||||
import jpa.FamilyDoctorJPA;
|
||||
import jpa.PatientJPA;
|
||||
import jpa.SpecialistDoctorJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -22,11 +18,11 @@ import jpa.SpecialistDoctorJPA;
|
||||
@Remote
|
||||
public interface CommonFacadeRemote {
|
||||
|
||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialities();
|
||||
public List<MedicalSpecialtyTO> listAllMedicalSpecialties();
|
||||
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize);
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialtiesPaged(int pageNumber, int pageSize);
|
||||
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize);
|
||||
public List<MedicalSpecialtyTO> listMedicalSpecialtiesFiltered(String searchTerm, int pageNumber, int pageSize);
|
||||
|
||||
public List<PrimaryHealthCareCenterTO> listAllCAPs();
|
||||
|
||||
@@ -40,16 +36,26 @@ public interface CommonFacadeRemote {
|
||||
|
||||
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 PatientJPA findPatientByCode(String code);
|
||||
public PatientTO findPatientByCode(String code);
|
||||
|
||||
public PatientTO findPatientByNif(String searchValue);
|
||||
|
||||
public FamilyDoctorTO findFamilyDoctorById(int ProfessionalNumberId);
|
||||
|
||||
public FamilyDoctorJPA findFamilyDoctorByCode(String code);
|
||||
public FamilyDoctorTO findFamilyDoctorByCode(String code);
|
||||
|
||||
public FamilyDoctorTO findFamilyDoctorByNif(String searchValue);
|
||||
|
||||
public SpecialistDoctorTO findSpecialistDoctorById(int ProfessionalNumberId);
|
||||
|
||||
public SpecialistDoctorJPA findSpecialistDoctorByCode(String code);
|
||||
public SpecialistDoctorTO findSpecialistDoctorByCode(String code);
|
||||
|
||||
public SpecialistDoctorTO findSpecialistDoctorByNif(String searchValue);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +1,408 @@
|
||||
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.persistence.EntityManager;
|
||||
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 persistencia.
|
||||
* 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
|
||||
* persistencia.
|
||||
*
|
||||
* @author mark
|
||||
* Tanto los pacientes como los médicos deben acceder a la vista de pruebas médicas.
|
||||
*
|
||||
* @author rorden
|
||||
*
|
||||
*/
|
||||
@Stateless
|
||||
public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
|
||||
|
||||
// Persistence Unit Context
|
||||
@PersistenceContext(unitName = "MyHealth")
|
||||
private EntityManager entman;
|
||||
EntityManager entman;
|
||||
|
||||
public void ejbMethod(String parameter) {
|
||||
|
||||
@EJB
|
||||
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 getSpecialistDoctorByMedicalSpecialtyCount(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> findSpecialistDoctorByMedicalSpecialty(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,18 +1,137 @@
|
||||
package ejb.medicalTest;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
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 mark
|
||||
* @author rorden
|
||||
*
|
||||
*/
|
||||
@Remote
|
||||
public interface MedicalTestFacadeRemote {
|
||||
|
||||
// *********************************************************************
|
||||
// QUESTION RESPONSE
|
||||
|
||||
/**
|
||||
* Definimos la interfaz remota
|
||||
* Realizar una pregunta al médico por un paciente
|
||||
*
|
||||
* @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 void ejbMethod(String parameter);
|
||||
public String askQuestion(int userID, String title, String message);
|
||||
|
||||
/**
|
||||
* 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 getSpecialistDoctorByMedicalSpecialtyCount(int specialityId);
|
||||
|
||||
/**
|
||||
* Listar médicos con una especialidad concreta
|
||||
*
|
||||
* @param speciality
|
||||
*/
|
||||
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpecialty(int specialityId, int pageNumber, int pageSize);
|
||||
}
|
||||
@@ -32,19 +32,42 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
@PersistenceContext(unitName = "MyHealth")
|
||||
private EntityManager entman;
|
||||
|
||||
//Propiedad que permite el acceso local a los métodos del EJB de servicios comunes (para recuperar entidades, etc).
|
||||
@EJB
|
||||
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() {
|
||||
Query q = entman.createNativeQuery("select nextval('myhealth.profesionalnumber')");
|
||||
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() {
|
||||
Query q = entman.createNativeQuery("select nextval('myhealth.profesionalnumber')");
|
||||
Query q = entman.createNativeQuery("select nextval('myhealth.codigoidentificacionpaciente')");
|
||||
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 {
|
||||
PatientJPA pat = entman.find(PatientJPA.class, patientId);
|
||||
if (pat == null) {
|
||||
@@ -63,16 +86,38 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
||||
}
|
||||
|
||||
public PatientTO registerPatient(int id, String nif, String name, String surname, String password, String email) {
|
||||
PatientTO paTO = null;
|
||||
|
||||
/**
|
||||
* 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(String nif, String name, String surname, String password, String email) {
|
||||
PatientJPA pat = new PatientJPA(this.getNextPersonalIdentificationCode(), nif, name, surname, HashUtils.hashMD5(password), email, null);
|
||||
entman.persist(pat);
|
||||
|
||||
return this.commonServices.getPOJOforPatientJPA(pat, 1);
|
||||
}
|
||||
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(int id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty)
|
||||
/**
|
||||
* 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(String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty)
|
||||
throws Exception {
|
||||
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, specialty.getId());
|
||||
if (ms == null) {
|
||||
@@ -85,9 +130,20 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return this.commonServices.getPOJOforSpecialistDoctorJPA(sd, 1);
|
||||
}
|
||||
|
||||
public FamilyDoctorTO registerFamilyDoctor(int id, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO cap) throws Exception {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
/**
|
||||
* 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(String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO cap) throws Exception {
|
||||
PrimaryHealthCareCenterJPA phcC = entman.find(PrimaryHealthCareCenterJPA.class, cap.getId());
|
||||
if (phcC == null) {
|
||||
throw new Exception("No se encuentra el centro de atención primaria con identificador: " + cap.getName());
|
||||
@@ -99,6 +155,18 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
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 {
|
||||
PatientJPA pat = entman.find(PatientJPA.class, id);
|
||||
|
||||
@@ -119,6 +187,20 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
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)
|
||||
throws Exception {
|
||||
SpecialistDoctorJPA sd = entman.find(SpecialistDoctorJPA.class, id);
|
||||
@@ -145,6 +227,20 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
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 {
|
||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, id);
|
||||
if (fd == null) {
|
||||
@@ -170,9 +266,18 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
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 {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, professionalId);
|
||||
if (fd == null) {
|
||||
throw new Exception("No se encuentra en la base de datos ningún médico de familia con id: " + String.valueOf(professionalId));
|
||||
|
||||
@@ -18,11 +18,11 @@ public interface ProfileFacadeRemote {
|
||||
|
||||
public PatientTO changeFamilyDoctor(int id, int newDoctor) throws Exception;
|
||||
|
||||
public PatientTO registerPatient(int id, String nif, String name, String surname, String password, String email);
|
||||
public PatientTO registerPatient(String nif, String name, String surname, String password, String email);
|
||||
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(int id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty) throws Exception;
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty) throws Exception;
|
||||
|
||||
public FamilyDoctorTO registerFamilyDoctor(int id, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO cap) throws Exception;
|
||||
public FamilyDoctorTO registerFamilyDoctor(String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterTO cap) throws Exception;
|
||||
|
||||
public PatientTO updatePatientData(int id, String nif, String name, String surname, String password, String email) throws Exception;
|
||||
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
package ejb.systemAdmin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.EJB;
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import TO.FamilyDoctorTO;
|
||||
import TO.LoggedUserTO;
|
||||
import TO.MedicalSpecialtyTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.SpecialistDoctorTO;
|
||||
import TO.SystemAdminTO;
|
||||
import common.Constants;
|
||||
import common.HashUtils;
|
||||
import common.UserType;
|
||||
import ejb.common.CommonFacadeLocal;
|
||||
import jpa.AdministratorJPA;
|
||||
import jpa.SystemAdminJPA;
|
||||
import jpa.FamilyDoctorJPA;
|
||||
import jpa.PatientJPA;
|
||||
import jpa.SpecialistDoctorJPA;
|
||||
import jpa.MedicalSpecialtyJPA;
|
||||
import jpa.PrimaryHealthCareCenterJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
* @author David Álvarez González (dalvarezgon@uoc.edu)
|
||||
*
|
||||
*/
|
||||
@Stateless
|
||||
@@ -29,55 +39,54 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
||||
|
||||
@EJB
|
||||
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 correcta devuelve null, sino devuelve un POJO con datos del usuario logeado.
|
||||
*
|
||||
* La autenticación se realiza en 2 pasos:
|
||||
*
|
||||
* 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 de email que comienza por caracteres del
|
||||
* identificaodr de paciente o 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
|
||||
* de email que comienza por caracteres del identificador 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 correcta.
|
||||
* 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 completa y es
|
||||
* correcta.
|
||||
*/
|
||||
public LoggedUserTO login(String userCode, String pwd) {
|
||||
LoggedUserTO usr = null;
|
||||
|
||||
if (userCode == null)
|
||||
return usr;
|
||||
|
||||
userCode = userCode.trim().toUpperCase();
|
||||
|
||||
if (userCode.startsWith(Constants.PERSONAL_IDENTIFICATION_CODE_PREFIX)) {
|
||||
// Si el identificador de usuario es de tipo paciente, intentamos realizar el
|
||||
// login.
|
||||
PatientJPA pat = this.commonServices.findPatientByCode(userCode);
|
||||
PatientTO pat = this.commonServices.findPatientByCode(userCode);
|
||||
if (pat != null) {
|
||||
usr = new LoggedUserTO(String.valueOf(pat.getId()), pat.getName(), pat.getPassword(), UserType.PATIENT);
|
||||
usr = new LoggedUserTO(String.valueOf(pat.getId()), pat.getName(), pat.getPassword(), UserType.PATIENT, pat.getDisplayName());
|
||||
}
|
||||
} else if (userCode.startsWith(Constants.PROFESSIONAL_NUMBER_PREFIX)) {
|
||||
// Si el identificador de usuario es de tipo profesional, intentamos realizar el
|
||||
// login, primero como médico de familia, después como especialista
|
||||
FamilyDoctorJPA fd = this.commonServices.findFamilyDoctorByCode(userCode);
|
||||
FamilyDoctorTO fd = this.commonServices.findFamilyDoctorByCode(userCode);
|
||||
|
||||
if (fd != null) {
|
||||
usr = new LoggedUserTO(String.valueOf(fd.getId()), fd.getName(), fd.getPassword(), UserType.FAMILY_DOCTOR);
|
||||
usr = new LoggedUserTO(String.valueOf(fd.getId()), fd.getName(), fd.getPassword(), UserType.FAMILY_DOCTOR, fd.getDisplayName());
|
||||
} else {
|
||||
// No era un código de médico de familia, intenamos logearlo como especialista
|
||||
SpecialistDoctorJPA sd = this.commonServices.findSpecialistDoctorByCode(userCode);
|
||||
SpecialistDoctorTO sd = this.commonServices.findSpecialistDoctorByCode(userCode);
|
||||
|
||||
if (sd != null) {
|
||||
usr = new LoggedUserTO(String.valueOf(sd.getId()), sd.getName(), sd.getPassword(), UserType.SPECIALIST_DOCTOR);
|
||||
usr = new LoggedUserTO(String.valueOf(sd.getId()), sd.getName(), sd.getPassword(), UserType.SPECIALIST_DOCTOR, sd.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,10 +97,11 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
||||
// cual intentamos login contra la tabla de administradores
|
||||
if (usr == null) {
|
||||
// Intentamos recuperar un registro de administrador
|
||||
AdministratorJPA adm = entman.find(AdministratorJPA.class, userCode);
|
||||
userCode = userCode.toLowerCase();
|
||||
SystemAdminJPA adm = entman.find(SystemAdminJPA.class, userCode);
|
||||
|
||||
if (adm != null) {
|
||||
usr = new LoggedUserTO(adm.getEmail(), adm.getEmail(), adm.getPassword(), UserType.ADMINISTRATOR);
|
||||
usr = new LoggedUserTO(adm.getEmail(), adm.getEmail(), adm.getPassword(), UserType.ADMINISTRATOR, adm.getEmail());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,4 +117,158 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
||||
|
||||
return usr;
|
||||
}
|
||||
|
||||
public Long getSpecialtiesCount() {
|
||||
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from MedicalSpecialtyJPA", Long.class);
|
||||
|
||||
return query.getSingleResult();
|
||||
}
|
||||
|
||||
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 LOWER(ms.name)=LOWER(: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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public MedicalSpecialtyTO insertSpecialty(String name, String description) throws Exception {
|
||||
MedicalSpecialtyJPA ms = new MedicalSpecialtyJPA(name, description);
|
||||
entman.persist(ms);
|
||||
|
||||
return this.commonServices.getPOJOforMedicalSpecialtyJPA(ms);
|
||||
}
|
||||
|
||||
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 LOWER(cap.name)=LOWER(: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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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 Long getFamilyDoctorsByCAPCount(int primaryHealthCareCenterId) {
|
||||
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from FamilyDoctorJPA d where d.primaryHealthCareCenter.id=:capId", Long.class);
|
||||
query.setParameter("capId", primaryHealthCareCenterId);
|
||||
|
||||
return query.getSingleResult();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public SystemAdminTO findAdminByEmail(String email) {
|
||||
TypedQuery<SystemAdminJPA> query = entman.createQuery("from SystemAdminJPA a where LOWER(a.email)=LOWER(:email)", SystemAdminJPA.class);
|
||||
query.setMaxResults(1);
|
||||
query.setParameter("email", email);
|
||||
|
||||
List<SystemAdminJPA> results = query.getResultList();
|
||||
if (results.size() > 0)
|
||||
return this.commonServices.getPOJOforSystemAdminJPA(results.get(0));
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public SystemAdminTO insertAdmin(String email, String password) throws Exception {
|
||||
SystemAdminJPA admin = new SystemAdminJPA(email, password);
|
||||
entman.persist(admin);
|
||||
|
||||
return this.commonServices.getPOJOforSystemAdminJPA(admin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package ejb.systemAdmin;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
|
||||
import TO.FamilyDoctorTO;
|
||||
import TO.LoggedUserTO;
|
||||
import TO.MedicalSpecialtyTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.SystemAdminTO;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
* @author David Alvarez González (dalvarezgon@uoc.edu)
|
||||
*
|
||||
*/
|
||||
@Remote
|
||||
@@ -19,6 +21,35 @@ public interface SystemAdminFacadeRemote {
|
||||
* Definimos la interfaz remota
|
||||
*/
|
||||
|
||||
|
||||
public LoggedUserTO login(String id, String pwd);
|
||||
|
||||
public Long getSpecialtiesCount();
|
||||
|
||||
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 Long getFamilyDoctorsByCAPCount(int primaryHealthCareCenterId);
|
||||
|
||||
public List<FamilyDoctorTO> listAllFamilyDoctorsByCAPPaged(int primaryHealthCareCenterId, int pageNumber, int pageSize);
|
||||
|
||||
public Long getPatientCount(int familyDoctorId);
|
||||
|
||||
public SystemAdminTO findAdminByEmail(String email);
|
||||
|
||||
public SystemAdminTO insertAdmin(String email, String password) throws Exception;
|
||||
}
|
||||
@@ -1,28 +1,158 @@
|
||||
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.persistence.EntityManager;
|
||||
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 persistencia.
|
||||
* 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
|
||||
* persistencia.
|
||||
*
|
||||
* @author mark
|
||||
*
|
||||
*/
|
||||
@Stateless
|
||||
public class VisitFacadeBean implements VisitFacadeRemote {
|
||||
|
||||
// Persistence Unit Context
|
||||
@PersistenceContext(unitName = "MyHealth")
|
||||
private EntityManager entman;
|
||||
EntityManager entman;
|
||||
|
||||
public void ejbMethod(String parameter)
|
||||
{
|
||||
|
||||
@EJB
|
||||
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,12 +1,17 @@
|
||||
package ejb.visit;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
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 mark
|
||||
* @author alina
|
||||
*
|
||||
*/
|
||||
@Remote
|
||||
@@ -14,5 +19,23 @@ public interface VisitFacadeRemote {
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
@@ -28,7 +28,7 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
@Column(nullable = false, unique = true)
|
||||
private String professionalNumber;
|
||||
@@ -39,9 +39,9 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
private String email;
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
private Collection<PatientJPA> patients;
|
||||
private List<PatientJPA> patients;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="PrimaryHealthCareCenterId")
|
||||
@JoinColumn(name = "PrimaryHealthCareCenterId")
|
||||
private PrimaryHealthCareCenterJPA primaryHealthCareCenter;
|
||||
|
||||
/**
|
||||
@@ -111,20 +111,22 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
|
||||
/**
|
||||
* Metodos para get/set de relaciones (pacientes)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<PatientJPA> getPatients() {
|
||||
public List<PatientJPA> getPatients() {
|
||||
return patients;
|
||||
}
|
||||
|
||||
public void setPatients(Collection<PatientJPA> patients) {
|
||||
public void setPatients(List<PatientJPA> patients) {
|
||||
this.patients = patients;
|
||||
}
|
||||
|
||||
|
||||
public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() {
|
||||
return primaryHealthCareCenter;
|
||||
}
|
||||
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
|
||||
|
||||
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
|
||||
this.primaryHealthCareCenter = center;
|
||||
}
|
||||
|
||||
|
||||
134
1.sources/MyHealth/src/jpa/MedicalTestJPA.java
Normal file
@@ -0,0 +1,134 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
115
1.sources/MyHealth/src/jpa/QuestionJPA.java
Normal file
@@ -0,0 +1,115 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import javax.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MyHealth.Administrator")
|
||||
public class AdministratorJPA implements Serializable {
|
||||
public class SystemAdminJPA implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -24,11 +24,11 @@ public class AdministratorJPA implements Serializable {
|
||||
/**
|
||||
* Class constructor methods
|
||||
*/
|
||||
public AdministratorJPA() {
|
||||
public SystemAdminJPA() {
|
||||
super();
|
||||
}
|
||||
|
||||
public AdministratorJPA(String email, String password) {
|
||||
public SystemAdminJPA(String email, String password) {
|
||||
this.email = email;
|
||||
this.password = password;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -28,13 +28,15 @@ public class VisitJPA implements Serializable {
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private Date date;
|
||||
private Time time;
|
||||
private LocalDate date;
|
||||
private LocalTime time;
|
||||
private String observations;
|
||||
private String result;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
private FamilyDoctorJPA familyDoctor;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "PatientId")
|
||||
private PatientJPA patient;
|
||||
@@ -46,16 +48,15 @@ public class VisitJPA implements Serializable {
|
||||
super();
|
||||
}
|
||||
|
||||
public VisitJPA(Integer id, Date date, Time time, String observations, String result) {
|
||||
this.id = id;
|
||||
public VisitJPA(LocalDate date, LocalTime time, String observations, String result, PatientJPA patient, FamilyDoctorJPA familydoctor) {
|
||||
this.date = date;
|
||||
this.time = time;
|
||||
this.observations = observations;
|
||||
this.result = result;
|
||||
this.patient = patient;
|
||||
this.familyDoctor = familydoctor;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -64,19 +65,19 @@ public class VisitJPA implements Serializable {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date value) {
|
||||
public void setDate(LocalDate value) {
|
||||
this.date = value;
|
||||
}
|
||||
|
||||
public Time getTime() {
|
||||
public LocalTime getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(Time value) {
|
||||
public void setTime(LocalTime value) {
|
||||
this.time = value;
|
||||
}
|
||||
|
||||
@@ -84,8 +85,8 @@ public class VisitJPA implements Serializable {
|
||||
return observations;
|
||||
}
|
||||
|
||||
public void setObservations(String observation) {
|
||||
this.observations = observations;
|
||||
public void setObservations(String value) {
|
||||
this.observations = value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,4 +107,12 @@ public class VisitJPA implements Serializable {
|
||||
public void setPatient(PatientJPA pat) {
|
||||
this.patient = pat;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String value) {
|
||||
this.result = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package managedbean.common;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
@@ -14,6 +15,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import common.UserType;
|
||||
|
||||
@WebFilter(filterName = "AuthFilter", urlPatterns = { "*.xhtml" })
|
||||
public class AuthorizationFilter implements Filter {
|
||||
|
||||
@@ -25,27 +28,137 @@ 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
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
try {
|
||||
HttpServletRequest req = null;
|
||||
HttpServletResponse resp = null;
|
||||
HttpSession ses = null;
|
||||
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpServletResponse resp = (HttpServletResponse) response;
|
||||
HttpSession ses = req.getSession(false);
|
||||
req = (HttpServletRequest) request;
|
||||
String reqURI = req.getRequestURI();
|
||||
ses = req.getSession(false);
|
||||
|
||||
String reqURI = req.getRequestURI();
|
||||
if (reqURI.indexOf("/login.xhtml") >= 0 || reqURI.indexOf("/RegisterUser.xhtml") >= 0 || reqURI.indexOf("/home.xhtml") >= 0 || reqURI.indexOf("/public/") >= 0
|
||||
|| reqURI.contains("javax.faces.resource") || SessionUtils.isLogedIn(ses) == true)
|
||||
chain.doFilter(request, response);
|
||||
else
|
||||
resp.sendRedirect(req.getContextPath() + "/login.xhtml");
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
resp = (HttpServletResponse) response;
|
||||
|
||||
// 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("/systemAdmin/AddAdmin") > 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");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
System.out.println("Sessión destruida");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package managedbean.common;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.ejb.EJB;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.application.ViewExpiredException;
|
||||
import javax.faces.context.ExternalContext;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
@@ -89,26 +92,62 @@ public class ManagedBeanBase {
|
||||
remoteManagerMedicalTest = this.getContext("java:app/MyHealth.jar/MedicalTestFacadeBean!ejb.medicalTest.MedicalTestFacadeRemote", MedicalTestFacadeRemote.class);
|
||||
}
|
||||
|
||||
return remoteManagerMedicalTest;
|
||||
return remoteManagerMedicalTest;
|
||||
}
|
||||
|
||||
protected void addFacesMessageKeep(FacesMessage.Severity severity, String summary, String detail) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
this.addFacesMessage(FacesContext.getCurrentInstance(), severity, summary, detail);
|
||||
this.addFacesMessage(FacesContext.getCurrentInstance(), null, severity, summary, detail);
|
||||
|
||||
context.getExternalContext().getFlash().setKeepMessages(true);
|
||||
}
|
||||
|
||||
protected void addFacesMessage(FacesMessage.Severity severity, String summary, String detail) {
|
||||
this.addFacesMessage(FacesContext.getCurrentInstance(), severity, summary, detail);
|
||||
this.addFacesMessage(FacesContext.getCurrentInstance(), null, severity, summary, detail);
|
||||
}
|
||||
|
||||
protected void addFacesMessage(FacesContext context, FacesMessage.Severity severity, String summary, String detail) {
|
||||
context.addMessage(null, new FacesMessage(severity, summary, detail));
|
||||
protected void addFacesMessage(String clientId, FacesMessage.Severity severity, String summary, String detail) {
|
||||
this.addFacesMessage(FacesContext.getCurrentInstance(), clientId, 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) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Se ha producido un error inesperado", "Descripción del error: " + ex.getLocalizedMessage());
|
||||
String strType = "runtime";
|
||||
|
||||
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 {
|
||||
String msg = "";
|
||||
Throwable th = ex.getCause();
|
||||
|
||||
if (th != null)
|
||||
msg = th.getLocalizedMessage();
|
||||
else
|
||||
msg = ex.getLocalizedMessage();
|
||||
|
||||
this.addFacesMessageKeep(FacesMessage.SEVERITY_ERROR, "Se ha producido un error inesperado", "Descripción del error: ".concat(msg));
|
||||
}
|
||||
|
||||
try {
|
||||
ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
|
||||
|
||||
ctx.redirect(ctx.getApplicationContextPath() + "/error.xhtml?type=" + strType);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,13 @@ import java.io.Serializable;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.primefaces.model.menu.DefaultMenuItem;
|
||||
import org.primefaces.model.menu.DefaultMenuModel;
|
||||
import org.primefaces.model.menu.DefaultSeparator;
|
||||
import org.primefaces.model.menu.DefaultSubMenu;
|
||||
import org.primefaces.model.menu.MenuElement;
|
||||
import org.primefaces.model.menu.MenuModel;
|
||||
|
||||
import common.UserType;
|
||||
@@ -30,25 +29,28 @@ public class MenuMBean implements Serializable {
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
boolean loggedIn = SessionUtils.isLogedIn();
|
||||
|
||||
model = new DefaultMenuModel();
|
||||
DefaultSubMenu subMenu;
|
||||
UserType tipoUsuario = null;
|
||||
DefaultMenuItem menuItem;
|
||||
|
||||
model.addElement(createMenuItem("Home", "pi pi-home", "/home", null));
|
||||
|
||||
if (SessionUtils.isLogedIn() == true) {
|
||||
if (loggedIn == true) {
|
||||
tipoUsuario = SessionUtils.getUserType();
|
||||
|
||||
// Administracion Sistema
|
||||
if (tipoUsuario == UserType.ADMINISTRATOR) {
|
||||
subMenu = new DefaultSubMenu("Administración del sistema", "fa-wrench");
|
||||
subMenu = new DefaultSubMenu("Administración del sistema", "fa fa-wrench");
|
||||
|
||||
subMenu.addElement(createMenuItem("Gestionar especialidades", "fa fa-file-text-o", "/systemAdmin/ManageSpecialties", null));
|
||||
subMenu.addElement(createMenuItem("Centros At. Primaria", "fa fa-hospital-o", "/systemAdmin/ManageSpecialties", null));
|
||||
subMenu.addElement(createMenuItem("Centros At. Primaria", "fa fa-hospital-o", "/systemAdmin/ManageHealthCareCenters", null));
|
||||
subMenu.addElement(new DefaultSeparator());
|
||||
subMenu.addElement(createMenuItem("Ver médicos de un CAP", "fa fa-medkit", "/systemAdmin/ManageSpecialties", null));
|
||||
subMenu.addElement(createMenuItem("Ver médicos de un CAP", "fa fa-medkit", "/systemAdmin/ListDoctorsByCenter", null));
|
||||
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/AddAdmin", null));
|
||||
|
||||
model.addElement(subMenu);
|
||||
}
|
||||
@@ -58,15 +60,15 @@ public class MenuMBean implements Serializable {
|
||||
subMenu = new DefaultSubMenu("Visitas", "fa fa-calendar");
|
||||
|
||||
if (tipoUsuario == UserType.PATIENT)
|
||||
subMenu.addElement(createMenuItem("Solicitar nueva", "fa fa-calendar-o", "/visit/VisitView", null));
|
||||
subMenu.addElement(createMenuItem("Solicitar nueva", "fa fa-calendar-o", "/visit/AddVisit", null));
|
||||
if (tipoUsuario == UserType.PATIENT || tipoUsuario == UserType.ADMINISTRATOR)
|
||||
subMenu.addElement(createMenuItem("Modificar fecha/hora", "fa fa-briefcase", "/visit/VisitView", null));
|
||||
subMenu.addElement(createMenuItem("Modificar fecha/hora", "fa fa-briefcase", "/visit/PatientVisitList", null));
|
||||
if (tipoUsuario == UserType.PATIENT)
|
||||
subMenu.addElement(createMenuItem("Anular visita", "fa fa-remove", "/visit/VisitView", null));
|
||||
subMenu.addElement(createMenuItem("Anular visita", "fa fa-remove", "/visit/PatientVisitList", null));
|
||||
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
||||
subMenu.addElement(createMenuItem("Añadir resultado", "fa fa-align-left", "/visit/VisitView", null));
|
||||
subMenu.addElement(createMenuItem("Añadir resultado", "fa fa-align-left", "/visit/VisitList", null));
|
||||
if (tipoUsuario == UserType.FAMILY_DOCTOR)
|
||||
subMenu.addElement(createMenuItem("Ver agenda del día", "fa fa-repeat", "/visit/VisitView", null));
|
||||
subMenu.addElement(createMenuItem("Ver agenda del día", "fa fa-repeat", "/visit/VisitList", null));
|
||||
|
||||
model.addElement(subMenu);
|
||||
}
|
||||
@@ -88,36 +90,21 @@ public class MenuMBean implements Serializable {
|
||||
}
|
||||
|
||||
if (tipoUsuario == UserType.PATIENT)
|
||||
subMenu.addElement(createMenuItem("Buscar especialista...", "fa fa-heartbeat", "/medicaltest/MedicalTests", null));
|
||||
subMenu.addElement(createMenuItem("Buscar especialista...", "fa fa-heartbeat", "/medicaltest/SearchSpecialist", null));
|
||||
|
||||
model.addElement(subMenu);
|
||||
}
|
||||
|
||||
// Preguntas médicas
|
||||
if (tipoUsuario == UserType.PATIENT || tipoUsuario == UserType.FAMILY_DOCTOR) {
|
||||
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);
|
||||
model.addElement(createMenuItem("Preguntas", "fa fa-comment-o", "/medicaltest/Questions", null));
|
||||
}
|
||||
}
|
||||
|
||||
// Perfil
|
||||
subMenu = new DefaultSubMenu("Gestionar perfil", "fa fa-gears");
|
||||
if (SessionUtils.isLogedIn() == false) {
|
||||
if (loggedIn == false) {
|
||||
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 médico", "fa fa-user-md", "/profile/AddFamilyDoctor", null));
|
||||
subMenu.addElement(createMenuItem("Registro de especialista", "fa fa-user-md", "/profile/AddSpecialistDoctor", null));
|
||||
|
||||
model.addElement(subMenu);
|
||||
} else {
|
||||
if (tipoUsuario != UserType.ADMINISTRATOR) {
|
||||
@@ -136,6 +123,30 @@ public class MenuMBean implements Serializable {
|
||||
model.addElement(subMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// Opciones de menu a la derecha (login, logout, registrase y descripción del usuario logeado
|
||||
if (loggedIn == true) {
|
||||
menuItem = createMenuItem("Salir", "pi pi-sign-out", null, "#{loginView.logout}");
|
||||
menuItem.setContainerStyle("float: right;");
|
||||
model.addElement(menuItem);
|
||||
|
||||
menuItem = createMenuItem("Bienvenido, " + SessionUtils.getUserDisplayName(), null, "/profile/UpdateProfile", null);
|
||||
menuItem.setContainerStyle("float: right;");
|
||||
model.addElement(menuItem);
|
||||
} else {
|
||||
menuItem = createMenuItem("Entrar", "pi pi-sign-in", null, null);
|
||||
menuItem.setOnclick("PF('dlgLogin').show();");
|
||||
menuItem.setContainerStyle("float: right;");
|
||||
model.addElement(menuItem);
|
||||
|
||||
menuItem = createMenuItem("Registrarse", "pi pi-user-plus", "/profile/RegisterUser", null);
|
||||
menuItem.setContainerStyle("float: right;");
|
||||
model.addElement(menuItem);
|
||||
|
||||
menuItem = createMenuItem("hola, invitado", null, null, null);
|
||||
menuItem.setContainerStyle("float: right;");
|
||||
model.addElement(menuItem);
|
||||
}
|
||||
}
|
||||
|
||||
private DefaultMenuItem createMenuItem(String name, String icon, String outcome, String command) {
|
||||
|
||||
@@ -32,8 +32,7 @@ public class SessionPreferences implements Serializable {
|
||||
}
|
||||
|
||||
public void updateCurrentTheme() {
|
||||
// TODO: Se podría guardar el tema seleccionado en base de datos para el usuario
|
||||
// (en caso de que esté logeado en el sistema
|
||||
// Muestra mensaje al usuario indicando que el tema se utilizará en esta sesión
|
||||
FacesContext.getCurrentInstance().addMessage(null,
|
||||
new FacesMessage(FacesMessage.SEVERITY_INFO, "Tema guardado", "El tema seleccionado será utilizado durante esta sesión."));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package managedbean.common;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -14,15 +15,20 @@ public class SessionUtils {
|
||||
public static final String SESSION_VAR_USERID = "userId";
|
||||
public static final String SESSION_VAR_USERTYPE = "userType";
|
||||
public static final String SESSION_VAR_USER = "loggedOnUser";
|
||||
public static final String SESSION_VAR_MESSAGE = "facesMessage";
|
||||
|
||||
public static HttpSession getSession() {
|
||||
public static HttpSession getSession(boolean create) {
|
||||
FacesContext ctx = FacesContext.getCurrentInstance();
|
||||
if (ctx != null)
|
||||
return (HttpSession) ctx.getExternalContext().getSession(false);
|
||||
return (HttpSession) ctx.getExternalContext().getSession(create);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HttpSession getSession() {
|
||||
return getSession(false);
|
||||
}
|
||||
|
||||
public static HttpServletRequest getRequest() {
|
||||
return (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
|
||||
}
|
||||
@@ -31,13 +37,19 @@ public class SessionUtils {
|
||||
return ((HttpServletRequest) request).getSession(false);
|
||||
}
|
||||
|
||||
public static void CreateSession(LoggedUserTO usr) {
|
||||
HttpSession ses = getSession();
|
||||
public static void createOrUpdateSession(LoggedUserTO usr) {
|
||||
createOrUpdateSession(getSession(true), usr);
|
||||
}
|
||||
|
||||
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_USERID, usr.getId());
|
||||
ses.setAttribute(SessionUtils.SESSION_VAR_USERTYPE, usr.getUserType());
|
||||
ses.setAttribute(SessionUtils.SESSION_VAR_USER, usr);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DestroySession() {
|
||||
HttpSession ses = getSession();
|
||||
@@ -47,7 +59,7 @@ public class SessionUtils {
|
||||
public static boolean isLogedIn() {
|
||||
return isLogedIn(getSession());
|
||||
}
|
||||
|
||||
|
||||
public static boolean isLogedIn(HttpSession session) {
|
||||
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_USERID) != null)
|
||||
return true;
|
||||
@@ -70,15 +82,28 @@ public class SessionUtils {
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
public static UserType getUserType() {
|
||||
|
||||
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() {
|
||||
return getUserType(getSession());
|
||||
}
|
||||
|
||||
public static UserType getUserType(HttpSession session) {
|
||||
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_USERTYPE) != null)
|
||||
return UserType.class.cast(session.getAttribute(SessionUtils.SESSION_VAR_USERTYPE));
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static LoggedUserTO getloggedOnUser() {
|
||||
HttpSession session = getSession();
|
||||
if (session != null && session.getAttribute(SessionUtils.SESSION_VAR_USER) != null)
|
||||
@@ -86,4 +111,24 @@ public class SessionUtils {
|
||||
else
|
||||
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;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ThemeService {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ThemeService implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String DEFAULT_THEME = "nova-light";
|
||||
public static final List<Theme> THEMES = new ArrayList<Theme>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
int i = 1;
|
||||
add(new Theme(i++, "afterdark", "afterdark"));
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
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)
|
||||
@@ -9,6 +15,13 @@ public class ValidationUtils {
|
||||
static final String NIF_LETTERS = "TRWAGMYFPDXBNJZSQVHLCKE";
|
||||
static final String NIE_LETTERS = "XYZ";
|
||||
|
||||
public static String normalizeNIF(String nif) {
|
||||
if (nif == null)
|
||||
return nif;
|
||||
else
|
||||
return nif.toUpperCase().replace("-", "").replace(".", "");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param nif NIF a validar
|
||||
@@ -18,7 +31,7 @@ public class ValidationUtils {
|
||||
if (nif == null)
|
||||
return false;
|
||||
|
||||
nif = nif.toUpperCase().replace("-", "").replace(".", "");
|
||||
nif = normalizeNIF(nif);
|
||||
|
||||
if (nif.length() < 2 || nif.length() > 9)
|
||||
return false;
|
||||
@@ -47,4 +60,50 @@ public class ValidationUtils {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
141
1.sources/MyHealth/src/managedbean/common/errorMBean.java
Normal file
@@ -0,0 +1,141 @@
|
||||
package managedbean.common;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import common.Utils;
|
||||
|
||||
/***
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
*
|
||||
*/
|
||||
@Named("error")
|
||||
@RequestScoped
|
||||
public class errorMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String errorType;
|
||||
private String errorMessage;
|
||||
private String requestURI;
|
||||
private boolean renderBack;
|
||||
|
||||
@PostConstruct
|
||||
public void init() throws IOException {
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
this.setRenderBack(false);
|
||||
|
||||
if (fc != null) {
|
||||
HttpServletRequest req = (HttpServletRequest) fc.getExternalContext().getRequest();
|
||||
|
||||
Map<String, String> requestParams = fc.getExternalContext().getRequestParameterMap();
|
||||
|
||||
this.errorType = this.getRequestParameter(requestParams, "type");
|
||||
if (this.errorType.equals("") == true) {
|
||||
this.requestURI = this.getRequestAttribute(req, "javax.servlet.error.request_uri");
|
||||
|
||||
if (requestURI.equals("") == true)
|
||||
this.requestURI = req.getContextPath().concat("/home.xhtml");
|
||||
|
||||
setRenderBack(true);
|
||||
|
||||
Throwable rootCause = null;
|
||||
Object obj = req.getAttribute("javax.servlet.error.exception");
|
||||
if (obj != null) {
|
||||
Exception se = Exception.class.cast(obj);
|
||||
|
||||
rootCause = Utils.getExceptionRootCause(se);
|
||||
|
||||
if (rootCause != null) {
|
||||
this.errorType = rootCause.getClass().getName();
|
||||
this.errorMessage = rootCause.getLocalizedMessage();
|
||||
} else {
|
||||
this.errorType = se.getClass().getName();
|
||||
this.errorMessage = se.getCause().getLocalizedMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Si no hay error volvemos al home.
|
||||
if (this.errorType.equals("") == true)
|
||||
fc.getExternalContext().redirect(req.getContextPath().concat("/home.xhtml"));
|
||||
|
||||
switch (this.errorType) {
|
||||
case "javax.faces.application.ViewExpiredException":
|
||||
this.errorType = "expired";
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Sesión caducada", "Su sesión ha caducado, debe logearse de nuevo");
|
||||
break;
|
||||
case "java.sql.SQLException":
|
||||
case "org.hibernate.exception.GenericJDBCException":
|
||||
case "java.net.ConnectException":
|
||||
case "javax.persistence.PersistenceException":
|
||||
this.errorType = "sql";
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Error en el acceso a la base de datos", this.errorMessage);
|
||||
|
||||
break;
|
||||
default:
|
||||
this.errorType = "runtime";
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Error interno del servidor", this.errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getRequestAttribute(HttpServletRequest req, String attrName) {
|
||||
Object attr = req.getAttribute(attrName);
|
||||
|
||||
if (attr != null)
|
||||
return attr.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
private String getRequestParameter(Map<String, String> pars, String paramName) {
|
||||
Object par = pars.get(paramName);
|
||||
|
||||
if (par != null)
|
||||
return par.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getErrorType() {
|
||||
return errorType;
|
||||
}
|
||||
|
||||
public void setErrorType(String errorType) {
|
||||
this.errorType = errorType;
|
||||
}
|
||||
|
||||
public String getRequestURI() {
|
||||
return requestURI;
|
||||
}
|
||||
|
||||
public void setRequestURI(String requestURI) {
|
||||
this.requestURI = requestURI;
|
||||
}
|
||||
|
||||
public boolean isRenderBack() {
|
||||
return renderBack;
|
||||
}
|
||||
|
||||
public void setRenderBack(boolean renderBack) {
|
||||
this.renderBack = renderBack;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,8 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.view.ViewScoped;
|
||||
import javax.inject.Named;
|
||||
|
||||
import common.UserType;
|
||||
@@ -15,22 +16,29 @@ import common.UserType;
|
||||
*
|
||||
*/
|
||||
@Named("home")
|
||||
@RequestScoped
|
||||
public class homeMBean implements Serializable {
|
||||
@ViewScoped
|
||||
public class homeMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private boolean isLogedIn;
|
||||
private String userId;
|
||||
private String userName;
|
||||
private String userDisplayName;
|
||||
private UserType userType;
|
||||
private int refresh;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
isLogedIn = SessionUtils.isLogedIn();
|
||||
userName = SessionUtils.getUserName();
|
||||
userId = SessionUtils.getUserId();
|
||||
userType = SessionUtils.getUserType();
|
||||
this.isLogedIn = SessionUtils.isLogedIn();
|
||||
this.userName = SessionUtils.getUserName();
|
||||
this.userDisplayName = SessionUtils.getUserDisplayName();
|
||||
this.userId = SessionUtils.getUserId();
|
||||
this.userType = SessionUtils.getUserType();
|
||||
|
||||
FacesMessage message = SessionUtils.getMessage();
|
||||
|
||||
if (message != null) {
|
||||
this.addFacesMessage(message, null);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Theme> getThemes() {
|
||||
@@ -47,6 +55,13 @@ public class homeMBean implements Serializable {
|
||||
else
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public String getUserDisplayName() {
|
||||
if (this.isLogedIn == false)
|
||||
return "Invitado";
|
||||
else
|
||||
return this.userDisplayName;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return this.userId;
|
||||
@@ -56,14 +71,6 @@ public class homeMBean implements Serializable {
|
||||
return this.userType.getUserTypename();
|
||||
}
|
||||
|
||||
public int getRefresh() {
|
||||
return refresh;
|
||||
}
|
||||
|
||||
public void setRefresh(int refresh) {
|
||||
this.refresh = refresh;
|
||||
}
|
||||
|
||||
public boolean isPatient() {
|
||||
return (this.userType == UserType.PATIENT);
|
||||
}
|
||||
|
||||
@@ -1,51 +1,347 @@
|
||||
package managedbean.medicalTest;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Properties;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.EJB;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.event.AjaxBehaviorEvent;
|
||||
import javax.faces.view.ViewScoped;
|
||||
import javax.inject.Named;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
|
||||
import ejb.medicalTest.MedicalTestFacadeRemote;
|
||||
import org.primefaces.event.FileUploadEvent;
|
||||
import org.primefaces.event.SelectEvent;
|
||||
import org.primefaces.model.DefaultStreamedContent;
|
||||
import org.primefaces.model.StreamedContent;
|
||||
import org.primefaces.model.UploadedFile;
|
||||
|
||||
/**
|
||||
* ManagedBEan que gestiona la edición y actualización de una especialidad
|
||||
* médica.
|
||||
*
|
||||
* @author mark
|
||||
*
|
||||
*/
|
||||
@Named("MedicalTestMBean")
|
||||
@RequestScoped
|
||||
public class MedicalTestMBean implements Serializable {
|
||||
import TO.MedicalTestTO;
|
||||
import TO.PatientTO;
|
||||
import common.Constants;
|
||||
import common.MedicalTestType;
|
||||
import common.UserType;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
|
||||
@Named("mt")
|
||||
@ViewScoped
|
||||
public class MedicalTestMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@EJB
|
||||
private MedicalTestFacadeRemote remoteManager;
|
||||
private int userID;
|
||||
private UserType userType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public MedicalTestMBean() throws Exception {
|
||||
initializeAdminFacadeRemote();
|
||||
public MedicalTestMBean() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 = (MedicalTestFacadeRemote) ctx
|
||||
.lookup("java:app/myHealth.jar/MedicalTestFacadeBean!ejb.component.MedicalTestFacadeRemote");
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
this.userType = SessionUtils.getUserType();
|
||||
this.userID = Integer.valueOf(SessionUtils.getUserId());
|
||||
|
||||
this.medicalTestTypes = new ArrayList<MedicalTestType>();
|
||||
this.medicalTestTypes.add(MedicalTestType.BLOOD_TEST);
|
||||
this.medicalTestTypes.add(MedicalTestType.CT_SCAN);
|
||||
this.medicalTestTypes.add(MedicalTestType.MAGNETIC_RESONANCE_IMAGING);
|
||||
|
||||
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 uploadDataListener(FileUploadEvent event) {
|
||||
UploadedFile uploadedFile = event.getFile();
|
||||
// String fileName = uploadedFile.getFileName();
|
||||
String contentType = uploadedFile.getContentType();
|
||||
byte[] contents = uploadedFile.getContents();
|
||||
|
||||
if (contents != null && contents.length > 0) {
|
||||
this.selected.setHighresimage(String.format("data:%s;base64,%s", contentType, Base64.getEncoder().encodeToString(contents)));
|
||||
|
||||
this.getRemoteManagerMedicalTest().addImage(this.selected.getId(), this.selected.getHighresimage());
|
||||
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Imagen guardada", "La imagen se ha guardado correctamente.");
|
||||
} else {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Imagen vacía", "La imagen que itenta subir está vacía o no puede procesarse.");
|
||||
}
|
||||
}
|
||||
|
||||
public StreamedContent getImageDownload() {
|
||||
DefaultStreamedContent dsc = null;
|
||||
try {
|
||||
String[] data = this.selected.getHighresimage().split(",");
|
||||
String contentType = data[0];
|
||||
|
||||
// Obtenemos la extension del contentType
|
||||
String extension = contentType.split(";")[0].split("/")[1];
|
||||
String base64Image = data[1];
|
||||
|
||||
dsc = new DefaultStreamedContent(new ByteArrayInputStream(javax.xml.bind.DatatypeConverter.parseBase64Binary(base64Image)), contentType, "Imagen.".concat(extension));
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
return dsc;
|
||||
}
|
||||
|
||||
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();
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Imagen eliminada", "La imagen se ha eliminado correctamente.");
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
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.event.SelectEvent;
|
||||
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> medicalSpecialtiesList;
|
||||
private MedicalSpecialtyTO medicalSpecialty;
|
||||
private String lastUIQueryMS;
|
||||
private LazyDataModel<SpecialistDoctorTO> lazyDataModelDoctorList;
|
||||
|
||||
public SearchSpecialistMBean() {
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// Inicialización de variables y propiedades van aquí.
|
||||
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
this.medicalSpecialty = 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 (medicalSpecialty == null) {
|
||||
this.setRowCount(0);
|
||||
return null;
|
||||
} else {
|
||||
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialtyCount(medicalSpecialty.getId());
|
||||
this.setRowCount(totalRowCount.intValue());
|
||||
|
||||
return getRemoteManagerMedicalTest().findSpecialistDoctorByMedicalSpecialty(medicalSpecialty.getId(), (first / pageSize), pageSize);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public LazyDataModel<SpecialistDoctorTO> getLazyDataModelDoctorList() {
|
||||
return lazyDataModelDoctorList;
|
||||
}
|
||||
|
||||
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
|
||||
if (query != null && query.equals(this.lastUIQueryMS) == false) {
|
||||
this.lastUIQueryMS = query;
|
||||
// Recuperamos las 200 primeras coincidencias
|
||||
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
}
|
||||
return this.medicalSpecialtiesList;
|
||||
}
|
||||
|
||||
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
|
||||
return medicalSpecialtiesList;
|
||||
}
|
||||
|
||||
public void setMedicalSpecialtiesList(List<MedicalSpecialtyTO> value) {
|
||||
this.medicalSpecialtiesList = value;
|
||||
}
|
||||
|
||||
public MedicalSpecialtyTO getMedicalSpecialty() {
|
||||
return medicalSpecialty;
|
||||
}
|
||||
|
||||
public void setMedicalSpecialty(MedicalSpecialtyTO medicalSpecialty) {
|
||||
this.medicalSpecialty = medicalSpecialty;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
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() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
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,6 +17,7 @@ import managedbean.common.ManagedBeanBase;
|
||||
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)
|
||||
*
|
||||
@@ -36,60 +37,88 @@ 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
|
||||
public void init() {
|
||||
// Recuperamos el usuario logeado actual
|
||||
LoggedUserTO usr = null;
|
||||
this.lastUIQuery = "";
|
||||
try {
|
||||
usr = SessionUtils.getloggedOnUser();
|
||||
usr = SessionUtils.getloggedOnUser();
|
||||
|
||||
if (usr == null)
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Sesión no válida",
|
||||
"Su sesión actual no es válida, por favor cierre su sesión y vuelva a logearse en el sistema.");
|
||||
else {
|
||||
this.id = Integer.valueOf(usr.getId());
|
||||
if (usr == null)
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Sesión no válida", "Su sesión actual no es válida, por favor cierre su sesión y vuelva a logearse en el sistema.");
|
||||
else {
|
||||
this.id = Integer.valueOf(usr.getId());
|
||||
|
||||
if (usr.getUserType() == UserType.PATIENT) {
|
||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
if (usr.getUserType() == UserType.PATIENT) {
|
||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
|
||||
PatientTO pat = this.getRemoteManagerCommon().findPatientById(this.id);
|
||||
this.setCurrentFamilyDoctor(pat.getFamilyDoctor());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
PatientTO pat = this.getRemoteManagerCommon().findPatientById(this.id);
|
||||
this.currentFamilyDoctor = 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.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
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) {
|
||||
if (query != null && query.equals(this.lastUIQuery) == false) {
|
||||
this.lastUIQuery = query;
|
||||
// Recuperamos las 200 primeras coincidencias
|
||||
// Recuperamos las primeras ~30 coincidencias, según constante
|
||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
}
|
||||
return this.familyDoctorList;
|
||||
}
|
||||
|
||||
// Id del usuario actual, obtenido de la sessión del usuario logeado.
|
||||
public int getId() {
|
||||
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() {
|
||||
int error = 0;
|
||||
|
||||
if (this.getNewFamilyDoctor() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado", "Por favor, especifique un nuevvo médico de familia.");
|
||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado",
|
||||
"Por favor, especifique un nuevvo médico de familia.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (this.getCurrentFamilyDoctor() != null && this.getNewFamilyDoctor().getId() == this.getCurrentFamilyDoctor().getId()) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
||||
"Por favor, seleccione un médico de familia diferente al que tiene actualmente asignado.");
|
||||
error++;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package managedbean.profile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -18,6 +17,7 @@ import managedbean.common.ManagedBeanBase;
|
||||
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)
|
||||
*
|
||||
@@ -37,38 +37,46 @@ 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
|
||||
public void init() {
|
||||
// Recuperamos el usuario logeado actual
|
||||
LoggedUserTO usr = null;
|
||||
this.lastUIQuery = "";
|
||||
|
||||
try {
|
||||
usr = SessionUtils.getloggedOnUser();
|
||||
|
||||
if (usr == null)
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Sesión no válida",
|
||||
"Su sesión actual no es válida, por favor cierre su sesión y vuelva a logearse en el sistema.");
|
||||
else {
|
||||
this.id = Integer.valueOf(usr.getId());
|
||||
usr = SessionUtils.getloggedOnUser();
|
||||
|
||||
if (usr.getUserType() == UserType.FAMILY_DOCTOR) {
|
||||
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
if (usr == null)
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Sesión no válida", "Su sesión actual no es válida, por favor cierre su sesión y vuelva a logearse en el sistema.");
|
||||
else {
|
||||
this.id = Integer.valueOf(usr.getId());
|
||||
|
||||
FamilyDoctorTO fd = this.getRemoteManagerCommon().findFamilyDoctorById(this.id);
|
||||
this.setCurrentCenter(fd.getPrimaryHealthCareCenter());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
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);
|
||||
|
||||
FamilyDoctorTO fd = this.getRemoteManagerCommon().findFamilyDoctorById(this.id);
|
||||
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.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<PrimaryHealthCareCenterTO> getPhcList() {
|
||||
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) {
|
||||
if (query != null && query.equals(this.lastUIQuery) == false) {
|
||||
this.lastUIQuery = query;
|
||||
@@ -76,22 +84,30 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
||||
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
}
|
||||
return this.primaryHealthCareCentersList;
|
||||
}
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
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() {
|
||||
int error = 0;
|
||||
|
||||
if (this.getNewCenter() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un nuevvo centro de atención primaria.");
|
||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado",
|
||||
"Por favor, especifique un nuevvo centro de atención primaria.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (this.getNewCenter().getName().equals(this.getCurrentCenter().getName())) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente", "Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente",
|
||||
"Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
||||
error++;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ import managedbean.common.ManagedBeanBase;
|
||||
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)
|
||||
*
|
||||
@@ -35,7 +34,6 @@ import managedbean.common.ValidationUtils;
|
||||
public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int id;
|
||||
private String cipCode;
|
||||
private String nif;
|
||||
private String name;
|
||||
@@ -52,13 +50,18 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
private UserType userType;
|
||||
private PrimaryHealthCareCenterTO primaryHealthCareCenter;
|
||||
private MedicalSpecialtyTO medicalSpecialty;
|
||||
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
|
||||
private List<MedicalSpecialtyTO> medicalSpecialtiesList;
|
||||
private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
|
||||
|
||||
public RegisterUserMBean() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Inicializa el managedBean actual.
|
||||
*
|
||||
* Carga los tipos de usuario disponibles. Carga la lista de CAPs. Carga la lista de especialidades médicas.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
this.availableUserTypes = new ArrayList<UserType>();
|
||||
@@ -71,7 +74,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
this.userType = UserType.PATIENT;
|
||||
|
||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
}
|
||||
|
||||
@@ -79,37 +82,46 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
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() {
|
||||
switch (this.userType) {
|
||||
case SPECIALIST_DOCTOR:
|
||||
try {
|
||||
PrimeFaces.current().ajax().addCallbackParam("specs", true);
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
// 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);
|
||||
break;
|
||||
case FAMILY_DOCTOR:
|
||||
try {
|
||||
PrimeFaces.current().ajax().addCallbackParam("caps", true);
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
// 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);
|
||||
break;
|
||||
case ADMINISTRATOR:
|
||||
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);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
|
||||
return medicalSpecialitiesList;
|
||||
return medicalSpecialtiesList;
|
||||
}
|
||||
|
||||
public List<PrimaryHealthCareCenterTO> getPhcList() {
|
||||
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) {
|
||||
if (query != null && query.equals(this.lastUIQueryPH) == false) {
|
||||
this.lastUIQueryPH = query;
|
||||
@@ -119,13 +131,28 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
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) {
|
||||
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);
|
||||
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
}
|
||||
return this.medicalSpecialitiesList;
|
||||
return this.medicalSpecialtiesList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 boolean checkNIFDuplicated(String nifValue, UserType userType) {
|
||||
return ValidationUtils.checkIfNifAlreadyRegistered(this.getRemoteManagerCommon(), userType, nifValue, null);
|
||||
}
|
||||
|
||||
public boolean isPatient() {
|
||||
@@ -184,50 +211,67 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
this.nif = nif;
|
||||
}
|
||||
|
||||
public void addNewUser() {
|
||||
/**
|
||||
* 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() throws Exception {
|
||||
int error = 0;
|
||||
|
||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
||||
|
||||
if (this.isFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un centro de atención primaria.");
|
||||
this.addFacesMessage("frmRegisterUser:selPHC", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado",
|
||||
"Por favor, especifique un centro de atención primaria.");
|
||||
error++;
|
||||
}
|
||||
if (this.isSpecialistDoctor() && this.medicalSpecialty == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||
this.addFacesMessage("frmRegisterUser:selMS", FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||
error++;
|
||||
}
|
||||
if (ValidationUtils.isValid(nif) == false) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El NIF indicado no es válido", "Por favor, especifique un NIF válido.");
|
||||
error++;
|
||||
}
|
||||
if (this.checkNIFDuplicated(this.nif, this.userType) == true) {
|
||||
this.addFacesMessage("frmRegisterUser:nif", FacesMessage.SEVERITY_WARN, "NIF duplicado", "El nif indicado pertenece a otro usuario previamente registrado");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
try {
|
||||
switch (this.userType) {
|
||||
case PATIENT:
|
||||
PatientTO pat = this.getRemoteManagerProfile().registerPatient(id, nif, name, surname, password, email);
|
||||
this.cipCode = pat.getPersonalIdentificationCode();
|
||||
switch (this.userType) {
|
||||
case PATIENT:
|
||||
PatientTO pat = this.getRemoteManagerProfile().registerPatient(nif, name, surname, password, email);
|
||||
this.cipCode = pat.getPersonalIdentificationCode();
|
||||
|
||||
break;
|
||||
case FAMILY_DOCTOR:
|
||||
FamilyDoctorTO fd = this.getRemoteManagerProfile().registerFamilyDoctor(id, nif, name, surname, password, email, this.primaryHealthCareCenter);
|
||||
this.cipCode = fd.getProfessionalNumber();
|
||||
break;
|
||||
case FAMILY_DOCTOR:
|
||||
FamilyDoctorTO fd = this.getRemoteManagerProfile().registerFamilyDoctor(nif, name, surname, password, email, this.primaryHealthCareCenter);
|
||||
this.cipCode = fd.getProfessionalNumber();
|
||||
|
||||
break;
|
||||
case SPECIALIST_DOCTOR:
|
||||
SpecialistDoctorTO sd = this.getRemoteManagerProfile().registerSpecialistDoctor(id, nif, name, surname, password, email, this.medicalSpecialty);
|
||||
this.cipCode = sd.getProfessionalNumber();
|
||||
break;
|
||||
case SPECIALIST_DOCTOR:
|
||||
SpecialistDoctorTO sd = this.getRemoteManagerProfile().registerSpecialistDoctor(nif, name, surname, password, email, this.medicalSpecialty);
|
||||
this.cipCode = sd.getProfessionalNumber();
|
||||
|
||||
break;
|
||||
case ADMINISTRATOR:
|
||||
throw new NotSupportedException("No se soporta el registro directo de administradores.");
|
||||
}
|
||||
|
||||
this.registered = true;
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Registro realizado", "El usuario " + name + " " + surname + " se ha registrado correctamente.");
|
||||
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
break;
|
||||
case ADMINISTRATOR:
|
||||
throw new NotSupportedException("No se soporta el registro directo de administradores.");
|
||||
}
|
||||
|
||||
this.registered = true;
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Registro realizado", "El usuario " + name + " " + surname + " se ha registrado correctamente.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||