public async Task <RegisterPatientResponse> RegisterPatientAsync(RegisterPatientRequest data, CancellationToken cancellationToken) { var existedUsers = await _patientService.FindPatientsByPersonalIdAsync(data.PersonalId, cancellationToken); if (existedUsers.Any()) { return(RegisterPatientResponse.PersonalIdAlreadyExists); } var patient = new Patient { FirstName = data.FirstName, Patronymic = data.MiddleName, LastName = data.LastName, PersonalId = data.PersonalId, BirthDate = data.BirthDate, }; await _patientService.AddPatientAsync(patient, cancellationToken); return(new RegisterPatientResponse { Guid = patient.Guid, Status = RegisterPatientStatus.Ok, }); }
public ActionResult <RegisterPatientResponse> Post(RegisterPatientRequest request) { var service = new RegisterPatientService(_unitOfWork); var response = service.Ejecute(request); return(Ok(response)); }
public void CreatePatientStratum5Test() { var request = new RegisterPatientRequest { Identification = "1005", Name = "Paciente5", Surname = "Prueba", Age = 25, Gender = "Masculino", Stratum = 5, EPS = "EpsExample" }; var service = new RegisterPatientService(new UnitOfWork(_context)); var response = service.Ejecute(request); Assert.AreEqual("Paciente registrado satisfactoriamente", response.Mensaje); }
internal async Task Run() { Console.WriteLine("Hello World!"); var input = new RegisterPatientRequest() { FirstName = "Didier", Name = "Cauvin", Birthdate = new DateTime(1980, 12, 30), Adresse1 = "chemin du plan de clavel", PostalCode = "13330", City = "Pelissanne" }; await _mediator.Send(input); }
public Task <RegisterPatientResponse> RegisterPatientAsync(RegisterPatientRequest request, CancellationToken cancellationToken) { return(_accountsControllerService .RegisterPatientAsync(request, cancellationToken)); }