private void populateListControl(RepositioningPlanVoCollection voRepositioningPlanColl) { if(voRepositioningPlanColl == null) return; for(int i=0; i<voRepositioningPlanColl.size(); i++) { RepositioningPlanVo voRepositioningPlan = voRepositioningPlanColl.get(i); GenForm.grdDetailsRow row = form.grdDetails().getRows().newRow(); if(voRepositioningPlan.getAuthoringInformation() != null) { AuthoringInformationVo voInfo = voRepositioningPlan.getAuthoringInformation(); String authoringInfo = ""; if(voInfo.getAuthoringDateTimeIsNotNull()) authoringInfo += voRepositioningPlan.getAuthoringInformation().getAuthoringDateTime().toString(); if(voInfo.getAuthoringHcpIsNotNull()) authoringInfo += " - " + voRepositioningPlan.getAuthoringInformation().getAuthoringHcp().toString(); row.setColDateTime(authoringInfo); } if(voRepositioningPlan.getPositioningFreqIsNotNull()) row.setColFrequency(voRepositioningPlan.getPositioningFreq().toString()); if(voRepositioningPlan.getBlanchingIsNotNull()) row.setColBlanching(voRepositioningPlan.getBlanching().toString()); row.setColSides(getPosition(voRepositioningPlan.getPosition())); row.setColSkinTest(voRepositioningPlan.getSkinToleranceTest()); row.setValue(voRepositioningPlan); } if(voRepositioningPlanColl != null && voRepositioningPlanColl.size() != 0) form.getLocalContext().setpreviousRepositioningPlan(voRepositioningPlanColl.get(0)); }
public RepositioningPlanVoCollection listRepositioningPlanByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from RepositioningPlan rp"; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voCareContextRef != null) { hql.append(andStr + " rp.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; } hql.append(" order by rp.authoringInformation.authoringDateTime desc"); if (markers.size() > 0) query += " where "; query += hql.toString(); List plan = factory.find(query, markers, values); RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan); if(collRepositioningPlanVo != null) return collRepositioningPlanVo.sort(SortOrder.DESCENDING); return null; }
public RepositioningPlanVo getLastCompletedRepositioningPlan(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from RepositioningPlan rp "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voCareContextRef != null) { hql.append(" where "); hql.append(andStr + " rp.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(voCareContextRef.getID_CareContext()); } hql.append(" order by rp.authoringInformation.authoringDateTime desc "); List plan = factory.find(hql.toString(), markers, values); if(plan != null && plan.size() > 1) { Object firstItem = plan.get(0); plan.removeAll(plan); plan.add(firstItem); } RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan); if(collRepositioningPlanVo != null && collRepositioningPlanVo.size() > 0) return collRepositioningPlanVo.get(0); return null; }