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

enum Api {
  archivesFormulaTemplateQueryPage = '/archives/formulaTemplate/query/page',
  archivesFormulaTemplateQueryList = '/archives/formulaTemplate/query/list',
  archivesFormulaTemplateQueryType = '/archives/formulaTemplate/query/type',
  archivesFormulaTemplateDetail = '/archives/formulaTemplate/detail',
  archivesFormulaTemplateAdd = '/archives/formulaTemplate/add',
  archivesFormulaTemplateEdit = '/archives/formulaTemplate/edit',
  archivesFormulaTemplateRemove = '/archives/formulaTemplate/removeByIds',
}

/**
 *
 * @author fan
 * @date  2023/07/11 13:59
 * @description: 添加透析处方,权限 - archives:formulaTemplate:add
 * @method: POST
 */
export const archivesFormulaTemplateAdd = (params?: object) => {
  return defHttp.post({ url: Api.archivesFormulaTemplateAdd, params: params });
};

/**
 *
 * @author fan
 * @date  2023/07/11 13:59
 * @description: 编辑透析处方,权限 - archives:formulaTemplate:edit
 * @method: POST
 */
export const archivesFormulaTemplateEdit = (params?: object) => {
  return defHttp.post({ url: Api.archivesFormulaTemplateEdit, params: params });
};

/**
 *
 * @author fan
 * @date  2023/07/11 13:59
 * @description: 查询透析处方模板
 * @method: POST
 */

export const archivesFormulaTemplateQueryPage = (params?: object) => {
  return defHttp.post({ url: Api.archivesFormulaTemplateQueryPage, params: setParams(params) });
};

/**
 *
 * @author fan
 * @date  2023/07/11 13:59
 * @description: 基础病历下的所有处方模板
 * @method: GET
 */

export const archivesFormulaTemplateQueryList = (patientBasicId: string) => {
  return defHttp.get({ url: Api.archivesFormulaTemplateQueryList + '/' + patientBasicId });
};

/**
 *
 * @author fan
 * @date  2023/07/11 13:59
 * @description: 基础病历下的所有处方模板类型
 * @method: GET
 */

export const archivesFormulaTemplateQueryType = (patientBasicId: string) => {
  return defHttp.get({ url: Api.archivesFormulaTemplateQueryType + '/' + patientBasicId });
};

/**
 *
 * @author fan
 * @date  2023/07/11 13:59
 * @description: 查询透析处方模板byId
 * @method: GET
 */

export const archivesFormulaTemplateDetail = (id: string) => {
  return defHttp.get({ url: Api.archivesFormulaTemplateDetail + '/' + id });
};

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