Call Montréal, Canada 524-949-6869


Friday, December 11, 2015

How Elixir is Transforming My Mind

Last month I presented a talk to Montreal.rb on Elixir - a language I have been exploring on and off over the last year. Like any good talk from a newbie, it contains bloopers, mis-information and whole lot of gusto. Watch it at your peril!


How Elixir is Transforming My Mind from Nicholas Henry on Vimeo.


Saturday, September 5, 2015

Recently Launched: Wardware 2.0

Over the last year I have had the pleasure to work with Airslie Ltd, a UK-based medical informatics company, and King's College Hospital (NHS Foundation Trust) to rewrite and extended their clinical observations and assessments system, Wardware®. Wardware enables the entry, analysis and display of Early Warning Scores and other patient datasets for clinical use locally or remotely on mobile and desktop computers. The application was originally built using PHP, sans framework, and the company who originally authored the application, Airslie, was motivated to rewrite it using an application framework. Their chosen framework was Ruby on Rails and they approached me to lead the development effort.

Mobile Desktop

Desktop and Mobile views of Patient Chart

Facilitating the National Early Warning Score (NEWS)

The pivotal component of Wardware is the Observations and Assessments module. This module implements a number of assessments, including a key assessment for patient health, the - National Early Warning Score (NEWS). Early Warning Scores (EWS) are used to "quickly determine the degree of illness of a patient". This is determined by the scoring of physiological parameters such as temperature, heart rate and blood pressure. The total score assigns a patient to a risk category and the appropriate response, based on a predefined protocol, is carried out.

Physiological parameters are recorded using a mobile device, the MioCare Tablet, at the patient's bedside. The patient's charts, such as the NEWS chart can be viewed either on a desktop or the mobile device. The application has been developed using a Responsive front-end framework, allowing a single UI to be used for both desktop and mobile devices.

An extendible platform for supporting different assessments

The Observations and Assessments module is designed to be extended. It is a platform for implementing other assessments by simply configuring the physiological parameters and the assessment's calculator. Beyond NEWS, the Wardware installation at King's College Hospital is currently configured for:

Key assessments summarized in configurable Wardboards and Charts

Key assessments scores for patients such as NEWS along with assessment frequencies and due times are summarized on the Wardboard.


Wardboard summarizing current admissions for a specific ward.

Assessments with a specific threshold (e.g. a NEWS score greater than two) are also summarized at a ward and site-wide level.

Observation and Assessment Charts are presented in three formats:

1. Graphical


2. Tabular with the most recent 20 observations


3. Tabular with all historical patient data paginated


A range of modules supporting a patient's tracking and analysis requirements

Wardware doesn't just support observations and assessments, it supports various tracking and analysis requirements to monitor a patient. Briefly these include:

  • Oxygen Delivery Management, including the tracking of patient oxygen concentration targets
  • Response Management, recording responses to assessments such as NEWS
  • Device Management for surgical and urinary devices. Device Management tracks insertion and removal of devices for a patient, including the recording of complications
  • Diarrhoea Management integrated with Stools based on the Bristol Stool type
  • Blood Products Management (e.g. RBC, FFP, Platelets)
  • Fluid Management tracking patient's fluid balance and reporting

Integrated admission management with the hospital's Patient Information Management System

Wardware's Admissions module completes the admission process by assigning patients to a bed in their designated ward. Admissions for wards are automatically populated through a custom module integrating Wardware with KCH's Patient Information Management System (PIMS) using the Health Level-7 (HL7) messaging format, "a set of international standards for transfer of clinical and administrative data between software applications".

And there's a lot more

There is a lot more detail I can go into, but this post is long enough. Here are some facets that I'll highlight here:

  • Authentication and Authorization Management
  • Patient search via bar code scan from admission bracelet
  • Business Continuity Programme (offline storage of patient obs)

Domain Modeling Challenges

