当前位置: 首页>>代码示例>>Python>>正文


Python Diagnose.update方法代码示例

本文整理汇总了Python中DoctorSpring.models.Diagnose.update方法的典型用法代码示例。如果您正苦于以下问题:Python Diagnose.update方法的具体用法?Python Diagnose.update怎么用?Python Diagnose.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DoctorSpring.models.Diagnose的用法示例。


在下文中一共展示了Diagnose.update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: dicomfileUpload

# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import update [as 别名]
def dicomfileUpload():
    userId=session.get('userId')
    if userId is None:
        return redirect(LOGIN_URL)
    userId=string.atoi(userId)
    type=request.form.get('type')
    diagnoseId=request.form.get("diagnoseId")
    if diagnoseId is None:
        return jsonify({'code': 1,  'message' : "error", 'data': ''})
    diagnoseId=string.atoi(diagnoseId)
    if type:
        type=string.atoi(type)
    else:
        type=constant.FileType.Dicom
    try:
        diagnose=Diagnose.getDiagnoseById(diagnoseId)
        if diagnose and diagnose.pathologyId:
            file_infos = []
            files = request.files
            for key, file in files.iteritems():
                if file and allowed_file(file.filename):
                    filename = file.filename
                    # file_url = oss_util.uploadFile(diagnoseId, filename)
                    from DoctorSpring.util.oss_util import uploadFileFromFileStorage
                    fileurl = uploadFileFromFileStorage(diagnoseId, filename, file,'',{})


                    new_file = File(FileType.Dicom, filename, '11', fileurl,diagnose.pathologyId)
                    File.save(new_file)

                    if  type==FileType.Dicom:
                        filesAboutDiagnose=File.getFiles(diagnose.pathologyId,FileType.FileAboutDiagnose)
                        if filesAboutDiagnose and len(filesAboutDiagnose)>0:
                            diagnoseChange=Diagnose()
                            diagnoseChange.id=diagnoseId
                            diagnoseChange.ossUploaded=constant.DiagnoseUploaed.Uploaded
                            diagnose.uploadUserId=userId
                            Diagnose.update(diagnoseChange)
                    if type==FileType.FileAboutDiagnose:
                        filesAboutDiagnose=File.getFiles(diagnose.pathologyId,FileType.Dicom)
                        if filesAboutDiagnose and len(filesAboutDiagnose)>0:
                            diagnoseChange=Diagnose()
                            diagnoseChange.id=diagnoseId
                            diagnoseChange.ossUploaded=constant.DiagnoseUploaed.Uploaded
                            diagnose.uploadUserId=userId
                            Diagnose.update(diagnoseChange)


                    file_infos.append(dict(id=new_file.id,
                                           name=filename,
                                           size=11,
                                           url=fileurl))
                else:
                    return jsonify({'code': 1,  'message' : "error", 'data': ''})
            return jsonify(files=file_infos)
    except Exception,e:
        print e.message
        return jsonify({'code': 1,  'message' : "error", 'data': ''})
开发者ID:LichuanLu,项目名称:blueberry,代码行数:60,代码来源:front.py

示例2: rollbackDiagnose

# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import update [as 别名]
def rollbackDiagnose(diagnoseId):
    userId=session['userId']
    if userId is None:
        return json.dumps(rs.NO_LOGIN.__dict__,ensure_ascii=False)
    userId=string.atoi(userId)

    status=request.form.get('status')
    comments=request.form.get('comments')
    if status:
        status=string.atoi(status)
    diagnose=Diagnose.getDiagnoseById(diagnoseId)
    if diagnose is None:
        return  json.dumps(rs.NO_DATA.__dict__,ensure_ascii=False)
    if (hasattr(diagnose,'adminId') and diagnose.adminId and  diagnose.adminId==userId) or (hasattr(diagnose,'doctorId') and diagnose.doctorId and  diagnose.doctor.userId == userId):
        if status is None:
            status=constant.DiagnoseStatus.Draft
        diagnose.status=status
        Diagnose.save(diagnose)

        diagoseLog=DiagnoseLog(userId,diagnoseId,constant.DiagnoseLogAction.DiagnoseNeedUpateAction)
        diagoseLog.description=comments
        DiagnoseLog.save(db_session,diagoseLog)

        if hasattr(diagnose,'patient') and diagnose.patient.userID:
            content=dataChangeService.getPatienDiagnoseMessageContent(diagnose)

            #诊断通知
            message=Message(constant.DefaultSystemAdminUserId,diagnose.patient.userID,'诊断通知',content,constant.MessageType.Diagnose)
            Message.save(message)

        if(hasattr(diagnose,'doctorId') and diagnose.doctorId and  diagnose.doctor.userId == userId):
            reportDiagnoseRelations = ReportDiagnoseRelation.getReportsByDiagnoseId(diagnose.id)
            for reportDiagnoseRelation in reportDiagnoseRelations:
                if reportDiagnoseRelation.report.status != constant.ReportStatus.Del:
                    if reportDiagnoseRelation.report.type == constant.ReportType.Doctor:
                        print 'doctor report'
                        #delete doctor report if exist
                        # reportDiagnoseRelation.report.status = constant.ModelStatus.Del
                        Report.update(reportDiagnoseRelation.report.id,status=constant.ReportStatus.Del)
                        ReportDiagnoseRelation.update(reportDiagnoseRelation.id,status=constant.ModelStatus.Del)
                    elif reportDiagnoseRelation.report.type == constant.ReportType.Admin:
                        print 'admin report'
                        #set diagnose report to admin report

                        diagnose.reportId = reportDiagnoseRelation.report.id
                        Diagnose.update(diagnose)





        return  json.dumps(rs.SUCCESS.__dict__,ensure_ascii=False)
    else:
        return  json.dumps(rs.PERMISSION_DENY.__dict__,ensure_ascii=False)
