Skip to content
Permalink
Browse files

Added a way of choosing custom date range for time filter

  • Loading branch information
k-joseph committed Jul 9, 2015
1 parent 1d03968 commit 1474c4489a96e2297854fc0900269aff047390dd
@@ -10,6 +10,9 @@
jq('#searchText').focus();
jq("#chart-previous-searches-display").hide();
jq("#custom-date-dialog-content").hide();
jq("#ui-datepicker-start").datepicker();
jq("#ui-datepicker-stop").datepicker();
showHistorySuggestionsOnLoad();
displayBothPersonalAndGlobalNotes();
@@ -266,6 +269,18 @@
}
});
jq("#ui-datepicker-stop").change(function(event) {
var start = jq("#ui-datepicker-start").val();
var stop = jq("#ui-datepicker-stop").val();
var startDate = new Date(start);
var stopDate = new Date(stop);
if(stopDate.setHours(0, 0, 0, 0) > startDate.setHours(0, 0, 0, 0)) {
jq("#submit-custom-date-filter").removeAttr('disabled');
} else {
jq("#submit-custom-date-filter").attr('disabled','disabled');
}
});
});
@@ -748,6 +763,11 @@
<a class="single_filter_option" onclick="filterResultsUsingTime('custom')">Custom</a>
<a class="single_filter_option" onclick="filterResultsUsingTime('anyTime')">Any Time</a>
</div>
<div id="custom-date-dialog-content">
<p>Start: <input type="text" id="ui-datepicker-start"></p><br />
<p>Stop: <input type="text" id="ui-datepicker-stop"></p><br />
<p><input type="button" id="submit-custom-date-filter" value="Submit" disabled /></p>
</div>
</div>
</div>
<div class="dropdown" id="location_dropdown">
@@ -1210,7 +1210,7 @@ function refresh_data(json) {
if (numberOfResults === 0 && json.searchSuggestions.length > 0
&& json.search_phrase === "") {
noResultsMessageNote = "<br /><br /><br /><br /><p style='color:black;'><b>NOTE:</b> If this is the first time you are accessing this patient's chart, <b>Indexing patient data could still be in progress. </b>"
+ "So refresh the page a few moments from now. Otherwise the <b>patient has no data</b> (observations, allergies and appointments) in the Database</p>";
+ "So refresh the page a few moments from now. Otherwise the <b>patient has no data</b> (observations, allergies and appointments) that matches the current search or filter tried</p>";
}

if (noResultsMessageNote !== "") {
@@ -1616,7 +1616,7 @@ function filterResultsUsingTime(selectedPeriod) {
var selectedPeriodText = "Any Time";

if (selectedPeriod === "custom") {// TODO custom implementation

invokeDialog("#custom-date-dialog-content", "Choose Date Range", "245px")
} else {// TODO non custom time
if (selectedPeriod === "anyTime") {
// do nothing
@@ -1687,6 +1687,8 @@ function filterResultsUsingTime(selectedPeriod) {
selectedPeriodText = "Last 3 Months";
} else if (selectedPeriod === "thisYear") {
selectedPeriodText = "This Year";
} else if(selectedPeriod === "custom") {
selectedPeriodText = "Custom";
}
$("#time_anchor").text(selectedPeriodText);
}

0 comments on commit 1474c44

Please sign in to comment.
You can’t perform that action at this time.