diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java index 13b77c4e..b8117afc 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java @@ -87,6 +87,9 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService { @Resource private IOperatingRoomService operatingRoomService; + @Resource + private com.openhis.administration.service.IPractitionerService practitionerService; + /** * 分页查询手术列表 * @@ -425,43 +428,43 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService { } } - // 填充主刀医生姓名 + // 填充主刀医生姓名(使用practitionerId查询Practitioner表) if (surgery.getMainSurgeonId() != null) { - SysUser mainSurgeon = sysUserService.selectUserById(surgery.getMainSurgeonId()); + com.openhis.administration.domain.Practitioner mainSurgeon = practitionerService.getById(surgery.getMainSurgeonId()); if (mainSurgeon != null) { - surgery.setMainSurgeonName(mainSurgeon.getNickName()); + surgery.setMainSurgeonName(mainSurgeon.getName()); } } - // 填充麻醉医生姓名 + // 填充麻醉医生姓名(使用practitionerId查询Practitioner表) if (surgery.getAnesthetistId() != null) { - SysUser anesthetist = sysUserService.selectUserById(surgery.getAnesthetistId()); + com.openhis.administration.domain.Practitioner anesthetist = practitionerService.getById(surgery.getAnesthetistId()); if (anesthetist != null) { - surgery.setAnesthetistName(anesthetist.getNickName()); + surgery.setAnesthetistName(anesthetist.getName()); } } - // 填充助手1姓名 + // 填充助手1姓名(使用practitionerId查询Practitioner表) if (surgery.getAssistant1Id() != null) { - SysUser assistant1 = sysUserService.selectUserById(surgery.getAssistant1Id()); + com.openhis.administration.domain.Practitioner assistant1 = practitionerService.getById(surgery.getAssistant1Id()); if (assistant1 != null) { - surgery.setAssistant1Name(assistant1.getNickName()); + surgery.setAssistant1Name(assistant1.getName()); } } - // 填充助手2姓名 + // 填充助手2姓名(使用practitionerId查询Practitioner表) if (surgery.getAssistant2Id() != null) { - SysUser assistant2 = sysUserService.selectUserById(surgery.getAssistant2Id()); + com.openhis.administration.domain.Practitioner assistant2 = practitionerService.getById(surgery.getAssistant2Id()); if (assistant2 != null) { - surgery.setAssistant2Name(assistant2.getNickName()); + surgery.setAssistant2Name(assistant2.getName()); } } - // 填充巡回护士姓名 + // 填充巡回护士姓名(使用practitionerId查询Practitioner表) if (surgery.getScrubNurseId() != null) { - SysUser scrubNurse = sysUserService.selectUserById(surgery.getScrubNurseId()); + com.openhis.administration.domain.Practitioner scrubNurse = practitionerService.getById(surgery.getScrubNurseId()); if (scrubNurse != null) { - surgery.setScrubNurseName(scrubNurse.getNickName()); + surgery.setScrubNurseName(scrubNurse.getName()); } } @@ -489,11 +492,11 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService { } } - // 填充申请医生姓名(如果还没有设置) + // 填充申请医生姓名(如果还没有设置) - 使用practitionerId查询Practitioner表 if (surgery.getApplyDoctorId() != null && (surgery.getApplyDoctorName() == null || surgery.getApplyDoctorName().isEmpty())) { - SysUser applyDoctor = sysUserService.selectUserById(surgery.getApplyDoctorId()); + com.openhis.administration.domain.Practitioner applyDoctor = practitionerService.getById(surgery.getApplyDoctorId()); if (applyDoctor != null) { - surgery.setApplyDoctorName(applyDoctor.getNickName()); + surgery.setApplyDoctorName(applyDoctor.getName()); } } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml index 5bc57ff6..557ea422 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml @@ -75,9 +75,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" s.encounter_id, e.bus_no as encounter_no, s.apply_doctor_id, - s.apply_doctor_name, + COALESCE(s.apply_doctor_name, apply_doc.name) as apply_doctor_name, s.apply_dept_id, - s.apply_dept_name, + COALESCE(s.apply_dept_name, apply_dept.name) as apply_dept_name, s.surgery_name, s.surgery_code, s.surgery_type_enum, @@ -111,15 +111,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" s.actual_start_time, s.actual_end_time, s.main_surgeon_id, - s.main_surgeon_name, + COALESCE(s.main_surgeon_name, main_surgeon.name) as main_surgeon_name, s.assistant_1_id, - s.assistant_1_name, + COALESCE(s.assistant_1_name, assistant1.name) as assistant_1_name, s.assistant_2_id, - s.assistant_2_name, + COALESCE(s.assistant_2_name, assistant2.name) as assistant_2_name, s.anesthetist_id, - s.anesthetist_name, + COALESCE(s.anesthetist_name, anesthetist.name) as anesthetist_name, s.scrub_nurse_id, - s.scrub_nurse_name, + COALESCE(s.scrub_nurse_name, scrub_nurse.name) as scrub_nurse_name, s.anesthesia_type_enum, CASE s.anesthesia_type_enum WHEN 0 THEN '无麻醉' @@ -148,11 +148,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ELSE '未知' END as healing_level_dictText, s.operating_room_id, - s.operating_room_name, + COALESCE(s.operating_room_name, r.name) as operating_room_name, r.organization_id as operating_room_org_id, ro.name as operating_room_org_name, s.org_id, - o.name as org_name, + COALESCE(s.org_name, o.name) as org_name, s.preoperative_diagnosis, s.postoperative_diagnosis, s.surgery_description, @@ -170,6 +170,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN adm_operating_room r ON s.operating_room_id = r.id LEFT JOIN adm_organization ro ON r.organization_id = ro.id LEFT JOIN adm_organization o ON s.org_id = o.id + LEFT JOIN adm_practitioner main_surgeon ON s.main_surgeon_id = main_surgeon.id + LEFT JOIN adm_practitioner anesthetist ON s.anesthetist_id = anesthetist.id + LEFT JOIN adm_practitioner assistant1 ON s.assistant_1_id = assistant1.id + LEFT JOIN adm_practitioner assistant2 ON s.assistant_2_id = assistant2.id + LEFT JOIN adm_practitioner scrub_nurse ON s.scrub_nurse_id = scrub_nurse.id + LEFT JOIN adm_practitioner apply_doc ON s.apply_doctor_id = apply_doc.id + LEFT JOIN adm_organization apply_dept ON s.apply_dept_id = apply_dept.id