Files
his/healthlink-his-ui/scripts/query_depts.cjs
chenqi 24dc16b8d1 refactor(ybmock): 重构医保模拟接口并更新国际化配置
- 将医保模拟接口从通用路由改为具体功能路由
- 新增签到、取消门诊登记、预结算等功能接口
- 统一返回格式为 code/message/result 结构
- 移除旧版医保接口路由兼容处理
- 更新前端国际化配置文件中的医保相关词条
- 删除重复的无数据提示词条并补充新的字段翻译
- 移除药房模块独立词条合并至通用配置中
- 新增住院管理模块的完整国际化词条配置
2026-06-26 16:06:15 +08:00

30 lines
861 B
JavaScript

const { Client } = require('pg');
const fs = require('fs');
const path = require('path');
const client = new Client({
host: '192.168.110.252',
port: 15432,
database: 'postgresql',
user: 'postgresql',
password: 'Jchl1528',
});
async function main() {
await client.connect();
await client.query('SET search_path TO healthlink_his');
// Get all department names
const res = await client.query(
"SELECT DISTINCT dept_name FROM sys_dept WHERE dept_name IS NOT NULL AND dept_name != '' ORDER BY dept_name"
);
const names = res.rows.map(r => r.dept_name);
fs.writeFileSync(path.join(__dirname, 'dept_names.json'), JSON.stringify(names, null, 2), 'utf8');
console.log('Total departments:', names.length);
names.forEach(n => console.log(n));
await client.end();
}
main().catch(e => { console.error(e.message); process.exit(1); });