import request from '@/utils/request'

export function getBloodDialysisPatient (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: 'm/api/patient/getbloodDialysisPatient',
    method: 'get',
    params: params
  })
}

export function getAllBloodDialysisPatient (page, limit, status, source) {
  const params = {
    page: page,
    limit: limit,
    patientstatus: status,
    source: source
  }

  return request({
    url: '/m/api/patient/getallblooddialysispatient',
    method: 'get',
    params: params
  })
}

export function getAllSlowPatient (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: '/m/api/patient/getallslowpatient',
    method: 'get',
    params: params
  })
}

export function getAllMemberPatient (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: '/m/api/patient/getallmemberpatient',
    method: 'get',
    params: params
  })
}

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

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

export function GetPatientInfo (phone) {
  const params = {
    phone: phone
  }
  return request({
    url: 'm/api/patient/getpatientinfo',
    method: 'get',
    params: params
  })
}

export function savePatient (data) {
  return request({
    url: '/m/api/patient/savepatient',
    method: 'post',
    data: data
  })
}

export function getPatientDetail (id, params) {
  return request({
    url: '/m/api/patient/getpatientdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function getDoctorAdvices (id, type, startime, endtime, limit, page) {
  const params = {
    id: id,
    type: type,
    startime: startime,
    endtime: endtime,
    limit: limit,
    page: page
  }
  return request({
    url: '/m/api/patient/getdoctoradvices',
    method: 'get',
    params: params
  })
}

export function getDryWeight (id, startime, endtime, limit, page) {
  const params = {
    id: id,
    startime: startime,
    endtime: endtime,
    limit: limit,
    page: page
  }
  return request({
    url: '/m/api/paitent/getdryweight',
    method: 'get',
    params: params
  })
}

export function getBloodDialysisPatientTwo (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: 'm/api/patient/getbloodDialysisPatientwo',
    method: 'get',
    params: params
  })
}

export function ToSearch (name) {
  const params = {
    name: name
  }
  return request({
    url: 'm/api/patient/tosearch',
    method: 'get',
    params: params
  })
}

export function getBloodPatientInfo (phone) {
  const params = {
    phone: phone
  }
  return request({
    url: '/m/api/patient/getbloodpatientinfo',
    method: 'get',
    params: params
  })
}

export function getSlowPatientInfo (phone) {
  const params = {
    phone: phone
  }
  return request({
    url: '/m/api/patient/getslowpatientinfo',
    method: 'get',
    params: params
  })
}

export function getMemberPatientInfo (phone) {
  const params = {
    phone: phone
  }
  return request({
    url: '/m/api/patient/getmemberpatientinfo',
    method: 'get',
    params: params
  })
}

export function getCourseManagement (id, limit, page, startime, endtime) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/m/api/patient/getcoursemanagement',
    method: 'get',
    params: params
  })
}

export function DeleteCouseManage (id, params) {
  return request({
    url: '/m/api/patient/delelecousemanage?id=' + id,
    method: 'delete',
    params: params
  })
}

export function getCouseManagementDetail (id, params) {
  return request({
    url: '/m/api/patient/getcousemanagementdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function DeleteDryWeight (id, params) {
  return request({
    url: '/m/api/patient/deletedryweight?id=' + id,
    method: 'delete',
    params: params
  })
}

export function getDryWeightDetail (id, params) {
  return request({
    url: '/m/api/patient/getdryweightdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function GetLongDialysisRecord (id, limit, page, startime, endtime) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/m/api/patient/getlongdialysisrecord',
    method: 'get',
    params: params
  })
}

export function GetPatientDetail (id, params) {
  return request({
    url: '/m/api/patient/getpatientdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function getRescueRecord (id, limit, page, startime, endtime) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/m/api/patient/getrescuerecord',
    method: 'get',
    params: params
  })
}

export function getScheduling (id, limit, page, startime, endtime, mode_types) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime,
    mode_types: mode_types
  }
  return request({
    url: '/m/api/patient/getscheduling',
    method: 'get',
    params: params
  })
}

export function getEducation (id, limit, page, startime, endtime) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/m/api/patient/geteducation',
    method: 'get',
    params: params
  })
}

export function getSchedulingDetail (id, params) {
  return request({
    url: '/m/api/patient/getschedulingdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function DeleteScheduling (id, params) {
  return request({
    url: '/m/api/patient/deletescheduling?id=' + id,
    method: 'delete',
    params: params
  })
}

export function getEducationDetail (id, params) {
  return request({
    url: '/m/api/patient/geteducationdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function DeleteEducationOne (id, params) {
  return request({
    url: '/m/api/patient/deleteeductionone?id=' + id,
    method: 'delete',
    params: params
  })
}

export function getRescueRecordDetail (id, params) {
  return request({
    url: '/m/api/patient/getrescuerecorddetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function DeleteRescueRecord (id, params) {
  return request({
    url: '/m/api/patient/deleterescuerecord?id=' + id,
    method: 'delete',
    params: params
  })
}

export function toSearchPatient (keyword) {
  const params = {
    keyword: keyword
  }
  return request({
    url: '/m/api/patient/tosearchepatient',
    method: 'get',
    params: params
  })
}

export function SearchAllPatient (keyword) {
  const params = {
    keyword: keyword
  }
  return request({
    url: '/m/api/patient/searchallpatient',
    method: 'get',
    params: params
  })
}

export function SearchAllBlood (keyword) {
  const params = {
    keyword: keyword
  }
  return request({
    url: '/m/api/patient/searchallblood',
    method: 'get',
    params: params
  })
}

export function getSlowSearchPatient (keyword) {
  const params = {
    keyword: keyword
  }
  return request({
    url: '/m/api/patient/getslowsearchepatient',
    method: 'get',
    params: params
  })
}

export function getMemberSearchPatient (keyword) {
  const params = {
    keyword: keyword
  }
  return request({
    url: '/m/api/patient/getmembersearchpatient',
    method: 'get',
    params: params
  })
}

export function getLongDialysisDetail (id, params) {
  return request({
    url: '/m/api/patient/getlongdialysisdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function DeleteLongDialysis (id, params) {
  return request({
    url: '/m/api/patient/deletelongdialysis?id=' + id,
    method: 'delete',
    params: params
  })
}

export function getDialysisRecord (id, limit, page, startime, endtime, dislysType) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime,
    dislysType: dislysType
  }
  return request({
    url: '/m/api/patient/getdialysisrecord',
    method: 'get',
    params: params
  })
}

export function GetDoctorAdviceDetail (date, id) {
  const params = {
    date: date,
    id: id
  }
  console.log('params', params)
  return request({
    url: '/m/api/patient/getdoctoradvicedetail',
    method: 'get',
    params: params
  })
}

export function DeleteManagement (id, patientid) {
  const params = {
    id: id,
    patientid: patientid
  }
  return request({
    url: '/m/api/patient/deletemanagement',
    method: 'delete',
    params: params
  })
}

export function DeleteManagementTwo (id, patientid) {
  const params = {
    id: id,
    patientid: patientid
  }
  return request({
    url: '/m/api/patient/deletemanagementtwo',
    method: 'delete',
    params: params
  })
}

export function DeleteChild (id, params) {
  return request({
    url: '/m/api/patient/deletechild?id=' + id,
    method: 'delete',
    params: params
  })
}

export function updatedPatient (data) {
  return request({
    url: '/m/api/patient/updatedpatient',
    method: 'post',
    data: data
  })
}

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

export function GetAllProjectNameByDate (date, patientid) {
  const params = {
    date: date,
    patientid: patientid
  }
  return request({
    url: '/m/api/patient/getallprojectname',
    method: 'Get',
    params: params
  })
}

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

export function getInspection (id, limit, page, startime, endtime, projectid) {
  const params = {
    id: id,
    limit: limit,
    page: page,
    startime: startime,
    endtime: endtime,
    projectid: projectid
  }
  return request({
    url: '/m/api/patient/getinspection',
    method: 'get',
    params: params
  })
}

export function getMyInformation (id, params) {
  return request({
    url: '/m/api/patient/getmyinformation?id=' + id,
    method: 'get',
    params: params
  })
}

export function getMyInformationThree (id, params) {
  return request({
    url: '/m/api/patient/getmyinformationThree?id=' + id,
    method: 'get',
    params: params
  })
}

export function getPatientName (id, params) {
  return request({
    url: '/m/api/patient/getpatientname?id=' + id,
    method: 'get',
    params: params
  })
}

export function getInspectionDetail (patientid, date, projectid) {
  const params = {
    patientid: patientid,
    date: date,
    projectid: projectid
  }
  return request({
    url: '/m/api/patient/getinspectiondetail',
    method: 'get',
    params: params
  })
}

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

export function DeleteInspection (date) {
  const params = {
    date: date
  }
  return request({
    url: '/m/api/patient/deleteinspection',
    method: 'delete',
    params: params
  })
}

export function DeleteChildInspection (name, date) {
  const params = {
    name: name,
    date: date
  }
  return request({
    url: '/m/api/patient/deletechildinspection',
    method: 'delete',
    params: params
  })
}

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

export function SaveSex (sex, id, orgid) {
  const params = {
    sex: sex,
    id: id,
    orgid: orgid
  }
  return request({
    url: '/m/api/patient/savesex',
    method: 'get',
    params: params
  })
}

export function SaveBirthday (data) {
  return request({
    url: '/m/api/patient/savebirthday',
    method: 'post',
    data: data
  })
}

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

export function getRoleName (id, orgid) {
  const params = {
    id: id,
    orgid: orgid
  }
  return request({
    url: '/m/api/patient/getrolename',
    method: 'get',
    params: params
  })
}

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

export function GetAllZone (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: '/m/api/patient/getallzone',
    method: 'get',
    params: params
  })
}

export function DeleteZone (id, params) {
  return request({
    url: '/m/api/patient/deletezone?id=' + id,
    method: 'delete',
    params: params
  })
}

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

export function getAllGroup (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: '/m/api/patient/getallgroup',
    method: 'get',
    params: params
  })
}

export function DeleteGroup (id, params) {
  return request({
    url: '/m/api/patient/deletegroup?id=' + id,
    method: 'delete',
    params: params
  })
}

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

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

export function GetAllNumber (page, limit) {
  const params = {
    page: page,
    limit: limit
  }
  return request({
    url: '/m/api/patient/getallnumber',
    method: 'get',
    params: params
  })
}

export function DeleteBed (id, params) {
  return request({
    url: '/m/api/patient/deletebed?id=' + id,
    method: 'delete',
    params: params
  })
}

export function LoginOut (id, params) {
  return request({
    url: '/m/api/patient/loginout?id=' + id,
    method: 'get',
    params: params
  })
}

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

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

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

export function DeletePatient (id, params) {
  return request({
    url: '/m/api/patient/deletePatient?id=' + id,
    method: 'delete',
    params: params
  })
}

export function saveName (id, name) {
  const params = {
    id: id,
    name: name
  }
  return request({
    url: '/m/api/patient/savename',
    method: 'get',
    params: params
  })
}

export function saveNameTwo (id, name, orgid) {
  const params = {
    id: id,
    name: name,
    orgid: orgid
  }
  return request({
    url: '/m/api/patient/savenametwo',
    method: 'get',
    params: params
  })
}

export function getAllOrganization (id, params) {
  return request({
    url: '/m/api/patient/getallorganization?id=' + id,
    method: 'get',
    params: params
  })
}

export function getMyOrganazition (id, params) {
  return request({
    url: '/m/api/patient/getmyorganazition?id=' + id,
    method: 'get',
    params: params
  })
}

export function getOrgInformation (id, params) {
  return request({
    url: '/m/api/org/getorginformation?id=' + id,
    method: 'get',
    params: params
  })
}

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

export function updateOrg (params, id) {
  return request({
    url: '/m/api/patient/editorg?id=' + id,
    method: 'get',
    params: params
  })
}

export function getMyInforName (id, orgid) {
  const params = {
    id: id,
    orgid: orgid
  }
  console.log('params', params)
  return request({
    url: '/m/api/patient/getmyinforname',
    method: 'get',
    params: params
  })
}

export function getPartionDetail (id, params) {
  return request({
    url: '/m/api/patient/getpartiondetail?id=' + id,
    method: 'get',
    params: params
  })
}

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

export function getGroupDetail (id, params) {
  return request({
    url: '/m/api/patient/getgroupdetail?id=' + id,
    method: 'get',
    params: params
  })
}

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

export function getBedDetail (id, params) {
  return request({
    url: '/m/api/patient/getbeddetail?id=' + id,
    method: 'get',
    params: params
  })
}

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

export function getMyOrgInformation (creator, params) {
  return request({
    url: '/m/api/patient/getmyorginformation?creator=' + creator,
    method: 'get',
    params: params
  })
}

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

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

export function submitForm (params) {
  return request({
    url: '/m/api/patient/sumitform',
    method: 'Get',
    params: params
  })
}

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

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

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

export function getNewPatientId (id, params) {
  return request({
    url: '/m/api/patient/getnewpatientid?id=' + id,
    method: 'get',
    params: params
  })
}

export function UpdateImage (hash, params) {
  return request({
    url: '/m/api/patient/updateimage?hash=' + hash,
    method: 'get',
    params: params
  })
}

export function saveCourseManagement (params) {
  return request({
    url: '/m/api/patient/savecouresemanagement',
    method: 'get',
    params: params
  })
}
export function saveCourseManagementTwo (params) {
  return request({
    url: '/m/api/patient/savecoursemanagementtwo',
    method: 'get',
    params: params
  })
}

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

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

export function getAllDoctorList (params) {
  return request({
    url: '/m/api/patient/getalldoctorlist',
    method: 'Get',
    params: params
  })
}

export function getTreateSummary (params) {
  return request({
    url: '/m/api/patient/gettreatesummay',
    method: 'Get',
    params: params
  })
}

export function commitDialysisOrder (params) {
  return request({
    url: '/m/api/patient/commitdialysisOrder',
    method: 'Get',
    params: params
  })
}

export function getPatientPlan(params){
  return request({
    url:"/m/api/patient/getpatientplan",
    method:"get",
    params:params,
  })
}

export function toGetPatient(params){
  return request({
    url:"/m/api/patient/togetpatient",
    method:"Get",
    params:params
  })
}

export function getLastInspectionDetail(params){
 
  return request({
    url:"/m/api/patient/getllastinspectiondetail",
    method:"get",
    params:params,
  })
}

export function getNextInspectionDetail(params){
   return request({
    url:"/m/api/patient/getnextinspectionDetail",
    method:"get",
    params:params
   })
}

// 检验检查（新）
export function getinspectiongroup(id){
  return request({
   url:"/m/api/patient/getinspectiongroup?patient_id="+id,
   method:"get",
  })
}

export function getinspectiongroupdetails(params){
  return request({
   url:"/m/api/patient/getinspectionbyprojectid",
   method:"get",
   params:params
  })
}