export interface ListPatientsParams {
	clientCode: string;
	deviceGroupCode: string;
	patientName: string;
	queryDateBegin: string;
	queryDateEnd: string;
	timeSlot: number;
	feeState: number;
	patientCode: string;
}

interface PatientDiseaseRecordInGov {
	beginDate: number;
	code: string;
	name: string;
}

export interface ListPatientsItem {
	billSetTime: string;
	medDate: string;
	paidBills: number;
	patientAge: string;
	patientCode: string;
	patientGender: number;
	patientHemoCode: string;
	patientIdentityNo: string;
	patientMobile: string;
	patientName: string;
	pureWeight: number;
	unPaidBills: number;
	patientNo: string;
	schemeName: string;
	医保区划: any;
	patientDiseaseRecordInGov: PatientDiseaseRecordInGov[] | null;
}

export interface getBillsParams {
	patientCode: string;
	queryDate: string;
}

export interface getBillsParamsReponseItem {
	billInfos: Partial<BillInfos>[];
	billItemTime: string;
	billSetDoctor: string;
	billSetDoctorName: string;
	billSetIsAutoBuild: number;
	billSetIsPaid: number;
	billSetName: string;
	billSetOperator: string;
	billSetOperatorName: string;
	billSetTime: string;
	clientCode: string;
	code: string;
	createTime: string;
	createUser: number;
	deletedTime: any;
	feeGroups: any[];
	id: number;
	isDeleted: number;
	patBaoxiaoType: string;
	patBaoxiaoTypeName: string;
	patChuanranbinHistory: string;
	patDiagnose: string;
	patVisitType: number;
	patientCode: string;
	remark: string;
	updateTime: string;
	updateUser: any;
}

export interface BillInfos {
	billIsAutoBuild: number;
	billItemCode: string;
	billItemFeeState: number;
	billItemName: string;
	billItemPrice: number;
	billItemQty: number;
	billItemSetCode: string;
	billItemType: number;
	billItemUseAmount: any;
	billItemUseDays: null | number;
	billItemUseMethod: string;
	billItemUseOnce: number;
	billItemUseSpan: string;
	billTime: string;
	billTotalPrice: number;
	code: string;
	createTime: string;
	createUser: any;
	deletedTime: any;
	doseUnit: string;
	hisCode: string;
	hisState: number;
	id: number;
	isDeleted: number;
	packageUnit: string;
	patientCode: string;
	remark: string;
	updateTime: string;
	updateUser: any;
	hisPharmacyCode: string;
	hisLotNumber: string;
	billFromGroupCode: string;
	billFromGroupName: string;
}

export interface CopyPBSParams {
	patientCode: string;
	sourceCode: string;
	targetDate: string;
}

export enum DrugTypeEnum {
	noLimit = -1, // 不限
	medicine = 0, // 药
	injection = 1, // 注射剂
	diagnosisTreatment = 2, // 诊疗
	apply = 3, // 申请
	comprehensive = 4, // 综合
}

export interface ListReceipts1Params {
	pbsCode: string;
	drugType: DrugTypeEnum;
}

export interface DiagnosisFindParams {
	clientCode: string;
	queryCode: string;
}

export interface SaveDefaultPharmacyParams {
	clientCode: string;
	pharmacyCode: string;
}

/** 地址-类型 */
export interface Address {
	areaCode: string;
	areaLevel: string;
	areaName: string;
	areaNameLevel: string;
	code: string;
	createTime: string;
	createUser: number | null;
	deletedTime: string | null;
	id: number;
	isDeleted: number;
	upAreaCode: string;
	updateTime: string;
	updateUser: number | null;
}

