Friday, May 8, 2009

Update: OpenMRS Test-a-Thon (May 16 - 17)

What the heck is the OpenMRS Test-a-Thon?
The OpenMRS Test-a-Thon is a code-a-thon event that allows people to collaboratively increase and improve our testing process in order to make the OpenMRS platform a more stable and robust piece of software (click here for more details).

When is it going down?
We'll be starting at noon (EDT) on Saturday, May 16 and ending at noon (EDT) on Sunday, May 17. You can come and go as you wish. I'll be hanging out in our IRC Channel all day Saturday and will be taking in a feature film on Saturday night (9 - 11pm CDT). So no pressure. Come inside, submit yourself a junit test, and then go back out and finish your Saturday chores.

Where is the event going to take place?
The test-a-thon will take place online. You can join us on the OpenMRS IRC Channel. Contact me via Skype (jmiranda) or on the IRC channel to discuss how you might be able to help out.


Who can participate?
Anyone. Developers, implementers, supporters, documenters ... people who are bored.

Who should participate?
Everyone.

Why should you participate?
Because ...
  • You love OpenMRS.
  • You want to learn about test driven develement (TDD).
  • You want to learn about behavior driven development (BDD).
  • You want to learn about cool unit testing frameworks (i.e. JUnit).
  • You want to learn about cool web testing frameworks (Selenium).
  • You want to learn about continuous integration.
  • You want to write documentation for OpenMRS.
  • You want to meet the team.
  • You want to make Ben Wolfe happy.
  • You want to win a prize.
  • You have nothing better to do on a Saturday.
How can I participate in this once in a lifetime (more like bi-annual) event?
You can head over to the OpenMRS wiki for more details.

Thank you,

The OpenMRS Team

Warning: DO NOT INSTALL Subclipse 1.6 for Eclipse 3.4.x

The Problem
Save yourself a few days of headache ... don't do it! More details to come.

So Mike (mseaton) and I recently upgraded to Eclipse 3.4.2 because of some messed up issues with JSP/XML Validation within Eclipse 3.4. We also both installed Subclipse 1.6 thinking it would bring us joy. Three days later, with lots of back-and-forth collaboration on a project that we have sitting in Subversion, we've experienced nothing but headaches. When he's committed code to the repository, I'll update my working copy only to find that the only changes that come through are ones that are non-conflicting. So when I then try to commit my changes, I get warnings that my working copy is not up-to-date. I think the problem might be the fact that the new "SVN Update to HEAD" feature does not do a --force (but that's just a hunch). I just finished reverting my Eclipse upgrade to Subclipse 1.6 and have successfully reinstalled Subclipse 1.4.7.

Now the issue is that Subclipse 1.6 (which uses Subversion 1.6 wc format) has upgraded all of my working copy metadata to Subversion 1.6. Installing Subclipse 1.4.7 (which uses Subversion 1.4 wc format) means that I cannot use Subclipse on my currently checked out code. Since I have about 30+ projects checked out, this is kind of a problem. I can't waste hours

Here's the error you'll get when

root@jmiranda-laptop:~/Workspace/module-birtreport# svn diff
svn: This client is too old to work with working copy '.'. You need
to get a newer Subversion client, or to downgrade this working copy.
See http://subversion.tigris.org/faq.html#working-copy-format-change
for details.


So thankfully, the subversion folks have a downgrade script:

http://subversion.tigris.org/faq.html#working-copy-format-change


Download the script and run the following command:

root@jmiranda-laptop:~/Workspace# python change-svn-wc-format.py module-birtreport --force --verbose 1.5
Converted WC at 'module-birtreport' into format 9 for Subversion 1.5


Now, at least, I can run svn commands on that directory.

root@jmiranda-laptop:~/Workspace/module-birtreport# svn diff
Index: .project
===================================================================
--- .project (revision 7566)
+++ .project (working copy)
@@ -1,18 +1,18 @@
...

However, when I open Eclipse I can no longer see the very helpful icon overlays on top of files that are "unchanged" or "dirty". I just get unadorned, naked file icons.

Anyone have any ideas on how to fix it?

"Taste my sad, Michael" -G.O.B Bluth

Update:
So the "icon overlay" was looking more and more like an Eclipse issue, so I decided to start Eclipse with the "-clean" option.

/usr/lib/eclipse3.4.2/eclipse -clean


That fixed it. And still a few hours short of what it would have taken to reinstall Eclipse, plugins, and re-download all source code.

"Taste the happy, Michael" -G.O.B Bluth

Update:
It's still broken. Only the top-level folders were successfully restored after the -clean restart. After a few restarts and rebuilds, none of the files or folders have the icon overlay. So we're back to square one.

Following Ben's advice, I tried to install Subversive, but this did not help either. This seems to be a problem with Eclipse. It's as if Eclipse is blocking the icon overlay feature of any plugin (except the core plugins that mark files with "build errors". Checking the properties of any of the files definitely shows that they are "managed" and should have at least the "managed" icon.

One last thing (check the error logs again) and then I'm going to re-install Eclipse.

Last Update:
Ok, so some combination of the above instructions, as well as closing all projects and dealing with them one at a time, while drinking coffee, and threatening to reinstall Eclipse while shaking your fist at your computer, on top of the Celtics winning Game 2 of the Eastern Conference Semifinals has seemed to fix the problem.

I can't explain it folks. Just keep playing around until it works. The one project at a time helped me focus on what I was doing.

(1) Run the script to convert from svn 1.6 to svn 1.5
(2) Clean project
(3) Build project
(4) If that fails to work, close Eclipse and restart with the (-clean) option.

The last thing I was going to try was to create a brand new workspace and move one project over at a time (running the svn convert script). It didn't come to that thankfully.

As I mentioned earlier, the last resort option would have been to reinstall Eclipse and download all of my project source code. Given that half of my day was spent troubleshooting this, I would recommend going that route when you're confronted with this issue and can't get it resolved within an hour.

Friday, May 1, 2009

Walk MS 2009: Part 2

This is my mom (the one whose head is being covered by my giant hand). Her name is Claudia Angel Miranda. She's 56 years old. And she has Multiple Sclerosis.

Her middle/maiden name is no accident -- she had to be an angel to put up with the crap that we put her through when we were kids. But aside from possibly being an angel, she is also one of the greatest moms I've ever known. Heck, she's one of the greatest people I've ever known. Her strength, kindness, sensitivity made me the person I am today. I love the heck out of this woman.

My mom started having symptoms of Multiple Sclerosis in her mid-20's. She was diagnosed with MS around her 30th birthday. Multiple Sclerosis is one of the more confusing and misunderstood diseases out there. You need an M.D. just to understand the Wikipedia article about MS. But here are some facts:

There is no cure.

There are no known causes.

It physically and mentally debilitates people.

It affects each person in different ways.

It is painful to cope with MS.

It is painful to watch someone you love cope with MS.




This is a difficult subject for me - I’ve never been comfortable talking about my mother's condition. And it's never been easy for me to ask for help. However, I've realized over the years that my silence is not helping and that it’s extremely important for me to begin talking about MS in order to make more people aware of the disease.

Last year, with the help of friends, family and co-workers, I raised $3000 (ranking in the top 100 for the Wisconsin Chapter of the MS Society).

Thank you to everyone who donated last year.

This year, Megan and I are hoping to raise $5000. Yes, I realize that's quite a bit of dough, but $3000 seemed like a lot last year and we did it!

We don't need large donations. We just need lots of small donations. So donate $1, $5, $10, $25. It all adds up.

Donate $1, $5, $10, $25

OR

Join us for the MS Walk in Madison

Thank you so much for reading.


Friday, April 17, 2009

Walk MS 2009: Part 1

In a few weeks (Sunday, May 3rd 2009), Megan and I are going to be participating in the 2009 MS Walk in Madison, WI. I’m blogging to ask you all for a donation (of any size) to help in the fight against Multiple Sclerosis. Last year, with your help, we raised: $2500.00. Not bad for our first year.

But this year we want to double that. For the mathematically challenged, that means we're looking to raise a whopping:

$5000.00

So please help us achieve this goal by
making a tax-deductible donation to the National Multiple Sclerosis Society! Any amount will help. Give $1, $5, $10, $20. Every dollar counts.


Thank you for your support,

Justin and Megan


Some useful links:


Friday, April 10, 2009

On MySQL Being Confused

So I've been using MySQL Query Browser and Administration Tools for years now and I've never been able to figure this one out. I have a user ('openmrs') that was created within the Administration tool and granted all privileges to the 'openmrs' schema on all possible hosts ('openmrs'@'%', 'openmrs'@'localhost', 'openmrs'@'127.0.0.1'). I have verified that the 'openmrs' user can connect to the 'openmrs' schema via the MySQL command-line client and the Query Browser. Yet, the 'openmrs' user used to connect to the database via JDBC within the OpenMRS webapp cannot connect. What gives? I keep getting the following error:


Attempted reconnect 3 times. Giving up.
Could not connect to database using url 'jdbc:mysql://localhost:3306/openmrs?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8', username 'openmrs', and pw '*******'. Connection properties can be set with runtime property: 'connection.username', 'connection.password', and 'connection.url'


I'm guessing there might be a mismatch between the mysql.db and mysql.user table that is causing the confusion. I have a workaround, but I really want to know what's going on inside MySQL's brain. For those interested, here's the simple workaround.


grant all on openmrs.* to openmrs;

Saturday, March 28, 2009

On the Dataset Builder

I wasn't sure how to incorporate these mockups into the Dataset Builder Project page on the OpenMRS.org wiki, so I've uploaded them to scribd.com and posted them to my blog. At some point, I'll work on getting these converted to Balsamiq, but for now they will just have to remain as scanned paper mockups.

NOTE:This is just a rough draft. I'll clean this up when I get a chance. Oh and it would be great if someone could tell me how to embed HTML into mediawiki.

Create a Patient Dataset

Dataset Builder - Create a Patient Dataset


Create an Encounter Dataset (v1.1)

Dataset Builder - Create an Encounter Dataset (v1.1)

Create an Observation Dataset

Dataset Builder - Create an Obs Dataset (v1.0)

Create an Encounter Dataset

Dataset Builder - Create an Encounter Dataset (v1.0)



Examples of Datasets


Dataset Viewer - Dataset Examples


Create a Dataset (v1.0)


This is an early version of the Dataset Builder (circa 2008). Not too many features. You add some columns, choose a cohort and ... voila ... you get a dataset to play around with. There are some other features like moving/deleting columns, but the idea was to keep things simple.

Dataset Builder - Create a Dataset (v1.0)


Create a Dataset (v1.1)


The next version of the Create Dataset feature ...

Dataset Builder - Create a Dataset (v1.1)

Thursday, March 26, 2009

On the Quartz Scheduler Project

I have been trying (in vain) to get the Quartz Scheduler project page up on the OpenMRS wiki, but keep getting the following error when posting my changes:

So for now, the project page will just have to be left here.

Overview


There are many activities within a healthcare information system which benefit from automation. For example: daily clinic reports might need to be generated the morning before a clinic opening, decision support rules might need to be run over a patient group once every week, or healthcare data coming in from outside sources might need to be analyzed every 30 mins. To give end implementations the flexibility to define these sorts of automated conveniences, the OpenMRS community has added scheduler functionality to the core software application. The OpenMRS scheduler (based on the JDK Timer) currently supports executing tasks on regular basis (i.e. a task will execute every X seconds, minutes, hours, days). However, there's no way to schedule a task to recur at a particular time every week. The data model supports this type of feature (start time and repeat interval), but we need to add some logic to the Scheduler to handle triggering these tasks to occur at exact times.

We want to support more complex scheduling (i.e. cron-like) in the very near future, where we can specify rules that will allow Tasks to run more more/less frequently based on the day/time. For instance, an implementation might want to schedule a Task to run once every day at midnight, but also at 6pm on Saturday and Sunday. This type of scheduling would be difficult to support using the JDK Timer, so we would like to add an extension point to the scheduler to allow a developer (probably myself) to create a module based on the [http://www.opensymphony.com/quartz Quartz Scheduler]. This will allow us to handle more advanced scheduling requirements.


Requirements

High Level Goals

  • Decide whether to build as a module to extend current functionality or as a core component to replace the current functionality.
  • Decide whether to include Quartz tables in the OpenMRS data model (there are about 7 Quartz-specific tables).
  • Implement a Quartz version of the scheduler to extend (possibly replace) the current JDK Timer implementation.
  • Implement features that allow a user to manage scheduled tasks.
  • Redesign the Manage Scheduler user interface to provide a more user-friendly and intuitive experience.
  • Create unit tests for each expected behavior of every method within the scheduler service and its domain objects.


User Stories


Student will be responsible for soliciting requirements (user stories) from users/implementers. Here are just a few examples of user stories that might be applicable to this project.

  • Allow a user to view all available tasks.
  • Allow a user to view all scheduled tasks.
  • Allow a user to create a scheduled task.
  • Allow a user to update a scheduled task.
  • Allow a user to delete a scheduled task.
  • Allow a user to schedule tasks to be run on an interval (i.e. every 30 seconds) or at specific moments in time (Tue, March 24 at 10:42pm).
  • Allow a user to schedule emails to be sent at a specific time.
  • Allow a user to schedule reports to be generated and sent to stakeholders at a specific time.
  • Allow a user to start an available task.
  • Allow a user to stop a scheduled task.
  • Allow a user to check whether a task is currently executing.

Planning Process

  1. Identify user roles that will be using the scheduler
  2. Identify user stories for each role by interviewing users / stakeholders
  3. Prioritize user stories using MoSCoW rating (Must, Should, Could, Want)
  4. Estimate user stories (a.k.a Planning Poker) using ideal days (0.5, 1, 2, 3, 5, 8, 13, 20)
  5. Discuss acceptance criteria (expected behavior) for each user story with stakeholders.
  6. Create a Release backlog for the current sprint / iteration
  7. Estimate / calculate velocity (i.e. 20 story points)
  8. Create an Iteration backlog of stories
  9. Create tasks for each user story in the iteration
  10. Assign estimated hours to each task
  11. Mockup user stories prior to start of sprint to solicit feedback.
  12. Run sprint for iteration duration (between one to two weeks)
  13. Deploy features completed during sprint to labs.openmrs.org
  14. Solicit feedback from users/stakeholders
  15. Re-prioritize and re-estimate users stories / tasks
  16. Recalculate velocity
  17. Create an Iteration backlog for stories that fit into
  18. After X iterations, deliver final release

Timeline

This section will be completed by the mentor and student.

  • Iteration #1:
  • Iteration #2:
  • Iteration #3:
  • Iteration #4:
  • Iteration #5:
  • Iteration #6:
  • Release:

Mockups

This section will be completed by the student.

FAQs

Still compiling questions/answers. Will post by Friday.

Resources

Project Resources

  • [http://docs.google.com Project Discussion] (has not been created yet)
  • [http://docs.google.com Release Backlog] (has not been created yet)
  • [http://docs.google.com Iteration Backlog] (has not been created yet)

OpenMRS Resources

  • [http://openmrs.org/wiki/Scheduler_API Scheduler API]
  • [http://openmrs.org/wiki/Quartz_Scheduler_Developer_Guide Quartz Scheduler Developer's Guide]
  • [http://openmrs.org/wiki/Quartz_Scheduler_User_Guide Quartz Scheduler User Guide]
  • [http://openmrs.org/wiki/Technical_Discussion#Task_Scheduling Technical Discussion about existing Scheduler]
  • [[ticket:357|Ticket #357]]
  • [[ticket:359|Ticket #359]]
  • [[ticket:1056|Ticket #1056]]

Blogs

  • [http://blog.justinmiranda.com Justin Miranda]
  • [http://www.openmrs.org Student Blog]

External

  • For more information on Quartz, please see the [http://www.opensymphony.com/quartz Quartz Project] home page.
  • more resources to follow