def allowed_to_forward(self, episode_case): allowed_case_types_and_users = self._allowed_case_type(episode_case) and self._allowed_user(episode_case) episode_case_properties = episode_case.dynamic_case_properties() return allowed_case_types_and_users and ( not episode_case_properties.get('nikshay_registered', 'false') == 'true' and not episode_case_properties.get('nikshay_id', False) and case_properties_changed(episode_case, [TREATMENT_OUTCOME]) and episode_case_properties.get(TREATMENT_OUTCOME) in treatment_outcome.keys() )
def allowed_to_forward(self, episode_case): allowed_case_types_and_users = self._allowed_case_type( episode_case) and self._allowed_user(episode_case) if not allowed_case_types_and_users: return False episode_case_properties = episode_case.dynamic_case_properties() return (episode_case_properties.get('nikshay_id', False) and case_properties_changed(episode_case, [TREATMENT_OUTCOME]) and episode_case_properties.get(TREATMENT_OUTCOME) in treatment_outcome.keys() and is_valid_archived_submission(episode_case))
def allowed_to_forward(self, episode_case): allowed_case_types_and_users = self._allowed_case_type(episode_case) and self._allowed_user(episode_case) if not allowed_case_types_and_users: return False episode_case_properties = episode_case.dynamic_case_properties() return ( not (episode_case_properties.get(ENROLLED_IN_PRIVATE) == 'true') and ( # has a nikshay id already or is a valid submission probably waiting notification episode_case_properties.get('nikshay_id') or valid_nikshay_patient_registration(episode_case_properties) ) and case_properties_changed(episode_case, [TREATMENT_OUTCOME]) and episode_case_properties.get(TREATMENT_OUTCOME) in treatment_outcome.keys() and is_valid_archived_submission(episode_case) )