Adds current EWS/BG frequency to mobile pages#97
Merged
DaeronAlagos merged 3 commits intoremove-custom-frequencyfrom Jan 16, 2020
Merged
Adds current EWS/BG frequency to mobile pages#97DaeronAlagos merged 3 commits intoremove-custom-frequencyfrom
DaeronAlagos merged 3 commits intoremove-custom-frequencyfrom
Conversation
added 2 commits
January 16, 2020 12:08
No associated task. Found this in a specific scenario.
[O2345] Adds additional information of the current associated frequency of EWS & Blood Glucose observations to tasks cards (EWS & BG Obs only), patient cards and escalation forms for the respective observation types.
PeterAlabaster
suggested changes
Jan 16, 2020
nh_eobs_mobile/controllers/main.py
Outdated
|
|
||
| for patient in patients: | ||
| if patient.get('frequency'): | ||
| patient['frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format( |
Contributor
There was a problem hiding this comment.
Suggested change
| patient['frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format( | |
| patient['frequency_string'] = self.minutes_to_hours_minutes_string(patient.get('frequency')) | |
| def minutes_to_hours_minutes_string(self, minutes): | |
| return '{:2d} hour(s) {:02d} min(s)'.format(*divmod(minutes, 60)) |
function name is up to you
nh_eobs_mobile/controllers/main.py
Outdated
| *divmod(patient.get('frequency'), 60) | ||
| ) | ||
| if patient.get('bg_frequency'): | ||
| patient['bg_frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format( |
Contributor
There was a problem hiding this comment.
call to function here
nh_eobs_mobile/controllers/main.py
Outdated
| @staticmethod | ||
| def _get_ews_frequency(creator_activity): | ||
| if creator_activity.data_model == 'nh.clinical.patient.observation.ews': | ||
| return '{:2d} hour(s) {:02d} min(s)'.format( |
Contributor
There was a problem hiding this comment.
call to function here
nh_eobs_mobile/controllers/main.py
Outdated
| def _get_bg_frequency(creator_activity): | ||
| if creator_activity.data_model == \ | ||
| 'nh.clinical.patient.observation.blood_glucose': | ||
| return '{:2d} hour(s) {:02d} min(s)'.format( |
Contributor
There was a problem hiding this comment.
call to function here
nh_eobs_mobile/controllers/main.py
Outdated
|
|
||
| for task in tasks: | ||
| if task.get('frequency'): | ||
| task['frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format( |
Contributor
There was a problem hiding this comment.
call to function here
nh_eobs_mobile/controllers/main.py
Outdated
| *divmod(task.get('frequency'), 60) | ||
| ) | ||
| if task.get('bg_frequency'): | ||
| task['bg_frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format( |
Contributor
There was a problem hiding this comment.
call to function here
[O2345] Adds additional information of the current associated frequency of EWS & Blood Glucose observations to tasks cards (EWS & BG Obs only), patient cards and escalation forms for the respective observation types.
PeterAlabaster
approved these changes
Jan 16, 2020
This was referenced Jun 2, 2021
This was referenced Jun 13, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[O2345] Adds additional information of the current associated frequency of EWS & Blood Glucose observations to tasks cards (EWS & BG Obs only), patient cards and escalation forms for the respective observation types.