コード例 #1
0
  public MedicamentsInDisease getMedicamentsInDisease(HttpServletRequest request, Disease disease) {
    User user = userService.findWithMedicaments(request);
    if (!disease.getUser().equals(user)) throw new AccessDeniedException();
    List<Medicament> medicaments = diseaseMedicamentRepositoryEntityGraph.findWithDisease(disease);

    return new MedicamentsInDisease(user, medicaments);
  }
コード例 #2
0
 public List<Dosage> findDosages(Disease disease) {
   Set<Dosage> dosages = new HashSet<Dosage>();
   List<DiseaseMedicament> diseaseMedicaments =
       diseaseMedicamentRepositoryEntityGraph.findWithDosagesAndMedicament(disease);
   for (DiseaseMedicament diseaseMedicament : diseaseMedicaments) {
     dosages.addAll(diseaseMedicament.getDosages());
   }
   List<Dosage> returnDosages = new ArrayList<Dosage>(dosages);
   Collections.sort(returnDosages);
   return returnDosages;
 }
コード例 #3
0
 public DiseaseMedicament finOne(Disease disease, Medicament medicament) {
   return diseaseMedicamentRepositoryEntityGraph.findOneWithDosages(medicament, disease);
 }
コード例 #4
0
 public Set<Dosage> find(Disease disease, Medicament medicament) {
   DiseaseMedicament diseaseMedicament =
       diseaseMedicamentRepositoryEntityGraph.findOneWithDosages(medicament, disease);
   return diseaseMedicament.getDosages();
 }