-
Notifications
You must be signed in to change notification settings - Fork 3
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
Process treatment_orders with a NULL enddate #1197
Process treatment_orders with a NULL enddate #1197
Conversation
ERROR: A pull request from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code meets the objective and is written as was discussed
We received feedback that the first commit didn't fully fix the issue. The printed report Clinical Medications failed to produce the desired results for treatment orders having no end date when the report's date was in the future. I reviewed This latest commit modifies only |
@bbimber please take a look at this pull request. I've determined that allowing treatment orders to have NULL end dates breaks the two queries currently in the pull request. I believe these two proposed changes won't impact the rest of PRIMe, but I'd like your feedback. It might make more sense to require end dates for all treatment orders to avoid this issue. Should you agree that these changes are fine, I propose making similar changes to the other Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor comment, but i think this will work. I'm approving since the suggestion isnt required for the code to work
Adopt Ben Bimber's suggestion to modify both enddate comparisons to the same solution and use the one that is transparent about the problem being solved.
…eatmentNullEnddate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed changes with Brent and this is ready for production
Rationale
Treatment orders with NULL end dates can be entered into PRIMe.
study.treatmentSchedule.sql
queriesstudy.treatment_orders
over a time range defined by "dependee" queryehr_looksup.dateRange
. It doesn't return results of treatment orders where:enddate
is NULL, orenddate
is NULL AND adateRange
date is in the future.study.treatmentSchedule.sql
is used by printable report Clinical Medications and in the EHR animal history, Daily Reports > Clinical Medications Schedule. The animal history reports run for today's date (setting the start date of "dependee" queryehr_looksup.dateRange
to today's date with a length of one). The printable report can be run for user-selected dates, including future dates and date ranges greater than one.study.treatmentScheduleUpdate
is used for the TreatmentToDrug ETL, using today's date and range of 1 for thedateRange
.Related Pull Requests
#1111
Changes
dr.dateOnly
(all dates within dateRange) must be <= the treatment order's end date (if it exists).date
beforeenddate
now returns TRUE ifenddate
isNULL
.