Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/src/main/java/org/openmrs/util/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public HttpClient(HttpUrl url) {
this.url = url;
}

/**
* Realiza una consulta http post a la url que ingresa al constructor y devuelve la respuesta del servidor
*
* @param parameters parametro de ingreso al constructor
* @return respuesta del servidos
*/
public String post(Map<String, String> parameters) {
OutputStreamWriter wr = null;
BufferedReader rd = null;
Expand Down
36 changes: 36 additions & 0 deletions api/src/main/java/org/openmrs/util/UpgradeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public static Integer getConceptIdForUnits(String units) {
+ ". Please refer to upgrade instructions for more details. https://wiki.openmrs.org/x/OALpAw");
}

/**
*
* Busca en la base de datos el uuid del concepto cuyo concept_id es igual al que se pasa como parametro
*
* @param connection
* @param conceptId
* @return
* @throws SQLException
**/
public static String getConceptUuid(Connection connection, int conceptId) throws SQLException {

try (PreparedStatement select = connection.prepareStatement("select uuid from concept where concept_id = ?")) {
Expand All @@ -88,6 +97,15 @@ public static String getConceptUuid(Connection connection, int conceptId) throws
}
}

/**
*
* El parametro gp que se ingresa es buscado en la base para saber si existe y si es asi devuelve su valor
*
* @param connection
* @param gp
* @return
* @throws SQLException
**/
public static String getGlobalProperty(Connection connection, String gp) throws SQLException {

try (PreparedStatement select = connection
Expand All @@ -103,6 +121,15 @@ public static String getGlobalProperty(Connection connection, String gp) throws
}
}

/**
*
* al ingresar el identificador lo busca en la base de datos y devuelve una lista con los conceptos que pertenecen a ese grupo
*
* @param connection
* @param conceptUuid
* @return lista de los conceptos que pertenecen al grupo
* @throws SQLException
**/
public static List<Integer> getMemberSetIds(Connection connection, String conceptUuid) throws SQLException {
Integer conceptSetId;

Expand Down Expand Up @@ -132,6 +159,15 @@ public static List<Integer> getMemberSetIds(Connection connection, String concep
return conceptIds;
}

/**
*
* al ingresar el concepto se busca en la base de datos si existe ese valor, si es asi devuelve su identificador
*
* @param connection
* @param conceptIdForFrequency
* @return identificador del concepto
* @throws SQLException
**/
public static Integer getOrderFrequencyIdForConceptId(Connection connection, Integer conceptIdForFrequency)
throws SQLException {
PreparedStatement orderFrequencyIdQuery = connection
Expand Down