feat(zpfb): 更新邹平配置,移除 mock 数据支持

This commit is contained in:
Jafeng 2026-06-22 16:35:58 +08:00
parent b8a6e9a8e1
commit e89e1e466a
6 changed files with 4 additions and 181 deletions

View File

@ -3,7 +3,7 @@ CONFIG_ADAPTER_ROLE=gateway
CONFIG_MONGO_ENABLED=false
# 测试环境: 前端按 HIS 选项传固定 corpId网关按 corpId 路由到医院编码。
CONFIG_HOSPITAL_ADAPTER_CORP_MAP={"wwa54dfba0b5441ef1":"gk","zpfb-corp-id":"zpfb"}
CONFIG_HOSPITAL_ADAPTER_CORP_MAP={"wwa54dfba0b5441ef1":"gk","wpLgjyawAAEqxCUmBMjLo8CnXdDuQoeg":"zpfb"}
CONFIG_HOSPITAL_ADAPTER_ROUTE_MODE_MAP={"gk":"local","zpfb":"direct"}
CONFIG_HOSPITAL_ADAPTER_DIRECT_URL_MAP={"zpfb":"http://120.224.145.13:8082"}

View File

@ -128,7 +128,7 @@ dist\bundle.gateway.js
当前 `.env.gateway``gateway` 模式,前端 HIS 选项会传固定 `corpId`,网关按 `corpId` 路由医院编码,再按医院编码选择调用模式。广口走本地 `gk` adapter邹平走 `direct` 访问前置机公网地址:
```bash
CONFIG_HOSPITAL_ADAPTER_CORP_MAP={"wwa54dfba0b5441ef1":"gk","zpfb-corp-id":"zpfb"}
CONFIG_HOSPITAL_ADAPTER_CORP_MAP={"wwa54dfba0b5441ef1":"gk","wpLgjyawAAEqxCUmBMjLo8CnXdDuQoeg":"zpfb"}
CONFIG_HOSPITAL_ADAPTER_ROUTE_MODE_MAP={"gk":"local","zpfb":"direct"}
CONFIG_HOSPITAL_ADAPTER_DIRECT_URL_MAP={"zpfb":"http://120.224.145.13:8082"}
CONFIG_GK_JHIDS_PROXY_URL=https://crm.gykqyy.com/ykt/getYoucanData/gkJhids
@ -159,7 +159,7 @@ npm run build -- --env-file .env.zpfb --out dist\bundle.zpfb.js
每家医院可配置:
- `CONFIG_<HOSPITAL>_SOURCE_TYPE`: `mock | view | http | webservice`
- `CONFIG_<HOSPITAL>_SOURCE_TYPE`: `view | http | webservice`
- `CONFIG_<HOSPITAL>_BASE_URL`: HTTP/WebService 上游地址
- `CONFIG_<HOSPITAL>_DB_TYPE`: 视图数据库类型,支持 `mssql | oracle | oracle_sqlplus`
- `CONFIG_<HOSPITAL>_DB_HOST`: 视图数据库地址

View File

@ -1,5 +1,4 @@
const { RESOURCE_DEFINITIONS } = require("../../contracts/resources");
const mockData = require("./mock-data");
const hospitalCode = "zpfb";
const envPrefix = "ZPFB";
@ -22,7 +21,7 @@ const resources = Object.entries(RESOURCE_DEFINITIONS).reduce((acc, [resource, d
const defaults = viewDefaults[resource] || {};
acc[resource] = {
enabled: parseBoolean(process.env[`CONFIG_${envPrefix}_${upperResource}_ENABLED`], enabledByDefault.has(resource)),
sourceType: process.env[`CONFIG_${envPrefix}_${upperResource}_SOURCE_TYPE`] || process.env.CONFIG_ZPFB_SOURCE_TYPE || "mock",
sourceType: process.env[`CONFIG_${envPrefix}_${upperResource}_SOURCE_TYPE`] || process.env.CONFIG_ZPFB_SOURCE_TYPE || "view",
viewName: process.env[`CONFIG_${envPrefix}_${upperResource}_VIEW_NAME`] || definition.viewName,
endpoint: process.env[`CONFIG_${envPrefix}_${upperResource}_ENDPOINT`] || definition.endpoint,
defaultOrderBy: process.env[`CONFIG_${envPrefix}_${upperResource}_ORDER_BY`] || defaults.defaultOrderBy || definition.fields[0],
@ -42,5 +41,4 @@ module.exports = {
name: "邹平妇保",
envPrefix,
resources,
mockData,
};

View File

@ -1,141 +0,0 @@
module.exports = {
patient: [
{
patient_id: "P20230001",
patient_no: "OP20230001",
patient_name: "张三",
id_type: "1",
id_num: "110101199001011234",
mobile_phone_no: "13912345678",
sex: "1",
dob: "1990-01-01",
family_addr_area: "北京市朝阳区",
family_addr_detail: "XX街道XX小区1号楼1单元101室",
professional: "教师",
employer: "XX中学",
charge_type: "01",
charge_type_name: "城镇职工基本医疗保险",
allergy: "青霉素过敏",
history: "高血压病史5年",
create_date: "2018-05-10",
create_time: "2018-05-10 09:00:00",
update_time: "2026-06-15 09:00:00",
},
],
outpatientRecord: [
{
patient_id: "P20230001",
patient_no: "OP20230001",
patient_name: "张三",
visit_time: "2022-08-01 08:00:00",
leave_time: "2022-08-01 11:00:00",
visit_dept_code: "DEPT001",
visit_dept_name: "内科",
visit_doctor_code: "DOC001",
visit_doctor_name: "李四",
visit_service_code: "SER001",
visit_service_name: "王五",
diagnosis_ids: "E65.x02,E65.x03",
diagnosis_names: "背部脂肪堆积,高血压",
chief_complaint: "头晕、乏力3天",
entrust: "注意休息,按时服药",
create_time: "2022-08-01 08:00:00",
update_time: "2022-08-01 11:00:00",
},
],
orderInfo: [
{
order_no: "ORD202300001",
patient_id: "P20230001",
patient_no: "OP20230001",
admission_id: "ADM202300001",
dept_code: "DEPT001",
ward_code: "WARD001",
doctor_code: "DOC001",
doctor_name: "李四",
order_type: "OT001",
order_type_name: "长期医嘱",
order_code: "OC001",
order_name: "降压治疗",
drug_name: "硝苯地平缓释片",
drug_country_code: "国药准字H10910052",
frequency_code: "QD",
dosage: 20,
dosage_unit: "mg",
route_code: "PO",
route_name: "口服",
order_status: "在用",
enter_time: "2023-05-10 09:30:00",
start_time: "2023-05-10 10:00:00",
stop_time: "",
description: "每日一次,早餐后服用",
create_time: "2023-05-10 09:30:00",
update_time: "2023-05-10 09:30:00",
},
],
pacsInfo: [
{
report_id: "REP202300001",
patient_id: "P20230001",
patient_no: "OP20230001",
admission_id: "ADM202300001",
request_time: "2023-06-15 08:30:00",
app_dept_code: "DEPT002",
app_dept_name: "外科",
app_ward_code: "WARD002",
app_ward_name: "外科二病区",
app_doctor_code: "DOC002",
app_doctor_name: "赵六",
report_name: "胸部CT检查报告",
test_position: "胸部",
test_position_code: "ACR001",
test_result: "双肺纹理清晰,未见明显异常密度影。",
test_diag: "胸部未见明显异常",
test_link: "https://example.com/imaging/REP202300001",
test_remarks: "建议每年进行一次常规体检",
test_time: "2023-06-15 10:15:00",
report_time: "2023-06-15 11:00:00",
report_code: "DOC002",
create_time: "2023-06-15 11:00:00",
update_time: "2023-06-15 11:00:00",
},
],
lisInfo: [
{
report_id: "LIS202300001",
patient_id: "P20230001",
patient_no: "OP20230001",
admission_id: "ADM202300001",
report_name: "血常规",
report_time: "2024-06-10 10:00:00",
report_code: "DOC015",
request_time: "2024-06-10 08:15:00",
app_doctor_code: "DOC009",
app_doctor_name: "吴医生",
remarks: "各项指标基本正常,未见明显异常",
create_time: "2024-06-10 10:00:00",
update_time: "2024-06-10 10:00:00",
},
],
lisDetail: [
{
report_id: "LIS202300001",
patient_id: "P20230001",
patient_no: "OP20230001",
admission_id: "ADM202300001",
item_id: "HB",
item_name: "血红蛋白",
report_details: "130",
abnormality_flag: "",
critical_flag: "0",
high_max_value: "160",
low_max_value: "120",
value_unit: "g/L",
range_description: "120-160",
remarks: "",
create_time: "2024-06-10 10:00:00",
update_time: "2024-06-10 10:00:00",
},
],
};

View File

@ -1,11 +1,9 @@
const { queryMock } = require("./mock");
const { queryHttp } = require("./http");
const { queryWebservice } = require("./webservice");
const { queryView } = require("./view");
async function querySource(options) {
const sourceType = options.resourceConfig.sourceType;
if (sourceType === "mock") return queryMock(options);
if (sourceType === "http") return queryHttp(options);
if (sourceType === "webservice") return queryWebservice(options);
if (sourceType === "view") return queryView(options);
@ -17,4 +15,3 @@ async function querySource(options) {
module.exports = {
querySource,
};

View File

@ -1,31 +0,0 @@
function queryMock({ adapter, resource, query }) {
const rows = adapter.mockData && Array.isArray(adapter.mockData[resource]) ? adapter.mockData[resource] : [];
const filteredRows = filterRows(rows, query);
const page = toPositiveInteger(query && query.page, 1);
const pageSize = toPositiveInteger(query && query.pageSize, 20);
return {
rows: filteredRows.slice((page - 1) * pageSize, page * pageSize),
total: filteredRows.length,
alreadyPaged: true,
};
}
function filterRows(rows, query) {
const filters = Object.entries(query || {}).filter(([key, value]) => {
if (["page", "pageSize", "start_date", "end_date", "startCreateTime", "endCreateTime", "startUpdateTime", "endUpdateTime"].includes(key)) return false;
return value !== undefined && value !== null && String(value).trim() !== "";
});
if (!filters.length) return rows;
return rows.filter((row) => {
return filters.every(([key, value]) => String(row[key] || "").includes(String(value).trim()));
});
}
function toPositiveInteger(value, defaultValue) {
const numberValue = Number(value);
return Number.isInteger(numberValue) && numberValue > 0 ? numberValue : defaultValue;
}
module.exports = {
queryMock,
};