import request from "@/utils/request";

export function getCurrentPatient(params){
   return request({
      url:"/api/drug/getcurrentpatient",
      methods:"get",
      params:params  
   })
}

export function getAllDrugName(params){
   return request({
     url:"/api/drug/getalldrugname",
     methods:"get",
     params:params
   })
}


export function saveDrugName(params){
  return request({
     url:"/api/drug/savedrugname",
     methods:"get",
     params:params
  })
}

export function getdrugNameList(params){ 
  return request({
     url:"/api/drug/getdrugnamelist",
     methods:"get",
     params:params
  })
}

export function getRulleName(params){
  return request({
     url:"/api/drug/getrullename",
     methods:"get",
     params:params 
   })
}

export function getUnitByBaseId(params){
  return request({
     url:"/api/drug/getunitbybaseid",
     methods:"get",
     params:params  
  })
}

export function saveRulleName(params){
  return request({
     url:"/api/drug/saverullename",
     methods:"get",
     params:params
  })
}

export function EditRullerName(params){
   return request({
     url:"/api/drug/editrullername",
     methods:"get",
     params:params
   })
}


export function updatedRulleName(params){
  
  return request({
    url:"/api/drug/updatedrullername",
    methods:"get",
    params:params
  })
}

export function getAllDrugNameList(params){
  
  return request({
     url:"/api/drug/getalldrugnamelist",
     methods:"Get",
     params:params
  })
}

export function getRullListByDrugName(params){
  
   return request({
       url:"/api/drug/getrulllistbydrugname",
       methods:"Get",
       params:params
    })
}

export function SaveSelfMedicines(data){
   
   return request({
      url:"/api/drug/saveselfmedicines",
      method:"post",
      data:data
   })
}

export function getCurrentOrgAllStaff(params){
   return request({
      url:"/api/drug/getcurrentorgallstaff",
      methods:"get",
      params:params
   })
}


export function saveStock(data,startime,adminuserid,patientid){
  
   return request({
      url:"/api/drug/savestock?start_time="+startime+"&admin_user_id="+adminuserid+"&patient_id="+patientid,
      method:"post",
      data:data
   })

}

export function saveOutStock(data,startime,adminuserid,patientid){
   return request({
      url:"/api/drug/saveoutstock?start_time="+startime+"&admin_user_id="+adminuserid+"&patient_id="+patientid,
      method:"post",
      data:data
   })
}

export function DeleteDrugById(params){
   return request({
      url:"/api/drug/deletedrugbyid",
      method:"get",
      params:params
   })
}

export function saveRadio(params){
  
   return request({
      url:"/api/drug/saveradio",
      method:"get",
      params:params
   })
}

export function DeleteDrugStand(id,name){
    const params = {
      id:id,
      name:name
    }
   return request({
      url:"/api/drug/deletedrugstand",
      method:"get",
      params:params
   })
}

export function getStockList(params){
   
   return request({
      url:"/api/drug/getstocklist",
      method:"get",
      params:params
   })
}

export function DeleteDrugName(params){
  
   return request({
      url:"/api/drug/deletedrugname",
      method:"get",
      params:params
   })
}


export function getDrugDetail(params){
   return request({
      url:"/api/drug/getdrugdetail",
      method:"get",
      params:params
   })
}

export function getAllPatientStockList(params){
   
   return request({
      url:"/api/drug/getallpatientstocklist",
      method:"get",
      params:params
   })
}

export function getDrugDataByPatientId(params){
  
   return request({
      url:"/api/drug/getdrugdatabypatientid",
      method:"get",
      params:params
   })
}

export function getSelfMedicalList(params){
   
   return request({
       url:"/api/drug/getselfmedicallist",
       methods:"get",
       params:params
   })
}

export function getDrugDescByDrugName(params){

   return request({
      url:"/api/drug/getdrugdescbydrugname",
      methods:"get",
      params:params
   })
}

export function getDrugSet(params){
  
   return request({
      url:"/api/drug/getdrugset",
      methods:"get",
      params:params
   })
}

export function getAllMedicalList(params){
  
   return request({
      url:"/api/drug/getallmedicallist",
      methods:"get",
      params:params,
   })
}

export function getStandName(params){
  
   return request({
     url:"/api/drug/getstandname",
     methods:"get",
     params:params
   })
}

export function getRullerList(params){
  
   return request({
      url:"/api/drug/getrullerlist",
      methods:"get",
      params:params
   })
}


export function DeleteDrugNameById(params){
   
   return request({
      url:"/api/drug/deleteDrugNamebyid",
      methods:"get",
      params:params
   })
}

export function getPatientDetail(id,params){

   return request({
      url:"/api/drug/getpatientdetail?id="+id,
      methods:"Get",
      params:params
   })
}

// export function toSeachPatient(params){
   
//    return request({
//       url:"/api/drug/toseachpatient",
//       methods:"Get",
//       params:params
//    })
// }