Skip to content

Application architecture

ClaimBillEntry is a server-rendered ASP.NET MVC 5 / Razor application on .NET Framework 4.6.2, hosted in IIS with Windows authentication. Three full-page screens host a Kendo UI client that drives AJAX JSON and grid actions. Controllers derive from a local BaseController that extends the SAIF ClaimControllerBase, receive their services through Autofac constructor injection, and delegate domain work to SAIF.SAIFCode.Core services that use an NHibernate unit of work on Oracle and SAIF data API clients.

Layer diagram

The diagram shows how the browser, the MVC application, the composition-root companion project and the consumed SAIF packages relate.

flowchart TB
    Browser["Browser: Razor views, Kendo UI, page scripts"] --> Layout["_Bootstrap3 layout:<br>web context, top menu, side menu"]
    Browser -->|"AJAX JSON and grid calls"| Controllers
    subgraph Web["ClaimBillEntry (ASP.NET MVC 5)"]
        Controllers["Controllers: Entry, Inbox, Search, Provider,<br>NoteGrid, DiagnosisGrid, ProcedureGrid, ServiceGrid, Home"]
        Base["BaseController : ClaimControllerBase"]
        VM["ViewModels and AutoMapper maps"]
        Controllers --> Base
        Controllers --> VM
    end
    subgraph Comp["SAIF.DependencyMaps.Web.ClaimBillEntry (companion)"]
        DM["DependencyMap.Configure:<br>Autofac container and MVC resolver"]
    end
    Controllers -->|"constructor injection"| DM
    DM --> Core["SAIF.SAIFCode.Core: bill, diagnosis, procedure,<br>service, note and claim services and query providers"]
    DM --> FW["SAIF.Framework.Core, Common,<br>Web.Mvc and Data.NHibernate"]
    Core --> UoW["NHibernate unit of work ClaimBillEntry<br>(Oracle, pool CLM)"]
    Core --> Api["SAIF data API clients<br>(claim and financial data)"]
    DM --> Img["ImagingApi.Client"]
    Browser --> OnBase["OnBase: client-side document launch"]

Layer descriptions

The repository has no standalone libraries, so the layers below are application projects and consumed SAIF packages. The packages have no documentation set in this run; see Dependencies.

Layer Projects / packages Responsibility
Presentation ClaimBillEntry Razor views, _Bootstrap3 layout, script modules in ClaimBillEntry/js Renders the three screens and drives grid and AJAX calls; see Screen catalog
Controllers ClaimBillEntry/Controllers (ten controllers) Screen actions and the 44 hosted endpoints; map domain objects to ViewModels
Composition SAIF.DependencyMaps.Web.ClaimBillEntry Builds the Autofac container and registers services, query providers and the unit of work
Domain services SAIF.SAIFCode.Core Bill, diagnosis, procedure, service, note and claim services and query providers
Framework SAIF.Framework.Core, SAIF.Framework.Common, SAIF.Framework.Web.Mvc, SAIF.SAIFCode.Web.Mvc Environment service, user profile, web context, menu, security filter and controller bases
Data access SAIF.Framework.Data.NHibernate NHibernate unit of work and repository factory on Oracle
External services SAIF data API clients, ImagingApi.Client, OnBase Claim and financial data, imaging and document viewing

Start-up pipeline

ClaimBillEntry : HttpApplication.Application_Start runs these calls in order.

# Call Effect Source
1 AreaRegistration.RegisterAllAreas No areas exist, so this registers nothing ClaimBillEntry/Global.asax.cs:17
2 GlobalConfiguration.Configure(WebApiConfig.Register) Registers the route api/{controller}/{id}; no ApiController is compiled ClaimBillEntry/Global.asax.cs:20, ClaimBillEntry/App_Start/WebApiConfig.cs:9-13
3 FilterConfig.RegisterGlobalFilters Adds HandleErrorAttribute only ClaimBillEntry/Global.asax.cs:23, ClaimBillEntry/App_Start/FilterConfig.cs:10
4 RouteConfig.RegisterRoutes Registers the conventional MVC route ClaimBillEntry/Global.asax.cs:26
5 DependencyMap.Configure(typeof(ClaimBillEntry)) Builds the Autofac container and sets the MVC DependencyResolver; see Composition root ClaimBillEntry/Global.asax.cs:29, SAIF.DependencyMaps.Web.ClaimBillEntry/DependencyMap.cs:274
6 AutoMapperBootStrapper.Configure Defines domain-to-ViewModel maps ClaimBillEntry/Global.asax.cs:32, ClaimBillEntry/Classes/AutoMapperBootStrapper.cs:16-77
7 BundleTableBootStrapper.Configure Defines the ~/AppStyles and ~/AppScripts bundles ClaimBillEntry/Global.asax.cs:35, ClaimBillEntry/Classes/BundleTableBootStrapper.cs:10-13
8 FluentValidationModelValidatorProvider.Configure Plugs FluentValidation into MVC model validation ClaimBillEntry/Global.asax.cs:38
9 ViewEngines.Engines.Clear then add RazorViewEngine Leaves Razor as the only view engine ClaimBillEntry/Global.asax.cs:41-42
10 ModelBinders.Binders add JsonDateTimeModelBinder Custom binder for DateTime and DateTime? ClaimBillEntry/Global.asax.cs:44-46

