import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url: '/api/patients',
    method: 'get',
    params: params
  })
}

export function getSchedualPatient(params) {
  return request({
    url: '/api/dialysis/patients',
    method: 'get',
    params: params
  })
}

export function PatientInfo(params) {
  return request({
    url: '/api/dialysis/info',
    method: 'get',
    params: params
  })
}

export function doctorAndNurseList(params) {
  return request({
    url: '/api/alldoctors',
    method: 'get',
    params: params
  })
}

export function commitDailysisRecord(params) {
  return request({
    url: '/api/dialysis/record',
    method: 'post',
    params: params
  })
}

export function getGobelInfo(params) {
  return request({
    url: '/api/dialysis/golbal',
    method: 'post',
    params: params
  })
}

export function CreateDoctorAdvice(id, dialysisId, record_date, params) {
  return request({
    url: '/api/dialysis/advice/create?id=' + id + '&dialysis_id=' + dialysisId + '&record_date=' + record_date,
    method: 'post',
    data: params
  })
}

export function getDoctorAdviceById(params) {
  return request({
    url: '/api/dialysis/advice/get',
    method: 'get',
    params: params
  })
}

export function editDoctorAdviceById(params) {
  return request({
    url: '/api/dialysis/advice/edit',
    method: 'put',
    params: params
  })
}

export function CreateMonitor(params) {
  return request({
    url: '/api/dialysis/monitor/create',
    method: 'post',
    params: params
  })
}

export function DelMonitor(params) {
  return request({
    url: '/api/dialysis/monitor/del',
    method: 'post',
    params: params
  })
}

export function GetAllZone(params) {
  return request({
    url: '/api/dialysis/zone',
    method: 'get',
    params: params
  })
}

export function PostStartRecordInfo(params) {
  return request({
    url: '/api/dialysis/start',
    method: 'post',
    params: params
  })
}

export function GetGlobalInfo(params) {
  return request({
    url: '/api/dialysis/device',
    method: 'get',
    params: params
  })
}

export function GetDeviceInfo(params) {
  return request({
    url: '/api/dialysis/device',
    method: 'get',
    params: params
  })
}

export function commitDailysisSolution(params) {
  return request({
    url: '/api/dialysis/global',
    method: 'get',
    params: params
  })
}

export function delMonitor(params) {
  return request({
    url: '/api/dialysis/monitor/del',
    method: 'post',
    params: params
  })
}

export function getDialysisRecord(params) {
  return request({
    url: '/api/dialysis/dialysisorder',
    method: 'Get',
    params: params
  })
}

export function postPrescription(params) {
  console.log('params', params)
  return request({
    url: '/api/dialysis/prescription',
    method: 'Post',
    params: params,
    headers: {
      'Permission': 2
    }
  })
}

export function postSoulution(params) {
  return request({
    url: '/api/dialysis/soulution',
    method: 'Post',
    params: params,
    headers: {
      'Permission': 2
    }

  })
}

export function postDoubleCheck(params) {
  return request({
    url: '/api/dialysis/dobule',
    method: 'Post',
    params: params,
    headers: {
      'Permission': 2
    }

  })
}

export function postAccepts(params) {
  console.log('params', params)
  return request({
    url: '/api/dialysis/accepts',
    method: 'Post',
    params: params,
    headers: {
      'Permission': 2
    }

  })
}

export function postAssessmentBeforeDislysis(params) {
  console.log('params', params)
  return request({
    url: '/api/dialysis/assessmentbeforedislysis',
    method: 'Post',
    params: params,
    headers: {
      'Permission': 2
    }

  })
}

export function postTreatmentsummary(params) {
  return request({
    url: '/api/dialysis/treatmentsummary',
    method: 'Post',
    params: params,
    headers: {
      'Permission': 2
    }

  })
}

export function postAssessmentAfterDislysis(params, data) {
  return request({
    url: '/api/dialysis/assessmentafterdislysis',
    method: 'Post',
    params: params,
    data: data,
    headers: {
      'Permission': 2
    }

  })
}

export function postDelMonitorInfo(params) {
  return request({
    url: '/api/dialysis/monitor/del',
    method: 'Post',
    params: params,
    data: data
  })
}

export function CreateGroupAdvice(id, groupno, advices) {
 
  return request({
    url: '/api/advice_remind/create?id=' + id + '&groupno=' + groupno,
    method: 'post',
    data: advices,
    headers: {
      'Permission': 2
    }

  })
}

export function GetSolution(params) {
  return request({
    url: '/api/solution/get',
    method: 'get',
    params: params
  })
}

export function CreateDryWeight(params) {
  return request({
    url: '/api/dryweight/commit',
    method: 'post',
    params: params,
    headers: {
      'Permission': 2
    }

  })
}

export function GetDialysisgoods(params) {
  return request({
    url: '/api/dialysisgoods/get',
    method: 'get',
    params: params

  })
}

export function GetDialysisGoodStatistics(params) {
  return request({
    url: '/api/goodstatistics/get',
    method: 'get',
    params: params

  })
}


