Ejemplo n.º 1
0
        /// <summary>
        /// Method to save store survey response on the basis of coverage beat
        /// </summary>
        /// <param name="storeSurvey">store survey</param>
        /// <returns>returns status</returns>
        public long SaveStoreSurveyResponse(SurveyResponseDTO storeSurvey)
        {
            SurveyResponse survey = new SurveyResponse();

            ObjectMapper.Map(storeSurvey, survey);
            return(ActivityRepository.SaveStoreSurveyResponse(survey, storeSurvey.RaceProfile));
        }
        public void RecordResponse(string jmbg, int permissionId, SurveyResponseDTO response)
        {
            SurveyResponder responder = _repository.Get(jmbg);

            responder.RespondToSurvey(permissionId, response);
            _repository.Update(responder);
        }
        public void RespondToSurvey(int permissionId, SurveyResponseDTO surveyResponse)
        {
            SurveyPermission surveyPermission = Permissions.FirstOrDefault(p => p.Id == permissionId);

            if (surveyPermission is null)
            {
                throw new ActionNotPermittedException("Permission id is not valid.");
            }
            Permissions.Remove(surveyPermission);
            Responses.Add(new SurveyResponse(surveyPermission, surveyResponse));
        }
Ejemplo n.º 4
0
 public static SurveyResponse DtoToObject(SurveyResponseDTO dto)
 {
     return(new SurveyResponse
     {
         SubmittedAt = DateTime.Now,
         SurveyId = dto.SurveyId,
         RatedSurveySections = dto.RatedSurveySections,
         DoctorSurveySection = dto.DoctorSurveySection,
         PatientAccountId = dto.PatientAccountId,
         ExaminationId = dto.ExaminationId
     });
 }
Ejemplo n.º 5
0
 public SurveyResponse(SurveyPermission permission, SurveyResponseDTO response)
 {
     UsedPermission             = permission;
     MedicalStaffSurveyResponse = new MedicalStaffSurveyResponse(response.BehaviorOfMedicalStaff,
                                                                 response.MedicalStaffProfessionalism,
                                                                 response.GettingAdviceByMedicalStaff,
                                                                 response.EaseInObtainingFollowUpInformation);
     DoctorSurveyResponse = new DoctorSurveyResponse(response.BehaviorOfDoctor,
                                                     response.DoctorProfessionalism,
                                                     response.GettingAdviceByDoctor,
                                                     response.AvailabilityOfDoctor);
     HospitalSurveyResponse = new HospitalSurveyResponse(response.Nursing,
                                                         response.Cleanliness,
                                                         response.OverallRating,
                                                         response.SatisfiedWithDrugAndInstrument);
 }
Ejemplo n.º 6
0
 public IActionResult CreateSurveyResponse(SurveyResponseDTO dto)
 {
     return(Ok(_surveyResponseService.CreateSurveyResponse(SurveyResponseMapper.DtoToObject(dto))));
 }
Ejemplo n.º 7
0
        protected override async Task OnParametersSetAsync()
        {
            var responseId = Guid.Parse(SurveyResponseId);

            SurveyResponse = await SurveyResponseClient.GetResponse(responseId);
        }
Ejemplo n.º 8
0
 public IActionResult RespondToSurvey(string jmbg, int id, SurveyResponseDTO response)
 {
     _responseService.RecordResponse(jmbg, id, response);
     return(NoContent());
 }