public MedicationOverViewLiteVoCollection listMedicationOverviews(MedicationOverViewFilterVo voMedicationViewFilter) { if (voMedicationViewFilter == null) throw new DomainRuntimeException("Invalid Overview"); DomainFactory factory = getDomainFactory(); String hql = " from MedicationOverview mv where mv.careContext.episodeOfCare.careSpell.patient.id = :patid order by mv.authoringInformation.authoringDateTime desc"; List overs = factory.find(hql, new String[]{"patid"}, new Object[]{voMedicationViewFilter.getPatientRef().getID_Patient()}); if(overs.size() == 0) return null; return MedicationOverViewLiteVoAssembler.createMedicationOverViewLiteVoCollectionFromMedicationOverview(overs); }
private void open(Boolean search) { form.ctnDetails().setCollapsed(true); MedicationOverViewVo voOverView = new MedicationOverViewVo(); PatientRefVo voPat = new PatientRefVo(); voPat.setID_Patient(form.getGlobalContext().Core.getPatientShort().getID_Patient()); MedicationOverViewFilterVo voFilter = getSearchCriteria(); clearAll(); MedicationOverViewLiteVoCollection voColl = null; if (search) { voColl = domain.listMedicationOverviews(voFilter); if (voColl == null) { engine.showMessage("There is no current Medication Overview for this patient."); displayOrHideEnableDisableScreenSpecificControls(); return; } for (int i = 0 ; i < voColl.size() ; i++) { MedicationOverViewLiteVo voOverLite = voColl.get(i); StringBuffer sb = new StringBuffer(); sb.append(voOverLite.getTypeIsNotNull() ? voOverLite.getType().toString()+ ", " : ""); sb.append(voOverLite.getAuthoringInformationIsNotNull() ? voOverLite.getAuthoringInformation().toString(" - ") + ", " : ""); form.recbrOverviews().newRow(voOverLite, sb.toString()); } if (voColl.size() > 0) { form.recbrOverviews().setValue(voColl.get(0)); } } if (form.recbrOverviews().getValue() != null) { voOverView = domain.getMedicationOverView(form.recbrOverviews().getValue()); openOverview(voOverView); } form.setMode(FormMode.VIEW); displayOrHideEnableDisableScreenSpecificControls(); form.getLocalContext().setSelectedInstance(null); }