private void listAllInvestigations_OrderedAndSentOnly() { OrderInvestigationBookingVoCollection voColl = domain.listResultsAwaited(form.getGlobalContext().Core.getPatientShort(), ConfigFlag.UI.EDISCHARGE_RESULTS_NUM_DAYS.getValue()); for (int i = 0; voColl != null && i < voColl.size(); i++) { boolean bFound = false; for (int j = 0; j < form.grdResults().getRows().size(); j++) { if (voColl.get(i).equals(form.grdResults().getRows().get(j).getValue())) { bFound = true; break; } } if (!bFound && voColl.get(i).getInvestigationIsNotNull() && voColl.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voColl.get(i).getInvestigation().getInvestigationIndex().getNameIsNotNull()) { grdResultsRow row = form.grdResults().getRows().newRow(); row.setColInv(voColl.get(i).getInvestigation().getInvestigationIndex().getName()); row.setValue(voColl.get(i)); } } }
private void listAllResultsForTimePeriod(boolean bNew) { OrderInvestigationBookingVoCollection voColl = domain.listPendingResults(form.getGlobalContext().Core.getPatientShort(), form.getGlobalContext().Core.getCurrentCareContext()); //WDEV-13046 domain.listInvestigationResults(form.getGlobalContext().Core.getPatientShort(), ConfigFlag.UI.EDISCHARGE_RESULTS_NUM_DAYS.getValue()); for(int i = 0 ; voColl != null && i < voColl.size() ; i++) { boolean bFound = false; for(int j = 0 ; j < form.grdOtherResults().getRows().size() ; j++) { if (voColl.get(i).equals(form.grdOtherResults().getRows().get(j).getValue())) { bFound = true; break; } } if ( ! bFound &&voColl.get(i).getInvestigationIsNotNull() && voColl.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voColl.get(i).getInvestigation().getInvestigationIndex().getNameIsNotNull()) { grdOtherResultsRow row = form.grdOtherResults().getRows().newRow(); row.setColInvestigation(voColl.get(i).getInvestigation().getInvestigationIndex().getName()); //if(bNew) WDEV-13046 // row.setColInclude(true); WDEV-13046 row.setValue(voColl.get(i)); } } }
private void sortByOrderedDate(OrderInvestigationBookingVoCollection results) { if(results == null) return; results.sort(new OrderedDateTime(SortOrder.DESCENDING)); }
private void listAllResultsForTimePeriod() { OrderInvestigationBookingVoCollection voColl = domain.listInvestigationResults(form.getGlobalContext().Core.getPatientShort(), ConfigFlag.UI.EDISCHARGE_RESULTS_NUM_DAYS.getValue()); for(int i = 0 ; voColl != null && i < voColl.size() ; i++) { boolean bFound = false; for(int j = 0 ; j < form.grdInvestigations().getRows().size() ; j++) { if (voColl.get(i).equals(form.grdInvestigations().getRows().get(j).getValue())) { bFound = true; break; } } if ( ! bFound &&voColl.get(i).getInvestigationIsNotNull() && voColl.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voColl.get(i).getInvestigation().getInvestigationIndex().getNameIsNotNull()) { grdInvestigationsRow row = form.grdInvestigations().getRows().newRow(); row.setColInvestigation(voColl.get(i).getInvestigation().getInvestigationIndex().getName()); row.setValue(voColl.get(i)); } } }
public OrderInvestigationBookingVoCollection listResultsAwaited(PatientRefVo patientRefVo, Integer numDays) { if(numDays == null) throw new CodingRuntimeException("Invalid numDays"); if(patientRefVo == null) throw new CodingRuntimeException("Invalid patientRefVo"); Date dtFrom = new Date().addDay(-numDays); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer sb = new StringBuffer(" from OrderInvestigation as oi where "); sb.append(" oi.systemInformation.creationDateTime >= :fromDate"); markers.add("fromDate"); values.add(dtFrom.getDate()); sb.append(" and oi.ordInvCurrentStatus.ordInvStatus in (:id1, :id2)"); markers.add("id1"); values.add(getDomLookup(OrderInvStatus.ORDERED)); markers.add("id2"); values.add(getDomLookup(OrderInvStatus.SENT)); sb.append(" and "); sb.append(" oi.orderDetails.patient.id = :pat "); markers.add("pat"); values.add(patientRefVo.getID_Patient()); sb.append(" order by oi.repDateTime desc, oi.ordInvSeq asc"); List result = getDomainFactory().find(sb.toString(), markers, values); return OrderInvestigationBookingVoAssembler.createOrderInvestigationBookingVoCollectionFromOrderInvestigation(result); }
public OrderInvestigationBookingVoCollection listInvestigationResults(PatientRefVo patientRefVo, Integer numDays) { if (numDays == null) throw new CodingRuntimeException("Invalid numDays"); if (patientRefVo == null) throw new CodingRuntimeException("Invalid patientRefVo"); Date dtFrom = new Date().addDay(-numDays); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); StringBuffer sb = new StringBuffer("SELECT oi FROM OrderInvestigation AS oi LEFT JOIN oi.resultDetails AS resDetails"); sb.append(" LEFT JOIN resDetails.pathologyResultDetails AS pathResDetails LEFT JOIN resDetails.clinicalResultDetails AS clinicalResult where "); sb.append(" oi.systemInformation.creationDateTime >= :fromDate"); markers.add("fromDate"); values.add(dtFrom.getDate()); sb.append(" and ( pathResDetails != null"); sb.append(" or clinicalResult != null)"); sb.append(" and "); sb.append(" oi.orderDetails.patient.id = :pat "); markers.add("pat"); values.add(patientRefVo.getID_Patient()); sb.append(" order by oi.repDateTime desc, oi.ordInvSeq asc"); return OrderInvestigationBookingVoAssembler.createOrderInvestigationBookingVoCollectionFromOrderInvestigation(getDomainFactory().find(sb.toString(), markers, values)); }
public OrderInvestigationBookingVoCollection listInvestigationResults(PatientRefVo patientRefVo, Integer numDays) { if (numDays == null) throw new CodingRuntimeException("Invalid numDays"); if (patientRefVo == null) throw new CodingRuntimeException("Invalid patientRefVo"); Date dtFrom = new Date().addDay(-numDays); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer sb = new StringBuffer(" from OrderInvestigation as oi where "); sb.append(" oi.systemInformation.creationDateTime >= :fromDate"); markers.add("fromDate"); values.add(dtFrom.getDate()); sb.append(" and ( oi.pathResultDetails != null"); sb.append(" or oi.radReportingDetails != null)"); sb.append(" and "); sb.append(" oi.orderDetails.patient.id = :pat "); markers.add("pat"); values.add(patientRefVo.getID_Patient()); sb.append(" order by oi.repDateTime desc, oi.ordInvSeq asc"); List result = getDomainFactory().find(sb.toString(), markers, values); return OrderInvestigationBookingVoAssembler.createOrderInvestigationBookingVoCollectionFromOrderInvestigation(result); }
public OrderInvestigationBookingVoCollection listResultsAwaited(PatientRefVo patientRefVo, Integer numDays) { if(numDays == null) throw new CodingRuntimeException("Invalid numDays"); if(patientRefVo == null) throw new CodingRuntimeException("Invalid patientRefVo"); Date dtFrom = new Date().addDay(-numDays); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer sb = new StringBuffer(" from OrderInvestigation as oi where "); sb.append(" oi.systemInformation.creationDateTime >= :fromDate"); markers.add("fromDate"); values.add(dtFrom.getDate()); //WDEV-18620 sb.append(" and oi.resultDetails is null and oi.ordInvCurrentStatus.ordInvStatus.id not in (:id1, :id2)"); markers.add("id1"); values.add(-808); markers.add("id2"); values.add(-794); sb.append(" and "); sb.append(" oi.orderDetails.patient.id = :pat "); markers.add("pat"); values.add(patientRefVo.getID_Patient()); sb.append(" order by oi.repDateTime desc, oi.ordInvSeq asc"); List result = getDomainFactory().find(sb.toString(), markers, values); return OrderInvestigationBookingVoAssembler.createOrderInvestigationBookingVoCollectionFromOrderInvestigation(result); }
public OrderInvestigationBookingVoCollection listClinicalInvestigationsResults(PatientRefVo patientRefVo, Integer numDays) { if (numDays == null) throw new CodingRuntimeException("Invalid numDays"); if (patientRefVo == null) throw new CodingRuntimeException("Invalid patientRefVo"); Date dtFrom = new Date().addDay(-numDays); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); StringBuffer sb = new StringBuffer("SELECT oi FROM OrderInvestigation AS oi LEFT JOIN oi.resultDetails AS resDetails where"); sb.append(" oi.systemInformation.creationDateTime >= :fromDate"); markers.add("fromDate"); values.add(dtFrom.getDate()); sb.append(" and oi.resultDetails is not null "); sb.append(" and "); sb.append(" oi.orderDetails.patient.id = :pat "); markers.add("pat"); values.add(patientRefVo.getID_Patient()); sb.append(" order by oi.repDateTime desc, oi.ordInvSeq asc"); return OrderInvestigationBookingVoAssembler.createOrderInvestigationBookingVoCollectionFromOrderInvestigation(getDomainFactory().find(sb.toString(), markers, values)); }
public OrderInvestigationBookingVoCollection listPendingResults(PatientRefVo patient, CareContextShortVo careContext) { if(patient == null || patient.getID_Patient() == null) throw new CodingRuntimeException("Can not list investigations that are requested during the inpatient stay on null Patient."); if(careContext == null) throw new CodingRuntimeException("Can not list investigations that are requested during the inpatient stay on null CareContext."); StringBuffer sb = new StringBuffer(" from OrderInvestigation as oi where "); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); sb.append(" oi.orderDetails.patient.id = :pat "); markers.add("pat"); values.add(patient.getID_Patient()); sb.append(" and "); sb.append(" oi.systemInformation.creationDateTime >= :fromDate"); markers.add("fromDate"); values.add(careContext.getStartDateTime().getJavaDate()); sb.append(" and "); sb.append(" oi.systemInformation.creationDateTime <= :toDate"); markers.add("toDate"); values.add(careContext.getEndDateTime() != null ? careContext.getEndDateTime().getJavaDate() : new DateTime().getJavaDate()); sb.append(" and "); sb.append(" oi.ordInvCurrentStatus.ordInvStatus.id in (:statusAwaiting, :statusOrdered, :statusSent, :statusReceived, :statusAccepted, :statusInProgress, :statusScheduled, :statusCompleted, :statusAwaitingAppointment, :statusHeld) "); markers.add("statusAwaiting"); values.add(OrderInvStatus.AWAITING_AUTHORISATION.getID()); markers.add("statusOrdered"); values.add(OrderInvStatus.ORDERED.getID()); markers.add("statusSent"); values.add(OrderInvStatus.SENT.getID()); markers.add("statusReceived"); values.add(OrderInvStatus.RECEIVED.getID()); markers.add("statusAccepted"); values.add(OrderInvStatus.ACCEPTED.getID()); markers.add("statusInProgress"); values.add(OrderInvStatus.INPROGRESS.getID()); markers.add("statusScheduled"); values.add(OrderInvStatus.INPROGRESS_SCH.getID()); markers.add("statusCompleted"); values.add(OrderInvStatus.COMPLETE.getID()); markers.add("statusAwaitingAppointment"); values.add(OrderInvStatus.ORDERED_AWAITING_APPT.getID()); markers.add("statusHeld"); values.add(OrderInvStatus.HELD.getID()); sb.append(" order by oi.displayDateTime desc"); List<?> result = getDomainFactory().find(sb.toString(), markers, values); return OrderInvestigationBookingVoAssembler.createOrderInvestigationBookingVoCollectionFromOrderInvestigation(result); }
private void populateScreenFromData(DischargeClinicalInformationVo voClinInfo) { clearInstanceControls(); if (voClinInfo == null) return; StringBuffer tooltip = new StringBuffer(); OrderInvestigationBookingVoCollection pathInvestigations = new OrderInvestigationBookingVoCollection(); if (voClinInfo.getPresentingComplaints() != null) tooltip.append("<b>Presenting Complaint:</b> " + voClinInfo.getPresentingComplaints() + "<br>"); if (voClinInfo.getInvestigationComments() != null) tooltip.append("<b>Investigation Comments:</b> " + voClinInfo.getInvestigationComments() + "<br>"); if (voClinInfo.getAdditionalComments() != null) tooltip.append("<b>Additional Comments:</b> " + voClinInfo.getAdditionalComments()); form.imbInfo().setTooltip(tooltip.toString()); form.richTxtRelevantTreatmentsETC().setValue(voClinInfo.getRelevantTreatments()); form.richTxtSummaryofAdmission().setValue(voClinInfo.getSummaryOfAdmission()); for(int i = 0 ; voClinInfo.getResultsIsNotNull() && i < voClinInfo.getResults().size() ; i++) { if (voClinInfo.getResults().get(i).getInvestigation() == null || voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex() == null) continue; if (Category.CLINICALIMAGING.equals(voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex().getCategory())) { grdInvestigationsRow row = form.grdInvestigations().getRows().newRow(); row.setColInvestigation(voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex().getName()); row.setColInclude(Boolean.TRUE); row.setValue(voClinInfo.getResults().get(i)); } else if( Category.PATHOLOGY.equals(voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex().getCategory())) //wdev-18892 { grdPathologyRelevantResultsRow rowpat = form.grdPathologyRelevantResults().getRows().newRow(); rowpat.setColumnInvestigation(voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex().getName()); rowpat.setColumnInclude(Boolean.TRUE); rowpat.setValue(voClinInfo.getResults().get(i)); } else if( Category.CLINICAL.equals(voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex().getCategory())) { grdClinicalRelevantResultsRow rowclin = form.grdClinicalRelevantResults().getRows().newRow(); rowclin.setColumnOtherResults(voClinInfo.getResults().get(i).getInvestigation().getInvestigationIndex().getName()); rowclin.setColumnInclude(Boolean.TRUE); rowclin.setValue(voClinInfo.getResults().get(i)); } /*else pathInvestigations.add(voClinInfo.getResults().get(i));*/ } form.getLocalContext().setPathologyInvestigations(pathInvestigations); }