Session_Start is present and empty (ClaimBillEntry/Global.asax.cs:49). The analysis does not report Application_Error or Application_BeginRequest handlers.**

Route table

Routes are listed in registration order. There are no attribute routes and no areas. Client scripts hard-code the virtual directory /ClaimBillEntry/ (ClaimBillEntry/js/ClaimBillEntry.entry.js:219, ClaimBillEntry/js/ClaimBillEntry.js:97).

# Name URL pattern Defaults Constraints Source
1 (ignore) {resource}.axd/{*pathInfo} None None ClaimBillEntry/App_Start/RouteConfig.cs:10
2 Default (customized) {controller}/{action}/{id} Home / Index, id optional None reported ClaimBillEntry/App_Start/RouteConfig.cs:12-16
3 DefaultApi (Web API) api/{controller}/{id} id optional None reported ClaimBillEntry/App_Start/WebApiConfig.cs:9-13

Controller hierarchy

The diagram shows the base classes of the ten compiled controllers. HomeController derives from WebContextControllerBase rather than BaseController. The chain from ClaimControllerBase and WebContextControllerBase up to System.Web.Mvc.Controller is inferred from package naming.**

classDiagram
    Controller <|-- ClaimControllerBase
    Controller <|-- WebContextControllerBase
    ClaimControllerBase <|-- BaseController
    WebContextControllerBase <|-- HomeController
    BaseController <|-- EntryController
    BaseController <|-- InboxController
    BaseController <|-- SearchController
    BaseController <|-- ProviderController
    BaseController <|-- NoteGridController
    BaseController <|-- DiagnosisGridController
    BaseController <|-- ProcedureGridController
    BaseController <|-- ServiceGridController
Controller Base SaifAuthorize roles Serves
BaseController (abstract) ClaimControllerBase (SAIF.SAIFCode.Web.Mvc*) None Shared preference actions; menu category CLBLE
HomeController WebContextControllerBase (SAIF.Framework.Web.Mvc) None Redirect to Entry; Navigate
EntryController BaseController CBPEnterBill Bill entry
InboxController BaseController CBPEnterBill Inbox, and the preference actions used by Search
SearchController BaseController CBPEnterBill Search
ProviderController BaseController None Bill entry provider lookups
NoteGridController BaseController None Bill entry notes grid
DiagnosisGridController BaseController None Bill entry diagnoses grid
ProcedureGridController BaseController None Bill entry procedures grid
ServiceGridController BaseController None Bill entry service lines

WebContextControllerBase is matched to SAIF.Framework.Web.Mvc by reading that assembly, although against an older installed version than the one the project references. ClaimControllerBase is attributed to SAIF.SAIFCode.Web.Mvc from the assembly names in the project HintPaths because no local package copy was available.*

Sources for the table rows are the controller files named in ClaimBillEntry/Controllers/ (for example ClaimBillEntry/Controllers/BaseController.cs:20-34 and ClaimBillEntry/Controllers/EntryController.cs:22).

Composition root

Location: SAIF.DependencyMaps.Web.ClaimBillEntry/DependencyMap.cs, in the application companion project SAIF.DependencyMaps.Web.ClaimBillEntry. This is the path named as the composition root for this repository, and the project is part of the application, not a library.

The companion project is a .NET Framework 4.6.2 class library that compiles only DependencyMap.cs, AssemblyInfo and Version.cs (SAIF.DependencyMaps.Web.ClaimBillEntry/SAIF.DependencyMaps.Web.ClaimBillEntry.csproj:8, :12, :311-312, :345). Global.asax.cs calls DependencyMap.Configure(typeof(ClaimBillEntry)) (ClaimBillEntry/Global.asax.cs:29). The method creates new ContainerBuilder() and ends by setting an AutofacDependencyResolver as the MVC DependencyResolver; no Web API resolver is set (DependencyMap.cs:52, :274).

