Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ttpullima/RomsoftBackEnd2021_v2/llms.txt

Use this file to discover all available pages before exploring further.

The Romsoft Gestión Clínica backend is organized as a single Visual Studio solution (Romsoft.GESTIONCLINICA.sln) containing six C# projects. Each project maps cleanly to one architectural layer — there are no circular dependencies and no project that “does everything.” Understanding which project owns which responsibility is the fastest way to navigate the codebase when adding a new clinical module or debugging a production issue.

Solution Layout

Romsoft.GESTIONCLINICA.sln

├── Romsoft.GESTIONCLINICA.WebApi/                  ← IIS entry point
│   ├── App_Start/
│   │   ├── WebApiConfig.cs                         ← Route registration + TokenValidationHandler
│   │   └── SwaggerConfig.cs                        ← Swashbuckle /swagger UI
│   ├── Controllers/
│   │   ├── BaseController.cs                       ← Shared Logger + LogError helpers
│   │   ├── TokenGenerator.cs                       ← JWT creation (GenerateTokenJwt)
│   │   ├── TokenValidationHandler.cs               ← DelegatingHandler, JWT validation
│   │   ├── AccountController.cs                    ← Login / token issuance [AllowAnonymous]
│   │   ├── ADM_PACIENTEController.cs
│   │   ├── ADM_PROFESIONALController.cs
│   │   └── … (all other domain controllers)
│   ├── Core/
│   │   ├── CorsHandler.cs
│   │   ├── Mensajes.cs                             ← Localised response strings
│   │   ├── SimplePostVariableParameterBinding.cs
│   │   └── UtilsComun.cs
│   ├── Global.asax.cs                              ← Application_Start bootstrap
│   ├── Web.config                                  ← Connection strings, JWT keys, log4net
│   ├── Web.Debug.config                            ← Debug transform
│   └── Web.Release.config                          ← Release / production transform

├── Romsoft.GESTIONCLINICA.Business.Logic/          ← Domain rules + BL singletons
│   ├── Core/
│   │   └── ILogic.cs                               ← Generic CRUD interface
│   ├── Interfaces/                                 ← Per-entity BL interfaces
│   ├── Tablas/
│   │   ├── ADM_PACIENTEBL.cs                       ← Patient business logic singleton
│   │   ├── LogBL.cs                                ← Audit log persistence singleton
│   │   └── … (one BL class per entity)

├── Romsoft.GESTIONCLINICA.DataAccess/              ← SQL / OLEDB repositories
│   ├── Core/
│   │   └── ConectionStringRepository.cs            ← Reads connection strings from config
│   ├── Interfaces/                                 ← Per-entity repository interfaces
│   ├── Tablas/
│   │   ├── ADM_PACIENTERepository.cs
│   │   ├── LogRepository.cs
│   │   └── … (one Repository per entity)

├── Romsoft.GESTIONCLINICA.Entidades/               ← Plain domain/entity classes
│   ├── ADM_PACIENTE/ADM_PACIENTE.cs
│   ├── SEG_USUARIO/SEG_USUARIO.cs
│   ├── Log.cs
│   └── … (one folder per entity prefix)

├── Romsoft.GESTIONCLINICA.DTO/                     ← Data Transfer Objects + AutoMapper
│   ├── AutoMapper/
│   │   ├── AutoMapperConfiguration.cs              ← Configure() called in Global.asax
│   │   ├── DomainToDtoMappingProfile.cs
│   │   ├── DtoToDomainMappingProfile.cs
│   │   └── MapperHelper.cs                         ← MapperHelper.Map<TSource,TDest>()
│   ├── TABLAS/
│   │   ├── ADM_PACIENTE/ADM_PACIENTEDTO.cs
│   │   └── … (one DTO per entity)

├── Romsoft.GESTIONCLINICA.Common/                  ← Shared utilities
│   ├── JsonResponse.cs                             ← Universal API response envelope
│   ├── PaginationParameter.cs                      ← Pagination / filter parameters
│   ├── ValidationManager.cs
│   ├── EstadoActual.cs
│   ├── Encrypto/
│   │   ├── CryptoHelper.cs
│   │   └── EncryptConstants.cs
│   └── Generics/
│       └── Singleton.cs                            ← Thread-safe generic singleton base

