public DonorMedicalExamListItemViewModel(DonorMedicalExam exam)
 {
     Id             = exam.Id;
     ScheduledAt    = exam.ScheduledAt;
     ClinicId       = exam.ClinicId;
     Status         = exam.Status;
     Results        = exam.Results;
     DonorRequestId = exam.DonorRequestId;
 }
Beispiel #2
0
        private void ScheduleMedicalExamInner(ScheduleMedicalExamViewModel model)
        {
            var donorOrganRequest = _donorRequestsRepository.GetById(model.DonorRequestId);

            if (donorOrganRequest == null)
            {
                //TODO: handle
                return;
            }

            var medicalExamEntity = new DonorMedicalExam()
            {
                ClinicId       = model.ClinicId,
                DonorRequestId = model.DonorRequestId,
                ScheduledAt    = model.ScheduledDateTime,
                Status         = MedicalExamStatuses.Scheduled
            };

            donorOrganRequest.Status = DonorRequestStatuses.ScheduledMedicalExamination;

            _medicalExamsService.AddMedicalExam(medicalExamEntity);
            _donorRequestsRepository.Update(donorOrganRequest);
        }
 public void UpdateMedicalExam(DonorMedicalExam exam)
 {
     _medicalExamsRepository.Update(exam);
 }
 public DonorMedicalExam AddMedicalExam(DonorMedicalExam medicalExamEntity)
 {
     return(_medicalExamsRepository.Add(medicalExamEntity));
 }