import request from '@/utils/request'
import { params } from 'jquery'

export function getDialysisScheduals (params) {
  return request({
    url: '/m/api/scheduals',
    method: 'get',
    params: params
  })
}

export function getWaitingScheduals (params) {
  return request({
    url: '/m/api/waiting_scheduals',
    method: 'get',
    params: params
  })
}

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

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

export function commitTreatmentSummary (params) {
  return request({
    url: '/m/api/dialysis/treatmentSummary',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function commitDoubleCheck (params) {
  return request({
    url: '/m/api/dialysis/doublecheck',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }
  })
}

export function commitAcceptsAssessment (params) {
  return request({
    url: '/m/api/dialysis/acceptsAssessment',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function finish (params) {
  return request({
    url: '/m/api/dialysis/finish',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function commitDialysisPrescription (params) {
  console.log('params', params)
  return request({
    url: '/m/api/dialysis/dialysisPrescription',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function commitAssessmentAfterDislysis (params) {
  return request({
    url: '/m/api/dialysis/assessmentAfterDislysis',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function addMonitorRecord (params) {
  return request({
    url: '/m/api/monitor/add',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function editMonitorRecord (params) {
  console.log('params', params)
  return request({
    url: '/m/api/monitor/edit',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function deleteMonitorRecord (params) {
  return request({
    url: '/m/api/monitor/delete',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

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

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

export function postSolution (params) {
  console.log('param232323', params)
  return request({
    url: '/m/api/solution',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function startDialysis (params) {
  console.log('params22', params)
  return request({
    url: '/m/api/dialysis/start',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function getLastAccepts (params) {
  return request({
    url: '/m/api/accepts/get',
    method: 'get',
    params: params
  })
}

export function getPrintDialysisRecord (params) {
  return request({
    url: '/m/api/print/dialysisorder',
    method: 'Get',
    params: params
  })
}

export function getUrgentScheduleInitData (params) {
  return request({
    url: '/m/api/schedule/urgentinit',
    method: 'Get',
    params: params
  })
}

export function postUrgentSchedule (params) {
  return request({
    url: '/m/api/schedule/urgentadd',
    method: 'post',
    params: params
  })
}

export function postSign (params) {
  return request({
    url: '/m/api/dialysis/sign',
    method: 'Post',
    params: params

  })
}

export function GetMonitor (params) {
  return request({
    url: '/m/api/monitor/get',
    method: 'get',
    params: params
  })
}

export function GetMonitorToday (params) {
  return request({
    url: '/m/api/monitor/gettodaylast',
    method: 'get',
    params: params
  })
}

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

  })
}

export function PostModifyStartDialysis (params) {
  return request({
    url: '/m/api/startOrder/edit',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

export function PostModifyEndDialysis (params) {
  return request({
    url: '/m/api/finishOrder/edit',
    method: 'post',
    params: params,
    headers: {
      'Permission': 1
    }

  })
}

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

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

  })
}

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

export function GetSchedualNumber (params) {
  return request({
    url: '/m/api/schedule/get',
    method: 'get',
    params: params
  })
}

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

export function getLatestDialysisScheduals (params) {
  // console.log('param232322323', params)
  return request({
    url: '/m/api/dialysis/schedule',
    method: 'get',
    params: params
  })
}

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

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

export function getStockInGoodInfo (params) {
  return request({
    url: '/m/api/stockingood/get',
    method: 'get',
    params: params
  })
}

export function createDialysisBeforePrepare (patient_id, record_time, data, active) {
  return request({
    url: '/m/api/dialysisbeforeprepare/create?patient_id=' + patient_id + '&record_time=' + record_time + '&active=' + active,
    method: 'post',
    data: data
  })
}

export function PostGoodStockOut (patient_id, record_time,data) {
  return request({
    url: '/m/api/stockout/create?patient_id=' + patient_id + '&record_time=' + record_time,
    method: 'post',
    data:data,
  })
}

export function PostOtherGoodStockOut (patient_id, record_time, data) {
  return request({
    url: '/m/api/otherstockout/create?patient_id=' + patient_id + '&record_time=' + record_time,
    method: 'post',
    data: data
  })
}

export function editDialysisBeforePrepare (patient_id, record_time, data) {
  return request({
    url: '/m/api/dialysisbeforeprepare/edit?patient_id=' + patient_id + '&record_time=' + record_time,
    method: 'post',
    data: data
  })
}

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

export function getMobilePrintStockGood (params) {
  return request({
    url: '/m/api/getmobileprintstockgood',
    method: 'get',
    params: params
  })
}

export function getPrescriptionList(params){
  return request({
    url:"/m/api/getprescriptionlist",
    method:"get",
    params:params
  })
}

export function batchDeleteMonitor (params) {
  return request({
    url: '/m/api/batchdeletemonitor',
    method: 'get',
    params: params
  })
}

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

export function updateAutoReduceDetail (params) {
  return request({
    url: '/m/api/updateautoreducedetail',
    method: 'get',
    params: params
  })
}

export function deteleAutoReduceDetail (params) {
  return request({
    url: '/m/api/deleteautoreducedetail',
    method: 'get',
    params: params
  })
}

export function updateStockGoods (params) {
  console.log("parasm------",params)
  return request({
    url: '/m/api/updatestockgoods',
    method: 'get',
    params: params
  })
}

export function getMobileScheduleList (params) {
  return request({
    url: '/m/api/getmobileschedulelist',
    method: 'Get',
    params: params
  })
}

export function getInitSchedule (params) {
  return request({
    url: '/m/api/getinitschedule',
    method: 'get',
    params: params
  })
}

export function getRoleList (params) {
  return request({
    url: '/m/api/getrolelist',
    method: 'get',
    params: params
  })
}


export function checkSch (params) {
  return request({
    url: '/m/api/checksch/get',
    method: 'get',
    params: params
  })
}



// eslint-disable-next-line camelcase
export function savePatientSign (data, patient_id, dialysis_date) {
  return request({
    // eslint-disable-next-line camelcase
    url: '/m/api/savepatientsign?patient_id=' + patient_id + '&dialysis_date=' + dialysis_date,
    method: 'post',
    data: data
  })
}

export function getPatientSign (params) {
  return request({
    url: '/m/api/getpatientsign',
    method: 'get',
    params: params
  })
}

export function getDialysisRecordOrde (params) {
  return request({
    url: '/m/api/getdialysisrecordeorder',
    method: 'get',
    params: params
  })
}

export function getScheduleTypeById (params) {
  return request({
    url: '/m/api/getscheduletypebyidlist',
    method: 'get',
    params: params
  })
}

export function savePatientPicture (params) {
  return request({
    url: '/m/api/savepatientpicture',
    method: 'get',
    params: params
  })
}

export function getNewDoctorlistToday(params){
  return request({
    url:"/m/api/getnewdoctorlisttoday",
    method:"get",
    params:params
  })
}

export function saveMobileInformation(params){

  return request({
    url:"/m/api/savemobileinformation",
    method:"get",
    params:params
  })
}

export function getMobieInformation(params){

  return request({
    url:"/m/api/getmobileinformation",
    method:"get",
    params:params
  })
}

export function getMobieInformationOne(params){

  return request({
    url:"/m/api/getmobileinformationone",
    method:"Get",
    params:params,
  })
}

export function checkMobileInformation(params){

  return request({
    url:"/m/api/checkmobileinformation",
    method:"Get",
    params:params,
  })
}

export function getAdviceListNoExecution(admin_user_id,params){
  return request({
    url:"/m/api/getadvicelistnoexecution?admin_user_id="+admin_user_id,
    method:"get",
    params:params,
  })
}

export function getLastAcceptRecords(params){

  return request({
    url:"/m/api/getlastacceptrecrods",
    method:"Get",
    params:params,
  })
}
// 排班交换
export function getexchange(params){
  return request({
    url:"/m/api/sch/exchange",
    method:"Get",
    params:params,
  })
}
// 排班替换
export function getcoversch(params){
  return request({
    url:"/m/api/sch/coversch",
    method:"Get",
    params:params,
  })
}
// 更新排班患者
export function updateschedule(params){
  console.log("params",params)
  return request({
    url:"m/api/schedule/updateschedule",
    method:"Get",
    params:params,
  })
}


export function getPatientMap(patient_id,params){
  
  return request({
    url:"m/api/patient/getpatientmap?patient_id="+patient_id,
    method:"get",
    params:params
  })
}

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