import { defHttp } from '/@/utils/http/axios';
import { setParams } from '/@/utils/index';

enum Api {
  archivesVascularAccessQueryPage = '/archives/vascularAccess/query/page',
  archivesVascularAccessDetail = '/archives/vascularAccess/detail',
  archivesVascularAccessAdd = '/archives/vascularAccess/add',
  archivesVascularAccessEdit = '/archives/vascularAccess/edit',
  archivesVascularAccessRemove = '/archives/vascularAccess/removeByIds',
  archivesVascularAccessQueryCurrent = '/archives/vascularAccess/query/current',
  archivesVascularAccessQueryList = '/archives/vascularAccess/query/list',
}

// 当前基础病历的血透通路
export const archivesVascularAccessQueryCurrent = (patientBasicId: string) => {
  return defHttp.get({ url: Api.archivesVascularAccessQueryCurrent + '/' + patientBasicId });
};

// 基础病历下的所有血透通路
export const archivesVascularAccessQueryList = (patientBasicId: string) => {
  return defHttp.get({ url: Api.archivesVascularAccessQueryList + '/' + patientBasicId });
};

/**
 *
 * @author lf
 * @date  2023/06/19 13:59
 * @description: 根据条件查询血管通路列表,权限 - archives:vascularAccess:query
 * @method: POST
 * @param:
 * @return:
 *       {String}  patientBasicId  病人基础信息id
 *       {Boolean}  returnBack  是否转归
 *       {Date}  setUpTime  建立时间
 *       {String}  type  血管通路类型
 *       {String}  setUpHospital  建立医院名称
 *       {String}  puncture  穿刺体侧
 *       {String}  location  手术位置
 *       {String}  arteries  动脉
 *       {String}  vein  静脉
 *       {String}  vascularMaterial  血管材料(当通路类型为AVG时使用)
 *       {String}  path  路径
 *       {String}  anastomosis  吻合方式
 *       {String}  catheterGuidance  置管引导
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 */

export const archivesVascularAccessQueryPage = (params?: object) => {
  return defHttp.post({ url: Api.archivesVascularAccessQueryPage, params: setParams(params) });
};
/**
 *
 * @author lf
 * @date  2023/06/19 13:59
 * @description: 根据id查询血管通路详细信息,权限 - archives:vascularAccess:query
 * @method: GET
 * @param:  id 血管通路主键id
 * @return:
 *       {String}  patientBasicId  病人基础信息id
 *       {Boolean}  returnBack  是否转归
 *       {Date}  setUpTime  建立时间
 *       {String}  type  血管通路类型
 *       {String}  setUpHospital  建立医院名称
 *       {String}  puncture  穿刺体侧
 *       {String}  location  手术位置
 *       {String}  arteries  动脉
 *       {String}  vein  静脉
 *       {String}  vascularMaterial  血管材料(当通路类型为AVG时使用)
 *       {String}  path  路径
 *       {String}  anastomosis  吻合方式
 *       {String}  catheterGuidance  置管引导
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 */
export const archivesVascularAccessDetail = (id: string) => {
  return defHttp.get({ url: Api.archivesVascularAccessDetail + '/' + id });
};

/**
 *
 * @author lf
 * @date  2023/06/19 13:59
 * @description: 添加血管通路,权限 - archives:vascularAccess:add
 * @method: POST
 * @param:
 *       {String}  patientBasicId  病人基础信息id
 *       {Boolean}  returnBack  是否转归
 *       {Date}  setUpTime  建立时间
 *       {String}  type  血管通路类型
 *       {String}  setUpHospital  建立医院名称
 *       {String}  puncture  穿刺体侧
 *       {String}  location  手术位置
 *       {String}  arteries  动脉
 *       {String}  vein  静脉
 *       {String}  vascularMaterial  血管材料(当通路类型为AVG时使用)
 *       {String}  path  路径
 *       {String}  anastomosis  吻合方式
 *       {String}  catheterGuidance  置管引导
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 * @return:
 *       0 添加失败
 *       1 添加成功
 */
export const archivesVascularAccessAdd = (params?: object) => {
  return defHttp.post({ url: Api.archivesVascularAccessAdd, params: params });
};

/**
 *
 * @author lf
 * @date  2023/06/19 13:59
 * @description: 通过主键id编辑血管通路,权限 - archives:vascularAccess:edit
 * @method: POST
 * @param:
 *       {String}  patientBasicId  病人基础信息id
 *       {Boolean}  returnBack  是否转归
 *       {Date}  setUpTime  建立时间
 *       {String}  type  血管通路类型
 *       {String}  setUpHospital  建立医院名称
 *       {String}  puncture  穿刺体侧
 *       {String}  location  手术位置
 *       {String}  arteries  动脉
 *       {String}  vein  静脉
 *       {String}  vascularMaterial  血管材料(当通路类型为AVG时使用)
 *       {String}  path  路径
 *       {String}  anastomosis  吻合方式
 *       {String}  catheterGuidance  置管引导
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 * @return:
 *       0 编辑失败
 *       1 编辑成功
 */
export const archivesVascularAccessEdit = (params?: object) => {
  return defHttp.post({ url: Api.archivesVascularAccessEdit, params: params });
};

/**
 * @description: 删除,权限 - archives:vascularAccess:remove
 * @method: POST
 */
export const archivesVascularAccessRemove = (params: Array<string | number>) => {
  return defHttp.post({ url: Api.archivesVascularAccessRemove, params: params });
};
