Clases para reflejar los enumerados TestType y QuestionStatus.

This commit is contained in:
Marcos Garcia Nuñez
2019-12-12 22:08:36 +01:00
parent 49d07c6599
commit c2852718ce
6 changed files with 86 additions and 24 deletions

View File

@@ -1,7 +1,12 @@
package common; package common;
/**
*
* @author Marcos García Núñez (mgarcianun@uoc.edu)
*
*/
public class Constants { public class Constants {
public static final int MAX_ITEMS_AUTOCOMPLETE_SEARCH = 200; public static final int MAX_ITEMS_AUTOCOMPLETE_SEARCH = 200;
public static final String PROFESSIONAL_NUMBER_PREFIX= "PRO#"; public static final String PROFESSIONAL_NUMBER_PREFIX = "PRO#";
public static final String PERSONAL_IDENTIFICATION_CODE_PREFIX= "PAT#"; public static final String PERSONAL_IDENTIFICATION_CODE_PREFIX = "PAT#";
} }

View File

@@ -1,10 +1,14 @@
package common; package common;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.xml.bind.DatatypeConverter; import javax.xml.bind.DatatypeConverter;
/**
*
* @author Marcos García Núñez (mgarcianun@uoc.edu)
*
*/
public class HashUtils { public class HashUtils {
public static String hashMD5(String stringValue) { public static String hashMD5(String stringValue) {

View File

@@ -0,0 +1,24 @@
package common;
/**
*
* @author Marcos García Núñez (mgarcianun@uoc.edu)
*
*/
public enum QuestionStatus {
ANSWERED("Respondida"), PENDING("Pendiente");
private String questionStatusName;
private QuestionStatus(String typeName) {
this.questionStatusName = typeName;
}
public String getQuestionStatusName() {
return questionStatusName;
}
public String getName() {
return this.name();
}
}

View File

@@ -0,0 +1,24 @@
package common;
/**
*
* @author Marcos García Núñez (mgarcianun@uoc.edu)
*
*/
public enum TestType {
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) {
this.testTypeName = typeName;
}
public String getTestTypeName() {
return testTypeName;
}
public String getName() {
return this.name();
}
}

View File

@@ -1,22 +1,24 @@
package common; package common;
/**
*
* @author Marcos García Núñez (mgarcianun@uoc.edu)
*
*/
public enum UserType { public enum UserType {
PATIENT("Paciente"), PATIENT("Paciente"), FAMILY_DOCTOR("Médico de familia"), SPECIALIST_DOCTOR("Médico especialista"), ADMINISTRATOR("Administrador");
FAMILY_DOCTOR("Médico de familia"),
SPECIALIST_DOCTOR("Médico especialista"),
ADMINISTRATOR("Administrador");
private String userTypename;
private UserType (String userTypename){
this.userTypename = userTypename;
}
public String getUserTypename() { private String userTypename;
return userTypename;
} private UserType(String userTypename) {
this.userTypename = userTypename;
public String getName() {
return this.name();
}
} }
public String getUserTypename() {
return userTypename;
}
public String getName() {
return this.name();
}
}

View File

@@ -2,10 +2,13 @@ package common;
import java.text.Normalizer; import java.text.Normalizer;
/**
*
* @author Marcos García Núñez (mgarcianun@uoc.edu)
*
*/
public class Utils { public class Utils {
public static String stripAccents(String input){ public static String stripAccents(String input) {
return input == null ? null : return input == null ? null : Normalizer.normalize(input, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
Normalizer.normalize(input, Normalizer.Form.NFD)
.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
} }
} }