Example #1
0
def getPatientFile(patientId):
    userId = None
    if session.has_key('userId'):
        userId = session['userId']
    if userId is None:
        return redirect(LOGIN_URL)

    if patientId is None or patientId < 0:
        return jsonify(FAILURE)
    patient = Patient.get_patient_by_id(patientId)
    if patient is None or patient.userID != string.atoi(userId):
        return jsonify(FAILURE)

    pathologs = Pathology.getByPatientId(patientId)
    files = []
    if pathologs and len(pathologs) > 0:
        for patholog in pathologs:
            files.extend(File.getFilebypathologyId(patholog.id),
                         constant.FileType.FileAboutDiagnose)
    fileResults = None
    if len(files) > 0:
        fileResults = dataChangeService.getFilesResult(files)
    resultStatus = rs.ResultStatus(rs.SUCCESS.status, rs.SUCCESS.msg,
                                   fileResults)
    return jsonify(resultStatus.__dict__)
Example #2
0
def pathlogy_list():
    if 'patientId' in request.args.keys():
        patientId = request.args['patientId']
        pathlogys = Pathology.getByPatientId(patientId)
        if pathlogys is None or len(pathlogys) < 1:
            return jsonify(rs.SUCCESS.__dict__, ensure_ascii=False)
        pathlogysDict = dataChangeService.get_pathology_list(pathlogys)
        resultStatus = rs.ResultStatus(rs.SUCCESS.status, rs.SUCCESS.msg, pathlogysDict)
        return jsonify(resultStatus.__dict__, ensure_ascii=False)
    return jsonify(SUCCESS.__dict__)
Example #3
0
def pathlogy_list():
    if 'patientId' in request.args.keys():
        patientId = request.args['patientId']
        pathlogys = Pathology.getByPatientId(patientId)
        if pathlogys is None or len(pathlogys) < 1:
            return jsonify(rs.SUCCESS.__dict__, ensure_ascii=False)
        pathlogysDict = dataChangeService.get_pathology_list(pathlogys)
        resultStatus = rs.ResultStatus(rs.SUCCESS.status, rs.SUCCESS.msg,
                                       pathlogysDict)
        return jsonify(resultStatus.__dict__, ensure_ascii=False)
    return jsonify(SUCCESS.__dict__)
Example #4
0
def getPatientFile(patientId):
    userId=None
    if session.has_key('userId'):
        userId=session['userId']
    if userId is None:
        redirect(LOGIN_URL)

    if patientId is None or patientId<0 :
        return  jsonify(FAILURE)
    patient=Patient.get_patient_by_id(patientId)
    if patient is None or patient.userID!=string.atoi(userId):
        return  jsonify(FAILURE)

    pathologs=Pathology.getByPatientId(patientId)
    files=[]
    if pathologs and len(pathologs)>0:
       for patholog in pathologs:
           files.extend(File.getFilebypathologyId(patholog.id),constant.FileType.FileAboutDiagnose)
    fileResults=None
    if len(files)>0:
        fileResults=dataChangeService.getFilesResult(files)
    resultStatus = rs.ResultStatus(rs.SUCCESS.status, rs.SUCCESS.msg, fileResults)
    return jsonify(resultStatus.__dict__)