public MedicVo getMedic(HcpRefVo hcpId) { if(hcpId == null) throw new CodingRuntimeException("HCP id must not be null "); DomainFactory factory = getDomainFactory(); String hql = "from Medic as m1_1 where m1_1.id = :idHCP"; List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()}); if(list != null && list.size() > 0) { MedicVoCollection voColl = MedicVoAssembler.createMedicVoCollectionFromMedic(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } return null; }
private void displayAllConsultants() { if (form.getLocalContext().getConsultants() == null) return; MedicVoCollection voCollConsultants = form.getLocalContext().getConsultants(); TreeNode node = null; form.treAssociate().clear(); for(int i=0;i<voCollConsultants.size();i++) { node = form.treAssociate().getNodes().add(voCollConsultants.get(i), voCollConsultants.get(i).getMos().getName().toShortForm()); node.setCheckBoxVisible(form.getMode().equals(FormMode.EDIT)); node.setCollapsedImage(form.getImages().Admin.MemberOfStaff); } }
public MedicVoCollection listAllMedics() { MedicVoCollection voCollMedics = new MedicVoCollection(); List lstMedics = listActiveMedics(); if (lstMedics != null) { for (int i = 0; i < lstMedics.size(); i++) { Hcp hcp = (Hcp) lstMedics.get(i); if (Medic.class.isAssignableFrom(hcp.getClass())) voCollMedics.add(MedicVoAssembler.create((Medic) hcp)); } } return voCollMedics; }
public MedicVoCollection listFullMedicsForMedicLites(MedicLiteVoCollection voCollLiteMedics) { DomainFactory factory = getDomainFactory(); StringBuffer hqlStart = new StringBuffer(); String hql; hqlStart.append("from Hcp hcp where hcp.id in ( "); for (int i = 0; i < voCollLiteMedics.size(); i++) hqlStart.append(voCollLiteMedics.get(i) + ","); if (hqlStart.toString().endsWith(",")) hql = hqlStart.toString().substring(0, hqlStart.length() - 1); else hql = hqlStart.toString(); hql += " )"; return MedicVoAssembler.createMedicVoCollectionFromMedic(factory.find(hql)); }
@Override protected void onQmbConsultantTextSubmited(String value) throws PresentationLogicException { MedicVoCollection medics = domain.listMedicsForService(form.qmbService().getValue(), value); if (medics == null) return; for (MedicVo medic : medics) { form.qmbConsultant().newRow(medic, medic.toString()); } if (medics.size() == 1) form.qmbConsultant().setValue(medics.get(0)); else form.qmbConsultant().showOpened(); }
public MedicVo getMedicVo(HcpRefVo hcp) { if( hcp == null ) return null; DomainFactory factory = getDomainFactory(); List medics = factory.find("select m1_1 from Medic as m1_1 left join m1_1.mos as m2_1 left join m2_1.hcp as h1_1 where (h1_1.id = :hcpId)", new String[] {"hcpId"}, new Object[] {hcp.getID_Hcp()}); if( medics != null && medics.size() > 0) { MedicVoCollection tempColl = MedicVoAssembler.createMedicVoCollectionFromMedic(medics); if( tempColl != null && tempColl.size() > 0) return tempColl.get(0); } return null; }
public MedicVoCollection listMedics() { MosAdmin impl = (MosAdmin) getDomainImpl(MosAdminImpl.class); return impl.listAllMedics(); }
public MedicVoCollection listMedicsForService(ServiceRefVo service, String name) { if (service == null) return null; ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); StringBuilder query = new StringBuilder("SELECT medic FROM Medic AS medic "); query.append(" LEFT JOIN medic.mos AS mos LEFT JOIN medic.serviceFunction AS function LEFT JOIN medic.grade AS medicGrade "); query.append(" LEFT JOIN function.service AS service "); query.append(" WHERE "); query.append(" mos.name.surname LIKE :NAME AND service.id = :SERVICE_ID "); paramNames.add("NAME"); paramValues.add(name != null ? name + "%" : "%"); paramNames.add("SERVICE_ID"); paramValues.add(service.getID_Service()); return MedicVoAssembler.createMedicVoCollectionFromMedic(getDomainFactory().find(query.toString(), paramNames, paramValues)); }