@SuppressWarnings("unchecked") public ConsultantProcedureCategoryVoCollection listConsultantsProcedureCategory(HcpLiteVo hcp) throws DomainInterfaceException { StringBuilder query = new StringBuilder("select c1_1 from ConsultantProcedureCategory as c1_1 " + "left join c1_1.performingHCP as h1_1 left join h1_1.mos as m1_1"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); if (hcp != null) { query.append(" where (c1_1.performingHCP.id = :Hcp_id)"); paramNames.add("Hcp_id"); paramValues.add(hcp.getID_Hcp()); } query.append(" order by m1_1.name.surname asc "); List domObjs = getDomainFactory().find(query.toString(),paramNames,paramValues); if (domObjs == null || domObjs.size()==0) return null; return ConsultantProcedureCategoryVoAssembler.createConsultantProcedureCategoryVoCollectionFromConsultantProcedureCategory(domObjs); }
private void populateScreenFromData(ConsultantProcedureCategoryVoCollection record) { form.dyngrdMain().getRows().clear(); if (record == null || record.size()==0) { engine.showMessage("No records where found ", "Information", MessageButtons.OK, MessageIcon.INFORMATION); return; } for (int i = 0; i < record.size(); i++) { ConsultantProcedureCategoryVo cpc = record.get(i); if (cpc != null) { DynamicGridRow rowCons = addConsultantToGrid(cpc.getPerformingHCP()); rowCons.setValue(cpc); CategoryProceduresVoCollection categoryProcedures = cpc.getCategoryProcedures(); if (categoryProcedures != null) { for (int j = 0; j < categoryProcedures.size(); j++) { CategoryProceduresVo categoryProceduresVo = categoryProcedures.get(j); DynamicGridRow rowCat = addCategoryToGrid(rowCons, categoryProceduresVo.getCategory()); rowCat.setValue(categoryProceduresVo); ProcedureLiteVoCollection procedures = categoryProceduresVo.getProcedures(); if (procedures != null) { for (int k = 0; k < procedures.size(); k++) { addProcedureToGrid(rowCat, procedures.get(k)); } } } rebindAllGridComboBoxes(rowCons); } } } }
public ConsultantProcedureCategoryVo getConsultantProcedureCategoryByHcp(HcpLiteVo hcp) throws DomainInterfaceException { if(hcp == null) throw new CodingRuntimeException("hcp is null"); DomainFactory factory = getDomainFactory(); List conProcCateList = factory.find("from ConsultantProcedureCategory cpc where cpc.performingHCP.id = :idHcp)", new String[]{"idHcp"}, new Object[]{hcp.getID_Hcp()}); ConsultantProcedureCategoryVoCollection coll = ConsultantProcedureCategoryVoAssembler.createConsultantProcedureCategoryVoCollectionFromConsultantProcedureCategory(conProcCateList); if(coll.size()!= 0) return coll.get(0); else return null; }