First go at using the Planner API
28/11/2013by Rob Findlay
I just had a quick go at trying the Planner API; when I say quick, this all took under an hour (it took longer to write about it). It worked perfectly straight away, and I’m no software developer. So here is a run-down of what I did so you can see for yourself.
The whole point of the Planner API is to let you call Gooroo Planner automatically from within your own software, without always having to go through an on-screen interface. So what follows is all done in code.
If you aren’t a coding sort of person, don’t worry, all the results your organisation gets back from the Planner API will drop automatically into your usual business intelligence dashboards, so you won’t have to worry about any of this. You can read about that here.
To try out the Planner API, I used an ancient Sony Vaio that I affectionately call my “NHS laptop”. It runs Windows Vista and Internet Explorer 7, both slowly, and now I have it running Microsoft Visual Basic 2010 Express slowly as well. So I set up a new project to create a simple console application, and got stuck in.
Pop goes the WSDL
The first step was to hook up with the Gooroo Planner WSDL. Don’t worry what it stands for: this is the technology that makes the whole process so easy. In Visual Basic Express I just went to the Project menu and selected Add Service Reference… to get a screen like the one below (click the image for a larger version).
Then I just pasted in the URL for the WSDL; we provide this via the Gooroo Planner API screen where you can click the “Gooroo Service” button and copy the first link.
Some quick code
Then everything was ready to write some code, and I based mine on the sample code available via the Gooroo Planner API screen (click the Example Code button).
Because Visual Basic Express had been told all about the Planner API (by the WSDL), it could auto-complete all my code for me. So every time I wanted to refer to something that Gooroo Planner uses, it came up with a helpful list of possibilities. Here is my first line of code, with Visual Basic Express helpfully offering the GoorooData option that I wanted.
When I came to set up the dataset values (i.e. the data that goes into the Gooroo Planner model), it knew all about them too. Here is the screenshot where I selected the dataset field for past non-waiting list activity:
Once all the code was done, I stuck in a few message boxes to display some results on the screen where I could see them. And then I just hit the Run button in Visual Basic Express.
It worked!
After a few seconds, while my code contacted the Planner API, it came back with all the results. Here is the message box showing the activity plan, for this service (ENT non-electives), for the week beginning 9th June 2014.
As you can see, it all worked OK, and produced real results. The only things I had to to watch out for were: 1) you need to have a username with a valid Planner API licence; 2) if you run your code a second time you need to use different dataset and report names (because the original names are now in use).
Whenever you run the Planner API it creates a real dataset and report in your API user account. So I could login to cross-check the result from my code against the on-screen version of Gooroo Planner.
Here is the profile chart for the service I just created via the Planner API, with the week beginning 9th June 2014 picked out. (Before you say: yes, that image shows clinical priority demand not activity; because this is a non-elective service, activity is equal to clinical priority demand and so the blue activity icons are underneath the orange priority demand icons, but as you can see the value is correct for that week.)
So there you go; it was all very straightforward, even using an entry-level developer environment.
The real work, then, is not using the Planner API itself; it is extracting all the right data from your data warehouse to feed the model, and then making sure that the results drop into everyone’s business intelligence dashboards exactly the way they want them.
But then, if you’re already using Gooroo Planner, you will already have worked out the data extraction part. And if you have business intelligence dashboards, you’ll know how to do the other thing too.
UPDATE on 19 Dec 2013
The first NHS hospital is now using the Planner API in demonstration form, prior to integrating it with their new business intelligence dashboards.
Initially they have developed a form based application in Visual Studio which uses their existing automated CSV Planner datasets; they have also demonstrated output to a mock-up BI dashboard. Development time (from scratch, by one applications manager) was 3 days to understand the requirements and build the application, and a couple of hours to mock-up the dashboard.
UPDATE on 30 Jul 2014
If you call the API from Visual Basic and get an error “The maximum message size quota for incoming messages (65536) has been exceeded” then try opening “app.config” and changing the values in the relevant line of the binding to something like:
maxBufferSize=”9999999″ maxBufferPoolSize=”524288″ maxReceivedMessageSize=”9999999″
Return to Post Index
Leave a Reply
You must be logged in to post a comment.