@Override public List<PatientLiteModel> getConstrainedPatients(String fid, List<String> idList) { List<PatientLiteModel> ret = new ArrayList<PatientLiteModel>(idList.size()); for (String pid : idList) { try { PatientModel patient = (PatientModel) em.createQuery("from PatientModel p where p.facilityId=:fid and p.patientId=:pid") .setParameter("fid", fid) .setParameter("pid", pid) .getSingleResult(); ret.add(patient.patientAsLiteModel()); } catch (NoResultException e) { PatientLiteModel dummy = new PatientLiteModel(); dummy.setFullName("未登録"); dummy.setKanaName("未登録"); dummy.setGender("U"); ret.add(dummy); } } return ret; }