diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml index 0b0351431..698f1ea62 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml @@ -15,7 +15,11 @@ WHERE wsr2.prescription_no = drf.prescription_no AND wsr2.delete_flag = '0'), drf.name ) AS name, - drf.desc_json, + CASE + WHEN drf.desc_json::jsonb ->> 'targetDepartment' = '' AND MIN(wsr.org_id) IS NOT NULL THEN + (drf.desc_json::jsonb || jsonb_build_object('targetDepartment', MIN(wsr.org_id)::text))::text + ELSE drf.desc_json + END AS desc_json, drf.requester_id, drf.create_time, ap.NAME AS patient_name,