Sunday, December 04, 2011

Christmas Tree Layout

So I've settled on a new track plan for around the tree. It's a neat little three time around loop with some tunnels and hills and trees. As I said in my last post I don't plan on this being for realistic operations, it's mainly for display purposes at Christmas time and for constant running. The primary audience will be kids and people who are not really into operations. So if you want to be critical about the track arrangement feel free but remember it's not meant to be realistic just real nice looking.

Thursday, December 01, 2011

New projects

So lots of new projects going on lately. On the railroad front I have two major projects going on. First I'm working on an around the tree layout for Christmas. N scale of course. The track plan calls for nearly 30 feet of "mainline" that will loop around three times. I would like to be able to have one or two trains running on this at a time for display purposes only. It's meant to look good and not necessarily be realistic or operable.

On the operations side I'm still considering a point to point shelf layout for operations. I'm thinking of a proto-freelanced shelf based on Latrobe, PA and the mixture of the Ligoneer Valley Railroad, Pennsylvania Railroad Latrobe/Unity/Hostetter branches and the West Penn Railways lines. This will be a big undertaking so I'm doing some experimenting on the around the tree layout for some additional practice.

I'm also working on converting some more engines to DCC and building a DCC sound car. I have some older life like locomotives that I like and work well and I would like to be able to run on my layout. Since my NCE Powercab doesn't have support for DC I needed to get some more equipment updated.

I'm going to work on some more write ups about all these and I'll be posting them with pictures and links sometime soon.

Monday, September 19, 2011

A Readmissions Data Model, Mk II (part 3)

This is part three in a series of thoughts about how to track these readmission measures, you can read part 1 and part 2.

So after a lot of thought, struggle and some guidance from a very wise data modeler I had the opportunity to work with on another project I've come up with some ideas on how to manage this in various time periods. It's not trivial by any stretch of the imagination, but it is doable. While I don't have my schema fully designed yet, I've been able to test portions of it and it seems to work well. I have tested this basic design with SQL Server Reporting Services, Microstrategy, and Information Builders WebFocus. It appears to function well in all three environments.

The very first thing that needs to be done is to clean up and stage the data, in our case we are downloading the raw data from our EMR and storing it in SQL Server. Then I am using SSIS with stored procedures to go over and manipulate the data into the shape I need. I start by pulling every visit by encounter_id and I join that to itself by the medical_record_id where the prior visit encounter_id does not equal the current encounter_id and the date of the prior visit is less than or equal to the current visit, and the prior visit is an inpatient stay. This meets our basic needs, but I still need to iterate over the data again getting the max(prior_discharge_date) for each current.encounter_id and then filtering this out. I find that a series of temporary tables make this work much easier. Don't try to do this in one single statement loop over and remove the bits you need to from the dataset each time until you have a list of current and matching prior encounter_id fields.

Now the easy part is to just use this map (you did remember to store the output in a real and not temporary table right?) and link a current encounter to a prior encounter. I wind up making a very wide table (or view) that contains all the data elements I'm interested in including a bunch of calculated fields that I called things like [3day], [7day], [10day] and [30day]. Finally I populate those fields like so:

CASE WHEN datediff(dd,prior.discharge_date,current.admit_date) between 0 and 3 THEN 1 ELSE 0 END

Finally just open this table in your reporting app and merge with your date dimension table and then SUM on the above described calculated fields to get the number of patients in each bucket. In my case I'm interested in Fiscal_Month and Financial_Class buckets so I SUM those fields against those buckets and get an accurate and fast count of patients returning.

To make this model even more functional I decided to add another calculated field that I called [PatientCount] which simple equals 1.0 for each encounter_id. Then I can use this field to count patient visits in each bucket and give my users multiple ratio/percentage calculations on the same report.

While this is a lot more prep work than my first idea of using MS SSAS, it's a lot simpler to actually accomplish and since most of the execution is run by the stored procedures before the users ever start their work it's also a lot faster at runtime.

Let me know if you fine this useful or if anyone wants to discuss this further.

Wednesday, February 09, 2011

A Readmissions Data Model, Mk I

So this post continues the thoughts in one of my previous posts about designing a OLAP cube to analyze all cause readmissions. The E-R Diagram above shows my first pass at a star schema to answer these questions. To be totally honest I consider this one of my worst designs ever which is one reason I didn't put a lot of work into cleaning up the lines on this one.

My major issue with this first pass is that it doesn't allow for analysis of anything other than 7 day and 30 day metrics, it is currently incapable of providing a breakdown of readmissions by the delta between index discharge and readmission. Also a major functional issue of this model is that if a user mistakenly includes 7 day metrics with a 30 day dimension it will return results that are completely invalid (Although technically correct to computer).

So after deciding that this is completely unsustainable I've started working on rewriting this entire piece. I've actually contacted with a great Data Modeler to help us prepare for this among other projects. So today I just want to get this back out there and maybe get some of the folks who have been following this thread to comment and let me know their thoughts on designing this, and I will hopefully continue to share what I have found and built for this project here to continue spuring on discussion of this topic.

Sunday, January 30, 2011

A Hobby Mash-Up (aka: You Never Forget Your First Doctor)

So admittedly I haven't done any modeling, railroad or otherwise recently. My little layout has been sitting in the corner mostly untouched for months, and my track sketches for a larger more robust layout have been sitting on a shelf or in my My Documents folder also for months. There are doubtless many reason for it, but a large one is likely that the Thanksgiving, Christmas and New Years Holidays all just were here, and I have a nice new TV and Netflix account that I have been enjoying with the family.

One of the "new" things we have discovered on Netflix is Doctor Who. We started with the 2005 Series and have worked both forward and backward in the series. I think we've seen the first, second, third, fourth and ninth Doctors thus far.

Back on the model railroading front most of what I've done has been around operations. I joined OpSig this year in an effort to learn more about operations and maybe even find some local groups that I can guest operate with for a session or two to learn the ropes (if you know of any in Western PA please let me know). While learning operations and building a layout that allows me to run a good session is a goal I have to admit that Structure building really is what I enjoy the most about the hobby. So after breaking all the ice on the drive way and realizing that I was just too sore to do anymore around the house this weekend I thought about pulling out some card stock scratch building supplies and just messing around when I had a great idea. Why not build something that me and the kids would get a kick out of on the layout. Something we had been enjoying on TV currently, say an n-scale TARDIS.

Here is a picture of the mostly finished product on my layout. It's sitting under a tree near the train station. I can't help but think that this just might be the first time the Doctor has been in Pennsylvania. The base needs a bit of trimming and molding to the layout still, but that will come with time as I decide where to keep this piece at.

Here's a close up of the piece. The TARDIS itself came from a Deviant Art site, the sidewalk came from Scale Scenes, one of my favorite sources for card stock modeling products. The figures I bought online from a guy named Jens in a big multipack. They have been custom painted to match the scene as the Ninth Doctor and Rose. If you want to duplicate this Take the Image from Deviant Art and scale it to around 900 DPI. I did some simple math and a bit of trial and error to get that figure. If you want you can do what I did and rotate the page so that it's square to the TARDIS pattern and cut it down and then print it out to the right height. I found that somewhere around 1.6 in high for the pattern was pretty good to make the Doctor's head be at about the right height on the door.
All in all this was a quick project that I just threw together with the kids so that we weren't totally bored this weekend while my shoulder was healing from all the work around the house. It was pretty fun to watch the kids look for it on the layout after I installed it too. Even my four year old was able to find and it recognize it. While it's simple, made of paper and not the greatest it does look nice when viewed from the 2 foot rule. Now let's just hope some major disaster doesn't follow the Doctor to West Forge.