Service Implementation Lifetime Configuration used Source
Common SAIF services (validation, log, email, print, imaging, fax, user profile) via RegisterCommonDependencies Extension from SAIF.Framework.Web.Mvc Framework-defined** None DependencyMap.cs:52-58
SAIF data API clients (ICCClaimApiService, IClaimDataApiClient, IFinancialDataApiClient) via AddDataClients(SystemType.WebApp, UseCache true) CCClaimApiService†, ClaimDataApiClient†, FinancialDataApiClient† Not stated in the retrieved documentation for the three clients; the IDataClientConfiguration registration is a singleton† and UseCache = true enables the cache path† ** cc.ccclaimdataapiurl† (ICCClaimApiService), cc.claimdata.api.url.v1† (IClaimDataApiClient), cc.financial.api.url.v1† (IFinancialDataApiClient) DependencyMap.cs:58
IClaimSecurityService ClaimSecurityService Per request None DependencyMap.cs:60-61
IUnitOfWork, IRepositoryFactory NHibernate unit of work named ClaimBillEntry (Oracle) Per request EnvironmentConfigKeys.OracleDatabase, pool CLM; selected through IUnitOfWorkFactory.ResolveNamed("oracle") DependencyMap.cs:43-44, :64-72
IWorkCalendarService WorkCalendarService Instance per dependency None DependencyMap.cs:77-78
Service code, audit note, provider, claim payment, legal, audit, bill, reserve, worker and claim query providers Query provider implementations Per request None DependencyMap.cs:80-143
Overpayment, location, employee and policy query providers Query provider implementations Instance per dependency (inconsistent with the per-request providers) None DependencyMap.cs:97, :100, :103, :129-131
IBillService BillService Per request None DependencyMap.cs:145-158
IImagingClient ImagingClient Per request Environment setting imagingapiurl DependencyMap.cs:160-161
Claim bill entry repository ClaimBillEntryRepository over NHibernateUnitOfWork and ICCClaimApiService Per request None DependencyMap.cs:163-166
Note, claim contact, claim information, bill query, PDF and document services Service implementations Per request None DependencyMap.cs:168-216
Bill entry, bill service, diagnosis, bill diagnosis, procedure and bill procedure services Service implementations used by the controllers Per request None DependencyMap.cs:218-261
IValidator, IValidator<T> FluentValidation AssemblyScanner over the BillValidator assembly Per request None DependencyMap.cs:263-271
MVC DependencyResolver AutofacDependencyResolver Container None DependencyMap.cs:274

An HttpClient for the cc.ccclaimdataapiurl setting is created but never registered (DependencyMap.cs:47-49), and the call to RegisterInformationServices is commented out (DependencyMap.cs:75). Both are recorded in Tech debt.

Application dependencies facade

An IApplicationDependencies interface and an ApplicationDependencyContainer class exist in the companion project but are not compiled, so the facade is vestigial (SAIF.DependencyMaps.Web.ClaimBillEntry/IApplicationDependencies.cs, SAIF.DependencyMaps.Web.ClaimBillEntry/SAIF.DependencyMaps.Web.ClaimBillEntry.csproj:311-312). Its property map (unit of work, environment service, preference service, user profile service, validation service) is not active, and controllers use constructor injection instead.

Filters and model binders

Kind Type Scope Effect
Global filter HandleErrorAttribute All actions The only global filter; standard MVC error handling (ClaimBillEntry/App_Start/FilterConfig.cs:10)
Authorization SaifAuthorizeAttribute (SAIF.Framework.Web.Mvc) EntryController, InboxController, SearchController Requires the CBPEnterBill role; no application-local subclasses were reported
Action filter override BaseController.OnActionExecuting All controllers derived from BaseController Runs only when Request.IsAjaxRequest() is false: it calls the inherited OnActionExecuting and then sets the default web-context value through IWebContextExtensions.SetDefaultCurrentValue; AJAX requests skip both (ClaimBillEntry/Controllers/BaseController.cs:38-48)
Security override BaseController.CheckSecurity All controllers derived from BaseController Returns HasConflictAccess for the web-context claim (ClaimBillEntry/Controllers/BaseController.cs:31-34)
Model binder JsonDateTimeModelBinder DateTime and DateTime? Custom date binding for JSON requests (ClaimBillEntry/Global.asax.cs:44-46)
Model validation FluentValidationModelValidatorProvider All model binding Applies FluentValidation validators (ClaimBillEntry/Global.asax.cs:38)
View engine RazorViewEngine Application The only registered view engine (ClaimBillEntry/Global.asax.cs:41-42)

The inherited behavior of ClaimControllerBase, WebContextControllerBase and SaifAuthorizeAttribute is in packages whose internals were not traced.**

Client-side stack

