<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Danny Ruttle on Medium]]></title>
        <description><![CDATA[Stories by Danny Ruttle on Medium]]></description>
        <link>https://medium.com/@danny.ruttle?source=rss-a9b2b2a08fdc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8K4mCVR5pEgsfiytqq8n6Q.png</url>
            <title>Stories by Danny Ruttle on Medium</title>
            <link>https://medium.com/@danny.ruttle?source=rss-a9b2b2a08fdc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 17:25:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danny.ruttle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Rockets Spotter’s Progress!]]></title>
            <link>https://medium.com/@danny.ruttle/a-rockets-spotters-progress-6cfa8d70836?source=rss-a9b2b2a08fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cfa8d70836</guid>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[space-travel]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[hobby]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Danny Ruttle]]></dc:creator>
            <pubDate>Fri, 14 Apr 2023 19:26:23 GMT</pubDate>
            <atom:updated>2025-02-28T16:57:37.805Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*MfDSFBCJgrB3hc07w9UxXQ.jpeg" /></figure><p>This is a write up of a mainly technical journey I’ve been on for the past few months. Really it highlights pivots in response to changing requirements and how some technical challenges were overcome. It’s not intended as a guide, nor does it suggest that this is the way to develop applications or where to deploy them; moreover it is a blog with a few learning points which may (or may not) benefit others.<br> <br>Watching the Artemis spacecraft launch on the NASA YouTube channel in November 2022 rekindled my interest in space. I found myself looking at other things happening between NASA, SpaceX and other launch providers and after some consideration started to make plans to head to the USA to see a few rocket launches. There are several websites built around launch activities, including NASA and The Kennedy Space Centre, but they don’t present the information in a format that I find easy to use. They tend to present too much information that is difficult to filter or have very detailed information on individual launches (or both). If you want to arrange a holiday around launches it is very difficult to plan.<br> <br> So this provided some requirements and a blank canvas; a classic greenfield development opportunity!<br> <br> I opened my Python IDE (PyCharm) and started coding. First, I needed to find an information source to use as a starting point. One site I found had detailed information for all launches scheduled for the next 12 months, presented in a single web page. Launches in the next few weeks had date and time specified, whereas some were allocated to a month and others to the 2nd, 3rd quarter, etc. All the information was there but not easy to consume and needed parsing to summarise the key data.<br> <br> At first, I thought this would be a great opportunity to learn more about Python pandas as I’ve not used this previously. However, on viewing the underlying page HTML source this didn’t seem to suit pandas as the content wasn’t formatted in tables. The structure of the content used HTML H2 tags and P tags, so I needed to use a different approach to get the information. I looked at some of Python’s built in parsing tools (html.parser and Lxml which would both do the job), but then came across beautiful soup, a 3rd party library for parsing markup. I found a great tutorial, managed to get the information I needed and built a POC which met my basic requirements. The script was pulling out key information such as launch date and time, a short description, the launch pad and a hyperlink back to a page anchor in the original website. I added the capability to email the output to myself and a few other interested parties. It supports basic logging to local text files and uses a digest generated from content coming back from the source website to allow checking of page updates. After a week or two of effort Version 1 was deployed and working so happy days!<br> <br> The script was running fine on my laptop and I turned my thoughts to deployment of the code so it could run unattended on a schedule and email the details when the web page changed. Thinking about running costs, I decided to run it from my android phone. I installed a Linux terminal emulator called Termux, deployed the script and used a crond entry to run the script every few hours. This was working fine, but despite the Termux App having a keep alive option, the android OS kept killing the process, so I had to find another way.<br><br> Raspberry Pi to the rescue… I bought a model B Pi back in around 2012 but hadn’t really had a use for it until now, so I dusted it off, put the latest Raspberry Pi OS on it and got the script running on that instead. It was wired via an ethernet cable into a MESH router to get access to the internet. Everything was looking good as it was now running 24/7 in the corner of the bedroom that I used as a home office but I thought this was a potential fire risk. I bought an enclosure for a Raspberry Pi 3B model which had a built-in cooling fan, then modified it to suit my old unit. However, I still wasn’t comfortable running it in a bedroom and decided to move it to my garage instead. After buying a USB Wi-Fi dongle to enable it to connect to my wireless router, I realised (after several failed attempts) that the board on the Pi didn’t have enough power to run the dongle.<br> <br> Next stop, Amazon Web Services! I’d done some basic AWS training about 5 years ago, more at product owner level rather than hands on, so I had some awareness of cloud computing. I didn’t need a web server as such, just a means to run the Python script on a schedule. I was aware of the AWS Lambda service (not to be confused with Python Lambda anonymous functions!) and decided to try this out. AWS Lambda supports calling programming code using a base function, so I deployed all the code and dependencies (including beautiful soup, etc.) into a Lambda package and ran the code on AWS instead. For the POC I signed up to the AWS free tier, which allows limited access to AWS services and is free for 12 months (within the bounds of the free tier service agreement), allowing me plenty of time to develop a POC. There were new things to get my head around including S3 (for file storage), IAM (to assign permissions), CloudWatch (to view logs and debug messages) EventBridge (used to schedule the function) and Amazon Cost Explorer (to track any activities outside free tier that will lead to charges). I also decided to write to Amazon’s DynamoDB cloud database rather than text files for storing logs and the latest digest. There was some learning involved here though, as the syntax for storing and retrieving data is very different to traditional SQL. As a result, the code had changed drastically, so I created a new branch in my Github repository and labelled it as Version 2.<br> <br> So, I’d taken my first step in the world of cloud computing and was very proud of myself, until my script crashed, that is! I had a bug somewhere in the code relating to date and time parsing. However, because I had dependencies in cloud such as DynamoDB that I didn’t have deployed locally, I couldn’t debug the code using my IDE. In fact, I’d taken to writing and testing the code in the AWS Code console and copying it via the clipboard to PyCharm and then checking it into Github from there. I realised that there was a cart before the horse thing going on as I was now unable to step through the code in the PyCharm debugger to analyse any issues. Something needed to change. I still had the logging code from version 1 of the script in Github which used local text files and I had the new code for working with DynamoDB in the cloud in version 2. To address the debugging capability issue, I added an “environment” property to my configuration file and modified the code to pivot depending on the value returned (“cloud” or “local”). I then implemented a Factory Design Pattern which called different classes for data access called DataAccessCloud for AWS and DataAccessLocal for my IDE for debugging. I also refactored some of the code to isolate the data access elements for manageability. An alternative approach might have been to install DynamoDB locally, but it was quicker to reuse the code I already had and the data requirements for the script are minimal anyway. So now I could debug and the horse was back before the cart — Version 3 was born. I realised after deploying the script to AWS Lambda that PyCharm has dedicated project templates for Lambda Remote and Local applications, so will consider adopting these for my next Lambda project.<br> <br> On to version 4 (the current version). Functionally, the code was working fine but it was relying on the behaviour of the information in the source web page to produce the output. I knew there was a risk that if the author of the web page changed the content, then there would be a potential impact to my script. And one day this happened! My code was slicing a string of text to pull out the launch pad detail and previous analysis indicated a pattern to this that could be used to get the information. The pattern changed for some of the entries. There were other issues too such as the dates and times for launches were embedded within strings and not separate data elements, requiring complex slicing and logic to present in my output. I also noticed that some of the launch information wasn’t changing as quickly as information available from some of the other sources. I need up-to-date information to allow planning.<br> <br> After some research (browsing other websites with similar content) I discovered that a more reliable data source existed, one which some of the other sites seemed to be using but the site I’d chosen wasn’t. The data source is RESTful and fully described via an OAS3 specification with a comprehensive Swagger page for testing the interface. This service provides extensive information on everything related to rocket launches (apart from what the astronauts had for breakfast!). There is also a very active group of developers and a responsive discord community. I integrated with this data source as the behaviour is guaranteed, adding reliability to my code. This was straightforward as I could read the content easily using the Python requests object module and cast it to a Python dictionary using the json() function. Another benefit was efficiencies to the codebase which reduced by around 40% as there was less need for slicing strings to pull out the information and I could drop beautiful soup from the package dependencies.<br> <br> This has been a journey and a learning experience, requiring different challenges to be overcome along the way. The real takeaways are that I have a working application and I’ve got to grips with a cloud platform; and it was great to get back to some coding for the first time in a while. In hindsight, maybe I should have gone straight to the cloud, but that seemed to have a veneer that I wasn’t comfortable to break through as it lacked familiarity. Conversely, developing locally is something that is very familiar which enabled me to get to a POC in place reasonably quickly before having to consider how or where to deploy the code.<br> <br> I can see many opportunities for extending the capability and I will do so in time (next stop Docker, Flask and WSGI!), but for now I’ll review the email updates for changes to the launch schedule and head to Florida to see a few rockets!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cfa8d70836" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API to ORD and now demonstrators — what’s not to like?]]></title>
            <link>https://medium.com/@danny.ruttle/api-to-ord-and-now-demonstrators-whats-not-to-like-99e120df7a17?source=rss-a9b2b2a08fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/99e120df7a17</guid>
            <category><![CDATA[ord]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[nhs]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[data-standards]]></category>
            <dc:creator><![CDATA[Danny Ruttle]]></dc:creator>
            <pubDate>Tue, 22 Jan 2019 07:49:01 GMT</pubDate>
            <atom:updated>2019-01-22T07:49:01.986Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFW_Qi7Pjbx7UgSdNcyhwg.jpeg" /></figure><h3><strong>API to ORD and now demonstrators — what’s not to like?</strong></h3><p>The release of an open source demonstrator which provides developers with a starting point for synchronising updates to Organisation Reference Data used within Health and Social Care has prompted me to set the context for what we achieved so far.</p><p>The source code for the demonstrator (I wrote the Python version which was ported to .NET Core by a colleague) can be downloaded from the following.</p><p><a href="https://developer.nhs.uk/library/identifiers/ods-ord-api-implementation-guide/sync-endpoint/ord-api-demo/">https://developer.nhs.uk/library/identifiers/ods-ord-api-implementation-guide/sync-endpoint/ord-api-demo/</a></p><p>I work with a great team of business analysts and technologists and we are revolutionising the delivery of Organisation Reference Data. This data is authoritative and therefore key to supporting interoperability across Health and Social Care. There are around 75 types of organisations supported in the dataset, ranging from GP Practices, Pharmacies and CCGs to Independent Providers, Local Authorities and System Suppliers. Historically the data has been published within 60+ disparate CSV files conforming to varying specifications, including archives, full files and amendments published at different intervals. Processing the multitude of files is complex for suppliers and end users. Relationships are key to providing context including geography, operational context and commissioning and these are constantly evolving over time. The NHS has become more fluid particularly since the Health and Social Care act in 2012 and the demands on the data are much greater requiring a wider range of use cases be supported. These uses include patient registration, prescribing, electronic referrals, authentication/access control and clinical messaging. The existing CSV approach is not able to provide system suppliers with the appropriate level of context to support all these requirements.</p><p>Over a period of six years we have evolved initial analysis of the limitations of the existing CSV approach and in August 2016 we received roll out approval from the NHS Data Coordination Board for a fundamental standard for Organisation Reference Data (ORD — see <a href="https://digital.nhs.uk/data-and-information/information-standards/information-standards-and-data-collections-including-extractions/publications-and-notifications/standards-and-collections/dcb0090-health-and-social-care-organisation-reference-data">DCB0090</a>). This required commitment to create supporting documentation containing almost half a million words, not to mention scores of conference calls and the establishment of a steering group comprised of representatives from suppliers, Trusts and ALBs (this was XODUS-G “XML Organisation Data User Steering-Group” and yes we did play the Bob Marley song at the beginning of each meeting!). The ORD standard introduces many benefits including a single data model for all the data and a monthly schedule for release containing only two files — current organisations and archived organisations (these are organisations in the ODS dataset that closed on or before 31st March 2012). This approach provides the same view of all records in ORD via a single interface allowing consumers to standardise processes for consuming it.</p><p>In February 2017 the first release of the data conforming to the standard was published which was a massive achievement. The main challenge for many consumers was the requirement to handle XML rather than CSV. Feedback from a survey performed via the steering group indicated that XML technologies were immature amongst the current user base compared with other areas such as clinical messaging or commissioning data sets. In response we provided extensive supporting documentation including an XML schema, a navigable object model, a product roadmap, a data item catalogue and an XML ORD products guide which are available <a href="https://digital.nhs.uk/services/organisation-data-service/xml-organisation-data-products">here</a>. All suppliers and Healthcare Organisations MUST comply with the new ORD standard by November 2021 (legacy CSV products are being supported during a phase of dual running to allow consumers to transition to modernised products and services).</p><p>We also provided tools written using open source/free technologies to help those new to XML to transform the data thus simplifying adoption of the new products by consumers. The tools include a simple schema validator to allow all consumers to check the content of published files against the schema and XSLTs (XML Stylesheet Transforms) which users can leverage to transform the data. The XSLT tools leverage SAX parsers to transform the data based these around freely available Saxon packages (Java and .NET). We have made them available under open source licenses to all consumers with supporting guidance for users.</p><p>The first of these XSLTs splits the approximately 200,000 records into the components defined in the object model (core organisation, address details, relationships to other organisations, etc..) into separate files that can be loaded into a set of staging tables. Foreign key references are provided to allow consumers to build a consistent set of tables. Following further feedback, we have also provided consumers with the DDL statements which create the staging database tables themselves.</p><p>The second XSLT allows users to pass in a list of Primary Roles (these are things like NHS Trust, Pharmacy, etc. akin to organisation types) and this returns a fully schema-compliant file with a subset of organisations included, which can then be passed through the XSLT described above to stage the data.</p><p>Following the work carried out via the steering group several consumers contacted us to enquire whether the data was available via an online service. With the advent of the internet, stateless applications and the push to support open standards across Health and Social Care this was an obvious and logical step to make to improve access to Organisation Reference Data. During the beta phase of the ORD project, some users commented that an API service called OpenODS (an open source project) was available which returned data complying to our ORD standard. We approached the authors of this service (@MattStibbs and @TonyYates) and began work during Autumn 2017 to enhance and productionise the code to provide a centrally funded and managed API service. This involved the development of new services to automate the generation of delta changes daily, making the data available to all consumers closer to the time when changes are made. This offers a significant benefit compared with the CSVs which are released on a weekly/monthly/quarterly schedule. Taking the existing OpenODS implementation and modifying it to suit our needs meant that the new service could be delivered quicker and cheaper compared with building the service from scratch. The service aligns to cloud first principles and is hosted on AWS to provide resilience and scalability. It has a completely open interface, requiring no authentication and is available free to ALL requiring access to ORD.</p><p>At the point where requirements were being collated a need was identified to provide a FHIR interface to organisation reference data to support clinical messaging. The scope of the service was widened to deliver two interfaces from the same underlying data. On 2nd May 2018 the <a href="https://directory.spineservices.nhs.uk/ODSAPISuite">ODS API Suite</a> was born. It has become a roaring success with over five million queries processed to date from around five hundred unique systems/users with usage growing exponentially. The content of the database is refreshed from XML files conforming to the ORD standard and delta changes are uploaded to the system via an automated RESTful interface daily. The ORD standard has been updated to direct all consumers to the ODS API Suite to retrieve regular updates. Consumers wanting to maintain a local copy of ORD are encouraged to intercept a monthly XML release and use the tools we have provided to and process the data into staging tables to create a baseline. It is then simply a case of connecting to the API service to retrieve changes.</p><p>Demonstrators is an area which will continue to evolve and these will sit alongside the supporting materials for the ORD API hosted on the <a href="https://developer.nhs.uk/library/identifiers/ods-ord-api-implementation-guide/">developer network site</a>. We are working with key stakeholders to improve the service, particularly around support for cohorts based on the types of relationships that exist in the data and a notifications endpoint. The guidance materials developed to date the will be consolidated into a single coherent resource and feedback is welcomed from any interested parties, to aid the creation of a user-centred and user-friendly front-door to the technical products.</p><p>This has been an exciting piece of work to lead technically and there is still some way to go in supporting the user base to adapt to the modernised methods. The tools and interfaces provide key infrastructure for provision of data which is often taken for granted, but on which NHS and Social Care heavily depend to function. The work done on ORD is key to the government’s commitment to support technology and standards across Health and Social Care.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99e120df7a17" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>