import request from '/@/utils/request';
import type { IMedSummary, GetMedSummaryParams, QueryPatientByBirthParams, DialysisAgeStatisticsDetail, DialysisAgeStatisticsDetailParams, VascularAccessStatDetailParams, VascularAccessStatDetail, DialysisAgeStatisticsParams, IPatVascularAccessStatDetailsParams, IPatVascularAccessStatDetailsReponse, IPatientAgeDistributionParams, IPatientAgeDistributionReponse } from './types';
import { AxiosPromise } from 'axios';
export function accessStat(params: object) {
    return request({
		url: '/patient/vascular/access/stat', 
		method: 'post',
		data: params,
    })
}

export function accessStat2Api(params) {
	return request({
		url: '/patient/vascular/access/stat2', 
		method: 'post',
		data: params,
    })
}
export function listHemoMedWeights(params: object) {
    return request({
		url: '/patient/hemo/med/record/listHemoMedWeights',
		method: 'post',
		data:params
    })
}


/**
 * 患者在院数量统计
 * @param data 
 * @returns 
 */
export function listPatCountByStatusApi(params: any) {
	return request({
		url: '/patient/operate/status/info/listPatCountByStatus',
		method: 'post',
		headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params
	})
}


/**
 * 血管通路明细列表
 * @param data 
 * @returns 
 */
export function vascularAccessStatDetailApi(data: VascularAccessStatDetailParams) :AxiosPromise<{ list: VascularAccessStatDetail[]; [key: string]: any}> {
	return request({
		url: '/patient/vascular/access/statDetail',
		method: 'post',
		data
	})
}


/**
 * 统计透析龄
 * @param clientCode 
 * @returns 
 */
export function dialysisAgeStatisticsApi(params: DialysisAgeStatisticsParams): AxiosPromise<{ [key: string]: number }> {
	return request({
		url: '/patient/info/dialysisAgeStatistics',
		method: 'post',
		params
	})
}

/**
 * 统计透析领详细信息
 * @param params 
 * @returns 
 */
export function dialysisAgeStatisticsDetailApi(params: DialysisAgeStatisticsDetailParams) :AxiosPromise<DialysisAgeStatisticsDetail[]> {
	return request({
		url: '/patient/info/dialysisAgeStatisticsDetail',
		method: 'post',
		params
	})
}


/**
 * 查询患者生日
 * @param params 
 * @returns 
 */
export function queryPatientByBirthApi(params: QueryPatientByBirthParams) {
	return request({
		url: '/patient/info/queryPatientByBirth',
		method: 'post',
		params
	})
}

/**
 * 获取患者阶段小结
 * @param params 
 * @returns 
 */
export function getMedSummaryApi(params: GetMedSummaryParams): AxiosPromise<IMedSummary> {
	return request({
		url: '/patient/info/getMedSummary',
		method: 'post',
		params
	})
}

/**
 * 患者血管通路查询统计——查询明细Api
 * @param data 
 * @returns 
 */
export function patVascularAccessStatDetailsApi(data: IPatVascularAccessStatDetailsParams) :AxiosPromise<IPatVascularAccessStatDetailsReponse> {
	return request({
		url: '/patient/vascular/access/statDetails',
		method: 'post',
		data
	})
}

export function listRecentBpSummary(params:object) {
	return request({
		url: '/patient/hemo/med/record/listRecentBpSummary',
		method: 'post',
		headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params
	})
}

/**
 * 查询患者平均年龄和年龄分布接口API
 * @param params 
 * @returns 
 */
export function patientAgeDistributionApi(params: IPatientAgeDistributionParams) :AxiosPromise<IPatientAgeDistributionReponse> {
	return request({
		url: '/patient/info/patientAgeDistribution',
		method: 'post',
		params
	})
}

/**
 * 患者血管通路查询统计——查询明细Api
 * @param data 
 * @returns 
 */
// export function patVascularAccessStatDetailsApi(data: IPatVascularAccessStatDetailsParams) :AxiosPromise<IPatVascularAccessStatDetailsReponse> {
// 	return request({
// 		url: '/patient/vascular/access/statDetails',
// 		method: 'post',
// 		data
// 	})
// }