Thursday, 26 January 2017

Social Care Interoperability Project, Part 1 - Situation

Situation

I have been involved with a interoperability project to link a NHS trust to a social care provide via a web service hosted by the social care provide and accessed by Rhapsody by downloading WSDL. 

The objective was to send a NHS number, which was common to NHS and social care system, from the trusts ED system at the clinician's request.  The care provider returned a patient's social care record, if available, as XML as the body of a web service response.  The XML body would be rendered in a form and achieved as a result in a clinical document repository. 

Solutions 

These are the two solutions I prototyped. 

Social Care Interoperability Project, Part 3 - HTTP Server

Solution 1: Rhapsody's HTTP Server Communication Point

One of my current favourite communication points at present is the HTTP Server communication point.  The HTTP Server provides the means to render web pages from within Rhapsody.  This Rhapsody functionality has not been used with in the trust in the past so this solution is innovative. 

For those that do not know the HTTP Server communication point uses the HTTP actions such as GET and POST. 

As can be seen from the screenshot above context path is the used to identify the context to pass the incoming request. The URL for HTTP requests with a context path is in the form:

http://<Local Address>:/Path>

Transforming XML into HTML

One method of converting XML to HTML is using an XSLT file. 
XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML document types, or other formats such as HTML web pages, plain text documents. 



What is XSL? XSL is a language for expressing style sheets. An XSL style sheet is, like with CSS, a file that describes how to display an XML document of a given type

The XSLT filter is used to map between the XML and HTML



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
  <h2>Select Patient</h2>
  <form action="http://LAP-57422:8080/Form" method="post">
    <table border="1">
  <tr bgcolor="#9acd32">
   <th style="text-align:left">Given Name</th>
   <th style="text-align:left">Family Name</th>
   <th style="text-align:left">NHS Number</th>
   <th style="text-align:left">Action</th>
  </tr>
  <xsl:for-each select="message/NewStatement">
      <tr>
        <td>
          <xsl:value-of select="GN"/>
        </td>
        <td>
          <xsl:value-of select="FN"/>
        </td>
        <td>
          <xsl:value-of select="NHS"/>

Extract from XSLT file. 

To simulate the web service call to the social care provider a call to one of Rhapsody's web services is made which returns a message with a XML body. 

Orion may not agree, and it does not comply with best practice,  but during development my preference is to place all the routing, filters and communication points on one route.  The benefit is it is easier to follow the flow. 

Benefits


Social Care Interoperability Project, Part 4 - HTTP Server


Solution 2: Executable

This prototype produced in Visual Studio 2015 coding in C# linking to Rhapsody for the web service calls and message processing. 

Benefits


Sunday, 22 January 2017


HL7 Class (version 0.3) Beta


.NET Framework

This class is not certified to be used in a production environment working with live patient data.

Class to manipulate HL7 messages, updating values at specified positions, and reading patient data from the message.  

Namespace:   Assembly:   (in .dll)Copy

Syntax

public HL7_Edit(

            string HL7_Body)

Parameters


HL7_Body

The HL7 message body

Constructors


Name
Description
HL7_Edit()
Initializes a new instance of the HL_Edit class.
HL7_Edit(String)
Initializes a new instance of the HL7_Edit class with the specified argument.

Properties


Name
Description
PatNames
Gets PID:xxx information 
PatAddress
Gets a patient address (PID:xxx)
PatIDs
Gets a list of all patient IDs in the message (PID:xxx)
LocalID
Gets patient’s hospital number
NationalID
Gets patient’s national patient ID, eg UK’s NHS number
GN
Gets patient’s given name
FN
Gets patient’s family name
MN
Gets patient’s middle name
Title
Gets patient’s title
Addr1
Gets address line 1
Addr2
Gets address line 1
Addr3
Gets address line 1
Addr4
Gets address line 1
Addr5
Gets address line 1
Postcode
Gets postcode
PatGender
Gets the patients gender directly from the message
DoB
Gets the unformatted date of birth







Methods


Name
Description
searchForPosition( string, int)
Returns the value from the HL7 messages at the specified position
updateValue(string, int, string)
Updates value at the specified position
returnMessage()
Returns the HL7 message with any updated added by updateValue()
add()
Updates HL7





Remarks


Class is currently in Beta format. 
For a copy of the HL7_Edit class send an email from a healthcare email address to Pablo.BluesteelS@outlook.com

Examples


Simplified user control formatted as a common page header example.  Additional properties can be added to provide the required patient information. 
C#/XAML

<UserControl

    x:Class="HL7___UA.patientDetailsHeader"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:local="using:HL7___UA"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="100"

    d:DesignWidth="1280">



    <Grid>

        <Grid x:Name="LayoutRoot" Background="#555555" Width="1280" Height="70">

            <Grid.ColumnDefinitions>

                <!--patient national number-->

                <ColumnDefinition Width="Auto" MinWidth="100" />



                <!--patient local number-->

                <ColumnDefinition Width="Auto" MinWidth="100" />



                <!--patient FN-->

                <ColumnDefinition Width="Auto" MinWidth="100"  />



                <!--patient GN-->

                <ColumnDefinition Width="Auto" MinWidth="100" />

            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>

                <RowDefinition Height="75" />

            </Grid.RowDefinitions>

            <TextBlock Name="nationalNumberText" Text="National Number" Grid.Column="0" Margin="10,10,0,26" HorizontalAlignment="Center" VerticalAlignment="Center" IsDoubleTapEnabled="False" IsHoldingEnabled="False" IsTapEnabled="False" IsRightTapEnabled="False"/>

            <TextBlock Name="localNumberText" Text="Local Number" Grid.Column="1" Margin="10,10,0,26" HorizontalAlignment="Center" VerticalAlignment="Center"  IsDoubleTapEnabled="False" IsHoldingEnabled="False" IsTapEnabled="False" IsRightTapEnabled="False"/>



            <TextBlock Name="patientGN" Text="Patient Given Name " Grid.Column="2" Margin="10,10,0,26" HorizontalAlignment="Center" VerticalAlignment="Center"  IsDoubleTapEnabled="False" IsHoldingEnabled="False" IsTapEnabled="False" IsRightTapEnabled="False"/>

            <TextBlock Name="patientFN" Text="Patient Family Name" Grid.Column="3" Margin="10,10,0,26" HorizontalAlignment="Center" VerticalAlignment="Center"  IsDoubleTapEnabled="False" IsHoldingEnabled="False" IsTapEnabled="False" IsRightTapEnabled="False"/>



        </Grid>

    </Grid>

  

</UserControl>



/// <summary>

///

/// </summary>

/// <param name="natNumber"></param>

/// <param name="localNumber"></param>

/// <param name="GN"></param>

/// <param name="FN"></param>

public patientDetailsHeader(string natNumber, string localNumber, string GN, string FN)

        {

            this.InitializeComponent();

            nationalNumberText.Text = natNumber;

            localNumberText.Text = localNumber;

            patientGN.Text = GN;

            patientFN.Text = FN;


        }

 

    }

See Also

Tuesday, 3 January 2017

Removing Stacked Messages - the quick way

Situation

Yesterday I was asked to remove over 4,000,000 messages waiting to enter Rhapsody on a database communication point on a development server.  On a low specification development server the number of messages were causing the Rhapsody service major issues, for example a failure of the connection to the Rhapsody IDE which was restored by a restart of the Rhapsody service. 

In the past high message numbers had been manually removed from the Rhapsody Management Console.  It can take a long time to get the messages to display in management console so this is not a quick solution.

Memories of Rhapsody version 2

Rhapsody version 2, where I began, contained a tool to remove message from the Rhapsody routes and communication points.  This has long gone a few major versions ago.  I always found this tool useful. 

Solution

My solution was quick and simple taking less than 2 min to remove the four million messages. 
  1. Duplicate the effected communication point in the Rhapsody Workspace by dragging the communication point to folder level with Ctrl pressed, you know this.  The communication point appears in the workspace post fixed with a 2. 
  2. Delete the original communication point from the Rhapsody workspace. Message associated with the deleted communication point will be removed from the achieve at the next clean-up.   
  3. I manually ran the Rhapsody Achieve Clean-up, contained in the Management menu, to remove any messages from the Rhapsody Achieve.

 Advice

In this case we were testing to find the optimum through put for bulk loading messages into a downstream system to create a PMI.  It was predicable that we would get issue of this type.  With hindsight I would configure Rhapsody Notifications and Watchlists even on a development server when the probability is high of issues.  Most solutions will have Rhapsody Watchlists created as part of the development cycle.   

A little effort can save a lot of time!