Last active
September 1, 2021 15:10
-
-
Save fredkingham/7b29f6af4faf0089df0bfcc81568a703 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| from odonto.episode_categories import FP17OEpisode, FP17Episode | |
| SEND_ALL_AFTER_DATE = datetime.date(2020, 4, 1) | |
| def get_rejections(): | |
| rejected_fp17s = FP17Episode.get_rejected_episodes() | |
| rejected_fp17s = [ | |
| i for i in rejected_fp17s if i.category.get_sign_off_date() > SEND_ALL_AFTER_DATE | |
| ] | |
| rejected_fp17os = FP17OEpisode.get_rejected_episodes() | |
| rejected_fp17os = [ | |
| i for i in rejected_fp17os if i.category.get_sign_off_date() > SEND_ALL_AFTER_DATE | |
| ] | |
| rejected = sorted( | |
| rejected_fp17s + rejected_fp17os, | |
| key=lambda x: x.category.get_sign_off_date(), | |
| reverse=True | |
| ) | |
| result = [] | |
| for reject in rejected: | |
| result.append((reject, reject.patient.demographics().name, reject.category.get_submit_link(), reject.category.submission().rejection, reject.category.get_sign_off_date(),)) | |
| return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment