One of quality control measues in software development is the ability to produce reports that are of importance to the users of the system themselves.
The reports ought to be produced at the expected time and should also be tailored to meet the required format so that decisions should be made at the right time.
The above requirements have particularly been impressed upon me with the fact that i had to produce reports for the hospital pharmacy that the organization that i work for provides software to. The ordeal seemed fine on specification(they all seem so!), but when i dived into the actual production of the reports, i realized that huge join queries had to be used in order to generate them.
The application had been developed in VB 6.0, and at this point i was mainly proficient in VB 6.0. I wrote the algorithm of retrieving the data in my mind, but the idea of big queries, and opening and closing connections, kind of put me of writing an application to appropriately produce reports once and for all. I thought that, well, somehow i will produce the queries manually and the rest will take care of itself!
Meanwhile my colleagues had been experimenting with some web technolgies and had talked of ruby on rails. What, are these people all talking about. They are talking of monday languages, come tuesday, they are fading!
However my colleagues, went ahead to implement searches with rails ajax hooks such as observe_field, and produced dynamic searches in no time. "I can do that in VB 6.0 ", i said to myself amid sighs of "cool!,cool!".
So i did my queries, manually and exported them to excel, as i usually did. They did not however fulfill the required format, and they also reached the rightful stakeholders at the wrong time.Something like 2 days later.(Which was bad, considering that some of the data was required for drug forecasting at the pharmacy).
Well i became frustrated. The next day, i did. I had to regenerate some of the queries and add make some corrections. Now there is nothing so bad to be told that your work is not good enough, in a polite way of "can you look at this figure, it shows 10,000, but we only had 400, this month". And this is repeated 10 times.
Okay. Let me try something new. Let me really see how flexible this ruby thing is, so i jumped in with my colleagues did, the hello world legendary program. It worked and this brought gratification.One of my colleagues was a propeller head at web programming languages. He got ruby's message quick and led us into the unknown.......We wrote the base code for the application figured out the aciverecord querying style.
I was immediately impressed at how i could shrink gigantic queries like this :
SELECT epics_drugs.item_code,epics_drugs.description,sum(epics_dispensations.dispensed_quantity) FROM epics_drugs,epics_dispensations,epics_orders,epics_lots WHERE epics_drugs.id=epics_lots.id_epics_drug and epics_lots.id=epics_dispensations.id_epics_lot and epics_orders.id=epics_dispensations.id_epics_order and (epics_orders.date_created >=”2006-07-01 and epics_orders.date_created <=”2006-07-30”)
Into:
@consumptionTotal[drug] += dispensation.quantity_dispensed if dispensation.order.date_created.between?(begin_date,end_date)
Now this was fantastic! Referential integrity was being used in rails and there was no need for me to respecify this. Don't you folks like it when you don't have to say the same thing twice?
A second thing that store my heart were helpers such as the time helpers that allowed me to do logic like:
if order.date_created > 3.months_ago
end
In short coming from a visual basic 6.0 background, the economy and flexibility of ruby code has kept me with it up to now. Currently, i am developing a medical records system for Anti-Retroviral Therapy patients at Baobab Health Partnership, with my colleagues.
Amazed with rails' productivity i shared this exciting technology at a Linux Chix conference right here in Malawi Africa. I will talk about this in my later posts.
Now Rails makes my days.
Friday, January 05, 2007
Subscribe to:
Posts (Atom)
Efficient markets may determine self-sufficiency at the micro level for farmers
Watching dedication of farmers and their enthusiasm as they tend their gardens in various parts of the country, refreshes my mind as the p...
-
The Electricity Supply Corporation of Malawi proudly proclaimed that it provides power everyday all day long in its vision statement which i...
-
In an earlier post, well now almost 10 years ago, I laboured with the idea of alternative power faced with the power failures in Malawi due ...
-
Watching dedication of farmers and their enthusiasm as they tend their gardens in various parts of the country, refreshes my mind as the p...