import request from '/@/utils/request';
import { AxiosPromise } from 'axios';


export function listDiagnoseTypes() {
	return request({
		url: '/dict/diagnose/info/listDiagnoseTypes',
		method: 'post',
	});
}
export function Add(data:object){
	return request({
		url: '/dict/diagnose/info/add',
		method: 'post',
		data
	})
}
export function update(params: string) {
	return request({
		url: '/dict/diagnose/info/update',
		method: 'post',
		data: params,
	});
}
export function deleteId(params: string) {
	return request({
		url: '/dict/diagnose/info/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}
export function detail2(params: string) {
	return request({
		url: '/dict/diagnose/info/detail2',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}
export function addList(data:object){
	return request({
		url: '/patient/diagnose/history/addList',
		method: 'post',
		data
	})
}
export function updateList(data:object){
	return request({
		url: '/patient/diagnose/history/update',
		method: 'post',
		data
	})
}
export function listDiagnoses(params: string){
	return request({
		url: '/patient/diagnose/history/list',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
export function deletePId(params: string) {
	return request({
		url: '/patient/diagnose/history/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}

/**
 * 获取患者诊断
 * @param params 
 * @param string 
 * @param patientCode 
 * @returns 
 */
export function getDiagnoseByPatientCode(params: { patientCode: string }): AxiosPromise<string[]> {
	return request({
		url: '/patient/diagnose/history/getDiagnoseByPatientCode',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}
export function findByQueryCode(params:object) {
	return request({
		url: '/his/diagnose/sync/findByQueryCode',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params,
	});
}