def recalculate_dots_data(case_id, cc_user, sync_token=None): """ Recalculate the dots data and resubmit calling the pact api for dot recompute """ from pact.models import PactPatientCase from pact.api import recompute_dots_casedata if DOT_RECOMPUTE: try: casedoc = PactPatientCase.get(case_id) recompute_dots_casedata(casedoc, cc_user, sync_token=sync_token) except Exception, ex: tb = traceback.format_exc() notify_exception(None, message="PACT error recomputing DOTS case block: %s\n%s" % (ex, tb))