
(function(){
    var apis = {
        getPatientInfo: function(data){
            return APIService.httpGet("/doctor/patient/info", {data: data});
        },
        getDictByDictName: function(){
            return APIService.httpGet("/common/getDictByDictName", {
                data: {
                    name: 'FOLLOWUP_MANAGER_STATUS'
                }
            })
        },
        //获取随访内容
        getFollowup: function(data){
            return APIService.httpGet("/doctor/followup/getFollowup", {data: data});
        },
        //开始随访计划
        startFollowup: function(data){
            return APIService.httpPost("/doctor/followup/startFollowup", {data: data});
        },
        //新增临时随访
        addFollowup: function(data){
            return APIService.httpPost("/doctor/followup/addFollowup", {data: data});
        },
        //获得随访个项目数据
        getFollowupProjectData: function(data){
            return APIService.httpGet("/doctor/followup/getFollowupProjectData", {data: data});
        },
        //获得历史记录的数据
        getHealthIndexHistory: function(data){
            return APIService.httpGet("/doctor/health_index/getHealthIndexHistory", {data: data});
        },
        //获得历史记录的表格参数
        getHistoryTableObj:{
            url: APIService.server+ '/doctor/health_index/getHealthIndexHistory',
            datatype: 'json',
            mtype: 'get',
            ajaxGridOptions:{
                beforeSend: function(request) {
                    request.setRequestHeader("userAgent", JSON.stringify(APIService.userAgent));
                },
                complete: function(xhr, ts) {
                    console.log(xhr);
                    console.log(ts);
                    APIService.failCodeHandle(xhr.responseJSON)
////                  resolve(res)
//                  return res;
                }
            }
        },
        //保存填写的表单数据
        saveFollowupProjectData: function(data){
            return APIService.httpPost("/doctor/followup/saveFollowupProjectData", {data: data});
        },
        //获取随访用药记录的数据
        getFollowupDrugs: function(data){
            return APIService.httpGet("doctor/followup/drugs/getFollowupDrugs", {data: data});
        },
        //获取处方记录
        getPrescriptionList: function(data){
            return APIService.httpGet("doctor/prescriptionInfo/getPrescriptionInfos", {data: data});
        },
        getPrescriptionListTableAjaxObj: { //表格数据获取时，使用的ajax请求配置
            method: 'get',
            url: APIService.server + 'doctor/prescriptionInfo/getRecipeMasterList', 
            contentType: "application/json",
            dataType: "json",
            ajaxOptions: {
                beforeSend: function(request) {
                    var userAgent = APIService.userAgent;
                    userAgent = JSON.stringify(userAgent);
                    request.setRequestHeader("userAgent", userAgent);
                }
            }
        },
        //获取用药频率
        getRateList:function() {
            return APIService.httpGet('doctor/prescriptionInfo/getRateList');
        },
        //保存随访用药情况
        saveFollowupDrugs: function(data){
            return APIService.httpPost('doctor/followup/drugs/saveFollowupDrugs', {data: data});
        }
        
    };

    window.followupAPI = apis;
})(jQuery)