in lambda/src/medication_diary_bot.py [0:0]
def no_med(intent_request):
session_attributes = helper.get_attribute(intent_request, 'sessionAttributes')
user = helper.lookup_user(session_attributes)
current_time = get_current_time_for_user(user)
if user.caretaker_num:
logger.info(f'Will send notification to care taker: {user.caretaker_num}')
time_str = format_only_time_to_str(current_time)
msg = CARETAKER_MED_MISSING_MESSAGE.format(user.uid, time_str)
send_sms(user.caretaker_num, msg)
else:
logger.info('No caretaker to notify.')
med_diary.log_med(user.uid, time_reported=current_time, med_taken=False)
update_survey_completion(user.uid, current_time, BOT_MEDICATION_NAME)
session_attributes['NextBot'] = get_next_survey_bot(user.uid, current_time)
return helper.close(session_attributes, helper.FulfillmentState.FULFILLED,
message_content=msg_strings.get('DID_NOT_TAKE_MED'))