Пример #1
0
 @RequestMapping(method = RequestMethod.GET, value = "/update/{patientId}")
 public String update(@PathVariable("patientId") String patientId, Model uiModel) {
   Patient patient = patientService.findByPatientId(patientId);
   WeeklyAdherenceSummary adherenceSummary = adherenceService.currentWeekAdherence(patient);
   prepareModel(patient, uiModel, adherenceSummary);
   return "adherence/update";
 }
 @RequestMapping(value = "show", method = RequestMethod.GET)
 public String show(
     @RequestParam("patientId") String patientId, Model uiModel, HttpServletRequest request) {
   Patient patient = patientService.findByPatientId(patientId);
   treatmentUpdateOrchestrator.updateDoseInterruptions(patient);
   setupDashboardModel(uiModel, request, patient);
   return "patient/show";
 }
 public AdherenceValidationResponse validate(
     AdherenceValidationRequest request, ProviderId providerId) {
   Patient patient = patientService.findByPatientId(request.getPatientId());
   AdherenceErrors errors =
       adherenceRequestValidator.validatePatientProviderMapping(providerId, patient);
   Dosage dosage = adherenceService.dosageForPatient(patient);
   if (errors.isNotEmpty()) {
     return new AdherenceValidationResponse(dosage).failure(errors.errorMessage());
   } else if (isValidDose(request, dosage)) {
     return new AdherenceValidationResponse(dosage).success();
   } else {
     return new AdherenceValidationResponse(dosage).invalidAdherenceRange();
   }
 }