Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Designed a simpe useful display of a detailed appointment result and …
…fixed some compatibility issues
  • Loading branch information
k-joseph committed Jul 5, 2015
1 parent 868e21c commit 8d985cb
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 45 deletions.
17 changes: 14 additions & 3 deletions omod/src/main/webapp/fragments/topArea.gsp
Expand Up @@ -273,7 +273,7 @@
if (typeof single_obsJSON !== 'undefined') {
if(key.keyCode == 39) {// =>>
var diffBtnIndecs = navigationIndex - peviousIndex;
var numberOfResults = jsonAfterParse.obs_groups.length + jsonAfterParse.obs_singles.length + jsonAfterParse.patientAllergies.length;
var numberOfResults = jsonAfterParse.obs_groups.length + jsonAfterParse.obs_singles.length + jsonAfterParse.patientAllergies.length + jsonAfterParse.patientAppointments.length;
if(wasGoingNext) {
if(navigationIndex != numberOfResults) {
Expand Down Expand Up @@ -312,9 +312,10 @@
}
});
function increamentNavigation(single_obsJSON) {
function increamentNavigation(single_obsJSON) {//TODO logic may not work for some instances
var obs = single_obsJSON[navigationIndex];
var allergy = jsonAfterParse.patientAllergies[navigationIndex - (jsonAfterParse.obs_groups.length + jsonAfterParse.obs_singles.length)];
var appointment = jsonAfterParse.patientAppointments[navigationIndex - (jsonAfterParse.obs_groups.length + jsonAfterParse.obs_singles.length + jsonAfterParse.patientAllergies.length)];
peviousIndex = navigationIndex;
navigationIndex++;
Expand All @@ -323,12 +324,15 @@
focusOnNextObsAndDisplayItsDetails(obs.observation_id);
} else if(allergy && allergy.allergenId > 0) {
focusOnNextAllergenAndDisplayItsDetails(allergy.allergenId);
} else if(appointment && appointment.id > 0) {
focusOnNextAppointmentAndDisplayItsDetails(appointment.id)
}
}
function decreamentNavigation(single_obsJSON) {
function decreamentNavigation(single_obsJSON) {//TODO logic may not work for some instances
var obs = single_obsJSON[navigationIndex];
var allergy = jsonAfterParse.patientAllergies[navigationIndex - (jsonAfterParse.obs_groups.length + jsonAfterParse.obs_singles.length)];
var appointment = jsonAfterParse.patientAppointments[navigationIndex - (jsonAfterParse.obs_groups.length + jsonAfterParse.obs_singles.length + jsonAfterParse.patientAllergies.length)];
peviousIndex = navigationIndex;
navigationIndex--;
Expand All @@ -338,6 +342,8 @@
focusOnNextObsAndDisplayItsDetails(obs.observation_id);
} else if(allergy && allergy.allergenId > 0) {
focusOnNextAllergenAndDisplayItsDetails(allergy.allergenId);
} else if(appointment && appointment.id > 0) {
focusOnNextAppointmentAndDisplayItsDetails(appointment.id)
}
}
Expand All @@ -351,6 +357,11 @@
load_allergen(allergenId);
}
function focusOnNextAppointmentAndDisplayItsDetails(appId) {
jq('#appointment_' + appId).focus();
load_appointment(appId);
}
function hideSearchSuggestions() {
jq("#chart-searches-suggestions").hide();
}
Expand Down

0 comments on commit 8d985cb

Please sign in to comment.