private void open() { form.getLocalContext().setSelectedClinicalContact(new Boolean(false)); SplintDetailsVoCollection voSplintsDetailsColl = domain.listSplintDetails(form.getGlobalContext().Core.getCurrentCareContext()); disableCombos(); form.grdSummary().getRows().clear(); clearControls(); setGrids(true); if(voSplintsDetailsColl != null) { populateSummaryGrid(voSplintsDetailsColl); populateAllControls(form.grdSummary().getValue()); form.ctnDetails().setCollapsed(false); } else form.ctnDetails().setCollapsed(true); form.grdSummary().setEnabled(true); SplintDetailsVo voSplint = form.grdSummary().getValue(); form.getLocalContext().setupdateVoSplintDetails(voSplint); if (voSplint != null) isRecordEditable(voSplint); updateAllGridMenus(); }
public SplintDetailsVoCollection listSplintDetails(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = "from SplintDetails sd "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(voCareContextRef != null) { hql.append(andStr + " sd.clinicalContact.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List splintList = factory.find(query,markers,values); SplintDetailsVoCollection voSplintDetailsColl = SplintDetailsVoAssembler.createSplintDetailsVoCollectionFromSplintDetails(splintList); if(voSplintDetailsColl.size()>0) return voSplintDetailsColl.sort(SortOrder.DESCENDING); else return null; }
private void populateSummaryGrid(SplintDetailsVoCollection voSplintsDetailsColl) { GenForm.grdSummaryRow row = null; if(voSplintsDetailsColl != null) { for(int x=0; x<voSplintsDetailsColl.size(); x++) { SplintDetailsVo voSplint = voSplintsDetailsColl.get(x); row = form.grdSummary().getRows().newRow(); row.setColStartDate(voSplint.getStartDate()); if(voSplint.getArea() != null) row.setColArea(voSplint.getArea().toString()); if(voSplint.getSplintCategory() != null) row.setColCategory(voSplint.getSplintCategory().toString()); if(voSplint.getMaterial() != null) row.setColMaterial(voSplint.getMaterial().toString()); if(voSplint.getProduct() != null) row.setColProduct(voSplint.getProduct().toString()); if(voSplint.getLaterality() != null) row.setColLaterality(voSplint.getLaterality().toString()); row.setColEndDate(voSplint.getEndDate()); isGoldenInstanceFound(voSplint, row); row.setValue(voSplint); form.grdSummary().setValue(voSplint); } } if(form.getLocalContext().getupdateVoSplintDetailsIsNotNull()) form.grdSummary().setValue(form.getLocalContext().getupdateVoSplintDetails()); }