import request from '@/utils/request'

export function createPatientDialysisSolution (id, solution) {
  return request({
    url: '/m/api/solution/create?patient=' + id,
    method: 'post',
    data: solution
  })
}
export function EditDialysisSolution (id, solution) {
  return request({
    url: '/m/api/solution/edit?id=' + id,
    method: 'post',
    data: solution
  })
}

// eslint-disable-next-line camelcase
export function EditAssessmentBeforeDislysis (id, assessment_date, before, mode) {
  return request({
    // eslint-disable-next-line camelcase
    url: '/m/api/assessmentbefore/commit?patient=' + id + '&assessment_date=' + assessment_date + '&mode=' + mode,
    method: 'post',
    data: before,
    headers: {
      'Permission': 1
    }

  })
}
export function GetPatientInfoWithDiseases (id) {
  return request({
    url: '/m/api/patient/info?patient=' + id,
    method: 'Get'
  })
}

export function getAllEducationList (params) {
  return request({
    url: '/m/api/patient/education',
    method: 'get',
    params: params
  })
}

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

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

export function GetPatientDialysisSolutionList (params) {
  return request({
    url: '/m/api/patients/solutions',
    method: 'get',
    params: params
  })
}
export function GetDoctorAdvices (params) {
  return request({
    url: '/m/api/patients/doctoradvices',
    method: 'get',
    params: params
  })
}

export function PostSearch (keyword) {
  return request({
    url: '/m/api/patient/search?keyword=' + keyword,
    method: 'get'
  })
}
