@Test public void testNullAndEmptyProblemList() { try { when(this.mockJMeadowsClient.getPatientProblemList(any(JMeadowsQuery.class))).thenReturn(null); JMeadowsQuery query = new JMeadowsQueryBuilder() .user(user) .patient(patient) .build(); PatientIds patientIds = new PatientIds.Builder() .pid(pid) .icn(icn) .uid(uid) .edipi(edipi) .build(); List<VistaDataChunk> vistaDataChunkList = jMeadowsProblemService.fetchDodPatientProblems(query, patientIds); assertNotNull(vistaDataChunkList); assertThat(vistaDataChunkList.size(), is(0)); when(this.mockJMeadowsClient.getPatientProblemList(any(JMeadowsQuery.class))).thenReturn(new ArrayList<Problem>()); assertNotNull(vistaDataChunkList); assertThat(vistaDataChunkList.size(), is(0)); } catch (JMeadowsException_Exception e) { fail(e.getMessage()); } }
public List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsProblemService.fetchDodPatientProblems - Entering method..."); List<VistaDataChunk> oaProblemChunk = new ArrayList<VistaDataChunk>(); List<Problem> oaProblemResults = jMeadowsClient.getPatientProblemList(query); LOG.debug("JMeadowsProblemService.fetchPatientProblemList: " + ((oaProblemResults == null)? "NO" : "" + oaProblemResults.size()) + " Problems retrieved from JMeadows."); if ((oaProblemResults != null) && (oaProblemResults.size() > 0)) { oaProblemResults = (List<Problem>) filterOnSourceProtocol(oaProblemResults, SOURCE_PROTOCOL_DODADAPTER); int iNumProblems = calculateNumProblems(oaProblemResults); int oaProblemIdx = 1; for(Problem oProblem : oaProblemResults) { VistaDataChunk oProblemChunk = transformProblemChunk((ProblemDetail)oProblem, patientIds, iNumProblems, oaProblemIdx); if (oProblemChunk != null) { LOG.debug("JMeadowsProblemService.fetchPatientProblems: Found DoD Problem - Processing it... idx: " + oaProblemIdx); oaProblemChunk.add(oProblemChunk); oaProblemIdx++; } } } return oaProblemChunk; }
JMeadowsProblemService implements IJMeadowsProblemService { public List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsProblemService.fetchDodPatientProblems - Entering method..."); List<VistaDataChunk> oaProblemChunk = new ArrayList<VistaDataChunk>(); List<Problem> oaProblemResults = jMeadowsClient.getPatientProblemList(query); LOG.debug("JMeadowsProblemService.fetchPatientProblemList: " + ((oaProblemResults == null)? "NO" : "" + oaProblemResults.size()) + " Problems retrieved from JMeadows."); if ((oaProblemResults != null) && (oaProblemResults.size() > 0)) { oaProblemResults = (List<Problem>) filterOnSourceProtocol(oaProblemResults, SOURCE_PROTOCOL_DODADAPTER); int iNumProblems = calculateNumProblems(oaProblemResults); int oaProblemIdx = 1; for(Problem oProblem : oaProblemResults) { VistaDataChunk oProblemChunk = transformProblemChunk((ProblemDetail)oProblem, patientIds, iNumProblems, oaProblemIdx); if (oProblemChunk != null) { LOG.debug("JMeadowsProblemService.fetchPatientProblems: Found DoD Problem - Processing it... idx: " + oaProblemIdx); oaProblemChunk.add(oProblemChunk); oaProblemIdx++; } } } return oaProblemChunk; } }
JMeadowsProblemService implements IJMeadowsProblemService { public List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsProblemService.fetchDodPatientProblems - Entering method..."); List<VistaDataChunk> oaProblemChunk = new ArrayList<VistaDataChunk>(); List<Problem> oaProblemResults = jMeadowsClient.getPatientProblemList(query); LOG.debug("JMeadowsProblemService.fetchPatientProblemList: " + ((oaProblemResults == null)? "NO" : "" + oaProblemResults.size()) + " Problems retrieved from JMeadows."); if ((oaProblemResults != null) && (oaProblemResults.size() > 0)) { oaProblemResults = (List<Problem>) filterOnSourceProtocol(oaProblemResults, SOURCE_PROTOCOL_DODADAPTER); int iNumProblems = calculateNumProblems(oaProblemResults); int oaProblemIdx = 1; for(Problem oProblem : oaProblemResults) { VistaDataChunk oProblemChunk = transformProblemChunk((ProblemDetail)oProblem, patientIds, iNumProblems, oaProblemIdx); if (oProblemChunk != null) { LOG.debug("JMeadowsProblemService.fetchPatientProblems: Found DoD Problem - Processing it... idx: " + oaProblemIdx); oaProblemChunk.add(oProblemChunk); oaProblemIdx++; } } } return oaProblemChunk; } @Autowired  JMeadowsProblemService(JMeadowsConfiguration jMeadowsConfiguration); }
JMeadowsProblemService implements IJMeadowsProblemService { public List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsProblemService.fetchDodPatientProblems - Entering method..."); List<VistaDataChunk> oaProblemChunk = new ArrayList<VistaDataChunk>(); List<Problem> oaProblemResults = jMeadowsClient.getPatientProblemList(query); LOG.debug("JMeadowsProblemService.fetchPatientProblemList: " + ((oaProblemResults == null)? "NO" : "" + oaProblemResults.size()) + " Problems retrieved from JMeadows."); if ((oaProblemResults != null) && (oaProblemResults.size() > 0)) { oaProblemResults = (List<Problem>) filterOnSourceProtocol(oaProblemResults, SOURCE_PROTOCOL_DODADAPTER); int iNumProblems = calculateNumProblems(oaProblemResults); int oaProblemIdx = 1; for(Problem oProblem : oaProblemResults) { VistaDataChunk oProblemChunk = transformProblemChunk((ProblemDetail)oProblem, patientIds, iNumProblems, oaProblemIdx); if (oProblemChunk != null) { LOG.debug("JMeadowsProblemService.fetchPatientProblems: Found DoD Problem - Processing it... idx: " + oaProblemIdx); oaProblemChunk.add(oProblemChunk); oaProblemIdx++; } } } return oaProblemChunk; } @Autowired  JMeadowsProblemService(JMeadowsConfiguration jMeadowsConfiguration); void setJMeadowsClient(JMeadowsData jMeadowsClient); List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds); }
JMeadowsProblemService implements IJMeadowsProblemService { public List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsProblemService.fetchDodPatientProblems - Entering method..."); List<VistaDataChunk> oaProblemChunk = new ArrayList<VistaDataChunk>(); List<Problem> oaProblemResults = jMeadowsClient.getPatientProblemList(query); LOG.debug("JMeadowsProblemService.fetchPatientProblemList: " + ((oaProblemResults == null)? "NO" : "" + oaProblemResults.size()) + " Problems retrieved from JMeadows."); if ((oaProblemResults != null) && (oaProblemResults.size() > 0)) { oaProblemResults = (List<Problem>) filterOnSourceProtocol(oaProblemResults, SOURCE_PROTOCOL_DODADAPTER); int iNumProblems = calculateNumProblems(oaProblemResults); int oaProblemIdx = 1; for(Problem oProblem : oaProblemResults) { VistaDataChunk oProblemChunk = transformProblemChunk((ProblemDetail)oProblem, patientIds, iNumProblems, oaProblemIdx); if (oProblemChunk != null) { LOG.debug("JMeadowsProblemService.fetchPatientProblems: Found DoD Problem - Processing it... idx: " + oaProblemIdx); oaProblemChunk.add(oProblemChunk); oaProblemIdx++; } } } return oaProblemChunk; } @Autowired  JMeadowsProblemService(JMeadowsConfiguration jMeadowsConfiguration); void setJMeadowsClient(JMeadowsData jMeadowsClient); List<VistaDataChunk> fetchDodPatientProblems(JMeadowsQuery query, PatientIds patientIds); static final String DOMAIN_PROBLEM; }