public IMDResponse <EntPaciente> BSavePaciente(EntPaciente entPaciente) { IMDResponse <EntPaciente> response = new IMDResponse <EntPaciente>(); string metodo = nameof(this.BSavePaciente); logger.Info(IMDSerialize.Serialize(67823458420501, $"Inicia {metodo}(EntPaciente entPaciente)", entPaciente)); try { IMDResponse <DataTable> imdResponse = datPaciente.DSavePaciente(entPaciente); if (imdResponse.Code != 0) { return(imdResponse.GetResponse <EntPaciente>()); } entPaciente.iIdPaciente = Convert.ToInt32(imdResponse.Result.Rows[0]["iIdPaciente"].ToString()); response.Code = 0; response.Result = entPaciente; } catch (Exception ex) { response.Code = 67823458421278; response.Message = "Ocurrió un error inesperado al guardar los datos del paciente."; logger.Error(IMDSerialize.Serialize(67823458421278, $"Error en {metodo}(EntPaciente entPaciente): {ex.Message}", entPaciente, ex, response)); } return(response); }