Benefits of form versioning
Picture a fully developed CRF. The form layout is pristine, the validation rules are working exactly the way you want them to, and the field data maps directly to your database tables.
What more can you ask for?
Unfortunately, forms hardly ever stay the same throughout the course of a clinical trial or a research study. Forms frequently need to adapt to new data points that were unforeseen during the protocol definition phase. So how can we handle this?
We could go ahead and naively make the new changes, but what happens if the change asks for a field to be deleted? Even if we just hide the field and keep the previous underlying data, how can we display the data that was captured now that the field is missing from the form?
One solution for this is form versioning. The ability to load alternate versions of a form is a frequently overlooked feature when designing a system to handle CRFs for a clinical trial, forms for a research study, or generally any forms that tend to change.
Form versioning allows us to:
- Retrieve and display data even if the field is no longer part of the current version of the form.
- A dropdown list’s items can be added, removed, or changed and we’ll always be able to retrieve exactly what items were present before changes were made.
- Keep the validation rules (edit checks) specific to a specific version of the form.
- Tell customers that mid-study changes are a breeze because the form versioning technology keeps mid-study changes isolated from existing data.
Next time you’re designing a system that stores CRFs or basically stores form data, it may pay to integrate form versioning into your system. It definitely saved me a lot of time. Although I can’t say mid-study changes are my favorite thing in the world, I can say that form versioning makes mid-study changes a whole lot easier.
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Dealing with mid-study changes (data model)
- OpenClinica takes open-source community by storm
- Quick and dirty “dirty checking” for Windows form, C#
- Portrait vs Landscape, CRF Design for a Tablet PC
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
MySQL increasing ID manually
Some times it’s necessary to assign a consecutively increasing ID field to a set of rows. Autoincrement is available, but you would need to leverage an INSERT in order to make use of MySQL’s autoincrement feature. Fortunately, it is possible to do this in place by using a separate counter variable in an UPDATE statement.
The solution given below is largely adapted for MySQL from Phil Haack’s SQL Server recipe. If you’re using MySQL Query Browser, you’ll need to make this a script by clicking File > New Script Tab.
SET @counter = your_starting_index; UPDATE your_table_name SET your_id_column_name=(@counter:=@counter+1);
Make sure to change your_starting_index, your_table_name, and your_id_column_name.
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Dealing with mid-study changes (data model)
- Top 10 differences between Java and C#
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
- Remap keys, map caps lock to control button
- Overload the array square bracket operator in C#
Overload the array square bracket operator in C#
Although operator overloading is possible in C# (just like in C++), overloading the array square bracket operator is by definition not possible. However, C# provides an alternative called indexers. This is directly from the Microsoft C# Reference for the [] Operator:
The array indexing operator cannot be overloaded; however, types can define indexers, and properties that take one or more parameters. Indexer parameters are enclosed in square brackets, just like array indexes, but indexer parameters can be declared to be of any type, unlike array indexes, which must be integral.
The syntax for indexers resembles the C# syntax for properties rather than its syntax for operator overloading. Here’s a quick snippet for providing array-like access to a List you’d like to keep hidden within a class:
// overloads the square brackets to provide array-like access.
public T this[int i]
{
get { return this.List[i]; }
set { this.List[i] = value; }
}
Worked for me, and hopefully it works just as well for you!
UPDATE: As I do a quick search now, this Stack Overflow post just turned up.
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Hibernate is missing in Windows XP
- Top 10 differences between Java and C#
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
- Why does an abstract class need to implement interface methods?
- MySQL increasing ID manually
Hibernate is missing in Windows XP
Not only is hibernate hidden from the shutdown/log-off options in Windows XP, it is also disabled by default. The procedure to enable hibernate is not difficult, but it took a while to figure out where the configuration settings were hidden. Hopefully posting it here will save someone some time.
Before you logout out of Windows, a window appears giving you an array of shutdown, standby, hibernate… options. Depending on your configuration, this may be a set of 3 buttons or a dropdown set of options. If you see a set of 3 buttons, holding shift at the window should display hibernate as an option. If the hibernate option does not display, go to the section below about Enabling Hibernate. If you see a window with a dropdown set of options and hibernate is not one of them, go to the section below about Enabling Hibernate.
Enabling Hibernate
- Go to the Control Panel > Power Options > Hibernate tab.
- Make sure Enable hibernation is checked.
- Click OK and hibernate should show up as one of your shutdown options.
Repetitively Enabling Hibernate
Maybe you have a lot of systems that require hibernation, or perhaps you’d like to include it in a set of scripts that you run when a system is built from scratch. You could run this command from the command prompt, or put it in a batch file:
powercfg /H:ON
Hope this helps!
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Why does an abstract class need to implement interface methods?
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
- Benefits of form versioning
- Dealing with mid-study changes (data model)
- Overload the array square bracket operator in C#
Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
If you’ve got some older systems or a new netbook that can’t quite handle Vista , you might be hanging onto Windows XP longer than you thought. Out of the box, XP and the new DST changes don’t get along. As a result of The U.S. Energy Policy Act of 2005, the United States (that’s where I am) has an extended daylight saving period that lasts 3-4 weeks longer than in years prior to 2007. But there’s a fix!
There’s a handful of ways to update your computer so that it supports the new DST dates: downloading an EXE update, manual registry changes, TZEdit, and some others. For a single machine, I found the most straight-forward way to update your machine is through TZEdit.
- Download TZEdit.
- Run TZEdit.exe to extract it to the default directory (C:\Program Files\TZEDIT).
- Run C:\Program Files\TZEDIT\TZEdit.exe.
- The timezone configured on your machine should be automatically selected.
- Click the Edit button.
- Change the Start Day to the Second Sunday of March at 2:00am.
- Change the Last Day to the First Sunday of November at 2:00am.
- Click OK.
- I found to get the settings to stick I had to change time zones in the Date and Time Properties window (the window that pops up when you double-click the time in the tray). Change to some other time zone, and then change back to your original time zone.
- Now reboot.
- To test, change your date/time to the second Sunday of March at 1:59:59am. If all went well, you should “spring” forward to 3:00am.
If you’d like more technical information on more advanced configuration, jump over to Microsoft’s Help Page.
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Remap keys, map caps lock to control button
- Hibernate is missing in Windows XP
- MySQL increasing ID manually
- Benefits of form versioning
- Dealing with mid-study changes (data model)
Remap keys, map caps lock to control button
The caps locks key is one of the least commonly used keys on my keyboard… until I mapped it to a control key! I’m posting this here mostly for selfish reasons. Every time I redo a Windows installation, I end up googling around for the registry hack to make this happen. Putting it here, just makes it more convenient while saving time for anyone else looking to do the same.
A lot of the registry hacks available online for remapping the caps lock and control button involve swapping their functionality or swapping other keys. I have absolutely no use for a caps lock button, so I just map the caps lock button to a control button and leave the control button in the bottom-left corner alone.
- Fire up the Registry Editor by clicking Start Menu > Run.
- Type in regedit, and hit enter.
- Browse to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout. - Click on Keyboard Layout.
- Right-click in the table on the right, and click New > Binary Value.
- A new value will be added in the table. Name it “Scancode Map” without the quotes.
- Double-click on the new “Scancode Map” value.
- A window titled “Edit Binary Value” will pop-up.
- Enter:
00 00 00 00 00 00 00 00
02 00 00 00 1D 00 3A 00
00 00 00 00 - No need to enter the spaces. They will be automatically inserted as the numbers are entered.
- Click OK to save your changes.
- Now reboot.
- After rebooting, your caps lock will now act as a control button!
Check out the Microsoft Documentation if you’re looking for a more complete technical description of what all the HEX values mean.
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
- Future of notebooks, Dell Latitude XT Tablet PC
- MySQL increasing ID manually
- Hibernate is missing in Windows XP
- 5 Common Mistakes for Tablet PC Development
5 Common Mistakes for Tablet PC Development
Okay, so you’re sold on a Tablet PC, but what should you watch out for when developing a Tablet PC application in healthcare?
Below is a list of common mistakes for developing a Tablet PC application. All are avoidable early in the project’s life-cycle. Some of these mistakes I own, and others I’ve seen from other project managers and developers. Hopefully, this list helps others avoid these common mistakes.
There are already plenty of re-hashed lists on the Internet describing how to address goal setting, client and stakeholder buy-in, or various software and management anti-patterns. This is not one of those lists.
Mistake 1 - I need to learn another operating system
Mistake 2 - It looks fine on my machine, so it’ll look fine on the tablet
Mistake 3 - It’s just Windows, so I don’t need to worry about fonts
Mistake 4 - It works in notebook mode, I don’t need to worry about slate mode
Mistake 5 - 3-hour battery life is more than enough
Bonus - I’ll think about security when it’s up and running
Mistake 1. I need to learn another operating system. Some programmers (and some clients) still think Tablet PCs use a special mobile operating system with its own set of SDKs and APIs. Currently, the majority of Tablet PCs run Windows XP (with Tablet PC enhancements) or Vista (which has the core Tablet PC functionality built-in). Although development tools specific to the Tablet PC such as Digital Ink and the Text Input Panel are available, no one says you have to use them. Most applications you use on your desktop or notebook will work just as well on a Tablet PC.
Bottomline: No new OS, just some added libraries for Windows.
Mistake 2. It looks fine on my machine, so it’ll look fine on the tablet. Okay, great! It’s just a vanilla Windows machine with some extra bells and whistles. I can just develop my application on my workstation, and then deploy it when I’m done.
Almost — like any kind of development, it’s important to test in the environment where it will be used. Some times this isn’t possible, but hey, you’re developing for a tablet, it only makes sense to at least test it on a tablet. Microsoft does offer some emulation software (with limitations) that tries to duplicate a tablet environment, but nothing can replace testing it directly on your target system.
Probably the biggest time-saver is having a development environment that mirrors the screen resolution of the Tablet PC. If the monitor is the right size and it can rotate, you’ve got a winner! Tablet PCs often have an extra wide or extra tall screen, and they can change between notebook and slate mode. With the right monitor, you won’t need to deploy to a tablet every time you tweak something just to see if your application looks okay.
Bottomline: Make sure to test on your target system, and shell out the money for the right monitor. The development time you save will be well worth the cost.
Mistake 3. It’s just Windows, so I don’t need to worry about fonts. This one is a killer. Font size is probably the last thing I would worry about. Unfortunately, I’ve seen some good applications completely tank in front of the customers just because of font size.
Windows should keep the font size consistent whether it’s on a desktop, notebook, or Tablet PC. And… it does. Tablet PCs, just like desktops and notebooks, come in a variety of resolutions. Imagine squeezing everything on your monitor into an 10-12″ screen at the same resolution. Changing the resolution fixes the situation in a way, but then those magnified resolutions don’t take advantage of the added width or height of a tablet PC. And the accessibility settings? …the “Extra Large Fonts?” Another no-go. Because you’re starting out with a smaller screen, the font size difference isn’t substantial enough to make much of an improvement to the user. Try it, and you’ll see.
It really doesn’t seem like much of an issue, except when you’re working with an older user. If they can’t read the text, forget all the Ink widgets and latest technology you implemented, because your application is now considered completely useless by the people who should be using it. Make sure to use larger fonts (18pt worked for me!) in your application, or better yet, allow the user to adjust the fonts within your application.
Bottomline: If they can’t read the application text, don’t let the door hit you on the way out. Use larger fonts or let the user decide what font to use.
Mistake 4. It works in notebook mode, I don’t need to worry about slate mode. Most developers work on monitors that are wider than it is tall. So naturally, you’ll find yourself developing your Tablet PC applications in that environment. You’ll also find that you tend to work with the tablet in the notebook mode as well.
Not much harm in that, until you switch to slate mode. If your application GUI objects took advantage of the extra screen width, those objects will now either be off the screen or squeezed into about half the space. A number of techniques exist to leverage the added width or the added height, but I’ll leave that for another post.
Bottomline: Make sure your layout works in both notebook mode and slate mode.
Mistake 5. 3-hour battery life is more than enough. The battery is not so much a software development issue. However, if you’re taking ownership of developing a Tablet PC application, understanding whether the customer’s needs are met by the selected hardware is at the the top of your list. If the hardware doesn’t fit the customer’s needs, your application will never get used by anyone but you.
Learning how the customer uses the tablet is essential. Will they be running around all day in the wards? Are they traveling from site to site? Will they require Wi-Fi (battery drainer!)? If any of these are true, you’ll need to get extra battery packs. After getting the extra packs, either detail an SOP for swapping out the battery after hibernating the tablet, or better yet, start the project with tablets that have hot swappable batteries!
Bottomline: Understand in detail how the tablets will be used with regard to battery life. If 3 hours is not enough, make sure the users understand how to swap in a fresh battery.
Bonus: I’ll think about security when it’s up and running. I know, I know… I said 5, but I thought I’d throw in this one, since it’s a show-stopper. A tablet, just like a notebook, is meant to be portable. The price we pay for this convenience is it’s also a very good target for theft.
If a tablet containing patient data is lost or stolen, the law requires those patients be notified. The healthcare professionals responsible for the loss will be in a world of hurt and paperwork, but it doesn’t stop there. Your application will also come under scrutiny. How do you secure the protected health information? Is the patient data de-identified? How? What data was lost? Who else has seen that data? And that’s just for starters! As a first step, I recommend full disk encryption. TrueCrypt has worked well for me, and here’s list of full disk encryption providers.
Bottomline: Security, especially for tablets in a healthcare environment, cannot be an afterthought, it must be integrated into the design process.
So, there’s my 5. Hopefully it’ll save you guys the need to find them out on your own. Happy tablet hacking!
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Portrait vs Landscape, CRF Design for a Tablet PC
- Future of notebooks, Dell Latitude XT Tablet PC
- OpenClinica takes open-source community by storm
- Dealing with mid-study changes (data model)
- Hibernate is missing in Windows XP
Free iPHR Market Report from Chilmark
Chilmark Research is offering a FREE 20-page iPHR Market Report (Executive Summary). You’ll need to enter your email address and address info, but that’s it!
The full report is a 200+ page report going for just a little under $2,500. The full report consists of 3 chapters and an appendices. The free report only includes chapter 1 (Executive Summary). Nothing wrong with that, because that’s exactly what they advertised. Chapter 2 (Market Trends) and chapter 3 (iPHR Vendor Profiles) are not included. Too bad…
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Remap keys, map caps lock to control button
- Future of notebooks, Dell Latitude XT Tablet PC
- 5 Common Mistakes for Tablet PC Development
- Dealing with mid-study changes (data model)
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
Why does an abstract class need to implement interface methods?
In a comment for a previous post (Top 10 differences between Java and C#), John P. Wood wrote:
As a (primarily) Java developer, I’ve also noticed that C# handles abstract classes that implement interfaces differently. In Java, an abstract class can implement an interface, and not provide implementations of all of the interface’s methods. It is the responsibility of the first concrete class that has that abstract class as an ancestor to implement all of the methods in the interface.
C# on the other hand seems to require that the abstract class provide implementations for all of the methods on the interface. Even if that implementation is just a method signature.
Like these 3 posts (1 (bottom), 2, 3), I am struggling with why the Microsoft Team chose to do this. Why ask the developer to write a little stub for the interface method, when the abstract class has no intention of implementing it at all?
I believe it’s a natural artifact of virtual and non-virtual methods in C# (gotcha #2). In Java, methods are virtual by default (as far as I’m aware, Java doesn’t support non-virtual methods). However, C# (being derived from C++) does support non-virtual methods. When an abstract class implements an interface in C#, you are given the chance to describe the interface methods as abstract, virtual or non-virtual. Here’s exactly what each options means:
- abstract - No attempt at an implementation is made in the abstract class. It’s up to the first concrete class to provide an implementation. As a side note, defining a method as abstract implicitly defines it as virtual. If this weren’t the case, you wouldn’t be able to override it in the child class which defeats the purpose of an abstract method.
- virtual - An attempt was made in the abstract class to implement this method, but the child class has the option of overriding it and providing its own implementation.
- non-virtual - Again, an attempt was made at an implementation in the abstract class. However, the child class cannot override this method. If a child class defines a method with the same name, the method will not be associated with the interface implemented in the abstract class. The method associated with the interface is the non-virtual method defined by the abstract class.
Java can do options 1 and 2, but it lacks option 3. Java could define the method as final to prevent it from being overriden, but this is slightly different than non-virtual. The final keyword is more along the lines of seal in C#. By allowing an option 3, C# provides finer control over how interfaces are inherited. If C# went the route of Java and permitted abstract classes to put off interface method definitions, these methods would need to be virtual by default. However, this would be inconsistent with C# methods being non-virtual by default.
In a nutshell, the C# developer is forced in the abstract class to decide exactly which of the three options to assign to the interface method. Anyway, that’s my best guess…
To receive updates on new articles, subscribe to CRF Design today!
Similar Posts:
- Top 10 differences between Java and C#
- Hibernate is missing in Windows XP
- Portrait vs Landscape, CRF Design for a Tablet PC
- Overload the array square bracket operator in C#
- Using TZEdit on Windows SP, SP2, SP3 for Daylight Saving Time (DST)
Portrait vs Landscape, CRF Design for a Tablet PC
How do you systematically make use of the varied Tablet PC screen resolution dimensions using C#?
Designing a CRF specifically for a Tablet PC can be a challenging experience, but it can also be one of the most rewarding.
The Tablet PC is very similar to a traditional desktop computer or a laptop. As I write this entry, most Tablet PCs are running some variant of Windows. Whether it’s Windows XP Tablet PC Edition or Vista (which has built-in support for Tablet PC specific functionality), you’re basically dealing with a Windows machine and you can pretty much treat it as such… almost.
Maybe it’s not so much the variety. One of my biggest obstacles was that the dimensions change. They don’t change just once in a while (like when the resolution changes when you connect your laptop to a TV), they can change many times during a single session!
For example, convertible Tablet PCs (like the one in the image above) provide the ability to change from portrait to landscape and back again all in seconds. In addition, most Tablet PCs come in screen dimensions that are either wider or taller depending on whether it’s in slate mode or the more traditional notebook mode. Taking advantage of a taller or wider screen is going to be the topic of a future post, but let’s say you have a layout for making use of the added height or width, how do you know when to use which?
The first step is determining whether the screen dimensions are in portrait (slate) mode or landscape (notebook) mode. Here are two straight-forward methods for determining which mode the Tablet PC is using:
public bool IsPortrait()
{
return Screen.PrimaryScreen.Bounds.Height >
Screen.PrimaryScreen.Bounds.Width;
}
public bool IsLandscape()
{
return !this.IsPortrait();
}
We can setup a thread that calls one of these methods at specified intervals (polling solution), or we can leverage the .NET event architecture so that our application responds to dimension changes. Leveraging the event architecture is intuitively more efficient and more reliable, so add this to your Form_Load() method:
Microsoft.Win32.SystemEvents.DisplaySettingsChanged +=
new EventHandler(SystemEvents_DisplaySettingsChanged);
Now, define the event handler:
void SystemEvents_DisplaySettingsChanged(
object sender, EventArgs e)
{
if (ScreenProperties.IsPortrait())
// do portrait handling
else
// do landscape handling
}
And just like that, your form is now responding to screen resolution dimension changes!
To receive updates on new articles, subscribe to CRF Design today!