In future blog posts I will discuss some of the interesting domain modelling challenges of this project and how I leveraged Martin Fowler's Analysis Patterns. His patterns for observations and measurements is based on his work with the Cosmos Clinical Process Model for the UK National Health Service.

Thursday, May 28, 2015

Learning OO Design through Design Patterns

Last week at Montreal.rb there was an open discussion on RailsConf held in Atlanta which I had attended this year. We discussed favorite talks, themes and general experiences. I prepared a few notes prompting folks to explore design patterns after seeing Sandi Metz's talk, Nothing is Something. Why?

In the first half of Sandi's presentation she presented an example of using the Null Object Pattern as an example of sending messages to resolve her adversion to conditionals. During this portion of the presentation, she made an interesting comment explaining how she (re)discovered this pattern herself and then presented it to her co-worker. Sandi's co-worker described as "being a little more well read", told Sandi that this pattern had a name, the "Null Object Pattern". (OK, so I've cheated a little here. Sandi discusses this in her Bath Ruby version of her talk, not in the RailsConf version.)

Sandi goes on to suggest that we don't need to solve specific problems ourselves, as others have already solved these for us. She doesn't mention this explicitly but I interpreted this as Design Patterns. It just requires a little bit of research and reading. But where to start?

Two Book Recommendations

The classic Gang of Four Design Patterns book maybe a little intermediating for some, I know I've never found it appealing. However, there are some good alternatives. I recommend two.

The first book that really helped enter the world of design patterns was Design Patterns Explained by Shalloway and Trott. As the sub-title suggests, "A New Perspective on Object-Oriented Design", explains design patterns in the context of good OO design.

Likewise, Head First Design Patterns, also describes design patterns in the context of OO design, connecting design patterns with principles such as "Encapsulate what varies" and "Favor composition over inheritance". The first chapter is a great example of presenting these principles first in an example, and then identifying it as the Strategy Pattern. It removes the notion of using a pattern for patterns sake and focuses the discussion on solving problems, using principles and proven solutions.

The Head First series of books maybe off putting to some. Personally I've never been attracted to the series, but the Design Patterns book they have published, I feel, is first class. The examples they use really stick in your head and a great lever for accessing the patterns in the future. I've also heard good things about the Object-Oriented Analysis and Design book as well, although I haven't read it. (If I remember correctly, I think Sandi mentioned this title when I attended her course in Durham; however I not suggesting this is an endorsement of the book by her.)

Don't fear patterns, use appropriately

So rather trying to solve problems that have already been solved, I recommend investigating Design Patterns and these books are a great introduction. Design Patterns in the past do have a bad rap in the Ruby community, but I think that is no longer the case as the community matures. The original adversion to design patterns maybe due to the overuse within the Java community. Please remember, each design pattern needs to be used appropriately, and always consider a simpler approach.

I believe these book recommendations would be a good follow-up to Sandi's book Practical Object-Oriented Design in Ruby, to help triangulate your understanding of OO design.

Let me know how it goes!

Sunday, May 24, 2015

Rebecca Wirfs-Brock on Object Design

Building an object-oriented application means inventing appropriate machinery. We represent real-world information, processes, interactions, relationships, even errors, by inventing objects that don't exist in the real world. We give life and intelligence to inanimate things. We take difficult-to-comprehend real-world objects and split them into simpler, more manageable software ones. We invent new objects. Each has a specific role to play in the application. Our measure of success lies in how clearly we invent a software reality that satisfies our application's requirements -- and not in how closely it remembers the real world.

-- Rebecca Wirfs-Brock, Object Design

I pulled this quote from Avdi Grimm's excellent keynote presentation, The Soul of Software as a reminder this very important idea on object-oriented design: that we invent new objects that don't have a corresponding object in the real world. If we limit our domain objects to those that are represented in the real world, we miss opportunities to encapsulate variation in behaviour within our application.

Developing Ruby on Rails applications and custom Content Management Systems in Montréal. Contact Firsthand.