@Test public void testFetchPatientRadiologyReports() { try { when(this.mockJMeadowsClient.getPatientRads(any(JMeadowsQuery.class))).thenReturn(createTestData()); 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 = jMeadowsRadiologyService.fetchDodPatientRadiologyReports(query, patientIds); assertNotNull(vistaDataChunkList); assertThat(vistaDataChunkList.size(), is(2)); List<RadiologyReport> testDataList = createTestData(); for(int i = 0; i < vistaDataChunkList.size(); i++) { VistaDataChunk vistaDataChunk = vistaDataChunkList.get(i); assertThat(JMeadowsRadiologyService.DOMAIN_RADIOLOGY, is(vistaDataChunk.getDomain())); assertThat(2, is(vistaDataChunk.getItemCount())); assertThat(i+1, is(vistaDataChunk.getItemIndex())); assertThat(vistaId, is(vistaDataChunk.getParams().get("vistaId"))); assertThat(dfn, is(vistaDataChunk.getParams().get("patientDfn"))); assertThat(vistaId, is(vistaDataChunk.getSystemId())); assertThat(dfn, is(vistaDataChunk.getLocalPatientId())); assertThat(icn, is(vistaDataChunk.getPatientIcn())); assertThat("DOD;" + edipi, is(vistaDataChunk.getPatientId())); assertThat("vrpcb: assertThat(VistaDataChunk.NEW_OR_UPDATE, is(vistaDataChunk.getType())); Map<String,Object> jsonMap = vistaDataChunk.getJsonMap(); RadiologyReport testReport = testDataList.get(i); assertThat("INTERNAL MEDICINE SEYMOUR JOHNSON AFB, NC", is(jsonMap.get("imageLocation"))); assertThat("TRANSCRIBED", is(jsonMap.get("statusName"))); assertThat("DOD", is(jsonMap.get("facilityCode"))); assertThat("DOD", is(jsonMap.get("facilityName"))); assertThat("urn:va:image:DOD:"+edipi+":"+ testReport.getCdrEventId(), is(jsonMap.get("uid"))); assertThat("Radiology", is(jsonMap.get("kind"))); assertThat(testReport.getAccessionNumber(), is(jsonMap.get("localId"))); assertThat(testReport.getExamId(), is(jsonMap.get("encounterUid"))); assertThat(testReport.getReasonForOrder(), is(jsonMap.get("reason"))); assertThat(testReport.getStatus(), is(jsonMap.get("status"))); assertThat(calendarToPointInTime(testReport.getExamDate()).toString(), is(jsonMap.get("dateTime"))); List<Map<String, Object>> providers = (List<Map<String, Object>>)jsonMap.get("providers"); assertThat(providers.size(), is(1)); Map<String, Object> provider = providers.get(0); assertThat(testReport.getInterpretingHCP(), is(provider.get("providerName"))); assertThat(testReport.getInterpretingHCP(), is(provider.get("providerDisplayName"))); List<Map<String, Object>> results = (List<Map<String, Object>>)jsonMap.get("results"); assertThat(providers.size(), is(1)); Map<String, Object> result = results.get(0); assertThat(testReport.getStudy(), is(result.get("localTitle"))); } } catch (JMeadowsException_Exception e) { fail(e.getMessage()); } }
@Override public List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports - Entering method..."); validateParams(query, patientIds, USER, PATIENT); List<VistaDataChunk> oaRadChunk = new ArrayList<VistaDataChunk>(); List<RadiologyReport> oaRads = jMeadowsClient.getPatientRads(query); LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: " + ((oaRads == null)? "NO" : ""+oaRads.size()) + " results retrieved from JMeadows."); if ((oaRads != null) && (oaRads.size() > 0)) { oaRads = (List<RadiologyReport>) filterOnSourceProtocol(oaRads, SOURCE_PROTOCOL_DODADAPTER); int iNumRads = calculateNumRadiologyReports(oaRads); int iCurRadIdx = 1; for (RadiologyReport oRad : oaRads) { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: Found DoD Radiology Report - Processing it... idx: " + iCurRadIdx); VistaDataChunk oRadChunk = transformRadiologyChunk(oRad, patientIds, iNumRads, iCurRadIdx); if (oRadChunk != null) { oaRadChunk.add(oRadChunk); iCurRadIdx++; } } } return oaRadChunk; }
JMeadowsRadiologyService implements IJMeadowsRadiologyService { @Override public List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports - Entering method..."); validateParams(query, patientIds, USER, PATIENT); List<VistaDataChunk> oaRadChunk = new ArrayList<VistaDataChunk>(); List<RadiologyReport> oaRads = jMeadowsClient.getPatientRads(query); LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: " + ((oaRads == null)? "NO" : ""+oaRads.size()) + " results retrieved from JMeadows."); if ((oaRads != null) && (oaRads.size() > 0)) { oaRads = (List<RadiologyReport>) filterOnSourceProtocol(oaRads, SOURCE_PROTOCOL_DODADAPTER); int iNumRads = calculateNumRadiologyReports(oaRads); int iCurRadIdx = 1; for (RadiologyReport oRad : oaRads) { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: Found DoD Radiology Report - Processing it... idx: " + iCurRadIdx); VistaDataChunk oRadChunk = transformRadiologyChunk(oRad, patientIds, iNumRads, iCurRadIdx); if (oRadChunk != null) { oaRadChunk.add(oRadChunk); iCurRadIdx++; } } } return oaRadChunk; } }
JMeadowsRadiologyService implements IJMeadowsRadiologyService { @Override public List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports - Entering method..."); validateParams(query, patientIds, USER, PATIENT); List<VistaDataChunk> oaRadChunk = new ArrayList<VistaDataChunk>(); List<RadiologyReport> oaRads = jMeadowsClient.getPatientRads(query); LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: " + ((oaRads == null)? "NO" : ""+oaRads.size()) + " results retrieved from JMeadows."); if ((oaRads != null) && (oaRads.size() > 0)) { oaRads = (List<RadiologyReport>) filterOnSourceProtocol(oaRads, SOURCE_PROTOCOL_DODADAPTER); int iNumRads = calculateNumRadiologyReports(oaRads); int iCurRadIdx = 1; for (RadiologyReport oRad : oaRads) { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: Found DoD Radiology Report - Processing it... idx: " + iCurRadIdx); VistaDataChunk oRadChunk = transformRadiologyChunk(oRad, patientIds, iNumRads, iCurRadIdx); if (oRadChunk != null) { oaRadChunk.add(oRadChunk); iCurRadIdx++; } } } return oaRadChunk; } @Autowired  JMeadowsRadiologyService(JMeadowsConfiguration jMeadowsConfiguration); }
JMeadowsRadiologyService implements IJMeadowsRadiologyService { @Override public List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports - Entering method..."); validateParams(query, patientIds, USER, PATIENT); List<VistaDataChunk> oaRadChunk = new ArrayList<VistaDataChunk>(); List<RadiologyReport> oaRads = jMeadowsClient.getPatientRads(query); LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: " + ((oaRads == null)? "NO" : ""+oaRads.size()) + " results retrieved from JMeadows."); if ((oaRads != null) && (oaRads.size() > 0)) { oaRads = (List<RadiologyReport>) filterOnSourceProtocol(oaRads, SOURCE_PROTOCOL_DODADAPTER); int iNumRads = calculateNumRadiologyReports(oaRads); int iCurRadIdx = 1; for (RadiologyReport oRad : oaRads) { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: Found DoD Radiology Report - Processing it... idx: " + iCurRadIdx); VistaDataChunk oRadChunk = transformRadiologyChunk(oRad, patientIds, iNumRads, iCurRadIdx); if (oRadChunk != null) { oaRadChunk.add(oRadChunk); iCurRadIdx++; } } } return oaRadChunk; } @Autowired  JMeadowsRadiologyService(JMeadowsConfiguration jMeadowsConfiguration); void setJMeadowsClient(JMeadowsData jMeadowsClient); @Override List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds); }
JMeadowsRadiologyService implements IJMeadowsRadiologyService { @Override public List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds) throws JMeadowsException_Exception { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports - Entering method..."); validateParams(query, patientIds, USER, PATIENT); List<VistaDataChunk> oaRadChunk = new ArrayList<VistaDataChunk>(); List<RadiologyReport> oaRads = jMeadowsClient.getPatientRads(query); LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: " + ((oaRads == null)? "NO" : ""+oaRads.size()) + " results retrieved from JMeadows."); if ((oaRads != null) && (oaRads.size() > 0)) { oaRads = (List<RadiologyReport>) filterOnSourceProtocol(oaRads, SOURCE_PROTOCOL_DODADAPTER); int iNumRads = calculateNumRadiologyReports(oaRads); int iCurRadIdx = 1; for (RadiologyReport oRad : oaRads) { LOG.debug("JMeadowsRadiologyService.fetchDodPatientRadiologyReports: Found DoD Radiology Report - Processing it... idx: " + iCurRadIdx); VistaDataChunk oRadChunk = transformRadiologyChunk(oRad, patientIds, iNumRads, iCurRadIdx); if (oRadChunk != null) { oaRadChunk.add(oRadChunk); iCurRadIdx++; } } } return oaRadChunk; } @Autowired  JMeadowsRadiologyService(JMeadowsConfiguration jMeadowsConfiguration); void setJMeadowsClient(JMeadowsData jMeadowsClient); @Override List<VistaDataChunk> fetchDodPatientRadiologyReports(JMeadowsQuery query, PatientIds patientIds); static final String DOMAIN_RADIOLOGY; }