private void open() { form.setMode(FormMode.VIEW); super.clearScreen(); if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull()){ WheelchairReferralVoCollection coll = domain.getWheelchairReferralVoByCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if(coll!=null && coll.size()>0) form.getLocalContext().setWheelchairReferral(coll.get(0)); else form.getLocalContext().setWheelchairReferral(null); } displayButtons(); populateHCP(); super.populateScreenFromData(form.getLocalContext().getWheelchairReferral()); }
/** * list */ public WheelchairReferralVoCollection getWheelchairReferralVoByCareContext(CareContextShortVo voCareContext) { if (voCareContext == null) throw new RuntimeException("Cannot get WheelchairReferralVo for null CareContextShortVo"); StringBuffer hql = new StringBuffer(); hql.append("from WheelchairReferral as w1_1 where w1_1.careContext.id = :CCID"); java.util.List list = getDomainFactory().find(hql.toString(), "CCID", voCareContext.getID_CareContext()); if (list == null || list.size() == 0) return null; return WheelchairReferralVoAssembler.createWheelchairReferralVoCollectionFromWheelchairReferral(list); }