From 91500e550f29471d5a17c4e3828315783ddbf5f5 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Mon, 10 Mar 2025 16:15:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E6=8E=A5=E8=AF=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IDoctorStationMainAppService.java | 28 +++++++- .../impl/DoctorStationMainAppServiceImpl.java | 65 ++++++++++++++++--- .../DoctorStationMainController.java | 36 +++++++++- .../mapper/DoctorStationMainAppMapper.java | 2 +- 4 files changed, 118 insertions(+), 13 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationMainAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationMainAppService.java index 3da7caec..c3b41983 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationMainAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationMainAppService.java @@ -1,10 +1,12 @@ package com.openhis.web.doctorstation.appservice; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.core.common.core.domain.R; import com.openhis.web.doctorstation.dto.PatientInfoDto; +import org.springframework.web.bind.annotation.RequestParam; /** - * 医生站-电子病历 应用Service + * 医生站-主页面 应用Service */ public interface IDoctorStationMainAppService { @@ -20,4 +22,28 @@ public interface IDoctorStationMainAppService { IPage getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo, Integer pageSize); + /** + * 医生接诊 + * + * @param encounterId 就诊id + * @return 结果 + */ + R receiveEncounter(Long encounterId); + + /** + * 患者暂离 + * + * @param encounterId 就诊id + * @return 结果 + */ + R leaveEncounter(Long encounterId); + + /** + * 就诊完成 + * + * @param encounterId 就诊id + * @return 结果 + */ + R completeEncounter(Long encounterId); + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java index fefae69c..3d520804 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java @@ -5,26 +5,25 @@ import java.util.HashSet; import javax.annotation.Resource; -import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService; -import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; import com.core.common.utils.AgeCalculatorUtil; -import com.openhis.common.enums.AdministrativeGender; -import com.openhis.common.enums.ClinicalStatus; -import com.openhis.common.enums.EncounterStatus; -import com.openhis.common.enums.ParticipantType; +import com.openhis.administration.domain.Encounter; +import com.openhis.administration.mapper.EncounterMapper; +import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; -import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService; +import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService; import com.openhis.web.doctorstation.dto.PatientInfoDto; -import com.openhis.web.doctorstation.mapper.DoctorStationEmrAppMapper; +import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper; /** - * 医生站-电子病历 应用实现类 + * 医生站-主页面 应用实现类 */ @Service public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService { @@ -32,6 +31,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer @Resource DoctorStationMainAppMapper doctorStationMainAppMapper; + @Resource + EncounterMapper encounterMapper; + /** * 查询就诊患者信息 * @@ -60,4 +62,49 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer return patientInfo; } + /** + * 医生接诊 + * + * @param encounterId 就诊id + * @return 结果 + */ + @Override + public R receiveEncounter(Long encounterId) { + int update = encounterMapper.update(null, + new LambdaUpdateWrapper().eq(Encounter::getId, encounterId) + .set(Encounter::getStatusEnum, EncounterStatus.IN_PROGRESS.getValue()) + .set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.RECEIVING_CARE.getValue())); + return update > 0 ? R.ok() : R.fail(); + } + + /** + * 患者暂离 + * + * @param encounterId 就诊id + * @return 结果 + */ + @Override + public R leaveEncounter(Long encounterId) { + int update = encounterMapper.update(null, + new LambdaUpdateWrapper().eq(Encounter::getId, encounterId) + .set(Encounter::getStatusEnum, EncounterStatus.ON_HOLD.getValue()) + .set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.ON_LEAVE.getValue())); + return update > 0 ? R.ok() : R.fail(); + } + + /** + * 就诊完成 + * + * @param encounterId 就诊id + * @return 结果 + */ + @Override + public R completeEncounter(Long encounterId) { + int update = encounterMapper.update(null, + new LambdaUpdateWrapper().eq(Encounter::getId, encounterId) + .set(Encounter::getStatusEnum, EncounterStatus.DISCHARGED.getValue()) + .set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.DEPARTED.getValue())); + return update > 0 ? R.ok() : R.fail(); + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationMainController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationMainController.java index f3b88e27..a78b0add 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationMainController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationMainController.java @@ -3,14 +3,13 @@ */ package com.openhis.web.doctorstation.controller; -import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.core.common.core.domain.R; -import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService; +import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService; import com.openhis.web.doctorstation.dto.DoctorStationInitDto; import com.openhis.web.doctorstation.dto.PatientInfoDto; @@ -55,4 +54,37 @@ public class DoctorStationMainController { return R.ok(iDoctorStationMainAppService.getPatientInfo(patientInfoDto, searchKey, pageNo, pageSize)); } + /** + * 医生接诊 + * + * @param encounterId 就诊id + * @return 结果 + */ + @GetMapping(value = "/receive-encounter") + public R receiveEncounter(@RequestParam Long encounterId) { + return iDoctorStationMainAppService.receiveEncounter(encounterId); + } + + /** + * 患者暂离 + * + * @param encounterId 就诊id + * @return 结果 + */ + @GetMapping(value = "/leave-encounter") + public R leaveEncounter(@RequestParam Long encounterId) { + return iDoctorStationMainAppService.leaveEncounter(encounterId); + } + + /** + * 就诊完成 + * + * @param encounterId 就诊id + * @return 结果 + */ + @GetMapping(value = "/complete-encounter") + public R completeEncounter(@RequestParam Long encounterId) { + return iDoctorStationMainAppService.completeEncounter(encounterId); + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationMainAppMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationMainAppMapper.java index a8316cd6..8d36af03 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationMainAppMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationMainAppMapper.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.openhis.web.doctorstation.dto.PatientInfoDto; /** - * 医生站-电子病历 应用Mapper + * 医生站-主页面 应用Mapper */ @Repository public interface DoctorStationMainAppMapper {