Component Version Loaded by Source
SAIF shared asset bundle (CSS and JS; includes Kendo UI, jQuery and Bootstrap*) Unknown** _Bootstrap3.cshtml through /assets/v4/all.bundled.min.css and .min.js ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:16, :24
OnBase enabler v1 _Bootstrap3.cshtml ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:25
jQuery collapsible table 1.0.0 _Bootstrap3.cshtml ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:26
toastr 2.1.1 _Bootstrap3.cshtml ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:17, :27, ClaimBillEntry/packages.config:75
Kendo UI for ASP.NET MVC 2018.2.620 (vendor DLL) Views namespace Kendo.Mvc.UI ClaimBillEntry/Views/Web.config:46, ClaimBillEntry/ClaimBillEntry.csproj:114-115
jQuery (NuGet) 1.9.1 Package; used through the shared bundle* ClaimBillEntry/packages.config:17
jQuery Validation and Unobtrusive 1.11.1 and 2.0.30506.0 Packages ClaimBillEntry/packages.config:18, :37
Web Optimization 1.1.3; bundles ~/AppStyles (css folder) and ~/AppScripts (chained.js) Scripts.Render in the layout ClaimBillEntry/Classes/BundleTableBootStrapper.cs:10-13, ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:73

All screens load the claimbillentry.message, utils and shared js scripts from the layout (ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:28-30). Each screen adds its own script modules.

Script module Screen
ClaimBillEntry.entry.js, with claimbillentry.entry.service.js, claimbillentry.entry.service.validator.js, claimbillentry.entry.worker.js, claimbillentry.entry.note.js, claimbillentry.entry.diagnosis.js, claimbillentry.entry.procedure.js, claimbillentry.entry.sendpend.js and claimbillentry.entry.provider.js Bill entry (ClaimBillEntry/Views/Entry/Index.cshtml:13-21)
ClaimBillEntry.inbox.js Inbox (ClaimBillEntry/Views/Inbox/Index.cshtml:12)
ClaimBillEntry.search.js Search (ClaimBillEntry/Views/Search/Index.cshtml:11)

The layout renders the web-context control, top menu and side menu through SAIF helpers (ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml:43, :49, :58).

Key patterns

  • Server-rendered shell with an AJAX client: three full-page views host a kendo.observable view model that calls JSON and grid actions (ClaimBillEntry/Views/Entry/Index.cshtml:25).
  • Constructor injection through Autofac: controllers receive services from the companion project's container.
  • Thin controllers over package services: controllers call SAIF.SAIFCode.Core service interfaces and map results with AutoMapper.
  • Kendo grid transport: grid actions accept DataSourceRequest and return DataSourceResult.

Integration points

Integration Type Direction Libraries involved
Oracle database, pool CLM, through an NHibernate unit of work Database Outbound SAIF.Framework.Data.NHibernate, SAIF.SAIFCode.Core
SAIF data API clients (claim and financial data) API Outbound SAIF.SAIFCode.Core, SAIF.Framework.Web.Mvc
Imaging API (imagingapiurl) API Outbound ImagingApi.Client
OnBase document launch Browser navigation Outbound (client-side) OnBase enabler asset
SAIF shared asset bundle /assets/v4/ Static assets Inbound to the browser None
SAIF menu and web-context framework Framework Inbound SAIF.Framework.Web.Mvc; menu entries are defined outside this repository**

Design constraints

  • The application requires IIS Windows authentication with anonymous access disabled, and an application pool on .NET 4.0 in Classic pipeline mode (Pipelines/build-vars.yml:20-35).
  • Client scripts hard-code the /ClaimBillEntry/ virtual directory, so the application cannot be hosted at another path without script changes.
  • Controller-level role checks exist only on the Entry, Inbox and Search controllers; see Tech debt.

Note: Statements marked with † are derived from dependency library documentation via the Legends CLI. Statements marked with * were inferred from code structure or contextual evidence. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • ClaimBillEntry/Global.asax.cs
  • ClaimBillEntry/App_Start/RouteConfig.cs
  • ClaimBillEntry/App_Start/WebApiConfig.cs
  • ClaimBillEntry/App_Start/FilterConfig.cs
  • ClaimBillEntry/Classes/AutoMapperBootStrapper.cs
  • ClaimBillEntry/Classes/BundleTableBootStrapper.cs
  • ClaimBillEntry/Controllers/BaseController.cs
  • ClaimBillEntry/Controllers/HomeController.cs
  • ClaimBillEntry/Controllers/EntryController.cs
  • ClaimBillEntry/Controllers/InboxController.cs
  • ClaimBillEntry/Controllers/SearchController.cs
  • ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml
  • ClaimBillEntry/Views/Web.config
  • ClaimBillEntry/ClaimBillEntry.csproj
  • ClaimBillEntry/packages.config
  • SAIF.DependencyMaps.Web.ClaimBillEntry/DependencyMap.cs
  • SAIF.DependencyMaps.Web.ClaimBillEntry/SAIF.DependencyMaps.Web.ClaimBillEntry.csproj
  • SAIF.DependencyMaps.Web.ClaimBillEntry/IApplicationDependencies.cs
  • Pipelines/build-vars.yml