EverestConfig 3.4.1
dotnet add package EverestConfig --version 3.4.1
NuGet\Install-Package EverestConfig -Version 3.4.1
<PackageReference Include="EverestConfig" Version="3.4.1" />
<PackageVersion Include="EverestConfig" Version="3.4.1" />
<PackageReference Include="EverestConfig" />
paket add EverestConfig --version 3.4.1
#r "nuget: EverestConfig, 3.4.1"
#:package EverestConfig@3.4.1
#addin nuget:?package=EverestConfig&version=3.4.1
#tool nuget:?package=EverestConfig&version=3.4.1
EverestConfig — .NET
Librería .NET para gestionar parametrización genérica de formularios y secciones. Permite consultar desde una API centralizada qué campos son visibles, requeridos, su tipo y propiedades personalizadas — sin hardcodear configuración en cada proyecto.
Inicialmente diseñada para Historia Clínica (HC), aplicable a cualquier dominio.
Instalación
dotnet add package EverestConfig --version 2.1.0
Registro en DI
En Startup.cs (o Program.cs), registrá el servicio pasando la URL completa del endpoint de configuración:
services.AddEverestConfig("http://localhost:5000/api/Configuracion/GetConfig");
La librería agrega ?key=, &epsId= y &contratoId= a esa URL según los parámetros de cada llamada. El timeout del HttpClient está configurado en 30 segundos.
Endpoint que consume
GET /api/Configuracion/GetConfig?key={key}&epsId={epsId}&contratoId={contratoId}
| Parámetro | Tipo | Obligatorio |
|---|---|---|
| key | string | ✅ |
| epsId | int? | ❌ |
| contratoId | int? | ❌ |
El backend filtra los campos por epsId y contratoId antes de responder — la librería recibe la lista ya resuelta, sin duplicados. Si no hay configuración el endpoint responde [].
Interfaz del servicio
public interface IEverestConfigService
{
Task<SectionConfig> GetConfigAsync(string key, int? epsId = null, int? contratoId = null);
bool IsVisible(SectionConfig config, string fieldId);
bool IsRequired(SectionConfig config, string fieldId);
FieldType? GetFieldType(SectionConfig config, string fieldId);
object GetCustomProperty(SectionConfig config, string fieldId, string property);
}
Modelos públicos
public class SectionConfig
{
public string Key { get; set; }
public string Version { get; set; }
public List<FieldConfig> Fields { get; set; }
}
public class FieldConfig
{
public string Id { get; set; }
public bool Visible { get; set; }
public bool Required { get; set; }
public bool? Readonly { get; set; }
public string Label { get; set; }
public string Description { get; set; }
public string Section { get; set; }
public string ValidationRegex { get; set; }
public FieldType? Type { get; set; }
public Dictionary<string, object> CustomProperties { get; set; }
}
public enum FieldType
{
String, Number, Boolean, Date, DateTime, Select, Card, Custom
}
Ejemplo de uso en un controller
using EverestConfig.Services;
using Microsoft.AspNetCore.Mvc;
[ApiController]
[Route("api/[controller]")]
public class MorbilidadController : ControllerBase
{
private readonly IEverestConfigService _config;
public MorbilidadController(IEverestConfigService config)
{
_config = config;
}
[HttpGet("formulario")]
public async Task<IActionResult> GetFormulario([FromQuery] int epsId, [FromQuery] int contratoId)
{
var config = await _config.GetConfigAsync("hc.morbilidad", epsId, contratoId);
if (config == null)
return NotFound("No se encontró configuración.");
return Ok(new
{
mostrarOrdenamientos = _config.IsVisible(config, "ordenamientos"),
mostrarDiagnosticos = _config.IsVisible(config, "diagnosticos"),
tiposOrdenamiento = _config.GetCustomProperty(config, "ordenamientos", "types")
});
}
}
Validar un campo antes de guardar
using EverestConfig.Validators;
[HttpPost("guardar")]
public async Task<IActionResult> Guardar([FromBody] MorbilidadRequest request, [FromQuery] int epsId, [FromQuery] int contratoId)
{
var config = await _config.GetConfigAsync("hc.morbilidad", epsId, contratoId);
if (config == null)
return NotFound("Configuración no encontrada.");
var campoOrdenamientos = config.Fields.FirstOrDefault(f => f.Id == "ordenamientos");
if (campoOrdenamientos != null)
{
var resultado = FieldValidator.Validate(request.Ordenamientos, campoOrdenamientos);
if (!resultado.Valid)
return BadRequest(resultado.Message);
}
// lógica de guardado...
return Ok();
}
Leer propiedades personalizadas (CustomProperties)
var types = _config.GetCustomProperty(config, "ordenamientos", "types");
// Castear según la estructura conocida
var lista = types as Newtonsoft.Json.Linq.JArray;
Caché en memoria
GetConfigAsync almacena la respuesta en memoria con clave {key}_{epsId}_{contratoId}. Las llamadas siguientes con los mismos parámetros no hacen petición HTTP. Automático, sin configuración adicional.
Logs
El servicio loguea automáticamente usando ILogger. Todos los mensajes tienen el prefijo [EverestConfig]:
[EverestConfig] GetConfigAsync: configuración no encontrada | key: "hc.morbilidad" | epsId: 21 | contratoId: 1
[EverestConfig] IsVisible: campo no encontrado | key: "hc.morbilidad" | fieldId: "ordenamientos"
[EverestConfig] GetCustomProperty: propiedad no definida | fieldId: "ordenamientos" | property: "tipos"
JSON de respuesta esperado
[
{
"key": "hc.morbilidad",
"version": "1.0",
"fields": [
{
"id": "ordenamientos",
"section": "conducta.ordenamientos",
"label": "Laboratorios",
"visible": true,
"required": false,
"readonly": false,
"type": "select",
"validationRegex": null,
"customProperties": {
"types": [
{ "name": "laboratorio", "posfechado": true, "nota": false, "cantidad": false },
{ "name": "consulta", "posfechado": true, "nota": true, "cantidad": true },
{ "name": "imagenologia", "posfechado": true, "nota": true, "cantidad": true }
]
}
},
{
"id": "diagnosticos",
"section": "conducta.diagnosticos",
"label": "Diagnósticos",
"visible": true,
"required": false,
"type": "select",
"customProperties": {}
}
]
}
]
Tipos de campo
| FieldType | Descripción |
|---|---|
String |
Texto libre |
Number |
Número |
Boolean |
Verdadero / falso |
Date |
Fecha |
DateTime |
Fecha y hora |
Select |
Selección de lista |
Card |
Contenedor de campos |
Custom |
Comportamiento definido por CustomProperties |
Estructura del proyecto
EverestConfig/
├── Models/
│ ├── FieldType.cs
│ ├── FieldConfig.cs
│ ├── FieldConfigRaw.cs — internal, incluye epsId/contratoId para deserialización
│ ├── SectionConfig.cs
│ └── EverestConfigEntry.cs — internal
├── Converters/
│ └── IntOrArrayConverter.cs — deserializa null/1/[1,21] → int[]?
├── Services/
│ ├── IEverestConfigService.cs
│ └── EverestConfigService.cs
├── Validators/
│ ├── ValidationResult.cs
│ └── FieldValidator.cs
└── Extensions/
└── ServiceCollectionExtensions.cs
Licencia
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Http (>= 2.2.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.2.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.4.1 | 95 | 5/14/2026 |
| 3.4.0 | 84 | 5/13/2026 |
| 3.2.0 | 92 | 5/12/2026 |
| 3.1.0 | 96 | 5/12/2026 |
| 3.0.5 | 91 | 5/11/2026 |
| 3.0.4 | 93 | 5/11/2026 |
| 3.0.3 | 99 | 5/6/2026 |
| 3.0.2 | 91 | 5/6/2026 |
| 3.0.1 | 91 | 5/6/2026 |
| 3.0.0 | 87 | 5/6/2026 |
| 2.1.3 | 92 | 5/6/2026 |
| 2.1.2 | 89 | 5/5/2026 |
| 2.1.1 | 92 | 5/5/2026 |
| 2.1.0 | 88 | 5/5/2026 |
| 1.1.0 | 90 | 5/5/2026 |
| 1.0.1 | 96 | 4/30/2026 |
| 1.0.0 | 85 | 4/30/2026 |