Show / Hide Elements based on a Checkbox

One of the best ways to save space on a busy iForm and make it easier to read is to only show certain pieces of information when they are relevant. For instance, if you have an order with prompts that need to be filled in, you can hide the supporting prompts until the order is selected and in most iForms, that means checking a checkbox.

So today, we'll look at how to hide and show an element on your iForm based on when a checkbox is checked / unchecked. Up until this point on the blog, I've mainly focused on how to get things done using the jQuery JavaScript framework, but today I've decided to be more inclusive and include the instructions on how to do this using "native JavaScript" as well. For each method, I've included two examples: one example of showing / hiding an inline prompt and one example of showing / hiding whole orders.

Clinical Decision Support - Using Lab Dates in JavaScript

This blog post was inspired by a question raised by Scantron (Michael) on the HEO iForms Google Group. He writes:

Hello all,

I was wondering if anyone is working with dates in java script? I have some criteria to order a CBC if one has not been completed in the past 24 hours. I can get it to subtract the dates and order the tests when I hard code the dates, but when using the @@patient.lab_result.Plt.date@@, the value brings in a carriage return symbol, and I get an unterminated string constant error. anyone have a solution for this?

My js:

var dt1 = new Date(Date.parse("@@patient.lab_result.Plt.date@@"));
var one_day=1000*60*60*24;
var time_diff1 = (parseInt(dt1.getTime()-dt2.getTime())/(one_day));

if (time_diff1 > 1 || isNaN(time_diff1)){
 $('#PtInr').val(1);
}

What comes in:

var dt1 = new Date(Date.parse("03/13/2013 09:46 AM
"));

InSight Conference 2013

I just got confirmation that I will be co-presenting at this year's InSight user group conference again this year with Dr. Mark Pratt and Bonnie McGuire. I co-presented on two sessions with them last year; it was a great time and a great opportunity to share ideas and meet other people that work with McKesson products. This year, the two educational sessions that we're presenting in are on Friday morning, so make sure that you get an afternoon or evening flight home.

If you have not had the opportunity to check out this conference yet, I highly recommend it. It's a great opportunity to see what's coming up, to hear how some other hospitals have faced (and overcome) the same issues that you may be experiencing, to meet other folks and share ideas, and to even hear directly from McKesson about what they think about all of these things.

If you are going to be able to attend this year, I'd love to meet you. I have such a good time geeking out about this stuff and talking about new and interesting ways to use the system.

What is VGR?

Most folks, when I tell them that I know VGR have the same question: "What is VGR?" Well, the short answer is that "VGR is a scripting language designed to specify rules for implementing decision support"[2] from within McKesson's Horizon Export Orders system. But that's only half of the story.

Have you ever wondered where the acronym "VGR" came from? Well, here's a bit of a history lesson.

VGR was originally designed for WizOrder, Vanderbilt University Medical Center's (VUMC) computerized physician order entry (CPOE) system. In their words, it was designed to deliver "high-quality decision support to clinical end-users" and "to make it easy for non-programmer domain experts to enter rules."[2]