患者回话列表筛选
This commit is contained in:
@@ -300,6 +300,24 @@ export class PatientDao {
|
||||
}
|
||||
}
|
||||
|
||||
async getPatientTypeByUuid(uuid: string): Promise<number | null> {
|
||||
this.checkDatabaseState();
|
||||
if (!this.rdbStore) {
|
||||
throw new Error('数据库连接为空');
|
||||
}
|
||||
const sql = 'SELECT type FROM patients WHERE LOWER(uuid) = LOWER(?)';
|
||||
const resultSet = await this.rdbStore.querySql(sql, [uuid]);
|
||||
if (resultSet.rowCount > 0) {
|
||||
resultSet.goToFirstRow();
|
||||
const typeIndex = resultSet.getColumnIndex('type');
|
||||
const type = typeIndex >= 0 ? resultSet.getDouble(typeIndex) : null;
|
||||
resultSet.close();
|
||||
return type;
|
||||
}
|
||||
resultSet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
// 删除指定专家的所有患者数据
|
||||
async deletePatientsByExpertUuid(expertUuid: string): Promise<void> {
|
||||
try {
|
||||
@@ -855,6 +873,16 @@ export class PatientDatabaseManager {
|
||||
async addPatient(patient: PatientData): Promise<boolean> {
|
||||
return await this.addPatients(patient);
|
||||
}
|
||||
|
||||
// 在 PatientDatabaseManager 类内添加
|
||||
async getPatientTypeByUuid(uuid: string): Promise<number | null> {
|
||||
if (!this.isDatabaseReady()) {
|
||||
console.error('数据库未准备好,无法获取患者type');
|
||||
return null;
|
||||
}
|
||||
return await this.getPatientDao().getPatientTypeByUuid(uuid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 导出单例实例
|
||||
|
||||
Reference in New Issue
Block a user