fix: 护理记录患者列表科室ID从就诊表获取 (Bug #175)
- 将org_id来源从adm_patient改为adm_encounter - adm_patient.organization_id通常为空 - adm_encounter.organization_id才是入院科室 - 修复按科室过滤时查不到患者的问题
This commit is contained in:
@@ -16,13 +16,13 @@
|
||||
T5.ward_location_id,
|
||||
T5.bed_location_id
|
||||
FROM (SELECT T1.tenant_id,
|
||||
T1.id AS patient_id, --患者ID
|
||||
T1.name AS patient_name, --患者姓名
|
||||
T1.bus_no AS patient_bus_no, --病历号
|
||||
T1.birth_date, --患者出生日期
|
||||
T1.gender_enum, --患者性别
|
||||
T1.organization_id AS org_id, --科室ID
|
||||
T2.id AS encounter_id, --就诊ID
|
||||
T1.id AS patient_id, --患者ID
|
||||
T1.name AS patient_name, --患者姓名
|
||||
T1.bus_no AS patient_bus_no, --病历号
|
||||
T1.birth_date, --患者出生日期
|
||||
T1.gender_enum, --患者性别
|
||||
T2.organization_id AS org_id, --科室ID(从就诊表取)
|
||||
T2.id AS encounter_id, --就诊ID
|
||||
T2.start_time AS admissionDate, --入院日期
|
||||
T3.location_id AS ward_location_id, --病区
|
||||
T4.location_id AS bed_location_id --床号
|
||||
@@ -79,12 +79,12 @@
|
||||
T6.context_json,
|
||||
T6.bed_location_id
|
||||
FROM (SELECT T1.tenant_id,
|
||||
T1.id AS patient_id, --患者ID
|
||||
T1.name AS patient_name, --患者姓名
|
||||
T1.birth_date, --患者出生日期
|
||||
T1.gender_enum, --患者性别
|
||||
T1.organization_id AS org_id, --科室ID
|
||||
T2.id AS encounter_id, --就诊ID
|
||||
T1.id AS patient_id, --患者ID
|
||||
T1.name AS patient_name, --患者姓名
|
||||
T1.birth_date, --患者出生日期
|
||||
T1.gender_enum, --患者性别
|
||||
T2.organization_id AS org_id, --科室ID(从就诊表取)
|
||||
T2.id AS encounter_id, --就诊ID
|
||||
T2.start_time AS admissionDate, --入院日期
|
||||
T3.location_id AS ward_location_id, --病区
|
||||
T5.id AS record_id, --记录单ID
|
||||
|
||||
Reference in New Issue
Block a user