Exemple #1
0
        public async Task <IActionResult> Post(DiagnosisForAddDTO model)
        {
            Diagnosis diagnosis = mapper.Map <Diagnosis>(model);
            await diagnosisRepository.Add(diagnosis).ConfigureAwait(true);

            await unitOfWork.CompleteAsync().ConfigureAwait(true);

            return(Ok(mapper.Map <DiagnosisForGetDTO>(await diagnosisRepository.Get(diagnosis.Id).ConfigureAwait(true))));
        }
        public Examination GetEager(long id)
        {
            Examination exam = base.Get(id);

            exam.Doctor    = doctorRepository.GetEager(exam.Doctor.GetId());
            exam.User      = patientRepository.Get(exam.User.GetId());
            exam.Diagnosis = diagnosisRepository.Get(exam.Diagnosis.GetId());
            if (exam.Therapy != null)
            {
                exam.Therapy = therapyRepository.GetEager(exam.Therapy.GetId());
            }
            if (exam.Refferal != null)
            {
                exam.Refferal = referralRepository.GetEager(exam.Refferal.GetId());
            }
            if (exam.Prescription != null)
            {
                exam.Prescription = prescriptionRepository.GetEager(exam.Prescription.GetId());
            }
            return(exam);
        }
 public Diagnosis Get(long id)
 {
     return(_diagnosisRepository.Get(id));
 }