import request from '@/utils/request'

export function getAdviceConfig(){
    return request({
        url:'/m/api/getadviceconfigs',
        method:'get',
    })
}

export function CreateDoctorAdvice(id, advice){
    return request({
        url:'/m/api/advice/create?id='+id,
        method:'post',
        data:advice,
    })
}
export function EditDoctorAdvice(id, advice){
    return request({
        url:'/m/api/advice/edit?id='+id,
        method:'put',
        data:advice,
    })
}

export function StopDoctorAdvice(id, advice){
    return request({
        url:'/m/api/advice/stop?id='+id,
        method:'Post',
        data:advice,
    })
}

export function ExecDoctorAdvice(params){
    return request({
        url:'/m/api/advice/exec',
        method:'Post',
        params:params,
    })
}

export function CheckDoctorAdvice(params){
    return request({
        url:'/m/api/advice/check',
        method:'Post',
        params:params,
    })
}

export function DeleteDoctorAdvice(id){
    return request({
        url:'/m/api/advice/delete?id='+id,
        method:'Delete',
    })
}

export function DeleteDoctorAdviceNew(group_no, advice_id) {
    return request({
        url: "/m/api/newadvice/delete",
        method: "Delete",
        params: {
            groupno: group_no,
            advice_id: advice_id,
        }
    })
}

export function getSchedualDoctors(params) {
    return request({
        url: "/m/api/schedule/advices",
        method: "get",
        params: params,
    })
}

export function batchCreateAdvices(patient_id, group_no, data) {
    return request({
        url: "/m/api/advice/creategroup",
        method: "post",
        params: {
            id: patient_id,
            group_no: group_no,
        },
        data: data,
    })
}

export function modifyAdviceGroupStartTime(group_no, start_time_str) {
    return request({
        url: "/m/api/advice/group/modify_starttime",
        method: "post",
        params: {
            group_no: group_no,
            start_time: start_time_str,
        }
    })
}


export function ExecSingleDoctorAdvice(params){
  return request({
    url:'/m/api/advice/exec/single',
    method:'Post',
    params:params,
  })
}

export function DeleteSubDoctorAdvice(params){
  return request({
    url:'/m/api/delete/subadvice?advice_id='+params,
    method:'Delete',
  })
}

