private boolean hasResults(grdResultsRow selectedRow) { OrderInvestigationLiteVo resParent = (OrderInvestigationLiteVo) selectedRow.getValue().getOrderInvestigation(); if (isResultedStatus(resParent))// WDEV-13251 return true; grdResultsRowCollection rowColl = selectedRow.getRows(); for (int i = 0; i < rowColl.size(); i++) { grdResultsRow row = rowColl.get(i); OrderInvestigationLiteVo res = (OrderInvestigationLiteVo) row.getValue().getOrderInvestigation(); if (isResultedStatus(res))// WDEV-13251 return true; } return false; }
/** * Function used to update OrderInvestigationAppointment (with new Investigation - amended one) */ public void updateOrderInvestigationAppointment(OrderInvWithStatusApptVo orderInvestigationAppointment, OrderInvestigationLiteVo investigationToAmend) throws StaleObjectException { if (orderInvestigationAppointment == null) throw new CodingRuntimeException("Can not save null OderInvestigationAppointemnt"); if (orderInvestigationAppointment.isValidated() == false) throw new CodingRuntimeException("Can not save not validated OrderInvestigationAppointment"); if (investigationToAmend == null) throw new CodingRuntimeException("Can not save null OrderInvestigation"); // Get domain object to save OrderInvAppt domOrderInvestigationAppointment = OrderInvWithStatusApptVoAssembler.extractOrderInvAppt(getDomainFactory(), orderInvestigationAppointment); OrderInvestigation domOrderInvestigation = OrderInvestigationLiteVoAssembler.extractOrderInvestigation(getDomainFactory(), investigationToAmend); getDomainFactory().save(domOrderInvestigationAppointment); getDomainFactory().save(domOrderInvestigation); OCSExternalEvents impl = (OCSExternalEvents) getDomainImpl(OCSExternalEventsImpl.class); impl.generateOrderUpdateEvent(new Booking_AppointmentRefVo(domOrderInvestigationAppointment.getAppointment().getId(), domOrderInvestigationAppointment.getAppointment().getVersion()), new OrderInvestigationRefVo(domOrderInvestigationAppointment.getOrderInvestigation().getId(), domOrderInvestigationAppointment.getOrderInvestigation().getVersion())); return; }
private void addInvestigationRow(OrderInvestigationLiteVo voInv) { grdRejectedRow row = form.grdRejected().getRows().newRow(); if(voInv.getSysInfoIsNotNull() && voInv.getSysInfo().getCreationDateTime() != null) row.setColOrdDate(voInv.getSysInfo().getCreationDateTime().getDate()); row.setColRejectedDate(voInv.getOrdInvCurrentStatusIsNotNull() ? voInv.getOrdInvCurrentStatus().getChangeDateTime().getDate() : null); row.setColInvestigatio(voInv.getInvestigationIsNotNull() && voInv.getInvestigation().getInvestigationIndexIsNotNull() ? voInv.getInvestigation().getInvestigationIndex().getName() : ""); row.setColReasonRej(voInv.getOrdInvCurrentStatusIsNotNull() && voInv.getOrdInvCurrentStatus().getStatusChangeReasonIsNotNull() ? voInv.getOrdInvCurrentStatus().getStatusChangeReason().toString() : ""); row.setTooltipForColReasonRej(voInv.getOrdInvCurrentStatusIsNotNull() && voInv.getOrdInvCurrentStatus().getStatusChangeReasonIsNotNull() ? voInv.getOrdInvCurrentStatus().getStatusChangeReason().toString() : ""); row.setColReasonNotes(voInv.getOrdInvCurrentStatusIsNotNull() ? voInv.getOrdInvCurrentStatus().getStatusReason() : ""); row.setTooltipForColReasonNotes(voInv.getOrdInvCurrentStatusIsNotNull() ? voInv.getOrdInvCurrentStatus().getStatusReason() : ""); }
private void viewSelectedOrder() { if (form.grdResults().getValue() != null) { OrderInvestigationLiteVo voOrderInv = (OrderInvestigationLiteVo) form.grdResults().getValue().getOrderInvestigation(); if (voOrderInv.getOrderDetailsIsNotNull()) { form.getGlobalContext().OCRR.setResultDisplayDate(getSelectedDisplayDateTime().getDate()); form.getGlobalContext().OCRR.PathologyResults.setOrder(voOrderInv.getOrderDetails()); engine.open(form.getForms().OCRR.OrderSummaryDialog, true); } } }
private boolean isResultedStatus(OrderInvestigationLiteVo order) { if(order == null) return false; // WDEV-16224 - modifications following OCS DFT model changes if (order.getResultDetailsIsNotNull() && (order.getResultDetails().getPathologyResultDetailsIsNotNull() || order.getResultDetails().getClinicalResultDetailsIsNotNull() || order.getResultDetails().getDocumentResultDetailsIsNotNull())) { return true; } return false; }
private DateTime getSelectedDisplayDateTime() { if (form.grdResults().getValue() == null) return null; OrderInvestigationLiteVo voOrderInv = (OrderInvestigationLiteVo) form.grdResults().getValue().getOrderInvestigation(); return voOrderInv.getDisplayDateTime(); }
/** * Function used to determine if the modality has changed * It will analyse the first investigation from the new order with the investigation to amend. * If in either investigation the modality can not be reached it will consider that modality has changed */ private boolean hasModalityChanged(OcsOrderVo newOrder, OrderInvestigationLiteVo investigationToAmend) { // Check new order for investigations if (newOrder == null || newOrder.getInvestigations() == null || newOrder.getInvestigations().size() == 0) return true; OrderInvestigationVo investigation = newOrder.getInvestigations().get(0); // Check first OrderInvestigation for modality (Speciality in the Investigation.ProviderService.LocationService.Service) // If the modality can not be retrieved - consider that the modality has changed if (investigation == null || investigation.getInvestigation() == null || investigation.getInvestigation().getProviderService() == null || investigation.getInvestigation().getProviderService().getLocationService() == null || investigation.getInvestigation().getProviderService().getLocationService().getService() == null) return true; ServiceVo newModality = investigation.getInvestigation().getProviderService().getLocationService().getService(); // Check modality for OrderInvestigation to amend if (investigationToAmend == null || investigationToAmend.getInvestigation() == null || investigationToAmend.getInvestigation().getProviderService() == null || investigationToAmend.getInvestigation().getProviderService().getLocationService() == null || investigationToAmend.getInvestigation().getProviderService().getLocationService().getService() == null) return true; ServiceLiteVo oldModality = investigationToAmend.getInvestigation().getProviderService().getLocationService().getService(); // Keep in mind that the objects are of different types (cast is only to point this out) // and use the root of them as base for equals if (oldModality.equals((ServiceLiteVo)newModality)) return false; return true; }
public OrderInvestigationLiteVo updateInvestigationStatus(OrderInvestigationForStatusChangeVo investigation) throws StaleObjectException { if (investigation == null) throw new CodingRuntimeException("Error - Can not update the status for a null investigation"); OrderInvestigation domInvestigation = OrderInvestigationForStatusChangeVoAssembler.extractOrderInvestigation(getDomainFactory(), investigation); getDomainFactory().save(domInvestigation); return OrderInvestigationLiteVoAssembler.create(domInvestigation); }
public OrderInvestigationLiteVo getOrderInvestigation(OrderInvestigationRefVo orderInvRef) { if(orderInvRef == null) return null; OrderInvestigation doOrderInv = (OrderInvestigation)getDomainFactory().getDomainObject(OrderInvestigation.class, orderInvRef.getID_OrderInvestigation()); return OrderInvestigationLiteVoAssembler.create(doOrderInv); }
private boolean isInvNotAlreadyCoded(OrderInvestigationLiteVo investigation) { if (form.lyrTabs().tabOutpatientCoding().isVisible()) { for (int i = 0; i < form.lyrTabs().tabOutpatientCoding().grdOutpatientCoding().getRows().size(); i++) { if (form.lyrTabs().tabOutpatientCoding().grdOutpatientCoding().getRows().get(i).getColInvVo() != null && form.lyrTabs().tabOutpatientCoding().grdOutpatientCoding().getRows().get(i).getColInvVo().getID_OrderInvestigationIsNotNull() && investigation.getID_OrderInvestigation().equals(form.lyrTabs().tabOutpatientCoding().grdOutpatientCoding().getRows().get(i).getColInvVo().getID_OrderInvestigation())) return false; } } return true; }