public WheelchairDetailsVoCollection listByPatient(Integer idPatient) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from WheelchairDetails w "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (idPatient != null) { hql.append(andStr + " w.careContext.episodeOfCare.careSpell.patient.id = :id_Patient"); markers.add("id_Patient"); values.add(idPatient); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List details = factory.find(query, markers, values); WheelchairDetailsVoCollection collWheelchairDetails = WheelchairDetailsVoAssembler.createWheelchairDetailsVoCollectionFromWheelchairDetails(details); return collWheelchairDetails; }
/** * populates the screen from data from specified WheelchairDetailsVoCollection * @param collWheelchairDetailsVo * @return void */ private void populateListControl(WheelchairDetailsVoCollection collWheelchairDetailsVo) { clear(); if (collWheelchairDetailsVo != null) { GenForm.grdDetailsRow row; for (int i =0; i < collWheelchairDetailsVo.size();i++) { row = form.grdDetails().getRows().newRow(); row.setValue(collWheelchairDetailsVo.get(i)); if(collWheelchairDetailsVo.get(i).getAuthoringDateTimeIsNotNull()) row.setColDate(collWheelchairDetailsVo.get(i).getAuthoringDateTime().toString()); if(collWheelchairDetailsVo.get(i).getAuthoringHCPIsNotNull()) row.setColHCP(collWheelchairDetailsVo.get(i).getAuthoringHCP().toString()); if(collWheelchairDetailsVo.get(i).getWheelchairTypeIsNotNull()) row.setColType(collWheelchairDetailsVo.get(i).getWheelchairType().toString()); if(collWheelchairDetailsVo.get(i).getWheelchairModelIsNotNull()) row.setColModel(collWheelchairDetailsVo.get(i).getWheelchairModel().toString()); if(collWheelchairDetailsVo.get(i).getWheelchairFrameIsNotNull()) row.setColFrame(collWheelchairDetailsVo.get(i).getWheelchairFrame().toString()); if(collWheelchairDetailsVo.get(i).getWheelchairFootplatesIsNotNull()) row.setColFootplates(collWheelchairDetailsVo.get(i).getWheelchairFootplates().toString()); if(collWheelchairDetailsVo.get(i).getTrialStartDateIsNotNull()) row.setColDateStart(collWheelchairDetailsVo.get(i).getTrialStartDate().toString()); if(collWheelchairDetailsVo.get(i).getTrialEndDateIsNotNull()) row.setColDateEnd(collWheelchairDetailsVo.get(i).getTrialEndDate().toString()); } } }