From 4962c79588284b35a6a84d35e322561bbf6ee5a9 Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Fri, 16 Aug 2024 23:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=BD=B1=E5=83=8F?= =?UTF-8?q?=E5=88=86=E6=A3=80=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pom.xml | 6 ++ .../admin/applyform/ApplyformController.java | 73 ++++++++++++++++++- .../service/applyform/ApplyformService.java | 3 +- .../applyform/ApplyformServiceImpl.java | 8 ++ .../dicomworklist/vo/DicomWorklistVO.java | 9 +++ .../dicomworklist/DicomworklistMapper.java | 4 + .../dicomworklist/DicomworklistMapper.xml | 5 ++ .../PatientexamlistController.java | 9 +++ .../PatientexamlistMapper.java | 6 +- .../PatientexamlistService.java | 11 ++- .../PatientexamlistServiceImpl.java | 45 +++++++++++- 11 files changed, 169 insertions(+), 10 deletions(-) diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/pom.xml b/yudao-module-applyregistration/yudao-module-applyregistration-biz/pom.xml index a9a5a4dc0..b70e80338 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/pom.xml +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/pom.xml @@ -126,6 +126,12 @@ 2.1.0-jdk8-snapshot compile + + cn.iocoder.boot + yudao-module-tblist-biz + 2.1.0-jdk8-snapshot + compile + diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java index 4f60492ac..e8042a838 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java @@ -8,10 +8,14 @@ import cn.iocoder.yudao.module.applyregistration.service.applyform.device.Device import cn.iocoder.yudao.module.system.controller.admin.dicomworklist.vo.DicomWorklistVO; import cn.iocoder.yudao.module.system.dal.dataobject.apiconfig.ApiconfigDO; import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicomworklistDO; +import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.apiconfig.ApiconfigService; import cn.iocoder.yudao.module.system.service.dicomworklist.DicomworklistService; +import cn.iocoder.yudao.module.system.service.org.OrgUnitService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import cn.iocoder.yudao.module.tblist.dal.dataobject.patientexamlist.PatientexamlistDO; +import cn.iocoder.yudao.module.tblist.service.patientexamlist.PatientexamlistService; import com.mzt.logapi.starter.annotation.LogRecord; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; @@ -25,6 +29,7 @@ import io.swagger.v3.oas.annotations.Operation; import java.sql.SQLException; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; @@ -72,6 +77,11 @@ public class ApplyformController { private AdminUserService userService; @Resource private DicomworklistService dicomworklistService; + @Resource + private PatientexamlistService patientexamlistService; + + @Resource + private OrgUnitService Service; @PostMapping("/create") @Operation(summary = "创建申请登记记录") @@ -176,6 +186,9 @@ public class ApplyformController { } else { List worklightDOS = getDicomworklistDOS(deviceVO, user); dicomworklistService.insertbatch(worklightDOS); + + List patientexamlistDOList = getPatientexamlistDOS(deviceVO, user); + patientexamlistService.insertbatch(patientexamlistDOList); } @@ -189,7 +202,7 @@ public class ApplyformController { } //处理数据 - private static @NotNull List getDicomworklistDOS(deviceupVO deviceVO, AdminUserDO user) { + private @NotNull List getDicomworklistDOS(deviceupVO deviceVO, AdminUserDO user) { List dicomworklistDOS = new ArrayList<>(); for (DicomWorklistVO item : deviceVO.getWorklist()) { // 处理每个元素 @@ -211,6 +224,36 @@ public class ApplyformController { return dicomworklistDOS; } + //处理数据 + private @NotNull List getPatientexamlistDOS(deviceupVO deviceVO, AdminUserDO user) { + List patientexamlistDOList = new ArrayList<>(); + OrgUnitDO aDo = Service.get(user.getOrgId()); + for (DicomWorklistVO item : deviceVO.getWorklist()) { + // 处理每个元素 + LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + LocalDate PatientBir = LocalDate.parse(item.getPatientBir(), DateTimeFormatter.ofPattern("yyyyMMdd")); + UUID guid = UUID.randomUUID(); + PatientexamlistDO patientexamlistDO = new PatientexamlistDO(); + patientexamlistDO.setId(guid.toString()); + patientexamlistDO.setExamId(item.getStudyInsta()); + patientexamlistDO.setPName(item.getPatientNam()); + patientexamlistDO.setGender(Objects.equals(item.getPatientSex(), "F") ?"女":"男"); + patientexamlistDO.setBirthday(PatientBir.atStartOfDay()); + patientexamlistDO.setDeviceType(item.getModality()); + patientexamlistDO.setExamItemName(item.getExamItemName()); + patientexamlistDO.setExamItemCode(item.getExamItemCode()); + patientexamlistDO.setReportstatus("已分检"); + patientexamlistDO.setApplicationDate(dateTime); + patientexamlistDO.setOrgId(user.getOrgId()); + patientexamlistDO.setOrgName(aDo.getOrgName()); + patientexamlistDO.setRegId(item.getPatientID()); + patientexamlistDO.setBillDoctorDepartment("影像科"); + patientexamlistDO.setDeviceName(item.getDevname()); + patientexamlistDOList.add(patientexamlistDO); + + } + return patientexamlistDOList; + } @DeleteMapping("/cancel") @Operation(summary = "申请单作废") @@ -246,8 +289,11 @@ public class ApplyformController { //最终提交的数据 List doList = new ArrayList<>(); List dicomworklistDOS = new ArrayList<>(); + List patientexamlistDOList = new ArrayList<>(); + //获取当前登陆用户 AdminUserDO user = userService.getUser(getLoginUserId()); + OrgUnitDO aDo = Service.get(user.getOrgId()); //当前时间 LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); //循环传递进来的参数 赋值 @@ -278,11 +324,34 @@ public class ApplyformController { dicomworklistDO.setOrgId(user.getOrgId()); dicomworklistDO.setRegistrant(user.getUsername()); dicomworklistDOS.add(dicomworklistDO); + + // 处理每个元素 + LocalDate PatientBir = LocalDate.parse(item.getPatientBir(), DateTimeFormatter.ofPattern("yyyyMMdd")); + UUID guid = UUID.randomUUID(); + PatientexamlistDO patientexamlistDO = new PatientexamlistDO(); + patientexamlistDO.setId(guid.toString()); + patientexamlistDO.setExamId(item.getStudyInsta()); + patientexamlistDO.setPName(item.getPatientNam()); + patientexamlistDO.setGender(Objects.equals(item.getPatientSex(), "F") ?"女":"男"); + patientexamlistDO.setBirthday(PatientBir.atStartOfDay()); + patientexamlistDO.setDeviceType(item.getModality()); + patientexamlistDO.setExamItemName(item.getExamItemName()); + patientexamlistDO.setExamItemCode(item.getExamItemCode()); + patientexamlistDO.setReportstatus("已分检"); + patientexamlistDO.setApplicationDate(dateTime); + patientexamlistDO.setOrgId(user.getOrgId()); + patientexamlistDO.setOrgName(aDo.getOrgName()); + patientexamlistDO.setRegId(item.getPatientID()); + patientexamlistDO.setBillDoctorDepartment("影像科"); + patientexamlistDO.setDeviceName(item.getDevname()); + patientexamlistDOList.add(patientexamlistDO); } + } - if (!doList.isEmpty() && !dicomworklistDOS.isEmpty()) { + if (!doList.isEmpty() && !dicomworklistDOS.isEmpty() && !patientexamlistDOList.isEmpty()) { boolean bol = applyformService.updateBatchById(doList); dicomworklistService.insertbatch(dicomworklistDOS); + patientexamlistService.insertbatch(patientexamlistDOList); return success(bol); } else { return success(false); diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java index b74172127..0c499f35e 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.* import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.module.tblist.dal.dataobject.patientexamlist.PatientexamlistDO; import com.baomidou.mybatisplus.extension.service.IService; import javax.validation.Valid; @@ -67,5 +68,5 @@ public interface ApplyformService extends IService { */ PageResult getApplyformPage(ApplyformPageReqVO pageReqVO); - + boolean insertbatch(List doList); } \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java index 61bea8074..39aa245e4 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.deviceupVO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import cn.iocoder.yudao.module.tblist.dal.dataobject.patientexamlist.PatientexamlistDO; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -132,5 +133,12 @@ public class ApplyformServiceImpl extends ServiceImpl getApplyformPage(ApplyformPageReqVO pageReqVO) { return applyformMapper.selectPage(pageReqVO); } + @Override + public boolean insertbatch(List doList) { + boolean bol=false; + bol= applyformMapper.insertBatch(doList); + + return bol; + } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dicomworklist/vo/DicomWorklistVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dicomworklist/vo/DicomWorklistVO.java index 33564f34d..541535eae 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dicomworklist/vo/DicomWorklistVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dicomworklist/vo/DicomWorklistVO.java @@ -47,4 +47,13 @@ public class DicomWorklistVO { @Schema(description = "登记医生") private String registrant; + + @Schema(description = "检查项目") + private String examItemName; + + @Schema(description = "检查项目ID") + private String examItemCode; + @Schema(description = "检查设备名称") + private String devname; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java index cad0315b7..df3daeda2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java @@ -60,6 +60,8 @@ public interface DicomworklistMapper extends BaseMapperX { // 根据ID查询DicomStudies表对应的数据 List GetDicomStudiesData(@Param("patientId") String patientId, @Param("orgId") String orgId); + // 根据ID查询DicomStudies表对应的数据 + List GetInstaDicomStudiesData(@Param("patientId") String patientId,@Param("StudyInsta") String StudyInsta, @Param("orgId") String orgId); // 根据Studies的StudyInsta查询DicomSeries表对应的数据 List GetDicomSeriesData(@Param("StudyInsta") String StudyInsta, @Param("orgId") String orgId); @@ -91,4 +93,6 @@ public interface DicomworklistMapper extends BaseMapperX { @Update(" UPDATE dicompatients t1 SET t1.dataSync='1' WHERE t1.PatientID=#{patientID} ") int UpdateDataSyncOfDicompatientsByPatientID(@Param("patientID") String patientID); + + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/dicomworklist/DicomworklistMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/dicomworklist/DicomworklistMapper.xml index d73ab4f2b..975a24e2f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/dicomworklist/DicomworklistMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/dicomworklist/DicomworklistMapper.xml @@ -19,6 +19,11 @@ resultType="cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicomstudiesDO"> select * from dicomstudies where PatientID=#{patientId} and orgId=#{orgId} + +