import request from '/@/utils/request';
import type { AxiosPromise } from 'axios';
import type { IPatFootInspeck, IPatFootInspeckList, IPatientFootInspectListPatGroupParams, IPatientFootInspectListPatGroup } from './types/index.type';
import type { ICommonListParams } from '../common.type';



/**
 * 新增足部管理记录
 * @param data 
 * @returns 
 */
export function patientFootInspectAddApi(data: IPatFootInspeck) {
    return request({
        url: '/patient/foot/inspect/add',
        method: 'post',
        data
    })
}


/**
 * 批量新增足部管理记录
 * @param data 
 * @returns 
 */
export function patientFootInspectAddListApi(data: IPatFootInspeck[]) {
    return request({
        url: '/patient/foot/inspect/addList',
        method: 'post',
        data
    })
}


/**
 * 删除足部管理记录
 * @param id 
 * @returns 
 */
export function patientFootInspectDelApi(id: number) {
    return request({
        url: '/patient/foot/inspect/delete',
        method: 'post',
        params: { id }
    })
}


/**
 * 批量删除足部管理记录
 * @param ids 
 * @returns 
 */
export function patientFootInspectDelAllApi(ids: string) {
    return request({
        url: '/patient/foot/inspect/deleteAll',
        method: 'post',
        data: { ids }
    })
}

/**
 * 根据id获取足部管理记录详情
 * @param id 
 * @returns 
 */
export function patientFootInspectDetailByIdApi(id: number): AxiosPromise<IPatFootInspeck> {
    return request({
        url: '/patient/foot/inspect/detail',
        method: 'post',
        data: { id }
    })
}


/**
 * 根据code获取足部管理记录详情
 * @param code 
 * @returns 
 */
export function patientFootInspectDetailByCodeApi(code: string): AxiosPromise<IPatFootInspeck> {
    return request({
        url: '/patient/foot/inspect/detail2',
        method: 'post',
        data: { code }
    })
}


/**
 * 获取足部管理记录列表
 * @param params 
 * @returns 
 */
export function patientFootInspectListApi(params: ICommonListParams): AxiosPromise<IPatFootInspeckList>  {
    return request({
        url: '/patient/foot/inspect/list',
        method: 'post',
        params
    })
}


/**
 * 保存足部管理记录
 * @param data 
 * @returns 
 */
export function patientFootInspectSaveApi(data: IPatFootInspeck) {
    return request({
        url: '/patient/foot/inspect/save',
        method: 'post',
        data
    })
}


/**
 * 更新足部管理记录
 * @param data 
 * @returns 
 */
export function patientFootInspectUpdateApi(data: IPatFootInspeck) {
    return request({
        url: '/patient/foot/inspect/update',
        method: 'post',
        data
    })
}


/**
 * 获取患者足部管理记录检查未检查患者列表
 * @param data 
 * @returns 
 */
export function patientFootInspectListPatGroupApi(params: IPatientFootInspectListPatGroupParams) :AxiosPromise<IPatientFootInspectListPatGroup> {
    return request({
        url: '/patient/foot/inspect/listPatGroup',
        method: 'post',
        params
    })
}