It's time to make a real contribution to OpenMRS. My team is going to start by resolving a bug. I started the search for the bug by querying JIRA for all bugs that were marked "ready for work". This gave me 174 bugs. So, I began to read through many of them and read the titles of all of them. I found that the majority of the bugs required a deep knowledge of OpenMRS that no one in my team possesses. I only found a handful of bugs which I could understand and seemed doable. Here's the bug that we are currently going with (bug).
The bug seems more like a feature request to me but I could be wrong. The requirement is that when filling out a patient creation form, the user must select a preferred ID for the patient by selecting the corresponding radio button. Well, after about 10 seconds of Googling I found a way to require a radio button to be selected via JavaScript.
function checkRadio (patientForm, preferedRBs) {
var radios = document[patientForm].elements[preferedRBs];
for (var i=0; i <radios.length; i++) {
if (radios[i].checked) {
return true; }
}
return false;
}
function valFrm() {
if (!checkRadio("frm1","OpenMRSIDs"))
alert("You didnt select a preferred ID");
else
alert("You selected an id, good job");
}
The problem with this is that OpenMRS already has a mechanism in place for alerting the user when they leave a required field blank. What we need to do is find the code that handles this. I attempted this for several hours yesterday. I viewed the source of the web page and viewed the java-script for the page. Nothing jumped out at me. The plan for now is to keep searching for how OpenMRS handles this and - if necessary - reach out to the OpenMRS dev team for help. More on this to come...
No comments:
Post a Comment