Overview
The WRRS Messaging Metrics Dashboard provides a quick way to view the number of messages being processed from NDR. Users can also view the number of messages processed by message type and by health board.
The application has been developed and tested specifically for Internet Explorer 11, but is compatible with other browsers with HTML5 and JavaScript enabled.
Developed on the ASP.NET MVC 5 framework, the Dashboard uses the following technologies:
- Web API
- amCharts and Chart.js JavaScript charting frameworks
- jQuery
- Entity Framework
- SQL Server 204 or SQL Server 2016
The Messaging Metrics Dashboard is an ASP.NET MVC 5 application that displays the volume of messages successfully processed between clinical systems. Message volume can be viewed by department or system type.
It supports three system categories:
- Pathology
- Radiology
- Cardiology
The metrics themselves are stored in Service Broker queues, and retrieved through stored procedures. The data access layer of the application converts the returned data to JSON format, which is forwarded to the view layer on an AJAX request.
To render the graphs for the metrics, the application uses amCharts and Chart.js.
Under the application title/header, there is the drop-down menu. Eventually this might be used to enable the user to switch between dashboards for Pathology, Radiology and Cardiology:
View and Web API Controllers
Refers here to the view controllers. The view controllers themselves are very basic, without any additional logic other than routing the browser requests to the appropriate view.
The actual logic for returning the data to the charts is found in the Web API controllers:
- prMessagesProcessedByDay_LHB_ResultController.cs
- prMessagesProcessedByDay_ResultController.cs
The Web API controllers handle the access of objects representing the data returned by the stored procedures in the data access layer.
In the view layer, a Web API controller is invoked by AJAX requests. The code for this varies between AmCharts and Chart.js. The latter depends on jQuery's '
$.ajax' function to make this request to the Web API controller.
Model
Entity Framework is used to model the stored procedures and the return data, rather than the application being designed to query the database directly.
In the messaging database is stored procedure called ‘
prMessagesProcessedByDay’. This takes one input parameter, ‘
NoOfDays’ and returns a table with three column fields:
Date,
Id and
MessagesProcessed. These were imported as an Entity Framework model.
The
Context.cs file determines the parameters or values to be passed to the stored procedure through the EF model. Here it’s simply
NoOfDays as an integer.
public virtual ObjectResult prMessagesProcessedByDay(Nullable noOfDays)
{
var noOfDaysParameter = noOfDays.HasValue ?
new ObjectParameter("NoOfDays", noOfDays) :
new ObjectParameter("NoOfDays", typeof(int));
return((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("prMessagesProcessedByDay", noOfDaysParameter);
}
The values returned by the stored procedure are:
public Nullable Id { get; set; }
public Nullable Date { get; set; }
public Nullable MessagesProcessed { get; set; }
References
AMCHARTS. 2017.
JavaScript Charts & Maps. [WWW].
https://www.amcharts.com. 19th April 2017.
CHART.JS. 2017. Chart.js.
API Documentation. [WWW].
http://www.chartjs.org/docs/. 19th April 2017.
JQUERY FOUNDATION. 2017. jQuery API Documentation.
jQuery.ajax(). [WWW].
http://api.jquery.com/jquery.ajax/. 19th April 2017.