Esempio n. 1
0
def diagnosefileUpload(filetype):
    userId = session.get('userId')
    diagnoseId = request.args.get('diagnoseId')
    diagnose = Diagnose.getDiagnoseById(diagnoseId)
    if diagnose and userId:
        userId = string.atoi(userId)
        if diagnose.uploadUserId == userId:
            File.deleteFileByPathologyId(diagnose.pathologyId, filetype)
Esempio n. 2
0
def disableFile():
    try:
        disgnoseId = request.form.get('diagnoseId')
        type = request.form.get('type')
        if disgnoseId is None:
            disgnoseId = string.atoi(disgnoseId)
        if type is None:
            type = constant.FileType.Dicom
        else:
            type = string.atoi(type)
        diagnose = Diagnose.getDiagnoseById(disgnoseId)
        if diagnose and diagnose.pathologyId:
            pathologyId = diagnose.pathologyId
            result = File.deleteFileByPathologyId(pathologyId, type)
            if result > 0:
                diagnose.ossUploaded = constant.DiagnoseUploaed.NoUploaded
                Diagnose.save(diagnose)
                return jsonify(rs.SUCCESS.__dict__, ensure_ascii=False)
        return jsonify(rs.FAILURE.__dict__, ensure_ascii=False)

    except Exception, e:
        LOG.error(e.message)
        return redirect(ERROR_URL)