private void populateOrderDetails(NewResultOcsOrderVo order) { form.getGlobalContext().OCRR.setQuestionsNotes(order); if (order == null) return; boolean hasQuestions = order.getClinicalInfoIsNotNull() && order.getClinicalInfo().getCategoryQuestionAnswersIsNotNull() && order.getClinicalInfo().getCategoryQuestionAnswers().size() > 0; boolean hasNotes = order.getAdditClinNotesIsNotNull() && order.getAdditClinNotes().length() > 0; if (hasQuestions || hasNotes) { form.lnkViewOrderNotes().setEnabled(true); form.lnkViewOrderNotes().setTooltip("Click to view Order Notes"); } else { form.lnkViewOrderNotes().setTooltip("No Order Notes Entered"); form.lnkViewOrderNotes().setEnabled(true); } form.txtOrderingLocation().setValue(order.getCorrectLocation()); form.txtClinician().setValue(order.getCorrectClinician()); if (order.getOrderedByIsNotNull() && order.getOrderedBy().getNameIsNotNull()) { form.txtRequestedBy().setValue(order.getOrderedBy().getName().toString()); } if (order.getSysInfoIsNotNull()) form.txtOrderDt().setValue(order.getSysInfo().getCreationDateTime().toString()); //WDEV-4758 if(ConfigFlag.DOM.CREATE_ORDERS_WITH_CARECONTEXT_ONLY.getValue()) { if(order.getCareContextIsNotNull() && order.getCareContext().getPasEventIsNotNull()) form.txtPasEpisodeID().setValue(order.getCareContext().getPasEvent().getPasEpisodeId()); } }
public NewResultOcsOrderVo getNewResultOcsOrderVo(OrderInvestigationRefVo resultId) { if(resultId == null || resultId.getID_OrderInvestigation() == null) throw new DomainRuntimeException("Invalid OrderInvestigation id"); if(resultId != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select o2_1 from OrderInvestigation as o1_1 left join o1_1.orderDetails as o2_1 where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " o1_1.id = :OrderInvId"); markers.add("OrderInvId"); values.add(resultId.getID_OrderInvestigation()); andStr = " and "; List<?> list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { NewResultOcsOrderVoCollection voColl = NewResultOcsOrderVoAssembler.createNewResultOcsOrderVoCollectionFromOcsOrderSession(list);// WDEV-16232 if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }