Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed filter function of the Patient List Reports module #1497

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

maggienegm
Copy link
Contributor

Fixes Issue #1496

Before, the Patient List Report module would show the same results no matter the input. Now, the module filters correctly accordingly to input.

For example, now:

  • submitting the form with the default values ("All Providers" and no date range selected) outputs:

no-input-results-fixed

  • submitting the form with a provider selected, but no date range outputs:

w-patient-no-date-selected-fixed

  • submitting the form with a provider and date range outputs:

w-patient-from-and-to-dates-fixed

} else {
$query .= "LEFT OUTER JOIN form_encounter AS e ON " .
"e.pid = p.pid ";
$query .= "LEFT OUTER JOIN libreehr_postcalendar_events AS e ON " .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test this when i can. Can you repopulate back the fields with the search criteria? e.g if you chosed a date it should fill back after the search is done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, and I can do that. I will push those changes when I'm done.

@maggienegm
Copy link
Contributor Author

  1. Previously, the prepareAndShowResults() function would generate an invalid date range if no date range or an incomplete date range was entered. For example, if a user entered the to date as 07-01-2018, the function would have generated 01-01-2019 as the from date, because it generated a date based on the present year the form was submitted. Now, it generates a date based on the input submitted. Unfortunately, this doesn't prevent users from entering an invalid date range. This can be created into an issue report.

  2. The form now shows the date range entered after each submission.
    date-range-now-shows
    Since this function is also used by other reports that have a date range, it will now display correctly in those reports as well. :)

@maggienegm
Copy link
Contributor Author

I have created an issue report regarding the form accepting invalid date ranges: #1499

echo "<td class='label'>";
echo xlt('From');
echo ":
</td>
<td>
<input type='text' name='form_from_date' id='form_from_date' size='10'
value='"; htmlspecialchars(oeFormatShortDate(attr($from_date)));
echo "' />
value='"; echo $from_date;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm something seems not right here ....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I fixed this. I just pushed a change!

"i1.date AS idate1, i2.date AS idate2, " .
"c1.name AS cname1, c2.name AS cname2 " .
"FROM patient_data AS p ";

if (!empty($from_date)) {
$query .= "JOIN form_encounter AS e ON " .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Y did you delete the query? any specific reasons @mhn94, I think it did the Job.

Copy link
Contributor

@KoniKodes KoniKodes Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muarachmann Maggie has applied for the new Outreachy round, so we can't communicate with her until she's officially announced as an applicant on Oct. 1st.

Is there anyway to fix this before then?

Copy link
Contributor Author

@maggienegm maggienegm Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Y did you delete the query? any specific reasons @mhn94, I think it did the Job.

I deleted it because it wasn't displaying the right data when I ran the app on my machine. Most of the time, it wouldn't pull any appointment info when there should have been. Does the original query work for you?

I changed the db to "libreehr_postcalendar_events," because I saw that when new events are created/old events are edited (in /modules/calendar/add_edit_event.php), this db was used. For me, the new query seems to be displaying the correct info.

@muarachmann
Copy link
Member

muarachmann commented Aug 28, 2019 via email

@KoniKodes
Copy link
Contributor

It's more frustrating than anything right now. We can wait until she's back - hope she's accepted!
The Education Assessment forms are more important at the moment, I think.

@KoniKodes
Copy link
Contributor

@muarachmann @Ngai-E Can you check this please?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants