diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationEmrAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationEmrAppServiceImpl.java index 8282df46f..73c64d46d 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationEmrAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationEmrAppServiceImpl.java @@ -149,7 +149,7 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi return R.ok(null); } // 先查询门诊病历(emr表) - Emr emrDetail = emrService.getOne(new LambdaQueryWrapper().eq(Emr::getEncounterId, encounterId), false); + Emr emrDetail = emrService.getOne(new LambdaQueryWrapper().eq(Emr::getEncounterId, encounterId).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false); if (emrDetail != null) { return R.ok(emrDetail); }