├── Romsoft.GESTIONCLINICA.Presentacion/            ← WinForms / desktop presentation
│   ├── ApiService/                                 ← HTTP client wrappers
│   ├── ModuloConvenios/
│   ├── ModuloSeguridad/
│   ├── ModuloTablas/
│   └── Helpers/ · Utilities/ · Resources/

└── Romsoft.GESTIONCLINICA.Presentacion.Configuracion/  ← Desktop configuration forms

Project Responsibilities

Romsoft.GESTIONCLINICA.WebApi

The sole IIS-hosted project. It owns:
  • Route registration — the api/{controller}/{action}/{id?} template defined in WebApiConfig.cs
  • Authentication pipelineTokenValidationHandler registered as a DelegatingHandler
  • SwaggerSwaggerConfig.cs enables /swagger with JWT header support
  • BootstrapGlobal.asax.cs calls log4net config, AutoMapper config, and Web API config
  • Shared stringsCore/Mensajes.cs holds all user-visible response messages in Spanish

Romsoft.GESTIONCLINICA.Business.Logic

Contains exactly one BL class per domain entity plus LogBL. Every BL class:
  • Extends Singleton<T> so callers use XxxBL.Instancia — no dependency injection container is used
  • Implements ILogic<T> (or a domain-specific interface) to enforce a standard CRUD contract
  • May add domain-specific methods beyond the interface (e.g., ADM_ATENCIONBL.GetAtencionPending)

Romsoft.GESTIONCLINICA.DataAccess

Issues all SQL through the Microsoft Enterprise Library Data Application Block v6. Repository classes call DatabaseFactory.CreateDatabase(ConectionStringRepository.ConnectionStringNameSQL) and execute stored procedures in the Romsoft. schema. The static ConectionStringRepository.EsquemaName property returns "Romsoft." as a consistent prefix.

Romsoft.GESTIONCLINICA.Entidades

Plain C# POCO classes. They match database table columns one-to-one and carry no framework dependencies. Folder names match the entity prefix (e.g., ADM_PACIENTE/, FAR_PRODUCTO/).

Romsoft.GESTIONCLINICA.DTO

Mirror classes of Entidades with properties suitable for external consumers (camel-case, nullable types for optional fields). AutoMapper profiles are the only place where entity ↔ DTO property mappings are declared.

Romsoft.GESTIONCLINICA.Common

Shared across all layers. Key types:
TypePurpose
JsonResponseUniversal HTTP response envelope returned by every controller action
PaginationParameterCarries Start, CurrentPage, AmountRows, OrderBy, WhereFilter for paginated queries
Singleton<T>Thread-safe (mutex-guarded) generic singleton base class
CryptoHelperAES/MD5 helpers for password and token hashing

Romsoft.GESTIONCLINICA.Presentacion / .Presentacion.Configuracion

WinForms desktop application that consumes the Web API. Not deployed to IIS. Contains HTTP client wrappers under ApiService/ that mirror each controller’s endpoints.

Controller Naming Conventions

Controllers are named with a two- or three-letter module prefix that identifies the clinical domain:
PrefixModuleExamples
ADM_Admissions & clinical master dataADM_PACIENTEController, ADM_ATENCIONController
CVN_Insurance / ConveniosCVN_PLAN_SEGUROController, CVN_BENEFICIOController
FAR_Pharmacy / FarmaciaFAR_PRODUCTOController, FAR_GENERICOController
FAC_Billing / FacturaciónFAC_DOCUMENTO_PAGOController
CON_Accounting / ContabilidadCON_CUENTA_CONTABLEController, CON_CONTACTOController
SEG_Security / SeguridadSEG_USUARIOController, SEG_ROLController
The AccountController (no prefix) is the authentication endpoint. It carries [AllowAnonymous] on its login action so that TokenValidationHandler does not reject unauthenticated callers before they can obtain a token.
When adding a new clinical module, create one project-per-layer artifact in the same order: entity class → DTO class → repository → BL singleton → controller. This keeps the dependency direction strictly downward and avoids circular references.

Build docs developers (and LLMs) love