Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. /**
  2.      * Adds the given CPT codes to the given office visit
  3.      * @param icd A double representing the ICD code to be added.
  4.      * @param visitID The ID of the office visit we are adding the code to.
  5.      * @return A long for the new ICD code's ID.
  6.      * @throws DBException
  7.      */
  8.     public long addDiagnosisToOfficeVisit(double icd, long visitID) throws DBException {
  9.         Connection conn = null;
  10.         PreparedStatement ps = null;
  11.         try {
  12.             conn = factory.getConnection();
  13.             ps = conn.prepareStatement("INSERT INTO OVDiagnosis (ICDCode,VisitID) VALUES (?,?)");
  14.             ps.setDouble(1, icd);
  15.             ps.setLong(2, visitID);
  16.             ps.executeUpdate();
  17.             return DBUtil.getLastInsert(conn);
  18.         } catch (SQLException e) {
  19.             e.printStackTrace();
  20.             throw new DBException(e);
  21.         } finally {
  22.             DBUtil.closeConnection(conn, ps);
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement