beta it republik » Articles

Articles

Untitled Document
Tuesday, 29 July 2008 | Article

Using PHP and Agile Development for Medical Management Software

Many of those who are tapped in to the Agile way of software development think this practice can only be applied to something like Ruby on Rails. Not true—we PHPers know— and here’s a perfect example of a forward-thinking software company who is using Agile methodology in their PHP development to produce complex medical management software.


Introduction
The CEO and founder of MediGeek, Mel Rottinghaus, knows firsthand about the difficulties of dealing with a small medical practice stuck in a paper-only, “keep a copy of everything,” “caught in the US healthcare quagmire” world. Mel and her husband, Dr. Dean Rottinghaus have wrestled with this for years in his small to mid-sized chiropractic practice located in Cincinnati, Ohio. Necessity is indeed the mother of invention, as it became clear to both of them they were not the only ones struggling to cut costs, increase reimbursement from insurance companies, and bring the healthcare industry into the twenty-first century already. MediGeek, LLC and its unique software package, MedicFusion, were subsequently born.

Doctors who manage their own practice generally do not have time to learn or deal with complicated computer systems; their jobs are to heal the sick and to diagnose disease. They are also not known for their business management savvy, and often times they find the cost of doing business overwhelming. Likewise, young doctors starting out are usually swamped with paying off medical school loans, and have to build a base of patients from scratch. These two groups need the most help, and the MedicFusion paperless medical management system is there to fill that need.

The MedicFusion software package is still being developed, and the beta is set to be released to a select group of chiropractors in the local area in July 2006. Currently, national release is scheduled for early 2007.

What does MedicFusion do?
The MedicFusion software essentially acts as a doctor’s personal assistant. Through the software, the doctor can access patient information and complete medical history, manage personnel, administer billing and payer information, control patient scheduling, search for a specific patient, keep track of notes regarding a patient’s visit, prescribe medications or physical therapies, and much more. Through the desktop stationed near the entrance to the office, patients can check-in themselves, scan their own insurance cards and photo IDs as required, complete necessary forms online, schedule future appointments and even check out and pay their co-payment before leaving. The system is meant to replace the receptionist, or at least allow the receptionist to perform other duties.

As Ken Macke, the Senior Application Engineer on the project states, “the web-based environment allows patients to contribute to their records management from their own computers, and doctors and staff to manage their practices even when they are on vacation. Patients get immediate access to their records, and physicians spend more time practicing medicine instead of being business managers. The process of visiting a physician is faster, more pleasant and more secure. The costs to the doctor are less than paper- and people-intensive methods, and the benefits show in virtually all aspects of the practice—most importantly, in their bottom lines. Because we are web-based, we can continue adding to our features without forcing costly upgrades on our customers.”

MediGeek had some lofty goals however, as they also realized that time was of the essence. They set themselves out on an aggressive development track and knew that the core group of professionals, both from the medical side of things and from the software development world would be deeply involved with the process and the result. When they discovered the world of agile programming, they knew this was something that could propel them toward their goals, and that it would work very well with their tightly knit group. They had already begun development on the software with PHP, and the trick was to integrate those methodologies into their current state of mind.

One of MedicFusion’s big selling points is its comprehensiveness. It is the only software package that has covered the office visit process from before the patient enters the building to all the postvisit billing follow-up that takes place with insurance companies. Because of this, integration with modules written both internally and provided by external sources is absolutely crucial to its success. The MedicFusion team realized early on that sometimes it just does not make sense to re-invent the wheel. They went in search of companies that could potentially partner with them to allow them to provide a more comprehensive package. When this partnership scenario solidified in a few cases, integration and tapping into APIs, for instance, became increasingly important. PEAR packages like the SOAP package that are straightforward and easy to implement, greatly simplify access to Web Services, and are thus tightly integrated into the code.

The team also wanted to offer the doctors a complete hardware solution, and therein lies the challenge to integrate multiple inputs and hardware components. The doctors will be able to hand carry tablets from exam room to exam room, the patient will need to scan photo IDs from a photo scanner, swipe credit cards from a magnetic card swiper, and digitally sign healthcare documents with a digital signature reader. All of that information will be collected, parsed, and stored in a MySQL database through the use of PHP code.

Why PHP for MedicFusion?
So why would a company who is new into software development choose PHP/MySQL for their language of choice? They list several reasons. For one, like the rest of us, they like the flexibility that comes with PHP. Matt Warden, one of the developers on the project whose role in the development has been mostly prototyping thus far, likes the fact that he can easily use PHP over Java and prototype a backend for his AJAX applications.

The software has an AJAX ‘auto save’ functionality built in, which saves form values every few seconds, in case the user navigates to a previous form screen without first submitting the form they are currently working on. Matt says, “This is an added feature which works when AJAX is available. It does not interfere with normal operation when AJAX is not available in the browser.” It is also a nice feature if a patient needs to complete a lot of medical history, and has to go back and fix something. AJAX has also been extensively used in the calendar portion of the software, with drag-and-drop functionality on the administrative side, for ease of scheduling patients and office resources such as personnel.


Another reason for choosing PHP for their development was the freedom to be able to move away from Microsoft. As Ken states, “by choosing PHP over ASP.net, we have the maximum flexibility with the operating system we choose for our servers— whether Windows, Linux, OSX, or another UNIX variant. PHP is also a proven platform that has tremendous support from both the open source community and Zend.” PHP has also allowed them to internally develop on different platforms such as Mac OSX versus Windows. They can still develop and test on their local machines because of the “cross-platform nature of PHP.”

As is the case many times, the developers working on the project appreciate the support offered from the PHP community, both through user’s groups and online resources. As Ken states, “there is a tremendous community of developers out there with a great deal of knowledge of real-world PHP application development, and they are all too happy to share their experiences.”


When I asked if there were things about the PHP language that were frustrating or that have made development more difficult, they discussed the lack of a robust coding environment. Ken says “Zend Studio is an amazing environment, but we would like to see broader-based and more extensive support for PHP in both open source tools and commercial products such as Macromedia Dreamweaver. Code-completion and debugging are must-haves, but it is only the beginning if the goal is to compete with the likes of Microsoft Visual Studio.”

The simplicity of PHP is also a double-edged sword. It is obviously easy for a newbie to get up and running on a simple program (as Ken says, “here is your first PHP web page: <?php phpinfo(); ?>”) but that simplicity can come back to haunt you. “I would advise that the choice to use PHP should not be made to get around the “overhead” of some other languages like Java or Ruby on Rails,” Matt offers. “The overhead is often there to push good programming practices that will save time and money in even the short run, let alone the long run.” Sound advice, indeed.


A Quick Word about Agile
Agile programming represents a large group of forwardthinking software development methodologies such as Extreme Programming (XP) and Scrum. The principles behind agile programming, as taken from the Agile Manifesto, are as follows: “Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage. Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale. Business people and developers must work together daily throughout the project. Build projects around motivated individuals.

Give them the environment and support they need, and trust them to get the job done. The most efficient and effective method of conveying information to and within a development team is face to face conversation. Working software is the primary measure of progress. Agile processes promote sustainable development. The sponsors, developers and users should be able to maintain a constant pace indefinitely. Continuous attention to technical excellence and good design enhances agility. Simplicity—the art of maximizing the amount of work not done—is essential. The best architectures, requirements, and designs emerge from selforganizing teams. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behaviour accordingly.”




In a nutshell, we see that Agile methodologies promote:
  • Customer interaction on a daily basis
  • Three to five day release cycle for stable releases
  • Pair programming (two coders working together at one machine)
  • Test-driven development
  • Communication with everybody on everything
  • That it is alright to throw away code rather than spin your wheels trying to fix a bad idea
  • Mutual respect for each other

Usually when you think of ‘software development’ you do not think of such “warm, fuzzy” topics as “mutual respect” and “trust.” As hard as it is for some coders to get out of that ‘document everything,’ ‘work independently’ and ‘release when it is done’ mentality, proponents of the Agile way of software development tout sharp decreases in software bugs, sharp increases in customer satisfaction, and earlier returns on investment.

While Agile, XP, Scrum and the rest are usually associated with Ruby on Rails, there is a new breed implementing this way of thinking into PHP development.

A Marriage Made in Heaven
The challenge in integrating the Agile process in any coding or corporate environment exists more in shifting the mindset away from traditionally accepted best practices. At first glance, it is easy to see where there may be resistance from both coders and those in executive management. Putting end users side by side with coders, throwing code away (and thus potentially hours of work) and releasing a new version of the software every week would seem downright ludicrous to an ‘old school’ coder. Putting two coders at one machine, while it would certainly cut down on hardware costs, would most likely seem to be an inefficient use of resources to a manager. And, let us face it, neither side has been known for their stellar communication skills—so to keep everybody in the loop on everything is a foreign concept in a traditional setting.

Thankfully, the staff working on the MedicFusion software is far from traditional. They knew that just because they were using PHP instead of Ruby on Rails, it would not have that large of an impact on implementing the process in their own company. Mel states that, “the agile process is absolutely critical to our search for excellence. In fact, it frees us to pursue excellent ideas and scrap those that disappoint. The agile approach allows us to encourage the free exchange of ideas among all staff at all levels, and incorporate the best ideas now, as we continue to develop our product rather than later, when the ideas are less fresh and perhaps less unique. And it allows us to create and amend our product quickly and efficiently, saving untold amounts of time and money.”




There are a few challenges that altered the way agile processes would be implemented, but the trick is finding something that works for your unique situation. “We are using pair programming, frequent testing, including user/customer testing, and flexible documentation together in what we have been calling agile-plus,” Mel told me. “Because of our unique qualities (creating an entire suite from scratch, making use of a lean and geographically dispersed staff, and including the customer in the development process), we have modified the agile process accordingly, either because we have needed to or because we have identified strategies that work for us.”

Let us look at the high points of the Agile method individually in the case of MedicFusion:
  • Customer interaction on a daily basis: because MedicFusion has not been released in beta version yet, potential customer interaction is crucial to its design. There is at least one doctor present at the MedicFusion development center every day to answer usability and industry related requirement questions, or offer suggestions to improve the overall function, look, or design of the package as it is being developed. Being able to quickly respond to and anticipate customer needs will ultimately result in a better product.
  • Three to five day release cycle: this has not been enforced strictly yet, as many of the modules and features being developed are still in prototype form. Once the beta version is released, there will undoubtedly be an aggressive release schedule that falls along these lines. The team’s use of PHP-efficiency-boosting tools, such as PEAR modules and reusing their own code base will make this happen.
  • Pair programming: in a perfect world, this would consist of literally two coders working at one machine, each offering input and writing the code together. The theory behind this is that two heads really are better than one and the resulting code is less buggy and better written. Unfortunately, as is the case many times with PHP work, the coders are spread out and in different time zones. However, with tools such as Skype, Instant Messenger(IM), and the good old telephone, the “pair programming” concept can be implemented to a degree. This challenge faces the MedicFusion team, so they have implemented this as much as they possibly can.
  • Test-Driven Development: Ruby on Rails folks love this one. However, with the creation and ever-maturing PEAR:: PHPUnit, PHPers can have just as much fun automating their tests. MedicFusion plans on implementing this to some degree, but for now is sticking with end user and customer testing.
  • Communication with everybody on everything: when you go into the MedicFusion office, you see the entire staff in two rooms. All the desks are facing each other in a circular fashion and the CEO sits next to her Administrative Assistant who sits next to the Project Manager who sits next to the database designer. Yes, they are a very tightly knit group that acts like a family. It may seem to be an odd setup but this is indicative of the open relationship and mutual respect they have fostered in the environment. No one has to fear if there is a problem, because the whole team is in it together. Likewise if clarification is needed, there is no lag time between when an e-mail is sent or a phone call returned. You simply peer across the desk in front of you and ask the person directly.
  • It is okay to throw code away: because the software is still being developed, and prototypes are being created, code gets thrown away all the time. They know what works, and what does not.
  • Mutual respect for each other: this is fostered from the top level down, and is absolutely the cornerstone of the process.


Conclusion
I think the moral of the story is “why should Rails guys have all the fun?” PHP itself is flexible and functional enough to withstand aggressive coding deadlines. Tools such as PHPUnit make automated testing possible and easy to implement. The rest is up to the ability of the coding team and management to think outside the box and make a bold change for the good of the project (and the well-being of everyone involved.)


About the Author

Elizabeth Naramore has been working in web development since 1997, and PHP specifically since 2002. Although her main focus is in e-commerce, she has also co-authored several PHP related titles. Besides web development, Elizabeth also teaches e-commerce and writes a weekly PHP news column for PHPBuilder. com. She also enjoys being an active part of the mighty OINKPUG (Ohio, Indiana, Northern Kentucky PHP Users Group). She lives in Cincinnati, Ohio, with her husband and two children.


   Related Links
medicfusion
Manifesto for Agile Software Development
PEAR::PHPUnit
Agile Alliance
Martin Fowler’s “The New Methodology”
ONLamp’s “Testing PHP Code with PHPUnit”


Comment

Name:

Comment:

Captcha Verification !
captcha_image