Skip to content

Adds current EWS/BG frequency to mobile pages#97

Merged
DaeronAlagos merged 3 commits intoremove-custom-frequencyfrom
O2345
Jan 16, 2020
Merged

Adds current EWS/BG frequency to mobile pages#97
DaeronAlagos merged 3 commits intoremove-custom-frequencyfrom
O2345

Conversation

@DaeronAlagos
Copy link
Copy Markdown
Contributor

[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.

James Curtis 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.

for patient in patients:
if patient.get('frequency'):
patient['frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

*divmod(patient.get('frequency'), 60)
)
if patient.get('bg_frequency'):
patient['bg_frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

call to function here

@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(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

call to function here

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(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

call to function here


for task in tasks:
if task.get('frequency'):
task['frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

call to function here

*divmod(task.get('frequency'), 60)
)
if task.get('bg_frequency'):
task['bg_frequency_string'] = '{:2d} hour(s) {:02d} min(s)'.format(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
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.

2 participants