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

enum Api {
  archivesPatientReturnQueryPage = '/archives/patientReturn/query/list',
  archivesPatientReturnDetail = '/archives/patientReturn/detail',
  archivesPatientReturnAdd = '/archives/patientReturn/add',
  archivesPatientReturnEdit = '/archives/patientReturn/edit',
  archivesPatientReturnRemove = '/archives/patientReturn/removeByIds',
}

/**
 *
 * @author lf
 * @date  2023/07/04 13:42
 * @description: 根据条件查询转归记录列表,权限 - archives:patientReturn:query
 * @method: POST
 * @param:
 * @return:
 *       {String}  patientBasicId  基础病历id
 *       {Date}  returnTime  转归时间
 *       {String}  type  转归类型
 *       {String}  remark  remark
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 */

export const archivesPatientReturnQueryPage = (params?: any) => {
  return defHttp.get({ url: Api.archivesPatientReturnQueryPage + '/' + params?.patientBasicId });
};
/**
 *
 * @author lf
 * @date  2023/07/04 13:42
 * @description: 根据id查询转归记录详细信息,权限 - archives:patientReturn:query
 * @method: GET
 * @param:  id 转归记录主键id
 * @return:
 *       {String}  patientBasicId  基础病历id
 *       {Date}  returnTime  转归时间
 *       {String}  type  转归类型
 *       {String}  remark  remark
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 */
export const archivesPatientReturnDetail = (id: string) => {
  return defHttp.get({ url: Api.archivesPatientReturnDetail + '/' + id });
};

/**
 *
 * @author lf
 * @date  2023/07/04 13:42
 * @description: 添加转归记录,权限 - archives:patientReturn:add
 * @method: POST
 * @param:
 *       {String}  patientBasicId  基础病历id
 *       {Date}  returnTime  转归时间
 *       {String}  type  转归类型
 *       {String}  remark  remark
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 * @return:
 *       0 添加失败
 *       1 添加成功
 */
export const archivesPatientReturnAdd = (params?: object) => {
  return defHttp.post({ url: Api.archivesPatientReturnAdd, params: params });
};

/**
 *
 * @author lf
 * @date  2023/07/04 13:42
 * @description: 通过主键id编辑转归记录,权限 - archives:patientReturn:edit
 * @method: POST
 * @param:
 *       {String}  patientBasicId  基础病历id
 *       {Date}  returnTime  转归时间
 *       {String}  type  转归类型
 *       {String}  remark  remark
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 * @return:
 *       0 编辑失败
 *       1 编辑成功
 */
export const archivesPatientReturnEdit = (params?: object) => {
  return defHttp.post({ url: Api.archivesPatientReturnEdit, params: params });
};

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