开发者ID:LichuanLu,项目名称:redberry,代码行数:56,代码来源:diagnose.py

示例3: changeDiagnoseToNeedPay

# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import update [as 别名]
def changeDiagnoseToNeedPay(diagnoseId):
    try:
        loginUserId=session.get('userId')
        if loginUserId is None:
            return

        fileIds = request.form.getlist('fileIds')

        loginUserId=string.atoi(loginUserId)
        diagnose=Diagnose.getDiagnoseById(diagnoseId)
        if diagnose is None or (not hasattr(diagnose,"patient")) or  diagnose.patient is None:
            return
        userID=diagnose.patient.userID
        if userID==loginUserId or diagnose.uploadUserId==loginUserId:
            # diagnose=Diagnose()
            # diagnose.id=diagnoseId
            #update by lichuan
            # diagnose.status= constant.DiagnoseStatus.NeedPay
            # Diagnose.update(diagnose)
            from DoctorSpring.views.front import sendAllMessage,checkFilesExisting
            from DoctorSpring.models.diagnoseDocument import File
            if(checkFilesExisting(diagnose)):
                # newDiagnose= Diagnose()
                # newDiagnose.id=diagnoseId
                if diagnose.status == constant.DiagnoseStatus.NeedUpdate:
                    new_diagnoselog = DiagnoseLog(diagnose.uploadUserId, diagnose.id, DiagnoseLogAction.DiagnoseNeedUpateRecommitAction)
                    DiagnoseLog.save(db_session, new_diagnoselog)
                    diagnose.status = constant.DiagnoseStatus.Triaging
                    Diagnose.update(diagnose)
                    pathologyId = diagnose.pathologyId
                    File.cleanAllDirtyFile(fileIds, pathologyId)
                else:
                    diagnose.status = constant.DiagnoseStatus.NeedPay
                    Diagnose.update(diagnose)
                    #清除以前的无用文件
                    pathologyId = diagnose.pathologyId
                    File.cleanAllDirtyFile(fileIds, pathologyId)
                    sendAllMessage(userID,diagnose)


            else:
                return json.dumps(rs.FAILURE.__dict__,"需要上传DICOM文件和诊断文件")

            #end update

    except Exception,e:
        LOG.error(e.message)
        return json.dumps(rs.FAILURE.__dict__,ensure_ascii=False)
开发者ID:LichuanLu,项目名称:redberry,代码行数:50,代码来源:diagnose.py

示例4: changeDiagnoseStatus

# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import update [as 别名]
def changeDiagnoseStatus(diagnoseId):
    try:
        status=request.args.get('status')
        loginUserId=session.get('userId')
        if loginUserId is None:
            return
        if status is None:
            return json.dumps(rs.PARAM_ERROR.__dict__,ensure_ascii=False)
        status=string.atoi(status)
        loginUserId=string.atoi(loginUserId)
        diagnose=Diagnose.getDiagnoseById(diagnoseId)
        if diagnose is None or (not hasattr(diagnose,"patient")) or  diagnose.patient is None:
            return
        userID=diagnose.patient.userID
        if userID==loginUserId or diagnose.uploadUserId==loginUserId:
            diagnose=Diagnose()
            diagnose.id=diagnoseId
            diagnose.status= status
            Diagnose.update(diagnose)
    except Exception,e:
        LOG.error(e.message)
        return json.dumps(rs.FAILURE.__dict__,ensure_ascii=False)
开发者ID:LichuanLu,项目名称:redberry,代码行数:24,代码来源:diagnose.py

示例5: changeNeedCallStatusBySupportStaff

# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import update [as 别名]
def changeNeedCallStatusBySupportStaff(diagnoseId):
   diagnose=Diagnose()
   diagnose.id=diagnoseId
   diagnose.supportStaffCall=constant.DiagnoseSupportStaffCallStatus.Call
   Diagnose.update(diagnose)
   return  json.dumps(rs.SUCCESS.__dict__,ensure_ascii=False)
开发者ID:LichuanLu,项目名称:blueberry,代码行数:8,代码来源:diagnose.py


注:本文中的DoctorSpring.models.Diagnose.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。