@Test public void testGetNotesLoincFromDodNcidNull() { try { when(mockResultSet.next()).thenReturn(false); JLVMappedCode oMappedCode = testSubject.getNotesLoincFromDodNcid(null); assertNull("The result should have been null", oMappedCode); } catch (Exception e) { System.out.println("An unexpected exception occurred. Error: " + e.getMessage()); e.printStackTrace(); fail("An unexpected exception occurred. Error: " + e.getMessage()); } }
public JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid) throws TermLoadException { JLVMappedCode oMappedCode = null; if (NullChecker.isNotNullish(sDodNcid)) { PreparedStatement psSelectStatement = null; ResultSet oResults = null; try { psSelectStatement = this.oDBConnection.prepareStatement(SQL_SELECT_BY_DOD_NCID); psSelectStatement.setString(SQL_PARAM_DOD_NCID, sDodNcid); oResults = psSelectStatement.executeQuery(); boolean bHasResult = false; if (oResults.next()) { JLVMappedCode oTempMappedCode = new JLVMappedCode(); String sUmlsCode = oResults.getString(SQL_FIELD_DOD_NOTES_LOINC); if (NullChecker.isNotNullish(sUmlsCode)) { oTempMappedCode.setCode(sUmlsCode); bHasResult = true; } String sUmlsText = oResults.getString(SQL_FIELD_DOD_NOTES_MMM_NAME); if (NullChecker.isNotNullish(sUmlsText)) { oTempMappedCode.setDisplayText(sUmlsText); bHasResult = true; } if (bHasResult) { oTempMappedCode.setCodeSystem(CODE_SYSTEM_LOINC); oMappedCode = oTempMappedCode; } } } catch (SQLException e) { throw new TermLoadException("Failed to read notes information from the 'dod_notes' table. Error: " + e.getMessage(), e); } finally { TermLoadException exceptionToThrow = null; if (oResults != null) { try { oResults.close(); oResults = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the result set. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (psSelectStatement != null) { try { psSelectStatement.close(); psSelectStatement = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the prepared statement. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (exceptionToThrow != null) { throw exceptionToThrow; } } } return oMappedCode; }
JLVNotesMap { public JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid) throws TermLoadException { JLVMappedCode oMappedCode = null; if (NullChecker.isNotNullish(sDodNcid)) { PreparedStatement psSelectStatement = null; ResultSet oResults = null; try { psSelectStatement = this.oDBConnection.prepareStatement(SQL_SELECT_BY_DOD_NCID); psSelectStatement.setString(SQL_PARAM_DOD_NCID, sDodNcid); oResults = psSelectStatement.executeQuery(); boolean bHasResult = false; if (oResults.next()) { JLVMappedCode oTempMappedCode = new JLVMappedCode(); String sUmlsCode = oResults.getString(SQL_FIELD_DOD_NOTES_LOINC); if (NullChecker.isNotNullish(sUmlsCode)) { oTempMappedCode.setCode(sUmlsCode); bHasResult = true; } String sUmlsText = oResults.getString(SQL_FIELD_DOD_NOTES_MMM_NAME); if (NullChecker.isNotNullish(sUmlsText)) { oTempMappedCode.setDisplayText(sUmlsText); bHasResult = true; } if (bHasResult) { oTempMappedCode.setCodeSystem(CODE_SYSTEM_LOINC); oMappedCode = oTempMappedCode; } } } catch (SQLException e) { throw new TermLoadException("Failed to read notes information from the 'dod_notes' table. Error: " + e.getMessage(), e); } finally { TermLoadException exceptionToThrow = null; if (oResults != null) { try { oResults.close(); oResults = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the result set. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (psSelectStatement != null) { try { psSelectStatement.close(); psSelectStatement = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the prepared statement. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (exceptionToThrow != null) { throw exceptionToThrow; } } } return oMappedCode; } }
JLVNotesMap { public JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid) throws TermLoadException { JLVMappedCode oMappedCode = null; if (NullChecker.isNotNullish(sDodNcid)) { PreparedStatement psSelectStatement = null; ResultSet oResults = null; try { psSelectStatement = this.oDBConnection.prepareStatement(SQL_SELECT_BY_DOD_NCID); psSelectStatement.setString(SQL_PARAM_DOD_NCID, sDodNcid); oResults = psSelectStatement.executeQuery(); boolean bHasResult = false; if (oResults.next()) { JLVMappedCode oTempMappedCode = new JLVMappedCode(); String sUmlsCode = oResults.getString(SQL_FIELD_DOD_NOTES_LOINC); if (NullChecker.isNotNullish(sUmlsCode)) { oTempMappedCode.setCode(sUmlsCode); bHasResult = true; } String sUmlsText = oResults.getString(SQL_FIELD_DOD_NOTES_MMM_NAME); if (NullChecker.isNotNullish(sUmlsText)) { oTempMappedCode.setDisplayText(sUmlsText); bHasResult = true; } if (bHasResult) { oTempMappedCode.setCodeSystem(CODE_SYSTEM_LOINC); oMappedCode = oTempMappedCode; } } } catch (SQLException e) { throw new TermLoadException("Failed to read notes information from the 'dod_notes' table. Error: " + e.getMessage(), e); } finally { TermLoadException exceptionToThrow = null; if (oResults != null) { try { oResults.close(); oResults = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the result set. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (psSelectStatement != null) { try { psSelectStatement.close(); psSelectStatement = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the prepared statement. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (exceptionToThrow != null) { throw exceptionToThrow; } } } return oMappedCode; } @SuppressWarnings("unused") private  JLVNotesMap();  JLVNotesMap(Connection oDBConnection); }
JLVNotesMap { public JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid) throws TermLoadException { JLVMappedCode oMappedCode = null; if (NullChecker.isNotNullish(sDodNcid)) { PreparedStatement psSelectStatement = null; ResultSet oResults = null; try { psSelectStatement = this.oDBConnection.prepareStatement(SQL_SELECT_BY_DOD_NCID); psSelectStatement.setString(SQL_PARAM_DOD_NCID, sDodNcid); oResults = psSelectStatement.executeQuery(); boolean bHasResult = false; if (oResults.next()) { JLVMappedCode oTempMappedCode = new JLVMappedCode(); String sUmlsCode = oResults.getString(SQL_FIELD_DOD_NOTES_LOINC); if (NullChecker.isNotNullish(sUmlsCode)) { oTempMappedCode.setCode(sUmlsCode); bHasResult = true; } String sUmlsText = oResults.getString(SQL_FIELD_DOD_NOTES_MMM_NAME); if (NullChecker.isNotNullish(sUmlsText)) { oTempMappedCode.setDisplayText(sUmlsText); bHasResult = true; } if (bHasResult) { oTempMappedCode.setCodeSystem(CODE_SYSTEM_LOINC); oMappedCode = oTempMappedCode; } } } catch (SQLException e) { throw new TermLoadException("Failed to read notes information from the 'dod_notes' table. Error: " + e.getMessage(), e); } finally { TermLoadException exceptionToThrow = null; if (oResults != null) { try { oResults.close(); oResults = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the result set. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (psSelectStatement != null) { try { psSelectStatement.close(); psSelectStatement = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the prepared statement. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (exceptionToThrow != null) { throw exceptionToThrow; } } } return oMappedCode; } @SuppressWarnings("unused") private  JLVNotesMap();  JLVNotesMap(Connection oDBConnection); List<JLVMappedCode> getNotesLoincFromVuid(String sVuid); JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid); }
JLVNotesMap { public JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid) throws TermLoadException { JLVMappedCode oMappedCode = null; if (NullChecker.isNotNullish(sDodNcid)) { PreparedStatement psSelectStatement = null; ResultSet oResults = null; try { psSelectStatement = this.oDBConnection.prepareStatement(SQL_SELECT_BY_DOD_NCID); psSelectStatement.setString(SQL_PARAM_DOD_NCID, sDodNcid); oResults = psSelectStatement.executeQuery(); boolean bHasResult = false; if (oResults.next()) { JLVMappedCode oTempMappedCode = new JLVMappedCode(); String sUmlsCode = oResults.getString(SQL_FIELD_DOD_NOTES_LOINC); if (NullChecker.isNotNullish(sUmlsCode)) { oTempMappedCode.setCode(sUmlsCode); bHasResult = true; } String sUmlsText = oResults.getString(SQL_FIELD_DOD_NOTES_MMM_NAME); if (NullChecker.isNotNullish(sUmlsText)) { oTempMappedCode.setDisplayText(sUmlsText); bHasResult = true; } if (bHasResult) { oTempMappedCode.setCodeSystem(CODE_SYSTEM_LOINC); oMappedCode = oTempMappedCode; } } } catch (SQLException e) { throw new TermLoadException("Failed to read notes information from the 'dod_notes' table. Error: " + e.getMessage(), e); } finally { TermLoadException exceptionToThrow = null; if (oResults != null) { try { oResults.close(); oResults = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the result set. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (psSelectStatement != null) { try { psSelectStatement.close(); psSelectStatement = null; } catch (SQLException e) { String sErrorMessage = "Failed to close the prepared statement. Error: " + e.getMessage(); LOG.error(sErrorMessage, e); exceptionToThrow = new TermLoadException(sErrorMessage, e); } } if (exceptionToThrow != null) { throw exceptionToThrow; } } } return oMappedCode; } @SuppressWarnings("unused") private  JLVNotesMap();  JLVNotesMap(Connection oDBConnection); List<JLVMappedCode> getNotesLoincFromVuid(String sVuid); JLVMappedCode getNotesLoincFromDodNcid(String sDodNcid); static final int SQL_PARAM_VUID; static final int SQL_PARAM_DOD_NCID; static final int SQL_FIELD_VA_NOTES_SOURCE_CODE; static final int SQL_FIELD_VA_NOTES_SOURCE_CODE_TEXT; static final int SQL_FIELD_VA_NOTES_MAP_PATH_WAY_ID; static final int SQL_FIELD_VA_NOTES_LOINC_NUM; static final int SQL_FIELD_VA_NOTES_LOINC_TITLE; static final int SQL_FIELD_DOD_NOTES_ID; static final int SQL_FIELD_DOD_NOTES_NCID; static final int SQL_FIELD_DOD_NOTES_LOINC; static final int SQL_FIELD_DOD_NOTES_MMM_NAME; static final String CODE_SYSTEM_LOINC; }