- 将医保模拟接口从通用路由改为具体功能路由 - 新增签到、取消门诊登记、预结算等功能接口 - 统一返回格式为 code/message/result 结构 - 移除旧版医保接口路由兼容处理 - 更新前端国际化配置文件中的医保相关词条 - 删除重复的无数据提示词条并补充新的字段翻译 - 移除药房模块独立词条合并至通用配置中 - 新增住院管理模块的完整国际化词条配置
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
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 dict types with their labels
|
|
const res = await client.query(
|
|
"SELECT dict_type, dict_label, dict_value FROM sys_dict_data WHERE status = '0' ORDER BY dict_type, dict_sort"
|
|
);
|
|
|
|
// Group by dict_type
|
|
const grouped = {};
|
|
for (const row of res.rows) {
|
|
if (!grouped[row.dict_type]) grouped[row.dict_type] = [];
|
|
grouped[row.dict_type].push({ label: row.dict_label, value: row.dict_value });
|
|
}
|
|
|
|
// Output as JSON
|
|
const output = {};
|
|
for (const [type, items] of Object.entries(grouped)) {
|
|
output[type] = items;
|
|
}
|
|
|
|
fs.writeFileSync(path.join(__dirname, 'dict_data.json'), JSON.stringify(output, null, 2), 'utf8');
|
|
|
|
console.log('Total dict types:', Object.keys(grouped).length);
|
|
console.log('Total dict entries:', res.rows.length);
|
|
console.log('\nDict types:');
|
|
for (const [type, items] of Object.entries(grouped)) {
|
|
console.log(` ${type}: ${items.length} items - ${items.map(i => i.label).join(', ')}`);
|
|
}
|
|
|
|
await client.end();
|
|
}
|
|
|
|
main().catch(e => { console.error(e.message); process.exit(1); });
|