public async System.Threading.Tasks.Task OpenExamInsertScreenAsync() { await _medicService.SaveAsync <MedicValidator>(_medic = new Medic { CRM = "123", User = new User { Name = "Medico", Email = "*****@*****.**", Password = "******" } }); await _patientService.SaveAsync <PatientValidator>(new Patient { Birthdate = DateTime.Now.Subtract(TimeSpan.FromDays(365 * 10)), Color = PatientColors.Branco, Sex = 'M', User = new User { Email = "*****@*****.**", Name = "Paciente", Password = "******" } }); _examRequest = new Domain.Entities.ExamRequest() { Medic = _medic }; _patient = await _patientService.FindByIdAsync(1); _examRequest.Patient = _patient; }
private CreateExamReportTest() { _examReportService = GetService <IExamReportService>(); _medicService = GetService <IMedicService>(); _examRequestService = GetService <IExamRequestService>(); _newExamReport = new Domain.Entities.ExamReport(); _resident = new Resident() { CRM = "123", InitialDate = DateTime.Now, User = new User { Id = 1, Email = "*****@*****.**", Name = "resident", Password = "******", } }; _examRequest = new Domain.Entities.ExamRequest { Id = 1, Hypothesis = "Cancer no coracao", ExamName = ExamType.Ecocardiograma, Recomendation = "Descansar" }; _medicService.SaveAsync <MedicValidator>(_resident); _examRequestService.SaveAsync <ExamRequestValidator>(_examRequest); }
public void AbrirTelaCadastrarPedidoExame() { _medic = new Medic { CRM = "123", User = new User { Name = "Medico", Email = "*****@*****.**", Password = "******" } }; _medicService.SaveAsync <MedicValidator>(_medic); _patientService.SaveAsync <PatientValidator>(new Patient { Birthdate = DateTime.Now.Subtract(TimeSpan.FromDays(365 * 10)), Color = PatientColors.Branco, Sex = 'M', User = new User { Email = "*****@*****.**", Name = "Paciente", Password = "******" } }); _examRequest = new Domain.Entities.ExamRequest() { Medic = _medic }; }
public async void MedicDeleteScreen() { await m_medicService.SaveAsync <MedicValidator>(new Medic() { CRM = "123456", User = new User() { Name = "Fulano" }, }); }
public async Task <IActionResult> Post([FromBody] Medic medic) { var _medic = await _medicService.SaveAsync(medic); if (_medic == null) { return(BadRequest()); } return(CreatedAtAction(nameof(Post), new { CRM = _medic.CRM }, medic)); }
public void UpdateMedicScreen() { _medicService.SaveAsync <MedicValidator>(new Medic() { User = new User() { Name = "Qualquer" }, CRM = "456", }); }
public async void ScreenListMedic() { await m_medicService.SaveAsync <MedicValidator>(new Medic() { User = new User() { Name = "Fulano" }, CRM = "123", }); await m_medicService.SaveAsync <MedicValidator>(new Medic() { User = new User() { Name = "Ciclano" }, CRM = "456", }); }
public async Task <IActionResult> Post([FromBody] Medic medic) { if (!ModelState.IsValid) { return(CustomResponse(ModelState)); } var _medic = await _medicService.SaveAsync <MedicValidator>(medic); if (_medic == null) { return(CustomResponse()); } var mappedMedic = _mapper.Map(medic, medic.GetType(), typeof(MedicDTO)); return(CreatedAtAction(nameof(Post), new { CRM = _medic.CRM }, _mapper.Map(medic, medic.GetType(), typeof(MedicDTO)))); }
public async void Cadastrar() { m_medic = await m_medicService.SaveAsync <MedicValidator>(m_medic); }