private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); } }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
private List<DiscontinuedOrder> getDiscontinuedOrders(JdbcConnection connection) throws CustomChangeException, SQLException { List<DiscontinuedOrder> dcOrders = new ArrayList<>(); PreparedStatement statement = null; try { statement = connection.prepareStatement("select order_id, concept_id, patient_id, encounter_id, date_stopped, " + "discontinued_by, discontinued_reason, discontinued_reason_non_coded, order_type_id " + "from orders where discontinued = ?"); statement.setBoolean(1, true); ResultSet rs = statement.executeQuery(); while (rs.next()) { dcOrders.add(new DiscontinuedOrder(rs.getInt("order_id"), rs.getInt("concept_id"), rs.getInt("patient_id"), rs.getInt("encounter_id"), rs.getInt("discontinued_by"), rs.getInt("discontinued_reason"), rs .getString("discontinued_reason_non_coded"), rs.getDate("date_stopped"), rs .getInt("order_type_id"))); } } catch (SQLException | DatabaseException e) { throw new CustomChangeException(e); } finally { if (statement != null) { statement.close(); } } return dcOrders; }
throws CustomChangeException { if (trueConceptId == null || trueConceptId < 1 || falseConceptId == null || falseConceptId < 1) { throw new CustomChangeException("Can't create global properties for true/false concepts with invalid conceptIds"); throw new CustomChangeException("Unable to create global properties for concept ids defining boolean concepts", e);
throw new CustomChangeException("Unable to get int", e);
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); DatabaseMetaData metadata; try { metadata = connection.getMetaData(); String[] types = { "TABLE" }; ResultSet rs = metadata.getTables(null, null, "%", types); while (rs.next()) { String tableName = rs.getString(3); connection.prepareStatement("ALTER TABLE " + tableName + " DISABLE TRIGGER ALL").execute(); } } catch (DatabaseException | SQLException ex) { throw new CustomChangeException("Error disabling trigger: " + ex); } }
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); DatabaseMetaData metadata; try { metadata = connection.getMetaData(); String[] types = { "TABLE" }; ResultSet rs = metadata.getTables(null, null, "%", types); while (rs.next()) { String tableName = rs.getString(3); connection.prepareStatement("ALTER TABLE " + tableName + " ENABLE TRIGGER ALL").execute(); } } catch (DatabaseException | SQLException ex) { throw new CustomChangeException("Error enabling trigger: " + ex); } }
throw new CustomChangeException(e);
throw new CustomChangeException("Unable to change obs", e);
throw new CustomChangeException("Unable to move deleted HL7s from archive table to queue table", e);
throw new CustomChangeException("Failed to update secret answers: " + e);
throw new CustomChangeException( "Unable to copy " + sqlFile + " to file: " + tmpOutputFile.getAbsolutePath(), e); } else { throw new CustomChangeException("Unable to copy " + sqlFile, e); throw new CustomChangeException("Unable to generate command string for file: " + sqlFile, e); throw new CustomChangeException("Unable to run command: " + commands.get(0) + ". Make sure that it is on the PATH and then restart your server and try again. " + " Or run " + errorCommand + " at the command line with the appropriate full mysql path", io); throw new CustomChangeException("Error while executing command: '" + commands.get(0) + "'", e); log.error("There was an error while running the " + commands.get(0) + " command. Command output: " + output.toString()); throw new CustomChangeException( "There was an error while running the " + commands.get(0)
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { List<DiscontinuedOrder> discontinuedOrders = getDiscontinuedOrders(connection); createDiscontinueOrders(connection, discontinuedOrders); } catch (SQLException | DatabaseException e) { throw new CustomChangeException(e); } }
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { List<List<Object>> usersAndProviders = getUsersAndProviders(connection); convertOrdererToProvider(connection, usersAndProviders); } catch (Exception e) { throw new CustomChangeException(e); } }
throw new CustomChangeException("Unable to create concept with names " + names, e);
ResultSet rs = selectStatement.executeQuery(sql); if (!rs.next()) { throw new CustomChangeException("Failed to find row with name 'Allergy' in the active_list_type"); throw new CustomChangeException(ex);
throw new CustomChangeException("Failed to insert one or more concept map types", be); throw new CustomChangeException("Failed to insert one or more concept map types:", e);