diff --git a/1.sources/MyHealth/docroot/profile/RegisterUser.xhtml b/1.sources/MyHealth/docroot/profile/RegisterUser.xhtml index 3eb6835..2fbd2c4 100644 --- a/1.sources/MyHealth/docroot/profile/RegisterUser.xhtml +++ b/1.sources/MyHealth/docroot/profile/RegisterUser.xhtml @@ -45,20 +45,22 @@ - function handleRequest(xhr, status, args) { - if(args.specs) { - $('#panCentros').slideUp(); - $('#panEspecialidades').slideDown(); - } - else if (args.caps) { - $('#panEspecialidades').slideUp(); - $('#panCentros').slideDown(); - } else { - $('#panCentros').slideUp(); - $('#panEspecialidades').slideUp(); - } - } - + 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(); + } + */ + } +
@@ -67,12 +69,11 @@
- - - + +
-
+

@@ -102,7 +103,7 @@
- +
@@ -112,8 +113,8 @@
- +
@@ -124,7 +125,7 @@
-
@@ -141,46 +142,48 @@ - -
- -
-
- - - - - - - - - -
-
- -
-
+ + +
+ +
+
+ + + + + + + + + +
+
+ +
+
- -
- -
-
- - - - - - - - - -
-
- -
+ +
+ +
+
+ + + + + + + + + +
+
+ +
+
diff --git a/1.sources/MyHealth/docroot/profile/UpdateProfile.xhtml b/1.sources/MyHealth/docroot/profile/UpdateProfile.xhtml index 69da325..cc543d1 100644 --- a/1.sources/MyHealth/docroot/profile/UpdateProfile.xhtml +++ b/1.sources/MyHealth/docroot/profile/UpdateProfile.xhtml @@ -109,7 +109,7 @@
- +
@@ -130,7 +130,7 @@
- +
@@ -151,7 +151,7 @@
- +
diff --git a/1.sources/MyHealth/src/managedbean/profile/RegisterUserMBean.java b/1.sources/MyHealth/src/managedbean/profile/RegisterUserMBean.java index f2969b9..d53a778 100644 --- a/1.sources/MyHealth/src/managedbean/profile/RegisterUserMBean.java +++ b/1.sources/MyHealth/src/managedbean/profile/RegisterUserMBean.java @@ -2,7 +2,6 @@ package managedbean.profile; import java.io.Serializable; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import javax.annotation.PostConstruct; @@ -49,8 +48,8 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable { private String lastUIQueryMS; // private HashMap userTypes; - private List userTypes; - private String userType; + private List availableUserTypes; + private UserType userType; private PrimaryHealthCareCenterTO primaryHealthCareCenter; private MedicalSpecialtyTO medicalSpecialty; private List medicalSpecialitiesList; @@ -62,26 +61,26 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable { @PostConstruct public void init() { - this.userTypes = new ArrayList(); - this.userTypes.add(UserType.PATIENT); - this.userTypes.add(UserType.FAMILY_DOCTOR); - this.userTypes.add(UserType.SPECIALIST_DOCTOR); + this.availableUserTypes = new ArrayList(); + this.availableUserTypes.add(UserType.PATIENT); + this.availableUserTypes.add(UserType.FAMILY_DOCTOR); + this.availableUserTypes.add(UserType.SPECIALIST_DOCTOR); this.registered = false; this.lastUIQueryPH = ""; this.lastUIQueryMS = ""; - this.userType = UserType.PATIENT.name(); + this.userType = UserType.PATIENT; this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH); this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH); } - public List getUserTypes() { - return userTypes; + public List getAvailableUserTypes() { + return availableUserTypes; } public void onUserTypeChange() { - switch (UserType.valueOf(this.userType)) { + switch (this.userType) { case SPECIALIST_DOCTOR: try { PrimeFaces.current().ajax().addCallbackParam("specs", true); @@ -130,15 +129,15 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable { } public boolean isPatient() { - return (UserType.valueOf(this.userType) == UserType.PATIENT); + return (this.userType == UserType.PATIENT); } public boolean isFamilyDoctor() { - return (UserType.valueOf(this.userType) == UserType.FAMILY_DOCTOR); + return (this.userType == UserType.FAMILY_DOCTOR); } public boolean isSpecialistDoctor() { - return (UserType.valueOf(this.userType) == UserType.SPECIALIST_DOCTOR); + return (this.userType == UserType.SPECIALIST_DOCTOR); } public boolean isDoctor() { @@ -203,7 +202,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable { if (error == 0) { try { - switch (UserType.valueOf(this.userType)) { + switch (this.userType) { case PATIENT: PatientTO pat = this.getRemoteManagerProfile().registerPatient(id, nif, name, surname, password, email); this.cipCode = pat.getPersonalIdentificationCode(); @@ -232,28 +231,28 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable { } } - public String getUserType() { + public UserType getUserType() { return userType; } - public void setUserType(String userType) { - this.userType = userType; + public void setUserType(UserType value) { + this.userType = value; } public MedicalSpecialtyTO getMedicalSpecialty() { return medicalSpecialty; } - public void setMedicalSpecialty(MedicalSpecialtyTO medicalSpecialty) { - this.medicalSpecialty = medicalSpecialty; + public void setMedicalSpecialty(MedicalSpecialtyTO value) { + this.medicalSpecialty = value; } public PrimaryHealthCareCenterTO getPrimaryHealthCareCenter() { return primaryHealthCareCenter; } - public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterTO primaryHealthCareCenter) { - this.primaryHealthCareCenter = primaryHealthCareCenter; + public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterTO value) { + this.primaryHealthCareCenter = value; } public boolean isRegistered() { diff --git a/1.sources/MyHealth/src/managedbean/profile/UpdateProfileMBean.java b/1.sources/MyHealth/src/managedbean/profile/UpdateProfileMBean.java index 81b492f..9199d59 100644 --- a/1.sources/MyHealth/src/managedbean/profile/UpdateProfileMBean.java +++ b/1.sources/MyHealth/src/managedbean/profile/UpdateProfileMBean.java @@ -2,7 +2,6 @@ package managedbean.profile; import java.io.Serializable; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import javax.annotation.PostConstruct; @@ -53,7 +52,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable private String lastUIQueryFD; private List userTypes; - private String userType; + private UserType userType; private PrimaryHealthCareCenterTO primaryHealthCareCenter; private MedicalSpecialtyTO medicalSpecialty; private List medicalSpecialitiesList; @@ -83,7 +82,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable 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.userType = usr.getUserType().getName(); + this.userType = usr.getUserType(); this.id = Integer.valueOf(usr.getId()); switch (usr.getUserType()) { @@ -147,29 +146,6 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable return userTypes; } - public void onUserTypeChange() { - switch (UserType.valueOf(this.userType)) { - case SPECIALIST_DOCTOR: - try { - PrimeFaces.current().ajax().addCallbackParam("specs", true); - } catch (Exception e) { - this.manageException(e); - } - break; - case FAMILY_DOCTOR: - try { - PrimeFaces.current().ajax().addCallbackParam("caps", true); - } catch (Exception e) { - this.manageException(e); - } - break; - case ADMINISTRATOR: - case PATIENT: - PrimeFaces.current().ajax().addCallbackParam("pats", true); - break; - } - } - public List getMedicalSpecialtiesList() { return medicalSpecialitiesList; } @@ -210,15 +186,15 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable } public boolean isUserTypePatient() { - return (UserType.valueOf(this.userType) == UserType.PATIENT); + return (this.userType == UserType.PATIENT); } public boolean isUserTypeFamilyDoctor() { - return (UserType.valueOf(this.userType) == UserType.FAMILY_DOCTOR); + return (this.userType == UserType.FAMILY_DOCTOR); } public boolean isUserTypeSpecialistDoctor() { - return (UserType.valueOf(this.userType) == UserType.SPECIALIST_DOCTOR); + return (this.userType == UserType.SPECIALIST_DOCTOR); } public boolean isUserTypeDoctor() { @@ -300,7 +276,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable if (error == 0) { try { - switch (UserType.valueOf(this.userType)) { + switch (this.userType) { case PATIENT: PatientTO pat = this.getRemoteManagerProfile().updatePatientData(id, nif, name, surname, password, email); this.setPatientData(pat); @@ -333,12 +309,12 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable } } - public String getUserType() { + public UserType getUserType() { return userType; } - public void setUserType(String userType) { - this.userType = userType; + public void setUserType(UserType value) { + this.userType = value; } public MedicalSpecialtyTO getMedicalSpecialty() {