Example usage for java.sql Timestamp setMinutes

List of usage examples for java.sql Timestamp setMinutes

Introduction

In this page you can find the example usage for java.sql Timestamp setMinutes.

Prototype

@Deprecated
public void setMinutes(int minutes) 

Source Link

Document

Sets the minutes of this Date object to the specified value.

Usage

From source file:dk.nsi.haiba.lprimporter.dao.impl.LPRContactRowMapper.java

@Override
public Administration mapRow(ResultSet rs, int rowNum) throws SQLException {

    Administration adm = new Administration();

    adm.setRecordNumber(rs.getString("v_recnum"));
    adm.setSygehusCode(rs.getString("c_sgh"));
    adm.setAfdelingsCode(rs.getString("c_afd"));
    adm.setCpr(rs.getString("v_cpr"));
    adm.setPatientType(rs.getInt("c_pattype"));
    Timestamp tsIn = rs.getTimestamp("d_inddto");
    // Rule #4 - no minutes and seconds are used in LPR
    if (tsIn != null) {
        tsIn.setMinutes(0);
        tsIn.setSeconds(0);/*from w  ww  . ja va 2 s.  co  m*/
        adm.setIndlaeggelsesDatetime(new Date(tsIn.getTime()));
    }
    Timestamp tsOut = rs.getTimestamp("d_uddto");
    if (tsOut != null) {
        tsOut.setMinutes(0);
        tsOut.setSeconds(0);
        adm.setUdskrivningsDatetime(new Date(tsOut.getTime()));
    }

    String type = rs.getString("v_type");
    if (type != null) {
        if (DIAGNOSIS.equalsIgnoreCase(type)) {
            LPRDiagnose d = new LPRDiagnose();
            d.setRecordNumber(rs.getString("v_recnum"));
            d.setDiagnoseCode(rs.getString("c_kode"));
            d.setTillaegsDiagnose(rs.getString("c_tilkode"));
            d.setDiagnoseType(rs.getString("c_kodeart"));
            adm.addLprDiagnose(d);
        } else {
            // everything not a diagnosis is a procedure.
            LPRProcedure p = new LPRProcedure();

            p.setRecordNumber(rs.getString("v_recnum"));
            p.setProcedureCode(rs.getString("c_kode"));
            p.setTillaegsProcedureCode(rs.getString("c_tilkode"));
            p.setProcedureType(rs.getString("c_kodeart"));
            p.setSygehusCode(rs.getString("c_psgh"));
            p.setAfdelingsCode(rs.getString("c_pafd"));
            Timestamp ts = rs.getTimestamp("d_pdto");
            if (ts != null) {
                ts.setMinutes(0);
                ts.setSeconds(0);
                p.setProcedureDatetime(new Date(ts.getTime()));
            }
            adm.addLprProcedure(p);
        }
    }
    return adm;
}