Microsoft Home User Programme
Posted By Grant Forrest on 25-Aug 2010 at 16:08
The ever-popular eHealth Insider ran a story back in July on the DH's decision to pull the plug on the £500 million licensing deal that it has with Microsoft.
http://www.e-health-insider.com/news/6079/dh_axes_£500m_microsoft_licensing_deal
The story attracted what I think is probably a record-breaking 41 comments. I found myself coming back to it several times to read subsequent new comments.
The implications of the DH's decision are far-reaching. Not only is the burden of MS licensing being shifted toward the Trusts, but all the NHS employees that took advantage of the heavily-discounted copies of MS Office made available under the Home User Programme (HUP) have now been told that they must un-install the software, or upgrade their license.
I'm curious about how many will actually do this, and whether the MS "update" system will detect the invalid licenses. Assuming it does, will the HUP copies of Office stop working ? Will they become "guiltware" with a nag screen to prompt purchase of a new license or will it only become evident that the license has become invalid when users try to apply new patches or service packs ?
P.S. Paul and Tony have authored an article on this topic in the WIKI
Musings from the basement of a very tall building
Posted By R Freeman on 15-Aug 2010 at 16:08
In the early naughties a terrible pestilence stalked microsoft application server land. It wasn't if, but when, a memory leak would take your server down. Lets be clear; a client or workstation machine sits on its hands most of the time and waits for its user to peck at its keyboard or move its mouse. A server shouldn't have a user, it sits on its hands waiting for a request for information (from a workstation) via its network. It will then start up some application that ends up sending that information.
A server might have a hundred applications that each get used a hundred times a day. This sounds like a lot of work, but the applications may need to run for microseconds only. The important point is that when they finish they return any memory (and other resources) they use back to the operating system. If they do not, and at the time we are considering, each application instance kept 20-40kB of memory for a variety of reasons; the server runs out of memory and crashes. No I never did find the memory leak in my web applications, and yes I did just routinely restart the server every 4 weeks to overcome this problem.
Aware of this, microsoft revised its application development tools for the Visual Studio 2003 release. Working in a fundamentally different ways to anything that had preceeded, the most important point was that the code produced was managed as it ran. Only those parts required were run and they were destroyed after completion. The memory leak was gone, all hail the .net framework upon which this rests.
If you are going to do a microsoft development today, you are going to use .net framework managed code, google visual studio express for a free version. This comes with a number of languages. Choice is stressful, so you are going to use C Sharp (C#). Yes I know, I started out with Basic to, but it is a dead end language, and the visual studio version isn't anything you will recognise. C# was developed for managed code and if you become familiar with it you will find you can do C, C++, Java, Javascript, etc. to.
Web applications are one of the application types within visual studio, and I will look at them next time. However to understand these you will also need a smattering of hypertext (HTML), its general elements, DIV and the FORM elements. Ignore anything on CSS, Javascript, Ajax; you have enough on your plate with C# and HTML especially if you are starting out. Good luck.
0 comments | Post a Comment
Musings from the basement of a very tall building
Posted By R Freeman on 11-Jul 2010 at 15:07
The first Micrsoft offering for web application development was Active Server Pages (ASP). In the tall building we had spent the 90's developing visual basic forms (client tier) talking to SQL Server (storage tier) via ADO connections. ASP was of necessity a very different beast.
You see if you are going to use a browser as your client tier it is going to use the HyperText Transfer Protocol (HTTP) to talk your web application (a middle tier) via the web server that hosts it. To have any function the pages in the browser are going to collect or update information and this must be bundled up within the HTTP request at the browser end. On receipt at the web server the information must be picked out of the HTTP message and made available to the web application. This is one of the major features of ASP.
Classically HTTP carries information as Name Value pairs. You make up some meaningful name -eg- Surname; then there is an equals; then there is its value -eg- Freeman. As the meerkats say, simples.
The commonest HTTP request is called a GET and name value pairs can be placed with the page title in this type of request. They are seperated from it by a question mark. If there is more than one pair they are seperated by ampersands. The problem with this is that the title part of an HTTP request is limited to 256 characters.
To send more information you must use an HTTP POST request. Here the name value pairs (separated by ampersands if necessary) are placed at the end of the body of the HTTP request. This is effectively unlimited in length. Hypertext (the mark up used in web pages) has a FORM element for this purpose. The FORM action must be a POST, whence any named element, within the form element, will become the name part, its value becoming the value part of the pair which is put in the body of the HTTP request resulting from submission of the form. Clever that.
It is both instructive and disconcerting to watch the conversation taking place between browser and web server and HTTP sniffer applications allow this. Microsoft bought one which can be downloaded for free, google Fiddler.
The ASP page being requested on the web server will contain the Response.Write mark up. Within this a Request.QueryString["NAME"] will retrieve that value from an HTTP GET, while a Request.Form["NAME"] will retrieve that value from an HTTP POST. Thus these values can be used in the rest of the visual basic script that makes up the Response.Write and whose output is the hypertext that will be sent back to the browser.
While it was possible to have complex VB Script on the requested page to produce the output, we used it to call functions in a Visual Basic library application. This allowed the full power of VB to be applied at the cost of having to install and manage .dll's on the web server. We had several years of unsophisticated but very functional web applications from this development model. No one sensible would use this today, it was replaced by .aspnet in 2003. That is another kettle of fish I will delve into next time.
0 comments | Post a Comment
ICU DATABASE
Posted By nigel bedayse on 28-Jun 2010 at 11:06
Hi. I'm trying to use Access 2003 to set up a database for ICU as it's freely available on the PC's in hospital. Looks like I'll be learning some VBA.
Musings from the basement of a very tall building
Posted By R Freeman on 27-Jun 2010 at 10:06
In the begining, for the hobbyist, there was the development language BASIC. It managed memory invisibly, it had line numbers with GOTO, it ran from begining to end as what we would now call a Console Application on a single machine and knew nothing about networks.
Then came Windows. Nightmare. Each window is a process given processor clock cycles by the operatng system. The window has to know where it is on the screen and whether it is active. Lines of code alone, especially if it is to move, resize, close, etc. Should the window actually contain something, that something has to have coordinates relative to the window so it knows whether the mouse is over them, or whether they have focus (-eg- a cursor in a text box). That is all before anything is done with any data collected.
Fortunately this is all greatly simplfied in the early 1990's by Microsoft's Visual Basic which deals with all the code necessary to keep the windows and its contents alive behind the scenes. A Basic like code is exposed, though there are no line numbers because you are coding for pre defined methods associated with the window and its contents. The code doesn't run in any sequence, the next part that runs depends upon what the user does. Guessing what the user would do next was always interesting.
These are what we would now call Windows Forms applications. By the late 90's you could use these as a user interface on mutliple machines simultaneously, connected via a network to a server database. But by then they had to be formally installed on each machine they were to be used upon. This folks is their undoing.
While you might have the authority to install software on machines in your own department you are unlikely to have either the authority, or the time to install it on every machine in the trust a roaming anaesthetist might want to use it on. Now I know you can use automated installs but that opens new cans of worms.
What you need is an install in one place, available on all networked machines, solution. Fortunately anaesthetic departments weren't alone in needing this sort of solution, and by the late 90's methods for creating what are to be known as Web applications begin to emerge. These are installed once on a web server, and their pages (constructed after running some code) are potenially available to any browser application on any client machine that can reach the web server. OK its a fiddle, the user application is actually the web browser software, but that is part of the trust's standard install.
In my next blog I will try to recall the various paradigms used in Microsoft world to create web applications, to put into context the strategic choice we need to make now, if this route is to be followed.
0 comments | Post a Comment
Musings from the basement of a very tall building
Posted By R Freeman on 27-Jun 2010 at 09:06
Apple Mac's are very stylish machines, I can easily visualise the 27 inch screen all in one on my desk. On the other hand I would feel very clever with a linux based machine dribbling lines of code down the screen, Matrix like, as it did, whatever it does. Is there any point in me splashing out on my Mac, or hitting the linux learning curve? Absolutely none. My NHS trust, like yours(?), for better or worse, runs PC's with Windows operating systems and applications as per the NHS contract. If therefore I am to use my application development hobby to improve my lot, the lot of my colleagues, and perhaps the lot of our patients, Windows is what we have to talk about.
In my next blog, under the same monica, I will attempt to discuss why web based applications are best for us, and perhaps you to.
Geocoding SCATA
Posted By Paul Cooper on 13-Jun 2010 at 17:06
I've been having a go at doing things with googlemaps.
Here's an image of the postcodes of SCATA members' addresses - a mixture of hospital addresses and non-hospital addresses. Interesting perhaps, but is it actually any use?

0 comments | Post a Comment
SCATA mailing challenges
Posted By Grant Forrest on 23-May 2010 at 22:05
One of the tasks given to me as webmaster was to implement a web-based mailing solution that allows a committee member to send a membership-wide email.
Not that much of a challenge, you are probably saying, just use PHPMailer or MailChimp or something like that. Mail Chimp would have been the easy way out but I did use PHPMailer.
The SCATA membership list is some 400+ members in size, but the server's limit is 100 emails per account per hour, so I couldn't just bang them all out in one go.
The trick is to use an execution pause in the mail script. Something like :
global $mail_interval;
while ($member = mysql_fetch_array($res)) {
$mail_res = phpMailer(
$member["email"],
$recip_name,
$subject,
$msg,
$format,
$distribution,
$sender,
$sender_name);
// save the mail result
CreateMailResult(
$campaign_id,
$sender,$member["email"],
$recip_name,
$mail_res);
// sleep for $mail_interval
// will not work with Windows servers pre PHP5 / All servers PHP4
usleep($mail_interval * 1000 * 1000);
// after the pause, we have to reset the max execution time
set_time_limit($mail_interval * 2);}
This works fine, but the next problem is how to feed back progress to the browser. I experimented with various methods and one by one rejected them all as unsatisfactory. At the core of the problem is that scripts with sleep() or usleep() will have their output cached. It doesn't matter what tricks you try with ob_start() etc, you just won't be able to feed back progress to the browser. Even using AJAX, you have the same underlying problem.
What I really wanted was a way to run the script in the background and allow the user to get an update as and when required. Each mail transaction is logged in a MySQL table, so it's simple to fetch this information on demand.
I thought about running the mail script in the background using exec() but for security reasons, exec() is disabled on our server.
After a lengthy trawl of the coding forums, I hit on an idea. Why not open a TCP socket connection, run the script and then just chuck away the result ? For example :
// Create a socket to the mail script page and then return immediately
$fp = fsockopen($host, 80, $errno, $errstr, 30);
if (!$fp) {
$err = "$errstr ($errno)
\n";
} else {
$out = "GET $file HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
fclose($fp);
}
Once the mail script is running, we can output a simple page saying "Mail Campaign in Progress" and the socket connection has launched our mail script in the background.
Not perfect, but reasonably clean. A few snags still to tackle though.
If the script hits an error, it will just die, so I probably need to get it to write errors to a file rather than try to return them to the browser which has thrown the connection away.
Also, if you make a mistake and click "send" accidentally, there is no simple way of stopping the mail script, short of restarting Apache. I guess in theory you could hunt the httpd process ID down and try to kill it off, but how would you match the PID to the name of the script ?
Maybe next time I'll just try Mail Chimp ;-)
Sorting out dates
Posted By Paul Cooper on 19-May 2010 at 18:05
I need to try and get reliable data from our theatre system and who is doing what. The data in the Consultant resonsible for the list' field is unreliable ( dont ask......) in the theatre system. I'm told the most reliable source is the surgeons rota. This is available on the intranet as an excel spreadsheet.
i thought automating data extracation would be easy. Courtesy of IT ive got a spare computer on my desk running linux ( was gentoo, now ubuntu)
so i can retrieve the file with wget and then parse out the data i need.
The aim is to put it all into a perl hash of hashes - so extracting other data in the future will be straightforward, and i could even do it as a web page.
The hash would be
{date}=>( {on call}=>surgeon1, {theatre} +>surgeon2 )
so to get the person on call for 4 April :
value for {20090404}{on call} = person on call.
to get theatre surgeon for days of a week , just put it in a loop
for date =startdate to enddate ( eg 4 April 2009 -10 April 2009
substitue each value of 'date' into the formula (20090404,20090405,20090406 etc etc )
then surgeon =name stored in {date}{theatre}
which will give the name on a particular date and rota
(i appreciate this wont actually run as code!)
its possible to expand as well and i could pull data from a number of rotas on the same principle.
this is the spreadsheet
First problem :

date field isnt formatted as a date - its text.
the formatting isnt consistent - some dates have dots and some dont.
So i thought a regular expression would extract the bits I want.I played around with this sort of stuff.
/ (\d{2}) \. (\d{2}) \. (\d{4}) /
2 numbers followed by a dot, then 2 numbers then a dot then 4 numbers
/ (\d{2}) \.* (\d{2}) \.* (\d{4}) /
2 numbers followed by 0 or 1 characters followed by 2 numbers followed by zero or 1 characters followed by 4 numbers.
but it didnt sort out all the dates consistently.
bit more fiddling around should get it fixed though with the help fo the Date::Manip module in perl
But some thoughts :
- Whoever produced the rota doesnt know about date formatting in Excel
- Whoever produced the rota must have spent a good while typing in each date - thats what must have happened because there are different typos in many date fields.
- This must be the level of Excel /IT expertise , or ignorance that many users have.
- And whats the best way to do something about it, if we want to to. Does ECDL or similar cover this , and how far into the course?
i know for purists excel isnt the correct software to do rotas, but for small departments it gets used because its relatively straightforward and available
- introduce a rota package an spend time and money training people on it
- going and having a quiet word ("we've noticed you are doing the rota, do you know about ......)
- Introduce a 'rota template' that all shall use ?Produce an 'advice for rotamakers using Excel ' handout
- Just let things be.?
Scata Wiki embedded movies
Posted By Alan Hope on 19-May 2010 at 18:05
Planning on dipping my toe in the water here. True streaming movies require streaming set up on the server, and will probably not be viewable in hospitals (who take a dim view of this sort of activity). So HTML pseudo-streaming is the way to start. This may not support more than about 10 simultaneous views, but that may be enough.
I have access to a set of movies, made in-house here, covering ultrasound assisted nerve blocks. Really depends how much I can compress these without rendering them useless. I am looking to create a movie library, similar to the image library, for these.
Hope to have some news for the session in November.
Watch this space! http://www.scatawiki.com
0 comments | Post a Comment

