import request from '/@/utils/request';

import type { AxiosPromise } from 'axios';
import type { IPatientDamageEvaluate, IPatientDamageEvaluateReponse } from './types/index.type';
import type { ICommonListParams } from '../common.type';


/**
 * 新增压力性损伤风险api
 * @param data 
 * @returns 
 */
export function addPatientDamageEvaluateApi(data: IPatientDamageEvaluate) {
    return request({
        url: '/patient/damage/evaluate/add',
        method: 'post',
        data
    })
}


/**
 * 修改压力性损伤风险api
 * @param data 
 * @returns 
 */
export function updatePatientDamageEvaluateApi(data: IPatientDamageEvaluate) {
    return request({
        url: '/patient/damage/evaluate/update',
        method: 'post',
        data
    })
}

/**
 * 删除压力性损伤风险api
 * @param id 
 * @returns 
 */
export function delPatientDamageEvaluateApi(id: number) {
    return request({
        url: '/patient/damage/evaluate/delete',
        method: 'post',
        params: { id }
    })
}


/**
 * 根据code查询压力性损伤风险api
 * @param code 
 * @returns 
 */
export function getPatientDamageEvaluateDetailByCodeApi(code: string): AxiosPromise<IPatientDamageEvaluate> {
    return request({
        url: '/patient/damage/evaluate/detail2',
        method: 'post',
        params: { code }
    })
}

/**
 * 查询压力性损伤风险列表api
 * @param params 
 * @returns 
 */
export function getPatientDamageEvaluateListApi(params: ICommonListParams): AxiosPromise<IPatientDamageEvaluateReponse> {
    return request({
        url: '/patient/damage/evaluate/list',
        method: 'post',
        params,
    })
}