export interface IPatientInfo {
	age: number | string;
	birthday: string;
	clientCode: string;
	code: string;
	createTime: string;
	createUser: number | null;
	deletedTime: null | string;
	hisCode: string;
	historyCount: number | null;
	id: number;
	isDeleted: number;
	isTodayAsMyBirthday: boolean;
	medHistoryStatByMonth: string | number;
	patientAddress: string;
	patientAvatarIcon: string;
	patientBaoxiaoState: string;
	patientBaoxiaoStateName: string;
	patientBedNo: string;
	patientBloodType: string;
	patientBloodTypeName: string;
	patientCardNo: string;
	patientCareer: string;
	patientCareerName: string;
	patientCompany: string;
	patientCrb: string;
	patientCreditValue: number;
	patientDegree: string;
	patientDegreeName: string;
	patientDiagnose: string;
	patientDoctor: string;
	patientDoctorName: string;
	patientExtendJson: string;
	patientFirstTimeMedTime: string;
	patientFrom: number;
	patientGender: number;
	patientGenderText: string;
	patientHeight: number;
	patientHemoCode: string | number;
	patientIdentityNo: string;
	patientIdentityType: number;
	patientInitalMedCount: number;
	patientInitalWeight: any;
	patientIsAlcohol: number;
	patientIsAlive: number;
	patientIsEyeObstacle: number;
	patientIsPositive: number;
	patientIsReligion: number;
	patientIsSmoking: number;
	patientMobile: string;
	patientName: string;
	patientNamePy: string;
	patientNation: string;
	patientNationName: string;
	patientNickName: string;
	patientNo: string;
	patientNurse: string;
	patientNurseName: string;
	patientOpenId: string;
	patientParentCameFrom: string;
	patientPassword: string;
	patientQrcodeUrl: string;
	patientReceiveTime: string;
	patientRh: string;
	patientRhName: string;
	patientSignUrl: string;
	patientTelNo: string;
	patientTelNoRelative: string;
	patientType: string;
	patientTypeName: string;
	patientUnionId: string;
	patientWard: string;
	patientWardName: string;
	patientWeddingState: string;
	patientWeddingStateName: string;
	patientYibaoAlarmDate: string;
	patientYibaoBarcode: string;
	patientYibaoCode: string;
	patientYibaoEndDate: any;
	patientYoudaoPeriod: string;
	patientYoudaoPeriodName: string;
	remark: string;
	updateTime: string;
	updateUser: number;
	患者扩展属性信息: {
		历史疾病: string;
		既往替代治疗史详情: string;
		是否存在既往史: number;
		是否存在既往肾脏替代治疗史: number;
		诊疗计划: string;
	};
	patientJoinInsureArea: string;
	医保区划信息: Address | null;
	hIS慢病备案信息: any;
}

export type DefaultFormValueSaveType = 'crb' | 'mainDiagnose' | 'subDiagnoses'; // 传染病/主要诊断/次要诊断

export interface SaveDefaultFormValueParams {
	patCode: string;
	saveType: DefaultFormValueSaveType;
	saveValue: string;
}

export interface LoadDefaultFormValueParams {
	patCode: string;
	saveType: DefaultFormValueSaveType;
}

export interface PatientListByTransferInOrOutParams {
	page: number;
	size: number;
	clientCode: string;
	beginTime?: string; // 查询日期-开始时间
	endTime?: string; // 查询日期-结束时间
	patientType?: string; // 患者类型（字典编码）
	patientWard?: string; // 病区
	patientIsPositive?: '0' | '1' | ''; // 否为阳性传染病人(0:否 1:是)默认0
	operateType?: '0' | '1' | '2' | ''; // 转归类型 0:转入 1:转出 2:院内转诊 默认0
	patientGender?: '0' | '1' | ''; // 患者性别 0:男 1:女
	patientNo?: string; // 门诊住院号
	patientHemoCode?: string; // 透析号
	patientName?: string; // 患者名称
	patientNurse?: string; // 主管护士（用户编号）
	startTime?: string; // 接收日期-开始时间
	finishTime?: string; // 接收日期-结束时间
	patientIsAlive?: '1' | '2' | ''; // 患者是否处于活动状态(1:已转入, 2:已转出 默认1),查留治时间是必须要传（留治时间=当前字段和接收开始结束日期）
}

export interface AddressListParams {
	page: number;
	size: number;
	wherecondition: string;
	ordercondition: string;
}


export interface AddNewPbsParams {
	clientCode: string;
	patientCode: string;
	pbsDate: string;
}

export interface UpdateRecordPatSnapParams {
    recordCode: string; // 透析单编号
    patientFrom: number; // 患者来源
    patientNo: string; // 住院门诊号
    InHospitalWardCode: string; // 病区
    InHospitalBedNo: string; // 床号
    InHospitalTime: string; // 入院时间
    isSyncUpdateToPatInfo: 0 | 1; // 是否将修改内容同步至患者信息
}
