diff --git a/openhis-server-new/core-admin/pom.xml b/openhis-server-new/core-admin/pom.xml
index 8fc2c124da333e9da01130c81eb1b159059b342b..227e9fe0a6e24075c5663a44eca5b2a45f414b21 100644
--- a/openhis-server-new/core-admin/pom.xml
+++ b/openhis-server-new/core-admin/pom.xml
@@ -36,11 +36,13 @@
io.swagger
swagger-models
+ 1.6.2
+
- com.mysql
- mysql-connector-j
+ mysql
+ mysql-connector-java
diff --git a/openhis-server-new/core-common/pom.xml b/openhis-server-new/core-common/pom.xml
index b73c4296c864aacb24384579df628cedec9eb06e..fb1779627562c81263408d6ece06f26a83ab8f12 100644
--- a/openhis-server-new/core-common/pom.xml
+++ b/openhis-server-new/core-common/pom.xml
@@ -77,10 +77,6 @@
com.alibaba.fastjson2
fastjson2
-
- com.alibaba
- fastjson
-
@@ -140,6 +136,7 @@
com.belerweb
pinyin4j
+ 2.5.1
diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java
new file mode 100644
index 0000000000000000000000000000000000000000..9431c01fefdef5c86750ca1a30675ea184d29e52
--- /dev/null
+++ b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java
@@ -0,0 +1,38 @@
+package com.core.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * Excel额外表头信息注解
+ *
+ * @author swb
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ExcelExtra {
+ /**
+ * 表头名称
+ */
+ String name();
+
+ /**
+ * 日期格式,如:yyyy-MM-dd HH:mm:ss
+ */
+ String dateFormat() default "";
+
+ /**
+ * 排序(越小越靠前)
+ */
+ int sort() default 0;
+
+ /**
+ * 默认值
+ */
+ String defaultValue() default "";
+
+ /**
+ * 是否导出
+ */
+ boolean isExport() default true;
+}
\ No newline at end of file
diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/DelFlag.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/DelFlag.java
similarity index 77%
rename from openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/DelFlag.java
rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/DelFlag.java
index 0e8b0f4fa16c49d01a3f2ea0ba9ebd3bffcac7a4..f59c8060b33f24a3aeaf183cbe618092718b62d8 100644
--- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/DelFlag.java
+++ b/openhis-server-new/core-common/src/main/java/com/core/common/enums/DelFlag.java
@@ -1,10 +1,13 @@
-package com.openhis.common.enums;
+package com.core.common.enums;
+
+import lombok.Getter;
/**
* 删除标识
*
* @author system
*/
+@Getter
public enum DelFlag {
/**
* 未删除
@@ -25,18 +28,6 @@ public enum DelFlag {
this.info = info;
}
- public String getCode() {
- return code;
- }
-
- public String getInfo() {
- return info;
- }
-
- public Integer getValue() {
- return value;
- }
-
public static DelFlag getByValue(Integer value) {
if (value == null) {
return null;
diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/enums/DeleteFlag.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/DeleteFlag.java
deleted file mode 100644
index 1668d5367ac1fcdb384d18946ac6531c45ec2cb9..0000000000000000000000000000000000000000
--- a/openhis-server-new/core-common/src/main/java/com/core/common/enums/DeleteFlag.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.core.common.enums;
-
-/**
- * 删除标志
- *
- * @author system
- */
-public enum DeleteFlag {
- NOT_DELETED("0", "未删除"), DELETED("1", "已删除");
-
- private final String code;
- private final String info;
-
- DeleteFlag(String code, String info) {
- this.code = code;
- this.info = info;
- }
-
- public String getCode() {
- return code;
- }
-
- public String getInfo() {
- return info;
- }
-}
diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java
index a03a2d0fd37a5e94d99db26e5f30f9ebad7289b1..5ac09b28b1f9005dd248228465a2d2740d269779 100644
--- a/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java
+++ b/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java
@@ -160,7 +160,7 @@ public enum TenantOptionDict {
/**
* 电子发票开关
*/
- INVOICE_SWITCH("invoiceSwitch", "电子发票开关 (0:关闭 1:开启)", 56),
+ INVOICE_SWITCH("invoiceSwitch", "电子发票开关", 56),
/**
* 医嘱定价来源
@@ -170,41 +170,153 @@ public enum TenantOptionDict {
/**
* 三方支付(签到)
*/
- THREE_PART_SIGN_URL("threePartSignUrl", "三方支付GET请求", 58),
+ THREE_PART_SIGN_URL("threePartSignUrl", "三方支付【签到】请求路径", 58),
+ /**
+ * 三方支付(签到)
+ */
+ THREE_PART_SIGN_STATIC_PARAM("threePartSignStaticParam", "三方支付【签到】固定参数", 59),
+ /**
+ * 三方支付(签到)
+ */
+ THREE_PART_SIGN_ACTIVE_PARAM("threePartSignActiveParam", "三方支付【签到】可变参数", 60),
+ /**
+ * 三方支付(签到)
+ */
+ THREE_PART_SIGN_MAPPING_METHOD("threePartSignMappingMethod", "三方支付【签到】请求方式", 61),
+ /**
+ * 三方支付(消费)
+ */
+ THREE_PART_PAY_URL("threePartPayUrl", "三方支付【消费】请求路径", 62),
+ /**
+ * 三方支付(消费)
+ */
+ THREE_PART_PAY_STATIC_PARAM("threePartPayStaticParam", "三方支付【消费】固定参数", 63),
+ /**
+ * 三方支付(消费)
+ */
+ THREE_PART_PAY_ACTIVE_PARAM("threePartPayActiveParam", "三方支付【消费】可变参数", 64),
/**
* 三方支付(消费)
*/
- THREE_PART_PAY_URL("threePartPayUrl", "三方支付GET请求", 59),
+ THREE_PART_PAY_MAPPING_METHOD("threePartPayMappingMethod", "三方支付【消费】请求方式", 65),
/**
* 三方支付(退费)
*/
- THREE_PART_RETURN_URL("threePartReturnUrl", "三方支付GET请求", 60),
+ THREE_PART_RETURN_URL("threePartReturnUrl", "三方支付【退费】请求路径", 66),
+ /**
+ * 三方支付(退费)
+ */
+ THREE_PART_RETURN_STATIC_PARAM("threePartReturnStaticParam", "三方支付【退费】固定参数", 67),
+ /**
+ * 三方支付(退费)
+ */
+ THREE_PART_RETURN_ACTIVE_PARAM("threePartReturnActiveParam", "三方支付【退费】可变参数", 68),
+ /**
+ * 三方支付(退费)
+ */
+ THREE_PART_RETURN_MAPPING_METHOD("threePartReturnMappingMethod", "三方支付【退费】请求方式", 69),
/**
* 三方支付(隔天退费)
*/
- THREE_PART_NEXT_DAY_RETURN_URL("threePartNextDayReturnUrl", "三方支付GET请求", 61),
+ THREE_PART_NEXT_DAY_RETURN_URL("threePartNextDayReturnUrl", "三方支付【隔天退费】请求路径", 70),
+ /**
+ * 三方支付(隔天退费)
+ */
+ THREE_PART_NEXT_DAY_RETURN_STATIC_PARAM("threePartNextDayReturnStaticParam", "三方支付【隔天退费】固定参数", 71),
+ /**
+ * 三方支付(隔天退费)
+ */
+ THREE_PART_NEXT_DAY_RETURN_ACTIVE_PARAM("threePartNextDayReturnActiveParam", "三方支付【隔天退费】可变参数", 72),
+ /**
+ * 三方支付(隔天退费)
+ */
+ THREE_PART_NEXT_DAY_RETURN_MAPPING_METHOD("threePartNextDayReturnMappingMethod", "三方支付【隔天退费】请求方式", 73),
/**
* 三方支付路径(支付结果查询)
*/
- THREE_PART_PAY_QUERY_URL("threePartPayQueryUrl", "三方支付GET请求", 62),
+ THREE_PART_PAY_QUERY_URL("threePartPayQueryUrl", "三方支付【支付结果查询】请求路径", 74),
+ /**
+ * 三方支付(支付结果查询)
+ */
+ THREE_PART_PAY_QUERY_STATIC_PARAM("threePartPayQueryStaticParam", "三方支付【支付结果查询】固定参数", 75),
+ /**
+ * 三方支付(支付结果查询)
+ */
+ THREE_PART_PAY_QUERY_ACTIVE_PARAM("threePartPayQueryActiveParam", "三方支付【支付结果查询】可变参数", 76),
+ /**
+ * 三方支付(支付结果查询)
+ */
+ THREE_PART_PAY_QUERY_MAPPING_METHOD("threePartPayQueryMappingMethod", "三方支付【支付结果查询】请求方式", 77),
/**
* 三方支付路径(退费结果查询)
*/
- THREE_PART_RETURN_QUERY_URL("threePartReturnQueryUrl", "三方支付GET请求", 63),
+ THREE_PART_RETURN_QUERY_URL("threePartReturnQueryUrl", "三方支付【退费结果查询】请求路径", 78),
+ /**
+ * 三方支付(退费结果查询)
+ */
+ THREE_PART_RETURN_QUERY_STATIC_PARAM("threePartReturnQueryStaticParam", "三方支付【退费结果查询】固定参数", 79),
+ /**
+ * 三方支付(退费结果查询)
+ */
+ THREE_PART_RETURN_QUERY_ACTIVE_PARAM("threePartReturnQueryActiveParam", "三方支付【退费结果查询】可变参数", 80),
+ /**
+ * 三方支付(退费结果查询)
+ */
+ THREE_PART_RETURN_QUERY_MAPPING_METHOD("threePartReturnQueryMappingMethod", "三方支付【退费结果查询】请求方式", 81),
/**
* 三方支付路径(隔天退费结果查询)
*/
- THREE_PART_NEXT_DAY_RETURN_QUERY_URL("threePartNextDayReturnQueryUrl", "三方支付GET请求", 64),
+ THREE_PART_NEXT_DAY_RETURN_QUERY_URL("threePartNextDayReturnQueryUrl", "三方支付【隔天退费结果查询】请求路径", 82),
+ /**
+ * 三方支付(隔天退费结果查询)
+ */
+ THREE_PART_NEXT_DAY_RETURN_QUERY_STATIC_PARAM("threePartNextDayReturnQueryStaticParam", "三方支付【隔天退费结果查询】固定参数", 83),
+ /**
+ * 三方支付(隔天退费结果查询)
+ */
+ THREE_PART_NEXT_DAY_RETURN_QUERY_ACTIVE_PARAM("threePartNextDayReturnQueryActiveParam", "三方支付【隔天退费结果查询】可变参数", 84),
+ /**
+ * 三方支付(隔天退费结果查询)
+ */
+ THREE_PART_NEXT_DAY_RETURN_QUERY_MAPPING_METHOD("threePartNextDayReturnQueryMappingMethod", "三方支付【隔天退费结果查询】请求方式",
+ 85),
+
+ /**
+ * 三方支付(签出)
+ */
+ THREE_PART_SIGN_OUT_URL("threePartSignOutUrl", "三方支付【签出】请求路径", 86),
+ /**
+ * 三方支付(签出)
+ */
+ THREE_PART_SIGN_OUT_STATIC_PARAM("threePartSignOutStaticParam", "三方支付【签出】固定参数", 87),
+ /**
+ * 三方支付(签出)
+ */
+ THREE_PART_SIGN_OUT_ACTIVE_PARAM("threePartSignOutActiveParam", "三方支付【签出】可变参数", 88),
+ /**
+ * 三方支付(签出)
+ */
+ THREE_PART_SIGN_OUT_MAPPING_METHOD("threePartSignOutMappingMethod", "三方支付【签出】请求方式", 89),
+
+ /**
+ * 三方支付(签出)
+ */
+ YB_INPATIENT_SETTLEMENT_UP_URL("ybInpatientSetlUp", "选填4101或4101A", 90),
+
+ /**
+ * PACS查看报告地址
+ */
+ PACS_REPORT_URL("pacsReportUrl", "PACS查看报告地址", 91),
/**
- * 三方支付参数
+ * LIS查看报告地址
*/
- THREE_PART_PARAM("threePartParam", "三方支付GET请求", 65);
+ LIS_REPORT_URL("lisReportUrl", "LIS查看报告地址", 92);
private final String code;
private final String name;
diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..b41f18a060599d68b80676dd8007e460b493230d
--- /dev/null
+++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java
@@ -0,0 +1,1837 @@
+package com.core.common.utils;
+
+import java.io.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.RegExUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ooxml.POIXMLDocumentPart;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.ss.util.CellRangeAddressList;
+import org.apache.poi.ss.util.RegionUtil;
+import org.apache.poi.util.IOUtils;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.*;
+import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.core.common.annotation.Excel;
+import com.core.common.annotation.Excel.ColumnType;
+import com.core.common.annotation.Excel.Type;
+import com.core.common.annotation.ExcelExtra;
+import com.core.common.annotation.Excels;
+import com.core.common.config.CoreConfig;
+import com.core.common.core.domain.AjaxResult;
+import com.core.common.core.text.Convert;
+import com.core.common.exception.UtilException;
+import com.core.common.utils.file.FileTypeUtils;
+import com.core.common.utils.file.FileUtils;
+import com.core.common.utils.file.ImageUtils;
+import com.core.common.utils.poi.ExcelHandlerAdapter;
+import com.core.common.utils.reflect.ReflectUtils;
+
+/**
+ * Excel相关处理
+ *
+ * @author system
+ */
+public class NewExcelUtil {
+ public static final String FORMULA_REGEX_STR = "=|-|\\+|@";
+ public static final String[] FORMULA_STR = {"=", "-", "+", "@"};
+ /**
+ * Excel sheet最大行数,默认65536
+ */
+ public static final int sheetSize = 65536;
+ private static final Logger log = LoggerFactory.getLogger(NewExcelUtil.class);
+ /**
+ * 数字格式
+ */
+ private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00");
+ /**
+ * 用于dictType属性数据存储,避免重复查缓存
+ */
+ public Map sysDictMap = new HashMap();
+ /**
+ * 实体对象
+ */
+ public Class clazz;
+ /**
+ * 需要显示列属性
+ */
+ public String[] includeFields;
+ /**
+ * 需要排除列属性
+ */
+ public String[] excludeFields;
+ /**
+ * 工作表名称
+ */
+ private String sheetName;
+ /**
+ * 导出类型(EXPORT:导出数据;IMPORT:导入模板)
+ */
+ private Type type;
+ /**
+ * 工作薄对象
+ */
+ private Workbook wb;
+ /**
+ * 工作表对象
+ */
+ private Sheet sheet;
+ /**
+ * 样式列表
+ */
+ private Map styles;
+ /**
+ * 导入导出数据列表
+ */
+ private List list;
+ /**
+ * 注解列表
+ */
+ private List
-
-
+
+ org.projectlombok
+ lombok
+ true
+
io.swagger
swagger-annotations
+ compile
diff --git a/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java
index c0c3d93828bd37d23a135edfde021aec8500acc4..e9b26bde6e8efae641610d00644f931798453820 100644
--- a/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java
+++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java
@@ -19,7 +19,7 @@ import com.core.common.core.domain.R;
import com.core.common.core.domain.entity.SysUser;
import com.core.common.core.domain.model.LoginUser;
import com.core.common.core.redis.RedisCache;
-import com.core.common.enums.DeleteFlag;
+import com.core.common.enums.DelFlag;
import com.core.common.enums.TenantStatus;
import com.core.common.utils.SecurityUtils;
import com.core.common.utils.StringUtils;
@@ -76,7 +76,7 @@ public class SysTenantServiceImpl extends ServiceImpl(pageNum, pageSize), lambdaQueryWrapper));
}
@@ -140,7 +140,7 @@ public class SysTenantServiceImpl extends ServiceImpl()
- .set(SysTenant::getDeleteFlag, DeleteFlag.DELETED.getCode()).in(SysTenant::getId, tenantIdList));
+ .set(SysTenant::getDeleteFlag, DelFlag.YES.getCode()).in(SysTenant::getId, tenantIdList));
}
return R.ok();
}
@@ -209,7 +209,7 @@ public class SysTenantServiceImpl extends ServiceImpl(pageNum, pageSize), lambdaQueryWrapper));
}
diff --git a/openhis-server-new/openhis-application/pom.xml b/openhis-server-new/openhis-application/pom.xml
index 4849ac967f723dc09a6754772f10041a1d4b68e1..e91725253579cf4cd6b5e7a1b4ed1d669f69fb77 100644
--- a/openhis-server-new/openhis-application/pom.xml
+++ b/openhis-server-new/openhis-application/pom.xml
@@ -23,21 +23,18 @@
true
-
- cn.hutool
- hutool-all
-
-
com.openhis
openhis-domain
+ 0.0.1-SNAPSHOT
com.yomahub
liteflow-spring-boot-starter
+ 2.12.4.1
@@ -46,10 +43,11 @@
junit
test
-
- com.alibaba.fastjson2
- fastjson2
+ com.alibaba
+ fastjson
+ 2.0.43
+ compile
org.apache.httpcomponents
@@ -68,6 +66,7 @@
org.springframework.boot
spring-boot-maven-plugin
+ 2.5.15
true
@@ -82,12 +81,20 @@
org.apache.maven.plugins
maven-war-plugin
- ${maven-war-plugin.version}
+ 3.1.0
false
${project.artifactId}
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 17
+ 17
+
+
${project.artifactId}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/AutoRollTask.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/AutoRollTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..34031c2a6266f024e44aad9554cbe7f475b8a9df
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/AutoRollTask.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright ©2023 CJB-CNIT Team. All rights reserved
+ */
+package com.openhis.quartz.task;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Component;
+
+import com.core.framework.config.TenantContext;
+import com.openhis.web.inhospitalnursestation.appservice.IEncounterAutoRollAppService;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 自动滚方定时任务(每日执行)
+ */
+@Slf4j
+@Component("AutoRollTask")
+public class AutoRollTask {
+
+ @Resource
+ private IEncounterAutoRollAppService encounterAutoRollAppService;
+
+ /**
+ * 护理费
+ *
+ * @param tenantId 租户id
+ * @param orderPricing 医嘱定价来源 | 定时任务调用时传参
+ */
+ public void autoRollNursingFee(Integer tenantId, String orderPricing) {
+ // 设置当前线程的租户ID
+ TenantContext.setCurrentTenant(tenantId);
+ // 滚护理费
+ encounterAutoRollAppService.autoRollNursingFee(tenantId, orderPricing);
+ }
+
+ /**
+ * 基础服务费 | 取暖费,床位费 等
+ *
+ * @param tenantId 租户id
+ * @param orderPricing 医嘱定价来源 | 定时任务调用时传参
+ */
+ public void autoRollBasicService(Integer tenantId, String orderPricing) {
+ // 设置当前线程的租户ID
+ TenantContext.setCurrentTenant(tenantId);
+ // 滚基础服务费
+ encounterAutoRollAppService.autoRollBasicService(tenantId, orderPricing);
+ }
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/InventoryBackupTask.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/InventoryBackupTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..219fb4ced7625b4b86aea2343241444ab20f1a5c
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/InventoryBackupTask.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright ©2023 CJB-CNIT Team. All rights reserved
+ */
+package com.openhis.quartz.task;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.annotation.Resource;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.core.common.enums.DelFlag;
+import com.core.common.utils.AssignSeqUtil;
+import com.core.common.utils.DateUtils;
+import com.core.framework.config.TenantContext;
+import com.openhis.common.enums.AssignSeqEnum;
+import com.openhis.document.domain.DocInventoryItemStatic;
+import com.openhis.document.service.IDocInventoryItemStaticService;
+import com.openhis.web.inventorymanage.appservice.IProductDetailAppService;
+import com.openhis.web.inventorymanage.dto.ProductDetailPageDto;
+import com.openhis.web.inventorymanage.dto.ProductDetailSearchParam;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 库存备份定时任务(每日执行)
+ *
+ * @author zwh
+ * @date 2025-11-12
+ */
+@Slf4j
+@Component("InventoryBackupTask")
+public class InventoryBackupTask {
+
+ Logger logger = LoggerFactory.getLogger(InventoryBackupTask.class);
+
+ @Resource
+ private IProductDetailAppService productDetailAppService;
+
+ @Resource
+ private IDocInventoryItemStaticService docInventoryItemStaticService;
+
+ @Resource
+ private AssignSeqUtil assignSeqUtil;
+
+ private static final AtomicBoolean isRunning = new AtomicBoolean(false);
+
+ /**
+ * 库存备份
+ *
+ * @param tenantId 租户id
+ */
+ public void inventoryBackup(Integer tenantId) {
+
+ // 添加执行锁,防止重复执行
+ if (!isRunning.compareAndSet(false, true)) {
+ logger.warn("库存备份任务正在执行中,跳过本次执行");
+ return;
+ }
+
+ // 定时任务指定租户id
+ try {
+ logger.info("库存备份START:{}", DateUtils.getNowDate());
+ // 设置当前线程的租户ID
+ TenantContext.setCurrentTenant(tenantId);
+ String now = DateUtils.dateTime();
+ // 查询当天是否已经执行过一次库存备份
+ List hisDocInventoryItemStaticList = docInventoryItemStaticService
+ .list(new LambdaQueryWrapper()
+ .eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
+ .eq(DocInventoryItemStatic::getTenantId, tenantId))
+ .stream().filter(item -> item.getBusNo() != null && item.getBusNo().length() >= 11
+ && now.equals(item.getBusNo().substring(3, 11)))
+ .toList();
+ if (!hisDocInventoryItemStaticList.isEmpty()) {
+ logger.warn("库存备份任务已执行过,跳过本次执行");
+ return;
+ }
+ // 生成备份编号
+ String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.AUTO_BACKUP_NO.getPrefix(), 2);
+ // 获取库存商品明细
+ Page productDetailPage = productDetailAppService
+ .getProductDetailPage(new ProductDetailSearchParam(), 1, 9999, null, null).getData();
+ List docInventoryItemStaticList = new ArrayList<>();
+ if (productDetailPage != null && productDetailPage.getTotal() > 0) {
+ List productDetailList = productDetailPage.getRecords();
+ for (ProductDetailPageDto productDetail : productDetailList) {
+ DocInventoryItemStatic docInventoryItemStatic = new DocInventoryItemStatic();
+ docInventoryItemStatic
+ // 库存状态枚举
+ .setInventoryStatusEnum(productDetail.getInventoryStatusEnum())
+ // 备份编号
+ .setBusNo(busNo)
+ // 库存id
+ .setInventoryId(productDetail.getInventoryId())
+ // 医保等级
+ .setChrgitmLv(productDetail.getChrgitmLv())
+ // 耗材类型
+ .setDevCategoryCode(productDetail.getDevCategoryCode())
+ // 项目id
+ .setItemId(productDetail.getItemId())
+ // 项目名称
+ .setName(productDetail.getItemName())
+ // 项目编号
+ .setItemNo(productDetail.getBusNo())
+ // 药品类别
+ .setMedCategoryCode(productDetail.getMedCategoryCode())
+ // 项目所在表
+ .setItemTable(productDetail.getItemTable())
+ // 所在位置
+ .setLocationId(productDetail.getLocationId())
+ // 位置名称
+ .setLocationName(productDetail.getLocationName())
+ // 所在货位
+ .setLocationStoreId(productDetail.getLocationStoreId())
+ // 货位名称
+ .setLocationStoreName(productDetail.getLocationStoreName())
+ // 厂家
+ .setManufacturerText(productDetail.getManufacturerText())
+ // 最小单位
+ .setMinUnitCode(productDetail.getMinUnitCode())
+ // 拆零比
+ .setPartPercent(productDetail.getPartPercent())
+ // 采购价
+ .setPrice(productDetail.getPurchasePrice())
+ // 生产日期
+ .setProductionDate(productDetail.getProductionDate())
+ // 到期日期
+ .setExpirationDate(productDetail.getExpirationDate())
+ // 库存数量
+ .setQuantity(productDetail.getQuantity())
+ // 销售价
+ .setSalePrice(productDetail.getSalePrice())
+ // 采购总价
+ .setTotalPrice(productDetail.getTotalPurchasePrice())
+ // 销售总价
+ .setTotalSalePrice(productDetail.getTotalSalePrice())
+ // 规格
+ .setTotalVolume(productDetail.getTotalVolume())
+ // 单位
+ .setUnitCode(productDetail.getUnitCode())
+ // 五笔码
+ .setWbStr(productDetail.getWbStr())
+ // 拼音码
+ .setPyStr(productDetail.getPyStr())
+ // 供应商id
+ .setSupplierId(productDetail.getSupplierId())
+ // 供应商名称
+ .setSupplierName(productDetail.getSupplierName())
+ // 剩余过期天数
+ .setRemainingDays(productDetail.getRemainingDays())
+ // 包装数量(整数)
+ .setNumber(productDetail.getNumber())
+ // 包装数量(小数)
+ .setRemainder(productDetail.getRemainder())
+ // 医保码
+ .setYbNo(productDetail.getYbNo())
+ // 批准文号
+ .setApprovalNumber(productDetail.getApprovalNumber())
+ // 批次号
+ .setLotNumber(productDetail.getLotNumber());
+ docInventoryItemStatic.setTenantId(tenantId);
+ docInventoryItemStaticList.add(docInventoryItemStatic);
+ }
+ docInventoryItemStaticService.saveBatch(docInventoryItemStaticList);
+ }
+ } catch (Exception e) {
+ logger.error("库存备份失败:", e);
+ } finally {
+ // 清除线程局部变量,防止内存泄漏
+ TenantContext.clear();
+ // 释放执行锁
+ isRunning.set(false);
+ logger.info("库存备份END:{}", DateUtils.getNowDate());
+ }
+ }
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/StocktakingBatchTask.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/StocktakingBatchTask.java
deleted file mode 100644
index 58dc314daa10a8f2d441978e1de00f8f7b99d51e..0000000000000000000000000000000000000000
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/StocktakingBatchTask.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.openhis.quartz.task;
-
-import java.util.Date;
-import java.util.List;
-
-import javax.annotation.Resource;
-
-import com.alibaba.fastjson2.JSONObject;
-import com.core.common.core.domain.R;
-import com.core.common.utils.DateUtils;
-import com.openhis.web.inventorymanage.appservice.IProductStocktakingAppService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import com.core.common.utils.StringUtils;
-import com.core.framework.config.TenantContext;
-import com.openhis.administration.domain.Location;
-import com.openhis.administration.service.ILocationService;
-
-/**
- * 批量盘点定时任务
- *
- * @author yuxj
- */
-@Component("stocktakingBatchTask")
-public class StocktakingBatchTask {
-
- Logger logger = LoggerFactory.getLogger(StocktakingBatchTask.class);
- @Resource
- IProductStocktakingAppService productStocktakingAppService;
-
- public void autoStocktakingBatch(Integer tenantId) {
- // 定时任务指定租户id,示例
- try {
- // 在控制台打印当前时间加执行的功能名
- System.out.println("执行自动批量盘点START:" + DateUtils.getNowDate());
- logger.info("执行自动批量盘点START:" + DateUtils.getNowDate());
-
- // 设置当前线程的租户ID
- TenantContext.setCurrentTenant(tenantId);
- //执行自动盘点
- productStocktakingAppService.autoStocktakingBatch();
-
- logger.info("执行自动批量盘点END:" + DateUtils.getNowDate());
- // 在控制台打印当前时间加执行的功能名
- System.out.println("执行自动批量盘点END:" + DateUtils.getNowDate());
- } finally {
- // 清除线程局部变量,防止内存泄漏
- TenantContext.clear();
- }
-
- }
-}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/IInstrumentManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/IInstrumentManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..087b7f07c637b75397b807c566530516573bca8e
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/IInstrumentManageAppService.java
@@ -0,0 +1,33 @@
+package com.openhis.web.Inspection.appservice;
+
+import com.core.common.core.domain.R;
+import com.openhis.administration.domain.Device;
+import com.openhis.administration.domain.Instrument;
+import com.openhis.web.Inspection.dto.InstrumentSelParam;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/18 15:38
+ */
+public interface IInstrumentManageAppService {
+
+
+ R> getManageInit();
+
+
+ R> getInstrumentPage(InstrumentSelParam InstrumentSelParam, String searchKey, Integer pageNo, Integer pageSize,
+ HttpServletRequest request);
+
+
+ R> updateOrAddInstrument(Instrument instrument);
+
+ R> getInstrumentOne(Long id);
+
+ R> editInstrumentStatus(List ids, Integer status);
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ILaboratoryManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ILaboratoryManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..0c3428389ac6779739c6d60225c192d8347862e6
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ILaboratoryManageAppService.java
@@ -0,0 +1,21 @@
+package com.openhis.web.Inspection.appservice;
+
+import com.core.common.core.domain.R;
+import com.openhis.web.Inspection.dto.ReportResultManageDto;
+import com.openhis.web.Inspection.dto.SampleCollectManageDto;
+import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/16 15:36
+ */
+public interface ILaboratoryManageAppService {
+
+ R> getReportResultList(ReportResultManageDto reportResultManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request);
+
+
+ R> getReportById(Long id);
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ILisConfigManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ILisConfigManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..dbbaf398a9ce42ded76a3a8a83bbdbe2cf1b92d1
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ILisConfigManageAppService.java
@@ -0,0 +1,34 @@
+package com.openhis.web.Inspection.appservice;
+
+import com.core.common.core.domain.R;
+import com.openhis.web.Inspection.dto.LisConfigManageDto;
+import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/29 16:00
+ */
+public interface ILisConfigManageAppService {
+
+ R> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
+ Integer pageNo, Integer pageSize, HttpServletRequest request);
+
+
+ R> getInfoList(String searchKey,String type);
+
+ R> getInfoDetail(Long id);
+
+ R> saveAll(LisConfigManageDto manageDto);
+
+ /**
+ *
+ * @param patientId 患者id
+ * @param ServiceId 服务id
+ * @param itemId 检验项目id
+ * @return
+ */
+ R>createAll(Long patientId,Long ServiceId, Long itemId);
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/IObservationManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/IObservationManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..6feb54b73d75a707415d82ac4adfc71b0fb1c03a
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/IObservationManageAppService.java
@@ -0,0 +1,29 @@
+package com.openhis.web.Inspection.appservice;
+
+import com.core.common.core.domain.R;
+import com.openhis.administration.domain.ObservationDefinition;
+import com.openhis.web.Inspection.dto.ObservationDefSelParam;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/23 16:32
+ */
+public interface IObservationManageAppService {
+
+ R> getManageInit();
+
+
+ R> getObservationDefPage(ObservationDefSelParam ObservationDefSelParam, String searchKey, Integer pageNo, Integer pageSize,
+ HttpServletRequest request);
+
+
+ R> updateOrAddObservationDef(ObservationDefinition Observation);
+
+ R> getObservationDefOne(Long id);
+
+ R> editObservationDefStatus(List ids, Integer status);
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ISampleCollectAppManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ISampleCollectAppManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..08320e7c84460b697e7e6a07b3ec8d87d0fef066
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ISampleCollectAppManageAppService.java
@@ -0,0 +1,20 @@
+package com.openhis.web.Inspection.appservice;
+
+import com.core.common.core.domain.R;
+import com.openhis.web.Inspection.dto.SampleCollectManageDto;
+import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/16 15:36
+ */
+public interface ISampleCollectAppManageAppService {
+
+ R> getSampleCollectList(SampleCollectManageDto sampleCollectManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request);
+
+
+ R>updateSampleStatus(SampleCollectStatusRequest statusRequest);
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ISpecimenManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ISpecimenManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..627fe83cdd9d7ae06adad22d6d08ba8f4a57e230
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/ISpecimenManageAppService.java
@@ -0,0 +1,33 @@
+package com.openhis.web.Inspection.appservice;
+
+import com.core.common.core.domain.R;
+import com.openhis.administration.domain.SpecimenDefinition;
+import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/9 16:46
+ */
+public interface ISpecimenManageAppService {
+
+
+
+ R> getManageInit();
+
+
+ R> getSpecimenPage(SpecimenDefSelParam specimenDefSelParam, String searchKey, Integer pageNo, Integer pageSize,
+ HttpServletRequest request);
+
+
+ R> updateOrAddSpecimen(SpecimenDefinition specimenDefinition);
+
+ R> getSpecimenOne(Long id);
+
+ R> editSpecimenStatus(List ids,Integer status);
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/InstrumentManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/InstrumentManageAppServiceImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..b35db096d37e0b246a2708bee04c9e65bf12ca10
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/InstrumentManageAppServiceImpl.java
@@ -0,0 +1,107 @@
+package com.openhis.web.Inspection.appservice.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.core.common.core.domain.R;
+import com.core.common.utils.MessageUtils;
+import com.openhis.administration.domain.Instrument;
+import com.openhis.administration.mapper.InstrumentMapper;
+import com.openhis.administration.service.IInstrumentService;
+import com.openhis.common.constant.PromptMsgConstant;
+import com.openhis.common.enums.InstrumentCategory;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.common.utils.EnumUtils;
+import com.openhis.common.utils.HisPageUtils;
+import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.web.Inspection.appservice.IInstrumentManageAppService;
+import com.openhis.web.Inspection.dto.InstrumentManageDto;
+import com.openhis.web.Inspection.dto.InstrumentManageInitDto;
+import com.openhis.web.Inspection.dto.InstrumentSelParam;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @Description 仪器信息
+ * @Author
+ * @Date 2025/9/18
+ */
+@Service
+@RequiredArgsConstructor
+public class InstrumentManageAppServiceImpl implements IInstrumentManageAppService {
+
+ private final IInstrumentService instrumentService ;
+ private final InstrumentMapper instrumentMapper ;
+
+
+ @Override
+ public R> getManageInit() {
+ InstrumentManageInitDto instrumentManageInitDto = new InstrumentManageInitDto();
+ // 获取状态
+ List statusEnumOptions = Stream.of(PublicationStatus.values())
+ .map(status -> new InstrumentManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ instrumentManageInitDto.setStatusFlagOptions(statusEnumOptions);
+ // 获取仪器种类
+ List typeList = Stream.of(com.openhis.common.enums.InstrumentCategory.values())
+ .map(status -> new InstrumentManageInitDto.InstrumentType(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ instrumentManageInitDto.setInstrumentTypeList(typeList);
+ // 获取仪器状态
+ List InstrumentStatusEnumOptions = Stream.of(com.openhis.common.enums.InstrumentStatus.values())
+ .map(status -> new InstrumentManageInitDto.InstrumentStatusEnumOption(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ instrumentManageInitDto.setInstrumentStatusEnumList(InstrumentStatusEnumOptions);
+
+ return R.ok(instrumentManageInitDto);
+ }
+
+ @Override
+ public R> getInstrumentPage(InstrumentSelParam InstrumentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
+ QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(InstrumentSelParam,
+ searchKey, new HashSet<>(Arrays.asList( "instrument_name", "instrument_name")), request);
+ Page instrumentPage = HisPageUtils.selectPage(instrumentMapper, queryWrapper, pageNo, pageSize,InstrumentManageDto.class);
+ instrumentPage.getRecords().forEach(instrumentManageDto -> {
+ instrumentManageDto.setInstrumentTypeEnumText(EnumUtils.getInfoByValue(InstrumentCategory.class, instrumentManageDto.getInstrumentTypeEnum())) ;
+ });
+
+ return R.ok(instrumentPage);
+ }
+
+ @Override
+ public R> updateOrAddInstrument(Instrument instrument) {
+ instrumentService.saveOrUpdate( instrument);
+ return R.ok();
+
+ }
+
+ @Override
+ public R> getInstrumentOne(Long id)
+ {
+ Instrument byId = instrumentService.getById(id);
+ InstrumentManageDto dto = new InstrumentManageDto();
+ BeanUtils.copyProperties(byId,dto);
+ return R.ok(dto);
+ }
+
+ @Override
+ public R> editInstrumentStatus(List ids, Integer status) {
+ List instrumentList = new CopyOnWriteArrayList<>();
+ for (Long detail : ids) {
+ Instrument instrument = new Instrument();
+ instrument.setId(detail);
+ instrument.setUsageStatusEnum(status);
+ instrumentList.add(instrument);
+ }
+ return instrumentService.updateBatchById(instrumentList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"仪器信息"})) : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
+
+ }
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/LaboratoryManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/LaboratoryManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..b0a89987df05ae2b1f59019b3ac1175cb3f9ffce
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/LaboratoryManageAppService.java
@@ -0,0 +1,58 @@
+package com.openhis.web.Inspection.appservice.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.core.common.core.domain.R;
+import com.openhis.common.enums.AdministrativeGender;
+import com.openhis.common.utils.EnumUtils;
+import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.web.Inspection.appservice.ILaboratoryManageAppService;
+import com.openhis.web.Inspection.dto.ReportResultManageDto;
+import com.openhis.web.Inspection.mapper.LisReportMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+/**
+ * @Description 样本采集
+ * @Author
+ * @Date 2025/10/16
+ */
+@RequiredArgsConstructor
+@Service
+public class LaboratoryManageAppService implements ILaboratoryManageAppService {
+
+ private final LisReportMapper reportMapper;
+ @Override
+ public R> getReportResultList(ReportResultManageDto reportResultManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
+ QueryWrapper queryWrapper =
+ HisQueryUtils.buildQueryWrapper(reportResultManageDto,
+ searchKey, new HashSet<>(Arrays.asList( "patient_name", "charge_name")), request);
+ IPage reportResultList = reportMapper.getReportResultList(new Page<>(pageNo, pageSize), queryWrapper);
+ Long total = reportMapper.getReportResultListTotal(new Page<>(pageNo, pageSize), queryWrapper);
+ reportResultList.getRecords().forEach(e -> {
+ // 性别
+ e.setGenderEnumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
+ });
+ if(total == null){
+ //总条数为null
+ total = 0L;
+ }
+ reportResultList.setTotal(total);
+ return R.ok(reportResultList);
+ }
+
+ @Override
+ public R> getReportById(Long id) {
+ //根据id查询所有观测值
+ List list = reportMapper.getReportListById(new QueryWrapper().eq("id", id));
+ //打印组件配置
+
+ return null;
+ }
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/LisConfigManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/LisConfigManageAppServiceImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..41b85420009a505d9f3512bea6ef199831a8fab3
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/LisConfigManageAppServiceImpl.java
@@ -0,0 +1,188 @@
+package com.openhis.web.Inspection.appservice.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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.SecurityUtils;
+import com.openhis.administration.domain.Device;
+import com.openhis.administration.domain.DeviceDefinition;
+import com.openhis.administration.domain.ObservationDefinition;
+import com.openhis.administration.domain.SpecimenDefinition;
+import com.openhis.administration.service.IDeviceDefinitionService;
+import com.openhis.administration.service.IDeviceService;
+import com.openhis.administration.service.IObservationDefinitionService;
+import com.openhis.administration.service.ISpecimenDefinitionService;
+import com.openhis.common.enums.SpecCollectStatus;
+import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.lab.domain.*;
+import com.openhis.lab.mapper.ActivityDefDeviceDefMapper;
+import com.openhis.lab.mapper.ActivityDefObservationDefMapper;
+import com.openhis.lab.mapper.ActivityDefSpecimenDefMapper;
+import com.openhis.lab.service.IObservationService;
+import com.openhis.lab.service.ISpecimenService;
+import com.openhis.web.Inspection.appservice.ILisConfigManageAppService;
+import com.openhis.web.Inspection.dto.LisConfigManageDto;
+import com.openhis.web.Inspection.dto.LisConfigManageInitDto;
+import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
+import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
+import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/29
+ */
+@RequiredArgsConstructor
+@Service
+public class LisConfigManageAppServiceImpl implements ILisConfigManageAppService {
+
+ @Resource
+ private ActivityDefinitionManageMapper activityDefinitionManageMapper;
+ @Resource
+ private ActivityDefDeviceDefMapper activityDefDeviceDefMapper;
+ @Resource
+ private ActivityDefObservationDefMapper activityDefObservationDefMapper;
+ @Resource
+ private ActivityDefSpecimenDefMapper activityDefSpecimenDefMapper;
+ @Resource
+ private IDeviceDefinitionService deviceDefinitionService;
+ @Resource
+ private ISpecimenDefinitionService specimenDefinitionService;
+ @Resource
+ private IObservationDefinitionService observationDefinitionService;
+ @Resource
+ private IObservationService observationService;
+ @Resource
+ private ISpecimenService specimenService;
+ @Resource
+ private IDeviceService deviceService;
+
+
+ @Override
+ public R> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
+ // 构建查询条件
+ QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
+ searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
+
+ // 分页查询
+ IPage diseaseTreatmentPage =
+ activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<>(pageNo, pageSize), queryWrapper);
+
+
+
+ return R.ok(diseaseTreatmentPage);
+ }
+
+ public R> getInfoList(String searchKey, String type) {
+ LisConfigManageInitDto initDto = new LisConfigManageInitDto();
+ initDto.setDeviceDefs(deviceDefinitionService.list());
+ initDto.setObservationDefs(observationDefinitionService.list());
+ initDto.setSpecimenDefs(specimenDefinitionService.list());
+ if (searchKey == null || searchKey.isEmpty()) {
+ // 如果searchKey为空,则查询所有
+ return switch (type) {
+ case "device" -> R.ok(deviceDefinitionService.list(new QueryWrapper().eq("status_enum",2)));
+ case "observation" -> R.ok(observationDefinitionService.list(new QueryWrapper().eq("status_enum",2) ));
+ case "specimen" -> R.ok(specimenDefinitionService.list(new QueryWrapper().eq("status_enum",2)));
+ default -> R.ok(initDto);
+ };
+ } else {
+ // 如果searchKey不为空,则根据name模糊查询
+ return switch (type) {
+ case "device" ->
+ R.ok(deviceDefinitionService.list((new QueryWrapper().like("name", searchKey).eq("status_enum",2))));
+ case "observation" ->
+ R.ok(observationDefinitionService.list((new QueryWrapper().like("name", searchKey).eq("status_enum",2))));
+ case "specimen" ->
+ R.ok(specimenDefinitionService.list((new QueryWrapper().like("name", searchKey).eq("status_enum",2))));
+ default -> R.ok();
+ };
+ }
+ }
+
+
+ @Override
+ public R> getInfoDetail(Long id) {
+ LisConfigManageDto manageDto = new LisConfigManageDto();
+ manageDto.setActivityDefDeviceDefs(activityDefDeviceDefMapper.selectList(new QueryWrapper().eq("activity_definition_id", id)));
+ manageDto.setActivityDefObservationDefs(activityDefObservationDefMapper.selectList(new QueryWrapper().eq("activity_definition_id", id)));
+ manageDto.setActivityDefSpecimenDefs(activityDefSpecimenDefMapper.selectList(new QueryWrapper().eq("activity_definition_id", id)));
+ return R.ok(manageDto);
+ }
+
+ @Override
+ public R> saveAll(LisConfigManageDto manageDto) {
+ //先全部删除项目下详情
+ activityDefDeviceDefMapper.delete(new QueryWrapper().eq("activity_definition_id", manageDto.getId()));
+ activityDefObservationDefMapper.delete(new QueryWrapper().eq("activity_definition_id", manageDto.getId()));
+ activityDefSpecimenDefMapper.delete(new QueryWrapper().eq("activity_definition_id", manageDto.getId()));
+ Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
+ // 根据ID查询【诊疗目录】详情
+ DiagnosisTreatmentDto diseaseTreatmentOne = activityDefinitionManageMapper.getDiseaseTreatmentOne(manageDto.getId(), tenantId);
+ manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
+ activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
+ activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
+ activityDefDeviceDefMapper.insert(activityDefDeviceDef);
+ });
+ manageDto.getActivityDefObservationDefs().forEach(activityDefObservationDef -> {
+ activityDefObservationDef.setActivityDefinitionId(manageDto.getId());
+ activityDefObservationDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
+ activityDefObservationDefMapper.insert(activityDefObservationDef);
+ });
+ manageDto.getActivityDefSpecimenDefs().forEach(activityDefSpecimenDef -> {
+ activityDefSpecimenDef.setActivityDefinitionId(manageDto.getId());
+ activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
+ activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
+ });
+
+ return R.ok();
+ }
+
+ @Override
+ public R> createAll(Long patientId,Long ServiceId, Long itemId) {
+ // 根据ID查询检查项目详情
+ List devices = activityDefDeviceDefMapper.selectList(new QueryWrapper().eq("activity_definition_id", itemId));
+ List observations= activityDefObservationDefMapper.selectList(new QueryWrapper().eq("activity_definition_id", itemId));
+ List specimens = activityDefSpecimenDefMapper.selectList(new QueryWrapper().eq("activity_definition_id", itemId));
+ devices.forEach(activityDefDeviceDef -> {
+ Device device = new Device();
+ device.setDeviceDefId(activityDefDeviceDef.getDeviceDefinitionId());
+ device.setName(activityDefDeviceDef.getDeviceDefinitionName());
+ //TODO 器材实体待完善,生成器材请求
+
+ });
+ observations.forEach(activityDefObservationDef -> {
+ Observation observation = new Observation();
+ //TODO 初始字段具体观测定义字段待完善
+ observation.setPatientId(patientId);
+ observation.setObservationDefinitionId(activityDefObservationDef.getObservationDefinitionId());
+ observationService.save(observation);
+ });
+ specimens.forEach(activityDefSpecimenDef -> {
+ Specimen specimen = new Specimen();
+ //TODO 初始字段具体标本定义字段待完善
+ specimen.setServiceId(ServiceId);
+ specimen.setSpecimenDefinitionId(activityDefSpecimenDef.getSpecimenDefinitionId());
+ specimen.setPatientId(patientId);
+ specimen.setCollectionStatusEnum(SpecCollectStatus.PENDING.getValue());
+ specimen.setSpecimenUnit(activityDefSpecimenDef.getSpecimenUnit());
+ specimen.setSpecimenVolume(activityDefSpecimenDef.getSpecimenVolume());
+ specimenService.save(specimen);
+ });
+
+ return R.ok();
+ }
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/ObservationManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/ObservationManageAppServiceImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..c876c05238b25872a25c0461645492dd87f12938
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/ObservationManageAppServiceImpl.java
@@ -0,0 +1,122 @@
+package com.openhis.web.Inspection.appservice.impl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.core.common.core.domain.R;
+
+import com.core.common.utils.MessageUtils;
+import com.core.common.utils.bean.BeanUtils;
+import com.openhis.administration.domain.ObservationDefinition;
+import com.openhis.administration.mapper.ObservationDefinitionMapper;
+import com.openhis.administration.service.IInstrumentService;
+import com.openhis.administration.service.IObservationDefinitionService;
+import com.openhis.common.constant.PromptMsgConstant;
+import com.core.common.enums.DelFlag;
+import com.openhis.common.enums.ObservationType;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.common.utils.EnumUtils;
+import com.openhis.common.utils.HisPageUtils;
+import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.web.Inspection.appservice.IObservationManageAppService;
+import com.openhis.web.Inspection.dto.ObservationDefManageDto;
+import com.openhis.web.Inspection.dto.ObservationDefManageInitDto;
+import com.openhis.web.Inspection.dto.ObservationDefSelParam;
+
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/23
+ */
+@Service
+@RequiredArgsConstructor
+public class ObservationManageAppServiceImpl implements IObservationManageAppService
+{
+ private final ObservationDefinitionMapper observationDefinitionMapper;
+
+ private final IObservationDefinitionService observationDefinitionService;
+
+ private final IInstrumentService instrumentService;
+
+
+ @Override
+ public R> getManageInit() {
+
+ ObservationDefManageInitDto observationDefManageInitDto = new ObservationDefManageInitDto();
+ // 获取状态
+ List statusEnumOptions = Stream.of(PublicationStatus.values())
+ .map(status -> new ObservationDefManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ observationDefManageInitDto.setStatusFlagOptions(statusEnumOptions);
+ //观测类型
+ List ObservationTypeEnumOptions = Stream.of(com.openhis.common.enums.ObservationType.values())
+ .map(status -> new ObservationDefManageInitDto.ObservationTypeEnumOption(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ observationDefManageInitDto.setObservationTypeList(ObservationTypeEnumOptions);
+ //仪器列表
+ List InstrumentEnumOptions = instrumentService.list().stream()
+ .map(status -> new ObservationDefManageInitDto.InstrumentEnumOption(status.getId(), status.getInstrumentName()))
+ .collect(Collectors.toList());
+ observationDefManageInitDto.setInstrumentEnumOptionList(InstrumentEnumOptions);
+ return R.ok(observationDefManageInitDto);
+ }
+
+ @Override
+ public R> getObservationDefPage(ObservationDefSelParam ObservationDefSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
+
+ QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(ObservationDefSelParam,
+ searchKey, new HashSet<>(Arrays.asList( "name", "code")), request);
+ Page ObservationPage = HisPageUtils.selectPage(observationDefinitionMapper, queryWrapper, pageNo, pageSize, ObservationDefManageDto.class);
+ ObservationPage.getRecords().forEach(item -> {
+ item.setInstrumentId_dictText(instrumentService.getById(item.getInstrumentId()).getInstrumentName());
+ item.setStatusEnumText(EnumUtils.getInfoByValue(PublicationStatus.class, item.getStatusEnum()));
+ item.setObservationTypeEnumText(EnumUtils.getInfoByValue(ObservationType.class, item.getObservationTypeEnum()));
+ });
+
+ return R.ok(ObservationPage);
+ }
+
+ @Override
+ public R> updateOrAddObservationDef(ObservationDefinition Observation) {
+ Observation.setDeleteFlag(DelFlag.NO.getCode());
+ observationDefinitionService.saveOrUpdate(Observation);
+ return R.ok(" 添加成功");
+ }
+
+ @Override
+ public R> getObservationDefOne(Long id) {
+ ObservationDefinition observationDefinition = observationDefinitionService.getById(id);
+ ObservationDefManageDto dto = new ObservationDefManageDto();
+ BeanUtils.copyProperties(observationDefinition,dto);
+ return R.ok(dto);
+ }
+
+ @Override
+ public R> editObservationDefStatus(List ids, Integer status) {
+ List observationDefinitionList = new CopyOnWriteArrayList<>();
+ for (Long detail : ids) {
+ ObservationDefinition observationDefinition = new ObservationDefinition();
+ observationDefinition.setId(detail);
+ observationDefinition.setStatusEnum(status);
+ observationDefinitionList.add(observationDefinition);
+ }
+ return observationDefinitionService.updateBatchById(observationDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"观测信息"}))
+ : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
+ }
+
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/SampleCollectManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/SampleCollectManageAppService.java
new file mode 100644
index 0000000000000000000000000000000000000000..adff9b371798627469103d01ddd7fd737e4e5ca3
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/SampleCollectManageAppService.java
@@ -0,0 +1,105 @@
+package com.openhis.web.Inspection.appservice.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.core.common.core.domain.R;
+import com.openhis.common.enums.AdministrativeGender;
+import com.openhis.common.enums.SpecCollectStatus;
+import com.openhis.common.utils.EnumUtils;
+import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.lab.domain.Specimen;
+import com.openhis.lab.service.ISpecimenService;
+import com.openhis.web.Inspection.appservice.ISampleCollectAppManageAppService;
+import com.openhis.web.Inspection.dto.SampleCollectManageDto;
+import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
+import com.openhis.web.Inspection.mapper.SampleCollectMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Objects;
+
+/**
+ * @Description 样本采集
+ * @Author
+ * @Date 2025/10/16
+ */
+@RequiredArgsConstructor
+@Service
+public class SampleCollectManageAppService implements ISampleCollectAppManageAppService {
+
+ private final SampleCollectMapper sampleCollectMapper;
+
+ private final ISpecimenService specimenService;
+
+ @Override
+ public R> getSampleCollectList(SampleCollectManageDto sampleCollectManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
+ QueryWrapper queryWrapper =
+ HisQueryUtils.buildQueryWrapper(sampleCollectManageDto,
+ searchKey, new HashSet<>(Arrays.asList( "patient_name", "charge_name")), request);
+ IPage sampleCollectList = sampleCollectMapper.getSampleCollectList(new Page<>(pageNo, pageSize), queryWrapper);
+ Long total = sampleCollectMapper.getSampleCollectListTotal(new Page<>(pageNo, pageSize), queryWrapper);
+ sampleCollectList.getRecords().forEach(e -> {
+ // 性别
+ e.setGenderEnumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
+ // 采集状态
+ e.setCollectionStatusEnumText(EnumUtils.getInfoByValue(SpecCollectStatus.class, e.getCollectionStatusEnum()));
+ });
+ if(total == null){
+ //总条数为null
+ total = 0L;
+ }
+ sampleCollectList.setTotal(total);
+ return R.ok(sampleCollectList);
+ }
+
+ @Override
+ public R> updateSampleStatus(SampleCollectStatusRequest statusRequest) {
+ // 根据状态类型设置对应的状态值
+ Integer status = switch (statusRequest.getType()) {
+ case "待采集" -> SpecCollectStatus.PENDING.getValue();
+ case "已采集" -> SpecCollectStatus.COLLECTED.getValue();
+ case "已接收" -> SpecCollectStatus.RECEIVED.getValue();
+ default -> 0;
+ };
+
+ // 批量更新样本状态
+ specimenService.listByIds(statusRequest.getIds()).forEach(specimen -> {
+ Integer currentStatus = specimen.getCollectionStatusEnum(); // 获取当前样本状态
+ // 如果传入状态是已接收,但当前状态是待采集,跳过更新
+ if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue()) && Objects.equals(currentStatus, SpecCollectStatus.PENDING.getValue())) {
+ return;
+ }
+ // 构建更新条件
+ UpdateWrapper updateWrapper = new UpdateWrapper<>();
+ updateWrapper.in("id", statusRequest.getIds()) // 设置批量更新的条件
+ .set("collection_status_enum", status); // 设置更新的状态字段
+ // 如果状态为已采集,且采集日期不为空,跳过采集日期的更新,仅更新状态
+ if (Objects.equals(status, SpecCollectStatus.COLLECTED.getValue())) {
+ if (specimen.getCollectionDate() == null) {
+ // 如果采集日期为空,则设置当前日期
+ updateWrapper.set("collection_date", new Date());
+ }
+ updateWrapper.set("received_date", null);
+ } else if (Objects.equals(status, SpecCollectStatus.PENDING.getValue())) {
+ updateWrapper.set("collection_date", null); // 清空采集日期
+ } else if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue())) {
+ updateWrapper.set("received_date", new Date());
+ }
+ // 执行更新
+ specimenService.update(updateWrapper);
+ });
+ if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue())) {
+ // TODO 接收样本后续逻辑
+ System.err.println("接收样本后!!");
+
+ }
+ return R.ok();
+ }
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/SpecimenManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/SpecimenManageAppServiceImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..281ffa93d65e49a37d720ac1743fab1f938ec0b2
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/appservice/impl/SpecimenManageAppServiceImpl.java
@@ -0,0 +1,110 @@
+package com.openhis.web.Inspection.appservice.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.core.common.core.domain.R;
+import com.core.common.utils.MessageUtils;
+import com.openhis.administration.domain.SpecimenDefinition;
+import com.openhis.administration.mapper.SpecimenDefinitionMapper;
+import com.openhis.administration.service.ISpecimenDefinitionService;
+import com.openhis.common.constant.PromptMsgConstant;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.common.enums.SpecimenType;
+import com.openhis.common.utils.EnumUtils;
+import com.openhis.common.utils.HisPageUtils;
+import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.web.Inspection.appservice.ISpecimenManageAppService;
+import com.openhis.web.Inspection.dto.SpecimenDefManageDto;
+import com.openhis.web.Inspection.dto.SpecimenDefManageInitDto;
+import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @Description
+ * @Author
+ * @Date 2025/9/9
+ */
+@Service
+@RequiredArgsConstructor
+public class SpecimenManageAppServiceImpl implements ISpecimenManageAppService {
+
+ private final SpecimenDefinitionMapper specimenDefinitionMapper;
+
+ private final ISpecimenDefinitionService specimenDefinitionService;
+ @Override
+ public R> getManageInit() {
+ SpecimenDefManageInitDto specimenDefManageInitDto = new SpecimenDefManageInitDto();
+
+ // 获取状态
+ List statusEnumOptions = Stream.of(PublicationStatus.values())
+ .map(status -> new SpecimenDefManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ specimenDefManageInitDto.setStatusFlagOptions(statusEnumOptions);
+ // 获取录种类
+ List typeList = Stream.of(SpecimenType.values())
+ .map(status -> new SpecimenDefManageInitDto.SpecimenType(status.getValue(), status.getInfo()))
+ .collect(Collectors.toList());
+ specimenDefManageInitDto.setSpecimenTypeList(typeList);
+
+
+ return R.ok(specimenDefManageInitDto);
+ }
+
+ /**
+ * 样本目录查询
+ * @param SpecimenDefSelParam 查询条件
+ * @param searchKey 查询条件-模糊查询
+ * @param pageNo 查询条件
+ * @param pageSize 查询条件
+ * @param request
+ * @return
+ */
+ @Override
+ public R> getSpecimenPage(SpecimenDefSelParam SpecimenDefSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
+
+ QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(SpecimenDefSelParam,
+ searchKey, new HashSet<>(Arrays.asList("custom_code", "specimen_name", "py_str", "wb_str")), request);
+ Page specimenPage = HisPageUtils.selectPage(specimenDefinitionMapper, queryWrapper, pageNo, pageSize, SpecimenDefManageDto.class);
+ specimenPage.getRecords().forEach(specimenDefManageDto -> {
+ specimenDefManageDto.setSpecimenTypeEnumText(EnumUtils.getInfoByValue(SpecimenType.class, specimenDefManageDto.getSpecimenTypeEnum())) ;
+ specimenDefManageDto.setStatusEnumText(EnumUtils.getInfoByValue(PublicationStatus.class, specimenDefManageDto.getStatusEnum()));
+ });
+ return R.ok(specimenPage);
+ }
+
+
+ @Override
+ public R> updateOrAddSpecimen(SpecimenDefinition specimenDefinition) {
+ specimenDefinitionService.saveOrUpdate(specimenDefinition);
+ return R.ok(" 添加成功");
+ }
+
+ @Override
+ public R> getSpecimenOne(Long id) {
+ SpecimenDefinition specimenDefinition = specimenDefinitionService.getById(id);
+ return R.ok(specimenDefinition);
+ }
+
+ @Override
+ public R> editSpecimenStatus(List ids, Integer status) {
+ List specimenDefinitionList = new CopyOnWriteArrayList<>();
+ for (Long detail : ids) {
+ SpecimenDefinition specimenDefinition = new SpecimenDefinition();
+ specimenDefinition.setId(detail);
+ specimenDefinition.setStatusEnum(status);
+ specimenDefinitionList.add(specimenDefinition);
+ }
+ return specimenDefinitionService.updateBatchById(specimenDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"样本信息"}))
+ : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
+ }
+}
+
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/InstrumentController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/InstrumentController.java
new file mode 100644
index 0000000000000000000000000000000000000000..c8480bf470e925cbc62066cc89d413066625244a
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/InstrumentController.java
@@ -0,0 +1,78 @@
+package com.openhis.web.Inspection.controller;
+
+import com.core.common.core.domain.R;
+import com.openhis.administration.domain.Instrument;
+import com.core.common.enums.DelFlag;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.web.Inspection.appservice.IInstrumentManageAppService;
+import com.openhis.web.Inspection.dto.InstrumentSelParam;
+import com.openhis.web.Inspection.dto.InstrumentStatusRequest;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description 仪器器材信息
+ * @Author
+ * @Date 2025/9/18
+ */
+@RestController
+@RequestMapping("/inspection/instrument")
+@Slf4j
+@AllArgsConstructor
+public class InstrumentController {
+
+
+ private final IInstrumentManageAppService appService;
+
+
+ @GetMapping("/init")
+ public R> getDiseaseTreatmentInit() {
+ return appService.getManageInit();
+ }
+
+ /**
+ * 查询样本类型分页列表
+ *
+ * @param pageNo 当前页码
+ * @param pageSize 查询条数
+ * @return
+ */
+ @GetMapping("/information-page")
+ public R> getInstrumentPage(InstrumentSelParam InstrumentSelParam,
+ @RequestParam(value = "searchKey", defaultValue = "") String searchKey,
+ @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
+ return appService.getInstrumentPage(InstrumentSelParam,searchKey, pageNo, pageSize, request);
+ }
+
+
+ @PostMapping("/information")
+ public R> editInstrument(@Validated @RequestBody Instrument instrument) {
+ instrument.setDeleteFlag(DelFlag.NO.getCode());
+
+ return appService.updateOrAddInstrument(instrument);
+ }
+
+
+ @GetMapping("/information-one")
+ public R> getInstrument(@RequestParam Long id) {
+ return appService.getInstrumentOne(id);
+ }
+
+ @PostMapping("/information-status")
+ public R> updateInstrumentStatus( @RequestBody InstrumentStatusRequest InstrumentStatusRequest ) {
+ //默认停用
+ Integer status = PublicationStatus.RETIRED.getValue();
+ if("启用".equals( InstrumentStatusRequest.getType())){
+ status = PublicationStatus.ACTIVE.getValue();
+ }
+ return appService.editInstrumentStatus(InstrumentStatusRequest.getIds(),status);
+ }
+
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/LaboratoryController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/LaboratoryController.java
new file mode 100644
index 0000000000000000000000000000000000000000..d974261162be49246a3b265240489158cd2f92e0
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/LaboratoryController.java
@@ -0,0 +1,40 @@
+package com.openhis.web.Inspection.controller;
+
+import com.core.common.core.domain.R;
+import com.openhis.web.Inspection.appservice.ILaboratoryManageAppService;
+import com.openhis.web.Inspection.dto.ReportResultManageDto;
+import com.openhis.web.Inspection.dto.SampleCollectManageDto;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description 检测中心相关
+ * @Author
+ * @Date 2025/10/24
+ */
+@RestController
+@RequestMapping("/inspection/laboratory")
+@Slf4j
+@AllArgsConstructor
+public class LaboratoryController {
+ private final ILaboratoryManageAppService appService;
+
+ @GetMapping("/information-page")
+ public R> getReportResultPage(ReportResultManageDto reportResultManageDto, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
+ @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
+ return appService.getReportResultList( reportResultManageDto, pageNo, pageSize, searchKey, request);
+ }
+
+
+ @GetMapping("/{id}")
+ public R> getReportById(@PathVariable Long id) {
+ // 调用 ReportService 获取报告数据
+ return appService.getReportById(id);
+ }
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/LisConfigController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/LisConfigController.java
new file mode 100644
index 0000000000000000000000000000000000000000..19733304b4a1883c6d3fc1527d45cd0410a8428c
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/LisConfigController.java
@@ -0,0 +1,67 @@
+package com.openhis.web.Inspection.controller;
+
+import com.core.common.core.domain.R;
+import com.openhis.web.Inspection.appservice.ILisConfigManageAppService;
+import com.openhis.web.Inspection.dto.LisConfigManageDto;
+import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description 检验定义配置
+ * @Author
+ * @Date 2025/9/29
+ */
+@RestController
+@RequestMapping("/inspection/lisConfig")
+@Slf4j
+@AllArgsConstructor
+public class LisConfigController {
+
+
+ private ILisConfigManageAppService lisConfigManageAppService;
+
+ /**
+ * @Description 获取检验项目列表
+ * @Author
+ * @Date 2025/9/29
+ */
+ @RequestMapping("/init-page")
+ public R> getDiseaseTreatmentList(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
+ Integer pageNo, Integer pageSize, HttpServletRequest request) {
+ return lisConfigManageAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, pageSize, request);
+ }
+
+
+ /**
+ * 根据项目id获取详细
+ * @return
+ */
+ @GetMapping ("/info-detail")
+ public R> getInfoDetail(Long id) {
+ return lisConfigManageAppService.getInfoDetail(id);
+ }
+
+
+ @GetMapping ("/init-list")
+ public R> getInfoList(String searchKey,String type) {
+ return lisConfigManageAppService.getInfoList(searchKey, type);
+
+ }
+ /**
+ * 修改检验配置
+ * @param
+ * @param manageDto
+ * @return
+ */
+ @PostMapping("/saveAll")
+ public R> saveInfo(@RequestBody LisConfigManageDto manageDto) {
+
+ return lisConfigManageAppService.saveAll(manageDto);
+ }
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/ObservationDefController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/ObservationDefController.java
new file mode 100644
index 0000000000000000000000000000000000000000..fe2eb27419e33b6e84c06a2aab0e6882dae83486
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/ObservationDefController.java
@@ -0,0 +1,77 @@
+package com.openhis.web.Inspection.controller;
+
+import com.core.common.core.domain.R;
+import com.openhis.administration.domain.ObservationDefinition;
+import com.core.common.enums.DelFlag;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.web.Inspection.appservice.IObservationManageAppService;
+import com.openhis.web.Inspection.dto.ObservationDefSelParam;
+import com.openhis.web.Inspection.dto.ObservationDefStatusRequest;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description 仪器器材信息
+ * @Author
+ * @Date 2025/9/18
+ */
+@RestController
+@RequestMapping("/inspection/observation")
+@Slf4j
+@AllArgsConstructor
+public class ObservationDefController {
+
+
+ private final IObservationManageAppService appService;
+
+
+ @GetMapping("/init")
+ public R> getTreatmentInit() {
+ return appService.getManageInit();
+ }
+
+ /**
+ * 查询样本类型分页列表
+ *
+ * @param pageNo 当前页码
+ * @param pageSize 查询条数
+ * @return
+ */
+ @GetMapping("/information-page")
+ public R> getObservationPage(ObservationDefSelParam observationDefSelParam,
+ @RequestParam(value = "searchKey", defaultValue = "") String searchKey,
+ @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
+ return appService.getObservationDefPage(observationDefSelParam,searchKey, pageNo, pageSize, request);
+ }
+
+
+ @PostMapping("/information")
+ public R> editObservation(@Validated @RequestBody ObservationDefinition observation) {
+ observation.setDeleteFlag(DelFlag.NO.getCode());
+
+ return appService.updateOrAddObservationDef(observation);
+ }
+
+
+ @GetMapping("/information-one")
+ public R> getObservation(@RequestParam Long id) {
+ return appService.getObservationDefOne(id);
+ }
+
+ @PostMapping("/information-status")
+ public R> updateObservationStatus( @RequestBody ObservationDefStatusRequest observationDefStatusRequest) {
+ //默认停用
+ Integer status = PublicationStatus.RETIRED.getValue();
+ if("启用".equals( observationDefStatusRequest.getType())){
+ status = PublicationStatus.ACTIVE.getValue();
+ }
+ return appService.editObservationDefStatus(observationDefStatusRequest.getIds(),status);
+ }
+
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/SampleCollectController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/SampleCollectController.java
new file mode 100644
index 0000000000000000000000000000000000000000..3f286cc40242f72262006b96bfeaa6dcfa37226b
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/SampleCollectController.java
@@ -0,0 +1,40 @@
+package com.openhis.web.Inspection.controller;
+
+import com.core.common.core.domain.R;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.web.Inspection.appservice.ISampleCollectAppManageAppService;
+import com.openhis.web.Inspection.dto.SampleCollectManageDto;
+import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description 样本采集
+ * @Author
+ * @Date 2025/10/16
+ */
+@RestController
+@RequestMapping("/inspection/collection")
+@Slf4j
+@AllArgsConstructor
+public class SampleCollectController {
+
+ private final ISampleCollectAppManageAppService appService;
+
+
+ @GetMapping("/information-page")
+ public R> getSampleCollectPage(SampleCollectManageDto sampleCollectManageDto,@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
+ @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
+ return appService.getSampleCollectList( sampleCollectManageDto, pageNo, pageSize, searchKey, request);
+ }
+
+ @PostMapping("/information-status")
+ public R> editSampleCollectStatus(@RequestBody SampleCollectStatusRequest statusRequest) {
+ return appService.updateSampleStatus(statusRequest);
+ }
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/SpecimenDefController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/SpecimenDefController.java
new file mode 100644
index 0000000000000000000000000000000000000000..0bb303dd922e1b4b4d297662ac2d88c6c28c0d4f
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/controller/SpecimenDefController.java
@@ -0,0 +1,76 @@
+package com.openhis.web.Inspection.controller;
+
+import com.core.common.core.domain.R;
+import com.openhis.administration.domain.SpecimenDefinition;
+import com.core.common.enums.DelFlag;
+import com.openhis.common.enums.PublicationStatus;
+import com.openhis.web.Inspection.appservice.ISpecimenManageAppService;
+import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
+import com.openhis.web.Inspection.dto.SpecimenDefStatusRequest;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description 样本定义相关
+ * @Author
+ * @Date 2025/9/9
+ */
+@RestController
+@RequestMapping("/inspection/specimen")
+@Slf4j
+@AllArgsConstructor
+public class SpecimenDefController {
+
+ private final ISpecimenManageAppService specimenManageAppService;
+
+
+ @GetMapping("/init")
+ public R> getDiseaseTreatmentInit() {
+ return specimenManageAppService.getManageInit();
+ }
+
+ /**
+ * 查询样本类型分页列表
+ *
+ * @param pageNo 当前页码
+ * @param pageSize 查询条数
+ * @return
+ */
+ @GetMapping("/information-page")
+ public R> getSpecimenPage(SpecimenDefSelParam specimenDefSelParam,
+ @RequestParam(value = "searchKey", defaultValue = "") String searchKey,
+ @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
+ return specimenManageAppService.getSpecimenPage(specimenDefSelParam,searchKey, pageNo, pageSize, request);
+ }
+
+
+ @PostMapping("/information")
+ public R> editSpecimen(@Validated @RequestBody SpecimenDefinition specimenDefinition) {
+ specimenDefinition.setStatusEnum( PublicationStatus.ACTIVE.getValue());
+ specimenDefinition.setDeleteFlag(DelFlag.NO.getCode());
+ return specimenManageAppService.updateOrAddSpecimen(specimenDefinition);
+ }
+
+
+ @GetMapping("/information-one")
+ public R> getSpecimen(@RequestParam Long id) {
+ return specimenManageAppService.getSpecimenOne(id);
+ }
+
+ @PostMapping("/information-status")
+ public R> updateSpecimenStatus( @RequestBody SpecimenDefStatusRequest specimenDefStatusRequest) {
+ //默认停用
+ Integer status = PublicationStatus.RETIRED.getValue();
+ if("启用".equals( specimenDefStatusRequest.getType())){
+ status = PublicationStatus.ACTIVE.getValue();
+ }
+ return specimenManageAppService.editSpecimenStatus(specimenDefStatusRequest.getIds(),status);
+ }
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..0031565f4133105bc3b54ed589b6d7c3742bc392
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java
@@ -0,0 +1,108 @@
+package com.openhis.web.Inspection.dto;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.openhis.common.annotation.Dict;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description 分页返回
+ * @Author
+ * @Date 2025/9/17
+ */
+@Data
+@Accessors(chain = true)
+public class InstrumentManageDto {
+
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long id;
+
+ /** 仪器编号,唯一且不能为空 */
+ private String instrumentCode;
+
+ /** 仪器名称,必填项 */
+ private String instrumentName;
+
+ /** 仪器主编号 */
+ private String instrumentMainCode;
+
+ /** 仪器类型,选择项 */
+ private Integer instrumentTypeEnum;
+ private String instrumentTypeEnumText;
+
+ /** 仪器型号 */
+ private String instrumentModel;
+
+ /** 生产厂家 */
+ private String manufacturer;
+
+ /** 仪器序列号 */
+ private String serialNumber;
+
+ /** 购买公司 */
+ private String purchasingCompany;
+
+ /** 联系人员 */
+ private String contactPerson;
+
+ /** 购买日期 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date purchaseDate;
+
+ /** 原价格 */
+ private BigDecimal originalPrice;
+
+ /** 成交价格 */
+ private BigDecimal transactionPrice;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ /** 安装日期 */
+ private Date installationDate;
+
+ /** 安装人员 */
+ private String installationPerson;
+
+ /** 维护人员 */
+ private String maintenancePerson;
+
+ /** 所属科室 */
+ @Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long orgId;
+ private String orgId_dictText;
+
+ /** 鉴定人员 */
+ private String identificationPerson;
+
+ /** 记录温度 */
+ private String recordedTemperature;
+
+ /** 仪器附件 */
+ private String accessories;
+
+ /** 仪器状态 */
+ private Integer instrumentStatusEnum;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ /** 报损日期 */
+ private Date damageReportDate;
+
+ /** 可复查仪器 是否 */
+ private Integer recheckableInstrumentEnum;
+
+ /** 使用状态,是否 */
+ private Integer usageStatusEnum;
+
+ /** 停用原因 */
+ private String decommissionReason;
+
+ /** 备注 */
+ private String remarks;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..a3832f71d053f7ce848535372aa7c494b43c4eef
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java
@@ -0,0 +1,56 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ *
+ * @author
+ * @date
+ */
+@Data
+@Accessors(chain = true)
+public class InstrumentManageInitDto {
+ private List statusFlagOptions;
+ private List InstrumentTypeList;
+ private List InstrumentStatusEnumList;
+
+ /**
+ * 状态
+ */
+ @Data
+ public static class statusEnumOption {
+ private Integer value;
+ private String info;
+ public statusEnumOption(Integer value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
+
+ @Data
+ public static class InstrumentStatusEnumOption {
+ private Integer value;
+ private String info;
+ public InstrumentStatusEnumOption(Integer value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
+
+ @Data
+ public static class InstrumentType {
+ private Integer value;
+ private String info;
+ public InstrumentType(Integer value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentSelParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentSelParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..40729b33311fb3768d7d8093cd2f4a85227fac41
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentSelParam.java
@@ -0,0 +1,22 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 样本定义分页检索条件
+ *
+ * @author lpt
+ * @date 2025-02-25
+ */
+@Data
+@Accessors(chain = true)
+public class InstrumentSelParam {
+
+ /** 仪器类型 */
+ private Integer instrumentTypeEnum;
+
+ /** 状态 */
+ private Integer statusEnum;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java
new file mode 100644
index 0000000000000000000000000000000000000000..85190ebb03fe806ef4b56d48d7d17d4cde8208d1
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java
@@ -0,0 +1,16 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/18
+ */
+@Data
+public class InstrumentStatusRequest {
+ private List ids;
+ private String type;
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..be03ef979f42f809255c0682abd98da453d0ee99
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java
@@ -0,0 +1,31 @@
+package com.openhis.web.Inspection.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.openhis.lab.domain.ActivityDefDeviceDef;
+import com.openhis.lab.domain.ActivityDefObservationDef;
+import com.openhis.lab.domain.ActivityDefSpecimenDef;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/30
+ */
+@Data
+@Accessors(chain = true)
+public class LisConfigManageDto {
+
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long id;
+
+ private List activityDefDeviceDefs;
+
+ private List activityDefObservationDefs;
+
+ private List activityDefSpecimenDefs;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..fad81023dd7e7c86f192efce46c76fe2171a4f80
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java
@@ -0,0 +1,29 @@
+package com.openhis.web.Inspection.dto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.openhis.administration.domain.DeviceDefinition;
+import com.openhis.administration.domain.ObservationDefinition;
+import com.openhis.administration.domain.SpecimenDefinition;
+import com.openhis.web.datadictionary.dto.DeviceManageDto;
+import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/10
+ */
+@Data
+@Accessors(chain = true)
+public class LisConfigManageInitDto {
+
+ private List deviceDefs;
+
+ private List observationDefs;
+
+ private List specimenDefs;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..5e41183b940bc4a58e01a68e2bef3d11f4650fc8
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java
@@ -0,0 +1,50 @@
+package com.openhis.web.Inspection.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.openhis.common.annotation.Dict;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description 分页返回
+ * @Author
+ * @Date 2025/9/17
+ */
+@Data
+@Accessors(chain = true)
+public class ObservationDefManageDto {
+
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long id;
+
+
+ /** 观测名称,用于标识观测的具体名称 */
+ private String name;
+
+ /** 观测代码,用于唯一标识一个观测项 */
+ private String code;
+
+ /** 观测类型,例如:实验室、临床症状等 */
+ private Integer observationTypeEnum;
+ private String observationTypeEnumText;
+
+ /** 参考范围,例如:3.0-6.0 mg/dL,用于指示正常范围 */
+ private String referenceRange;
+
+ @Dict(dictTable = "adm_instrument", dictCode = "id", dictText = "instrument_name")
+ /** 观测仪器id */
+ private Long instrumentId;
+ private String instrumentId_dictText;
+
+ /** 状态 */
+ private Integer statusEnum;
+ private String statusEnumText;
+
+ /** 删除状态) */
+ private String deleteFlag;
+
+
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..7715c1d33481a39244090ab1507129ead67ce3a9
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java
@@ -0,0 +1,53 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ *
+ *
+ * @author
+ * @date
+ */
+@Data
+@Accessors(chain = true)
+public class ObservationDefManageInitDto {
+ private List statusFlagOptions;
+ private List ObservationTypeList;
+ private List instrumentEnumOptionList;
+
+ /**
+ * 状态
+ */
+ @Data
+ public static class statusEnumOption {
+ private Integer value;
+ private String info;
+ public statusEnumOption(Integer value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
+
+ @Data
+ public static class ObservationTypeEnumOption {
+ private Integer value;
+ private String info;
+ public ObservationTypeEnumOption(Integer value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
+ @Data
+ public static class InstrumentEnumOption {
+ private Long value;
+ private String info;
+ public InstrumentEnumOption(Long value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
+}
+
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefSelParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefSelParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..a5e2e3e3c10677cb5f8cf11c5db231bcedbcc64e
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefSelParam.java
@@ -0,0 +1,22 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 样本定义分页检索条件
+ *
+ * @author lpt
+ * @date 2025-02-25
+ */
+@Data
+@Accessors(chain = true)
+public class ObservationDefSelParam {
+
+ /** 类型 */
+ private Integer observationTypeEnum;
+
+ /** 状态 */
+ private Integer statusEnum;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java
new file mode 100644
index 0000000000000000000000000000000000000000..d72af4a8fef4bb556879c05786ab11539c5f7611
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java
@@ -0,0 +1,16 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/18
+ */
+@Data
+public class ObservationDefStatusRequest {
+ private List ids;
+ private String type;
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..ffdb0c8ee717648f3e01b781d7b2e12e19fdc70c
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java
@@ -0,0 +1,37 @@
+package com.openhis.web.Inspection.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/17
+ */
+@Data
+public class ReportResultManageDto {
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long parentId;
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long id;
+ private String patientName; // 患者名称
+ private String chargeName; // 项目名称
+ private String specimenName; // 样本名称
+ private String doctorName; // 开单医生
+ private String observationName;//观测定义名称
+ private String observationResult; // 观测结果
+ private String referenceRange; // 参考范围
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private String observationDate;//观测时间
+ private Integer genderEnum; // 性别
+ private String genderEnumText;// 性别文本
+ private String technicianName;// 检查人员
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private String authoredTime; // 开单时间
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..cdf0b020384d8cf233556527cbd38b412614cf46
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java
@@ -0,0 +1,46 @@
+package com.openhis.web.Inspection.dto;
+
+import com.core.common.core.domain.entity.SysMenu;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/17
+ */
+@Data
+public class SampleCollectManageDto {
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long parentId;
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long id;
+ private String patientName; // 患者名称
+ private String chargeName; // 项目名称
+ private String specimenName; // 样本名称
+ private String doctorName; // 开单医生
+
+ private Integer specimenVolume; //样本量
+ private String specimenUnit; //样本单位
+
+ private Integer genderEnum; // 性别
+ private String genderEnumText;// 性别文本
+
+ private Integer collectionStatusEnum;//采集状态
+ private String collectionStatusEnumText; // 采集状态文本
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date collectionDate; // 采集时间
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date receivedDate; // 接收时间
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private String authoredTime; // 开单时间
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f15d8cc5f035c6b4bc7d93c624a6e01a70e45e30
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java
@@ -0,0 +1,16 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/23
+ */
+@Data
+public class SampleCollectStatusRequest {
+ private List ids;
+ private String type;
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..3f225baf6e8a43d7560923e861a33da362177a9b
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java
@@ -0,0 +1,62 @@
+package com.openhis.web.Inspection.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description 分页返回
+ * @Author
+ * @Date 2025/9/17
+ */
+@Data
+@Accessors(chain = true)
+public class SpecimenDefManageDto {
+ /** $column.columnComment */
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long id;
+
+ /** 样本类型 */
+ private Integer specimenTypeEnum;
+ private String specimenTypeEnumText;
+
+ /** 样本名称 */
+ private String specimenName;
+
+ /** 自定义码 */
+ private String customCode;
+
+ /** 类型顺序 */
+ private Integer typeOrder;
+
+ /** 外部代码 */
+ private String externalCode;
+
+ /** 序号 */
+ private Integer serialNumber;
+
+ /** 全网型 */
+ private String globalType;
+
+ /** 拼音 */
+ private String pyStr;
+
+ /** 五笔 */
+ private String wbStr;
+
+ /** 样本类 */
+ private String specimenClass;
+
+ /** 扩展类型 */
+ private String extendedType;
+
+ /** WHONET代码 */
+ private String whonetCode;
+
+
+ /** 状态 */
+ private Integer statusEnum;
+ private String statusEnumText;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java
similarity index 43%
rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java
rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java
index ecc7a4a32f708a623ed40f6dbba053031838848b..e8f4fa3d9643b6be78736b354907e403d66dd468 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java
@@ -1,24 +1,22 @@
-package com.openhis.web.outpatientmanage.dto;
+package com.openhis.web.Inspection.dto;
import lombok.Data;
import lombok.experimental.Accessors;
+import java.util.ArrayList;
import java.util.List;
/**
- * 皮试初始化记录
*
- * @author liuhr
- * @date 2025/3/15
+ *
+ * @author
+ * @date
*/
@Data
@Accessors(chain = true)
-public class OutpatientSkinTestInitDto {
-
- //皮试检查项目状态
- private List verificationStatus;
- //皮试结果
- private List clinicalStatus;
+public class SpecimenDefManageInitDto {
+ private List statusFlagOptions;
+ private List SpecimenTypeList;
/**
* 状态
@@ -27,11 +25,21 @@ public class OutpatientSkinTestInitDto {
public static class statusEnumOption {
private Integer value;
private String info;
-
public statusEnumOption(Integer value, String info) {
this.value = value;
this.info = info;
}
}
+ @Data
+ public static class SpecimenType {
+ private Integer value;
+ private String info;
+ List children = new ArrayList<>();
+
+ public SpecimenType(Integer value, String info) {
+ this.value = value;
+ this.info = info;
+ }
+ }
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefSelParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefSelParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..ab39350400ffe0487a1c15f59e2f150e45e68afb
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefSelParam.java
@@ -0,0 +1,22 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 样本定义分页检索条件
+ *
+ * @author lpt
+ * @date 2025-02-25
+ */
+@Data
+@Accessors(chain = true)
+public class SpecimenDefSelParam {
+
+ /** 样本类型 */
+ private Integer specimenTypeEnum;
+
+ /** 状态 */
+ private Integer statusEnum;
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java
new file mode 100644
index 0000000000000000000000000000000000000000..909e4abd8733f57d09076b5fa474da814d3fbf8a
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java
@@ -0,0 +1,16 @@
+package com.openhis.web.Inspection.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/9/18
+ */
+@Data
+public class SpecimenDefStatusRequest {
+ private List ids;
+ private String type;
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/GroupRecMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/GroupRecMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..6105f52a406f29f78fc34b7bb610948b298e3ffa
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/GroupRecMapper.java
@@ -0,0 +1,11 @@
+package com.openhis.web.Inspection.mapper;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/24 16:40
+ */
+public interface GroupRecMapper {
+
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/LisReportMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/LisReportMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..8010b25c28fb76b9218a4b507928b8259870d32e
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/LisReportMapper.java
@@ -0,0 +1,26 @@
+package com.openhis.web.Inspection.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.openhis.web.Inspection.dto.ReportResultManageDto;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/11/5 9:36
+ */
+@Mapper
+public interface LisReportMapper {
+
+ IPage getReportResultList(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+ Long getReportResultListTotal (@Param("page")Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+ List getReportListById(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/SampleCollectMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/SampleCollectMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..e680eb5685f77d1cb716e728371b4a176877bf75
--- /dev/null
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/mapper/SampleCollectMapper.java
@@ -0,0 +1,23 @@
+package com.openhis.web.Inspection.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.openhis.web.Inspection.dto.SampleCollectManageDto;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Description TODO
+ * @Author
+ * @Date 2025/10/17 11:27
+ */
+@Mapper
+public interface SampleCollectMapper {
+ IPage getSampleCollectList(@Param("page")Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+
+ Long getSampleCollectListTotal (@Param("page")Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java
index 1cbe64bd55fd4525284f58501fc632d5fe4fb22d..3d79cae78460ce34cf6348debf358ec9763ca3ee 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java
@@ -182,7 +182,7 @@ public class LocationAppServiceImpl implements ILocationAppService {
public R> deleteLocation(String busNo) {
// 删除位置信息(连同子集)
boolean result =
- locationService.remove(new LambdaQueryWrapper().likeRight(Location::getBusNo, busNo));
+ locationService.remove(new LambdaQueryWrapper().likeRight(Location::getBusNo, busNo));
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"位置信息删除"}))
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"位置信息删除"}));
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java
index ab501ec5ae0d6ec6ac4ba843f042621bb2e97d11..edb56b88c0cb8f99c322a038b6e9d7800df5626d 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java
@@ -406,7 +406,8 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
if (1L == userId) {
return R.fail(null, "admin不允许删除");
}
- iBizUserService.remove(new LambdaQueryWrapper().eq(BizUser::getUserId, userId));
+ // iBizUserService.remove(new LambdaQueryWrapper().eq(BizUser::getUserId, userId));
+ practitionerAppAppMapper.delUser(userId);
practitionerAppAppMapper.delUserRole(userId);
Practitioner one =
iPractitionerService.getOne(new LambdaQueryWrapper().eq(Practitioner::getUserId, userId));
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java
index c88b9ef0ee40bc6ff9aa8196c1311829e952c0cd..bf920c43490aa6238fc9bf097cd47a05e729a288 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java
@@ -63,4 +63,9 @@ public class OrgLocQueryDto {
/** 显示顺序 */
private Integer displayOrder;
+ /**
+ * 项目编码 | 药品:1 耗材:2
+ */
+ private String itemCode;
+
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java
index c65330da279a22b38e60dfa2637cbd1ef46cfceb..0f295904cfd199eb48bb6c7b1a56b9aa8cf1b672 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java
@@ -47,6 +47,13 @@ public interface PractitionerAppAppMapper {
List
getOrgAndLocationDtoList(@Param("practitionerIdList") List practitionerIdList);
+ /**
+ * 逻辑删除系统用户
+ *
+ * @param userId 系统用户id
+ */
+ void delUser(@Param("userId") Long userId);
+
/**
* 物理删除系统用户与角色的关系
*
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java
index ddd23701ffec527f51093b6d3e52bfaa8f36bf3f..6978f68d5870afe1d4b1a0d911c560b87e969e8d 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java
@@ -85,4 +85,9 @@ public class HealthcareServiceFormData {
/** 医保编码 */
private String ybNo;
+ /**
+ * 编码
+ */
+ private String busNo;
+
}
\ No newline at end of file
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java
index 778152f692fe60143160114ead91da11a466c81b..dfb0d24c680ae82623b05473ddadcf9b77c44eb6 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java
@@ -20,26 +20,32 @@ import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
public interface IInpatientChargeAppService {
/**
- * 查询就诊患者分页列表
+ * 门诊收费页面初始化
+ *
+ * @return 初始化信息
+ */
+ R> inpatientChargeInit();
+
+ /**
+ * 查询住院患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
- * @return 就诊患者分页列表
+ * @return 住院患者分页列表
*/
R> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
Integer pageSize, HttpServletRequest request);
/**
- * 根据就诊id查询患者处方列表
+ * 根据就诊id查询患者待结算信息
*
* @param encounterId 就诊id
- * @return 患者处方列表
+ * @return 患者待结算信息
*/
- List getEncounterPatientPrescription(Long encounterId, String startTime,
- String endTime);
+ List getEncounterPatientPrescription(Long encounterId);
/**
* 医保转自费
@@ -56,11 +62,4 @@ public interface IInpatientChargeAppService {
* @return 操作结果
*/
R> changeToMedicalInsurance(Long encounterId);
-
- /**
- * 门诊收费页面初始化
- *
- * @return 初始化信息
- */
- R> outpatientChargeInit();
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java
index 49298f918ca333a2d6acdd9472cfbeb83c48b35b..c5880b52dd45e04a89faf4c8e71defdbe6df0f5b 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java
@@ -40,6 +40,14 @@ public interface IOutpatientChargeAppService {
*/
List getEncounterPatientPrescription(Long encounterId);
+ /**
+ * 根据就诊id查询患者处方列表并新增字段:实收金额、应收金额、优惠金额、折扣率
+ *
+ * @param encounterId 就诊id
+ * @return 患者处方列表
+ */
+ List getEncounterPatientPrescriptionWithPrice(Long encounterId);
+
/**
* 医保转自费
*
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java
index e525f64bac387e64b52a468f7ebb29737cb34e82..f311e1bd162ae131e2d675b5534d43bb6c140814 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java
@@ -3,9 +3,10 @@
*/
package com.openhis.web.chargemanage.appservice.impl;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
import javax.servlet.http.HttpServletRequest;
@@ -21,10 +22,7 @@ import com.openhis.administration.service.IAccountService;
import com.openhis.administration.service.IChargeItemService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.constant.PromptMsgConstant;
-import com.openhis.common.enums.AdministrativeGender;
-import com.openhis.common.enums.ChargeItemContext;
-import com.openhis.common.enums.ChargeItemStatus;
-import com.openhis.common.enums.EncounterClass;
+import com.openhis.common.enums.*;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService;
@@ -51,33 +49,32 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
private IAccountService accountService;
/**
- * 门诊收费页面初始化
+ * 住院结算页面初始化
*
* @return 初始化信息
*/
@Override
- public R> outpatientChargeInit() {
+ public R> inpatientChargeInit() {
OutpatientInitDto initDto = new OutpatientInitDto();
- List chargeItemStatusOptions = new ArrayList<>();
- chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
- ChargeItemStatus.PLANNED.getInfo()));
- chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
- ChargeItemStatus.BILLABLE.getInfo()));
- chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
- ChargeItemStatus.BILLED.getInfo()));
- initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
+ List encounterStatusOptions = new ArrayList<>();
+ encounterStatusOptions
+ .add(new OutpatientInitDto.encounterStatusOption(EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue(),
+ EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getInfo()));
+ encounterStatusOptions.add(new OutpatientInitDto.encounterStatusOption(
+ EncounterZyStatus.ALREADY_SETTLED.getValue(), EncounterZyStatus.ALREADY_SETTLED.getInfo()));
+ initDto.setEncounterStatusOptions(encounterStatusOptions);
return R.ok(initDto);
}
/**
- * 查询就诊患者分页列表
+ * 查询住院患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
- * @return 就诊患者分页列表
+ * @return 住院患者分页列表
*/
@Override
public R> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
@@ -90,14 +87,15 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
request);
// 就诊患者分页列表
- Page encounterPatientPage = inpatientChargeAppMapper
- .selectEncounterPatientPage(EncounterClass.IMP.getValue(), new Page<>(pageNo, pageSize), queryWrapper);
+ Page encounterPatientPage = inpatientChargeAppMapper.selectEncounterPatientPage(
+ EncounterClass.IMP.getValue(), EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue(),
+ EncounterZyStatus.ALREADY_SETTLED.getValue(), new Page<>(pageNo, pageSize), queryWrapper);
encounterPatientPage.getRecords().forEach(e -> {
// 性别枚举
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
- // 收费状态枚举
- e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
+ // 住院状态
+ e.setEncounterStatus_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getEncounterStatus()));
// 计算年龄
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
});
@@ -105,36 +103,20 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
}
/**
- * 根据就诊id查询患者处方列表
+ * 根据就诊id查询患者待结算信息
*
* @param encounterId 就诊id
- * @return 患者处方列表
+ * @return 患者待结算信息
*/
@Override
- public List getEncounterPatientPrescription(Long encounterId, String startTime,
- String endTime) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
-
- startTime = startTime + "000000";
-
- endTime = endTime + "235959";
-
- Date startDate = null;
- Date endDate = null;
- try {
- startDate = sdf.parse(startTime);
- endDate = sdf.parse(endTime);
- } catch (ParseException e) {
- e.printStackTrace();
- }
-
+ public List getEncounterPatientPrescription(Long encounterId) {
List prescriptionDtoList =
inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
- ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), startDate, endDate);
+ ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
prescriptionDtoList.forEach(e -> {
// 收费状态枚举
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java
index fce535dc0313986844e7d8b51df10689a37644bf..b93fe99f5315e76f948c4c3d57385a334389b460 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java
@@ -3,6 +3,9 @@
*/
package com.openhis.web.chargemanage.appservice.impl;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -26,6 +29,7 @@ import com.openhis.common.enums.AdministrativeGender;
import com.openhis.common.enums.ChargeItemContext;
import com.openhis.common.enums.ChargeItemStatus;
import com.openhis.common.enums.EncounterClass;
+import com.openhis.common.enums.ybenums.YbPayment;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
@@ -210,4 +214,66 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
}
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
}
+
+ /**
+ * 根据就诊id查询患者处方列表并新增字段:应收金额,实收金额,优惠金额,折扣率
+ *
+ * @param encounterId 就诊id
+ * @return 患者处方列表
+ */
+ @Override
+ public List getEncounterPatientPrescriptionWithPrice(Long encounterId) {
+ List prescriptionDtoList = outpatientChargeAppMapper
+ .selectEncounterPatientPrescriptionWithPrice(encounterId, ChargeItemContext.ACTIVITY.getValue(),
+ ChargeItemContext.MEDICATION.getValue(), ChargeItemContext.DEVICE.getValue(),
+ ChargeItemContext.REGISTER.getValue(), ChargeItemStatus.PLANNED.getValue(),
+ ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
+ ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(),
+ ChargeItemStatus.PART_REFUND.getValue(), YbPayment.DISCOUNT_PAY.getValue(),
+ YbPayment.SELF_CASH_VALUE.getValue(), YbPayment.SELF_CASH_VX_VALUE.getValue(),
+ YbPayment.SELF_CASH_ALI_VALUE.getValue(), YbPayment.SELF_CASH_UNION_VALUE.getValue());
+ prescriptionDtoList.forEach(e -> {
+ // 应收金额
+ BigDecimal receivableAmount = e.getReceivableAmount();
+ // 实收金额
+ BigDecimal receivedAmount = e.getReceivedAmount();
+ // 计算折扣率
+ BigDecimal discountRate = BigDecimal.ONE;
+ if (receivableAmount.compareTo(BigDecimal.ZERO) > 0 && receivedAmount.compareTo(BigDecimal.ZERO) > 0
+ && receivableAmount.compareTo(receivedAmount) > 0) {
+ discountRate = receivedAmount.divide(receivableAmount, 2, RoundingMode.HALF_UP);
+ }
+ e.setDiscountRate(this.returnDiscountRate(discountRate));
+ // 收费状态枚举
+ e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
+ });
+ return prescriptionDtoList;
+ }
+
+ /**
+ * 调整折扣率
+ *
+ * @param discountRate 折扣率
+ * @return 调整后的折扣率(0.05的倍数)
+ **/
+ private String returnDiscountRate(BigDecimal discountRate) {
+ BigDecimal compareValue = BigDecimal.valueOf(0.05);
+ BigDecimal remainder = discountRate.remainder(compareValue);
+ DecimalFormat df = new DecimalFormat();
+ df.setMinimumFractionDigits(0);
+ df.setMaximumFractionDigits(2);
+ // 比较余数,若为0则数据为0.05倍数,否则需要再次四舍五入
+ if (remainder.compareTo(BigDecimal.ZERO) == 0) {
+ return df.format(discountRate);
+ } else {
+ // 再次四舍五入
+ BigDecimal reActuarial = BigDecimal.ZERO;
+ if (remainder.compareTo(BigDecimal.valueOf(CommonConstants.UtilMethodConstant.THRESHOLD_VALUE)) > 0) {
+ reActuarial = discountRate.add(compareValue.subtract(remainder));
+ } else {
+ reActuarial = discountRate.subtract(remainder);
+ }
+ return df.format(reActuarial);
+ }
+ }
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java
index caaffbea8baf04b60d86f4cc50fc5f5a27ce0250..7cab72285053ee71e8dcff711f1664b3429cdde1 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java
@@ -68,7 +68,7 @@ public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppSer
public IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
Long organizationId, Integer pageNo, Integer pageSize) {
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
- organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3));
+ organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3), null);
}
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java
index a051830ccb32761e7a499fe6c50faa13b1f2660d..f59c11b4bfe3890b70bce520baf503d38f51d249 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java
@@ -21,6 +21,7 @@ import com.core.common.utils.AgeCalculatorUtil;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.MessageUtils;
import com.core.common.utils.SecurityUtils;
+import com.core.common.utils.bean.BeanUtils;
import com.openhis.administration.domain.ChargeItem;
import com.openhis.administration.service.IChargeItemService;
import com.openhis.common.constant.CommonConstants;
@@ -80,8 +81,9 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
public R> outpatientRefundInit() {
OutpatientInitDto initDto = new OutpatientInitDto();
List chargeItemStatusOptions = new ArrayList<>();
- chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
- ChargeItemStatus.BILLED.getInfo()));
+ // 门诊退费页面去掉已收费状态筛选
+ // chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
+ // ChargeItemStatus.BILLED.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(),
ChargeItemStatus.REFUNDING.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(),
@@ -122,11 +124,6 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
refundItemList.forEach(e -> {
// 退费状态
e.setRefundStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getRefundStatus()));
- // 发放状态
- e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
- // 执行状态
- e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
-
});
refundItemList.sort(Comparator.comparing(RefundItemDto::getPaymentId));
return R.ok(refundItemList);
@@ -140,7 +137,6 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
*/
@Override
public R> refundPayment(List refundItemList) {
-
// 未退费用项,生成新的请求发放费用项
List creatList = new ArrayList<>();
for (RefundItemParam param : refundItemList) {
@@ -149,7 +145,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
creatList.add(param);
}
}
-
+ // todo 半退逻辑需修改
if (!creatList.isEmpty()) {
// 未退费费用项id集合
List creatChargeItemIdList =
@@ -245,108 +241,232 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
// 退费费用项id集合
List chargeItemIdList =
refundItemList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
-
- // 根据费用项id查询费用项请求发放信息
- List chargeItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
- CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
- CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
-
- List medDisIdList = new ArrayList<>();
- List devDisIdList = new ArrayList<>();
+ // 服务请求id集合
+ List medReqIdList = new ArrayList<>();
+ List devReqIdList = new ArrayList<>();
List serReqIdList = new ArrayList<>();
+ // 查询退费项目信息
+ List chargeItemList = chargeItemService.listByIds(chargeItemIdList);
+ if (chargeItemList != null && !chargeItemList.isEmpty()) {
+ chargeItemList.forEach(item -> {
+ switch (item.getServiceTable()) {
+ case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
+ case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
+ case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serReqIdList.add(item.getServiceId());
+ }
+ });
+ }
+ // 处理退药申请
+ if (!medReqIdList.isEmpty()) {
+ // 药品请求查询
+ List medicationRequests = medicationRequestService.listByIds(medReqIdList);
+ // 药品发放查询
+ List medicationDispenses =
+ medicationDispenseService.selectByRequestIdList(medReqIdList);
+ // 根据请求id做map
+ Map> medicationDispenseMap =
+ medicationDispenses.stream().collect(Collectors.groupingBy(MedicationDispense::getMedReqId));
+ for (MedicationRequest medicationRequest : medicationRequests) {
+ // 根据请求匹配发放
+ List medicationDispenseList = medicationDispenseMap.get(medicationRequest.getId());
+ // 判断是否是退药流程
+ boolean isRefundFlow = false;
+ if (medicationDispenseList != null) {
+ for (MedicationDispense dispense : medicationDispenseList) {
+ // 先判断是否包含“已完成/部分完成”的药品,这决定了是走“退药流程”还是“取消流程”
+ if (DispenseStatus.COMPLETED.getValue().equals(dispense.getStatusEnum())
+ || DispenseStatus.PART_COMPLETED.getValue().equals(dispense.getStatusEnum())) {
+ isRefundFlow = true;
+ break; // 只要有一条是完成状态,整个单子即视为走退药流程
+ }
+ }
+ }
- for (RefundItemDto dto : chargeItemList) {
-
- if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(dto.getServiceTable())) {
- // 药品需要先退药
- if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
- || DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
- // 药品请求查询
- MedicationRequest medicationRequest = medicationRequestService.getById(dto.getRequestId());
+ if (isRefundFlow) {
+ // ==================== 走退药流程 (生成新单据) ====================
+ // 校验是否重复申请
if (medicationRequest.getRefundMedicineId() != null) {
throw new ServiceException("已申请退药,请勿重复申请");
}
- // 生成药品请求(退药)
- medicationRequest.setId(null); // 药品请求id
- medicationRequest
- .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
- medicationRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
- medicationRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
- medicationRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
- medicationRequest.setRefundMedicineId(dto.getRequestId()); // 退药id
- medicationRequest.setPrescriptionNo(String.valueOf("T" + dto.getPrescriptionNo()));
- medicationRequestService.save(medicationRequest);
+ MedicationRequest newRefundRequest = new MedicationRequest();
+ BeanUtils.copyProperties(medicationRequest, newRefundRequest);
+ newRefundRequest.setId(null); // 清空ID以新增
+ newRefundRequest
+ .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
+ newRefundRequest.setQuantity(medicationRequest.getQuantity().multiply(new BigDecimal("-1"))); // 数量取反
+ newRefundRequest.setStatusEnum(RequestStatus.CANCELLED.getValue());
+ newRefundRequest.setRefundMedicineId(medicationRequest.getId()); // 关联原ID
+ newRefundRequest.setPrescriptionNo("T" + medicationRequest.getPrescriptionNo());
+ medicationRequestService.save(newRefundRequest);
+ Long newRequestId = newRefundRequest.getId();
+
+ // 再生成对应的负向发药记录,并关联退药请求
+ List newDispensesToSave = new ArrayList<>();
+ for (MedicationDispense originDispense : medicationDispenseList) {
+ // 只处理已完成或部分完成的记录
+ if (DispenseStatus.COMPLETED.getValue().equals(originDispense.getStatusEnum())
+ || DispenseStatus.PART_COMPLETED.getValue().equals(originDispense.getStatusEnum())) {
+ MedicationDispense refundDispense = new MedicationDispense();
+ BeanUtils.copyProperties(originDispense, refundDispense);
+ refundDispense.setId(null); // ID置空
+ refundDispense.setDispenseQuantity(BigDecimal.ZERO); // 已退数量
+ refundDispense.setMedReqId(newRequestId); // 关联退药请求id
+ refundDispense
+ .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
+ // 退药状态
+ refundDispense.setStatusEnum(DispenseStatus.PENDING_REFUND.getValue());
+ newDispensesToSave.add(refundDispense);
+ }
+ }
+ // 批量保存新的发药记录
+ if (!newDispensesToSave.isEmpty()) {
+ medicationDispenseService.saveBatch(newDispensesToSave);
+ }
} else {
- if (DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())
- && NotPerformedReason.REFUND.getValue().equals(dto.getNotPerformedReason())) {
- throw new ServiceException("已申请退药,请勿重复申请");
+ // ==================== 走直接取消流程 (修改原单据状态) ====================
+ if (medicationDispenseList != null) {
+ List dispensesToUpdate = new ArrayList<>();
+ for (MedicationDispense medicationDispense : medicationDispenseList) {
+ // 检查是否已经是退药状态
+ if (DispenseStatus.STOPPED.getValue().equals(medicationDispense.getStatusEnum())
+ && NotPerformedReason.REFUND.getValue().equals(medicationDispense.getStatusEnum())) {
+ throw new ServiceException("已申请退药,请勿重复申请");
+ }
+ // 修改状态
+ medicationDispense.setStatusEnum(DispenseStatus.STOPPED.getValue())
+ .setNotPerformedReasonEnum(NotPerformedReason.REFUND.getValue());
+ dispensesToUpdate.add(medicationDispense);
+ }
+ // 批量更新
+ if (!dispensesToUpdate.isEmpty()) {
+ medicationDispenseService.updateBatchById(dispensesToUpdate);
+ }
+ }
+ }
+ }
+ }
+ // 处理退耗材申请
+ if (!devReqIdList.isEmpty()) {
+ // 耗材请求查询
+ List deviceRequests = deviceRequestService.listByIds(devReqIdList);
+ // 耗材发放查询
+ List deviceDispenses = deviceDispenseService.selectByRequestIdList(devReqIdList);
+ // 根据请求id做map
+ Map> deviceDispenseMap =
+ deviceDispenses.stream().collect(Collectors.groupingBy(DeviceDispense::getDeviceReqId));
+ for (DeviceRequest deviceRequest : deviceRequests) {
+ // 根据请求匹配发放
+ List deviceDispenseList = deviceDispenseMap.get(deviceRequest.getId());
+ // 判断是否是退耗材流程
+ boolean isRefundFlow = false;
+ if (deviceDispenseList != null) {
+ for (DeviceDispense dispense : deviceDispenseList) {
+ // 先判断是否包含“已完成/部分完成”的耗材,这决定了是走“退耗材流程”还是“取消流程”
+ if (DispenseStatus.COMPLETED.getValue().equals(dispense.getStatusEnum())
+ || DispenseStatus.PART_COMPLETED.getValue().equals(dispense.getStatusEnum())) {
+ isRefundFlow = true;
+ break; // 只要有一条是完成状态,整个单子即视为走退耗材流程
+ }
}
- medDisIdList.add(dto.getDispenseId());
}
- } else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(dto.getServiceTable())) {
+ if (isRefundFlow) {
+ // ==================== 走退耗材流程 (生成新单据) ====================
+ // 校验是否重复申请
+ if (deviceRequest.getRefundDeviceId() != null) {
+ throw new ServiceException("已申请退耗材,请勿重复申请");
+ }
+ DeviceRequest newRefundRequest = new DeviceRequest();
+ BeanUtils.copyProperties(deviceRequest, newRefundRequest);
+ newRefundRequest.setId(null); // 清空ID以新增
+ newRefundRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
+ newRefundRequest.setQuantity(deviceRequest.getQuantity().multiply(new BigDecimal("-1"))); // 数量取反
+ newRefundRequest.setStatusEnum(RequestStatus.CANCELLED.getValue());
+ newRefundRequest.setRefundDeviceId(deviceRequest.getId()); // 关联原ID
+ newRefundRequest.setPrescriptionNo("T" + deviceRequest.getPrescriptionNo());
+ deviceRequestService.save(newRefundRequest);
+ Long newRequestId = newRefundRequest.getId();
+
+ // 再生成对应的负向发耗材记录,并关联退耗材请求
+ List newDispensesToSave = new ArrayList<>();
+ for (DeviceDispense originDispense : deviceDispenseList) {
+ // 只处理已完成或部分完成的记录
+ if (DispenseStatus.COMPLETED.getValue().equals(originDispense.getStatusEnum())
+ || DispenseStatus.PART_COMPLETED.getValue().equals(originDispense.getStatusEnum())) {
+ DeviceDispense refundDispense = new DeviceDispense();
+ BeanUtils.copyProperties(originDispense, refundDispense);
+ refundDispense.setId(null); // ID置空
+ refundDispense.setDispenseQuantity(BigDecimal.ZERO); // 已退数量
+ refundDispense.setDeviceReqId(newRequestId); // 关联退耗材请求id
+ refundDispense
+ .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
+ // 退耗材状态
+ refundDispense.setStatusEnum(DispenseStatus.PENDING_REFUND.getValue());
+ newDispensesToSave.add(refundDispense);
+ }
+ }
+
+ // 批量保存新的发耗材记录
+ if (!newDispensesToSave.isEmpty()) {
+ deviceDispenseService.saveBatch(newDispensesToSave);
+ }
+ } else {
+ // ==================== 走直接取消流程 (修改原单据状态) ====================
+ if (deviceDispenseList != null) {
+ List dispensesToUpdate = new ArrayList<>();
+ for (DeviceDispense deviceDispense : deviceDispenseList) {
+ // 检查是否已经是退耗材状态
+ if (DispenseStatus.STOPPED.getValue().equals(deviceDispense.getStatusEnum())
+ && NotPerformedReason.REFUND.getValue().equals(deviceDispense.getStatusEnum())) {
+ throw new ServiceException("已申请退耗材,请勿重复申请");
+ }
+ // 修改状态
+ deviceDispense.setStatusEnum(DispenseStatus.STOPPED.getValue())
+ .setNotPerformedReasonEnum(NotPerformedReason.REFUND.getValue());
+ dispensesToUpdate.add(deviceDispense);
+ }
+ // 批量更新
+ if (!dispensesToUpdate.isEmpty()) {
+ deviceDispenseService.updateBatchById(dispensesToUpdate);
+ }
+ }
+ }
+ }
+ }
+ // 处理退诊疗项目申请
+ // 诊疗申请待更新id列表
+ List serReqUpdateList = new ArrayList<>();
+ if (!serReqIdList.isEmpty()) {
+ // 查询诊疗申请
+ List serviceRequestList = serviceRequestService.listByIds(serReqIdList);
+ for (ServiceRequest serviceRequest : serviceRequestList) {
// 诊疗项目需医技科室同意退费
- if (RequestStatus.COMPLETED.getValue().equals(dto.getServiceStatus())) {
- // 服务请求查询
- ServiceRequest serviceRequest = serviceRequestService.getById(dto.getRequestId());
+ if (RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum())) {
if (serviceRequest.getRefundServiceId() != null) {
throw new ServiceException("已申请退费,请勿重复申请");
}
// 生成服务请求(取消服务)
- serviceRequest.setId(null); // 服务请求id
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
- serviceRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
- serviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
+ serviceRequest.setQuantity(serviceRequest.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
- serviceRequest.setRefundServiceId(dto.getRequestId()); // 退药id
+ serviceRequest.setRefundServiceId(serviceRequest.getId());// 退id
+ serviceRequest.setId(null); // 服务请求id
serviceRequestService.save(serviceRequest);
-
} else {
- if (RequestStatus.STOPPED.getValue().equals(dto.getServiceStatus())) {
+ if (RequestStatus.STOPPED.getValue().equals(serviceRequest.getStatusEnum())) {
throw new ServiceException("已申请退费,请勿重复申请");
}
- serReqIdList.add(dto.getServiceId());
- }
-
- } else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(dto.getServiceTable())) {
- // 耗材需要先退药
- if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
- || DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
- // 耗材请求查询
- DeviceRequest deviceRequest = deviceRequestService.getById(dto.getRequestId());
- if (deviceRequest.getRefundDeviceId() == null) {
- // 生成耗材请求(退耗材)
- deviceRequest.setId(null); // 耗材请求id
- deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
- deviceRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
- deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
- deviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
- deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id
- deviceRequestService.save(deviceRequest);
- }
- } else if (!DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())) {
- devDisIdList.add(dto.getDispenseId());
+ serReqUpdateList.add(serviceRequest.getId());
}
}
}
-
// 更新收费状态:退费中
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
-
- if (!medDisIdList.isEmpty()) {
- // 更新未发放药品状态:停止发放,停止原因:退费
- medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
- }
- if (!devDisIdList.isEmpty()) {
- // 更新未发放耗材状态:停止发放,停止原因:退费
- deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
+ // 更新未执行诊疗状态:停止
+ if (!serReqUpdateList.isEmpty()) {
+ serviceRequestService.updateStopRequestStatus(serReqUpdateList);
}
- if (!serReqIdList.isEmpty()) {
- // 更新未执行诊疗状态:停止
- serviceRequestService.updateStopRequestStatus(serReqIdList);
- }
-
// 返回退费成功信息
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"门诊退费"}));
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java
index ab4ec19fcc27cca63011ce80b0aa8f756b298be7..a38427afde49db379534eb4383a67b4125932bd5 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
+import com.core.common.core.domain.model.LoginUser;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -211,7 +212,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
CancelPaymentDto cancelPaymentDto = new CancelPaymentDto();
BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto);
-
+ //LoginUser loginUser = SecurityUtils.getLoginUser();
+ //String string1 = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH);
// 开通医保的处理
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
&& account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) {
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java
index 8d7386a1227f4687c63220734861e983e859da1b..fb34b1571e74f8fa5ab15db5a4695b8af1b26061 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java
@@ -3,9 +3,9 @@
*/
package com.openhis.web.chargemanage.controller;
+import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.core.common.core.domain.R;
@@ -16,18 +16,18 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
- * 门诊收费 controller
+ * 住院收费 controller
*
* @author zwh
* @date 2025-03-12
*/
@RestController
-@RequestMapping("/charge-manage/inpa-charge")
+@RequestMapping("/charge-manage/inpatient-charge")
@Slf4j
@AllArgsConstructor
public class InpatientChargeController {
- @Autowired
+ @Resource
private IInpatientChargeAppService inpatientChargeAppService;
/**
@@ -36,39 +36,38 @@ public class InpatientChargeController {
* @return 初始化信息
*/
@GetMapping(value = "/init")
- public R> outpatientChargeInit() {
- return inpatientChargeAppService.outpatientChargeInit();
+ public R> inpatientChargeInit() {
+ return inpatientChargeAppService.inpatientChargeInit();
}
/**
- * 查询就诊患者分页列表
+ * 查询住院患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
- * @return 就诊患者分页列表
+ * @return 住院患者分页列表
*/
@GetMapping(value = "/encounter-patient-page")
public R> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
- return R.ok(inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
- pageSize, request));
+ return inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo, pageSize,
+ request);
}
/**
- * 根据就诊id查询患者处方列表
+ * 根据就诊id查询患者待结算信息
*
* @param encounterId 就诊id
- * @return 患者处方列表
+ * @return 患者待结算信息
*/
@GetMapping(value = "/patient-prescription")
- public R> getEncounterPatientPrescription(@RequestParam Long encounterId, @RequestParam String startTime,
- @RequestParam String endTime) {
- return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId, startTime, endTime));
+ public R> getEncounterPatientPrescription(Long encounterId) {
+ return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId));
}
/**
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java
index ebb72bdf57be4dd65ae38069a78bc19a49c1f68c..302c09508bc3f8fce7c38588b0b477241c502f5b 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java
@@ -6,7 +6,6 @@ package com.openhis.web.chargemanage.controller;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.core.common.core.domain.R;
@@ -71,6 +70,17 @@ public class OutpatientChargeController {
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
}
+ /**
+ * 根据就诊id查询患者处方列表并新增字段:实收金额、应收金额、优惠金额、折扣率
+ *
+ * @param encounterId 就诊id
+ * @return 患者处方列表
+ */
+ @GetMapping(value = "/patient-prescription-with-price")
+ public R> getEncounterPatientPrescriptionWithPrice(@RequestParam Long encounterId) {
+ return R.ok(outpatientChargeAppService.getEncounterPatientPrescriptionWithPrice(encounterId));
+ }
+
/**
* 医保转自费
*
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java
index 544ccfea9c8b237dfd87e74037e2c8f51ea52dde..cb894e0c704335bba52be0a2feab5c007704705a 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java
@@ -11,7 +11,6 @@ import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.openhis.common.annotation.Dict;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -32,6 +31,10 @@ public class EncounterPatientPageDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
+ /** 住院状态 */
+ private Integer encounterStatus;
+ private String encounterStatus_enumText;
+
/**
* 患者
*/
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java
index b7acf61454ca9caf710691c39a2eb0255c0ab557..734cd4ac4c0ad3936083c99aa5b8469b0207873a 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java
@@ -67,4 +67,9 @@ public class EncounterPatientPageParam {
* 收费状态
*/
private Integer statusEnum;
+
+ /**
+ * 患者状态
+ */
+ private Integer encounterStatus;
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java
index 80e46d263e9cde087f695819f9d38850a63cafc7..e0f6e217d118f7d59dd9e2a0e9a2db02f60bead4 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java
@@ -51,7 +51,9 @@ public class EncounterPatientPrescriptionDto {
private Long quantityValue;
/** 单位 */
+ @Dict(dictCode = "unit_code")
private String quantityUnit;
+ private String quantityUnit_dictText;
/** 单价 */
private BigDecimal unitPrice;
@@ -92,17 +94,23 @@ public class EncounterPatientPrescriptionDto {
@Dict(dictCode = "med_type")
private String medTypeCode;
private String medTypeCode_dictText;
+
/** 用法 */
@Dict(dictCode = "method_code")
private String methodCode;
private String methodCode_dictText;
+
+ /** 剂量 */
private String dose;
+
+ /** 剂量单位 */
@Dict(dictCode = "unit_code")
private String doseUnitCode;
- /** 单次剂量单位 */
private String doseUnitCode_dictText;
+
/** 频次 */
private String rateCode;
+
/** 合同编码 */
private String contractNo;
@@ -123,4 +131,18 @@ public class EncounterPatientPrescriptionDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long paymentId;
+ /** 实收金额 */
+ private BigDecimal receivedAmount = BigDecimal.ZERO;
+
+ /** 优惠金额 */
+ private BigDecimal discountAmount = BigDecimal.ZERO;
+
+ /** 应收金额 */
+ private BigDecimal receivableAmount = BigDecimal.ZERO;
+
+ /** 折扣率 */
+ @Dict(dictCode = "charge_discount")
+ private String discountRate = "0";
+ private String discountRate_dictText;
+
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java
index 49392cc8290c65841cdcdf26a43b9f9b4a946d56..e8b3874fcf6ee309106d9cf1201eee3c922ff55b 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java
@@ -20,6 +20,8 @@ public class OutpatientInitDto {
private List chargeItemStatusOptions;
+ private List encounterStatusOptions;
+
/**
* 收费状态
*/
@@ -33,4 +35,18 @@ public class OutpatientInitDto {
this.label = label;
}
}
+
+ /**
+ * 住院状态
+ */
+ @Data
+ public static class encounterStatusOption {
+ private Integer value;
+ private String label;
+
+ public encounterStatusOption(Integer value, String label) {
+ this.value = value;
+ this.label = label;
+ }
+ }
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java
index dc5081875f87787f8ecc3c9b237722f2c170e013..c48ab73f0c41869466734a24cafd4ad1c3535ecc 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java
@@ -33,4 +33,7 @@ public class PractitionerMetadata {
/** 五笔码 */
private String wbStr;
+ /** 医生职称 */
+ private String drProfttlCode;
+
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java
index 158f18596eb55a5abc46f182e84e971387208bd9..36c49b8f11180690aaba587864025693dc9b4f07 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java
@@ -3,14 +3,15 @@
*/
package com.openhis.web.chargemanage.dto;
+import java.math.BigDecimal;
+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
+
import lombok.Data;
import lombok.experimental.Accessors;
-import java.math.BigDecimal;
-
/**
* 退款项目 dto
*
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java
index 7c704e233db2125130e0b29526d67a69d882f365..0e9d92613217a9495efad125b62bb5aca076f83d 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java
@@ -28,12 +28,16 @@ public interface InpatientChargeAppMapper {
/**
* 查询就诊患者分页列表
*
+ * @param classEnum 住院患者类型:住院
+ * @param dischargedFromHospital 住院状态:已出院
+ * @param alreadySettled 住院状态:已结算出院
* @param page 分页
* @param queryWrapper 查询条件
* @return 就诊患者分页列表
*/
Page selectEncounterPatientPage(@Param("classEnum") Integer classEnum,
- @Param("page") Page page,
+ @Param("dischargedFromHospital") Integer dischargedFromHospital,
+ @Param("alreadySettled") Integer alreadySettled, @Param("page") Page page,
@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
/**
@@ -56,5 +60,5 @@ public interface InpatientChargeAppMapper {
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
- @Param("partRefund") Integer partRefund, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+ @Param("partRefund") Integer partRefund);
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java
index e3c5d3be0aeb063a109e6aff6246f4a3483227f6..086607cc9c190427284384de5e1342cf743ec4cb 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java
@@ -57,4 +57,33 @@ public interface OutpatientChargeAppMapper {
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
@Param("partRefund") Integer partRefund);
+ /**
+ * 根据就诊id查询患者处方列表并新增字段:应收金额,实收金额,优惠金额,折扣率
+ *
+ * @param encounterId 就诊id
+ * @param activity 项目
+ * @param medication 药品
+ * @param device 耗材
+ * @param register 挂号费
+ * @param planned 收费状态:待收费
+ * @param billable 收费状态:待结算
+ * @param billed 收费状态:已结算
+ * @param refunding 收费状态:退费中
+ * @param refunded 收费状态:全部退费
+ * @param partRefund 收费状态:部分退费
+ * @param discountCode 优惠枚举码
+ * @param selfCode 现金枚举码
+ * @param selfVxCode 微信枚举码
+ * @param selfAliCode 支付宝枚举码
+ * @param selfUnionCode 银联枚举码
+ * @return 患者处方列表
+ */
+ List selectEncounterPatientPrescriptionWithPrice(
+ @Param("encounterId") Long encounterId, @Param("activity") Integer activity,
+ @Param("medication") Integer medication, @Param("device") Integer device, @Param("register") Integer register,
+ @Param("planned") Integer planned, @Param("billable") Integer billable, @Param("billed") Integer billed,
+ @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
+ @Param("partRefund") Integer partRefund, @Param("discountCode") Integer discountCode,
+ @Param("self") Integer selfCode, @Param("selfVx") Integer selfVxCode, @Param("selfAli") Integer selfAliCode,
+ @Param("selfUnion") Integer selfUnionCode);
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java
index c3d0effd6afe81ca6c0f6f6d96a572aa35407fd3..2cfa0823c0c9d05e47ffa00f4319103b0b36cb95 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java
@@ -188,4 +188,19 @@ public interface ICommonService {
* @return 诊疗项目
*/
R> getActivityDefinition();
+
+ /**
+ * 查询备份单号
+ *
+ * @return 备份单号列表
+ */
+ R> getBackupNoList();
+
+ /**
+ * 批号匹配
+ *
+ * @param encounterIdList 就诊id列表
+ * @return 处理结果
+ */
+ R> lotNumberMatch(List encounterIdList);
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java
index 00867bb58567b42a71c9d86e5ff72b73a07de93a..6c3999e3d814a6c65917ab483a030150faad6ca7 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java
@@ -3,6 +3,8 @@
*/
package com.openhis.web.common.appservice.impl;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
@@ -15,7 +17,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.enums.DelFlag;
import com.core.common.utils.AgeCalculatorUtil;
+import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.SecurityUtils;
import com.core.common.utils.StringUtils;
import com.core.common.utils.bean.BeanUtils;
@@ -32,13 +36,20 @@ import com.openhis.common.constant.CommonConstants;
import com.openhis.common.enums.*;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisQueryUtils;
+import com.openhis.document.domain.DocInventoryItemStatic;
+import com.openhis.document.service.IDocInventoryItemStaticService;
import com.openhis.financial.domain.Contract;
import com.openhis.financial.mapper.ContractMapper;
+import com.openhis.medication.domain.MedicationDispense;
+import com.openhis.medication.service.IMedicationDispenseService;
import com.openhis.web.chargemanage.dto.ContractMetadata;
import com.openhis.web.common.appservice.ICommonService;
import com.openhis.web.common.dto.*;
import com.openhis.web.common.mapper.CommonAppMapper;
+import com.openhis.web.pharmacymanage.dto.InventoryDetailDto;
+import com.openhis.workflow.domain.DeviceDispense;
import com.openhis.workflow.domain.InventoryItem;
+import com.openhis.workflow.service.IDeviceDispenseService;
import com.openhis.workflow.service.IInventoryItemService;
/**
@@ -50,6 +61,9 @@ import com.openhis.workflow.service.IInventoryItemService;
@Service
public class CommonServiceImpl implements ICommonService {
+ @Resource
+ private AssignSeqUtil assignSeqUtil;
+
@Resource
private TraceNoManageMapper traceNoManageMapper;
@@ -74,6 +88,15 @@ public class CommonServiceImpl implements ICommonService {
@Resource
private ISupplierService supplierService;
+ @Resource
+ private IDocInventoryItemStaticService iDocInventoryItemStaticService;
+
+ @Resource
+ private IMedicationDispenseService medicationDispenseService;
+
+ @Resource
+ private IDeviceDispenseService deviceDispenseService;
+
/**
* 获取药房列表
*
@@ -528,4 +551,264 @@ public class CommonServiceImpl implements ICommonService {
return R.ok(commonAppMapper.getActivityDefinition(PublicationStatus.ACTIVE.getValue()));
}
+ /**
+ * 查询备份单号
+ *
+ * @return 备份单号列表
+ */
+ @Override
+ public R> getBackupNoList() {
+ List docInventoryItemStaticList =
+ iDocInventoryItemStaticService.list(new LambdaQueryWrapper()
+ .eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
+ .eq(DocInventoryItemStatic::getTenantId, SecurityUtils.getLoginUser().getTenantId()));
+ if (docInventoryItemStaticList.isEmpty()) {
+ return null;
+ }
+ // 直接去重并按BusNo倒序排序
+ List busNoList = docInventoryItemStaticList.stream().map(DocInventoryItemStatic::getBusNo).distinct() // 去重
+ .sorted(Comparator.reverseOrder()).collect(Collectors.toList());
+ return R.ok(busNoList);
+ }
+
+ /**
+ * 批号匹配
+ *
+ * @param encounterIdList 就诊id列表
+ * @return 处理结果
+ */
+ @Override
+ public R> lotNumberMatch(List encounterIdList) {
+ // 查询患者待发放的药品信息
+ List medicationDispenseList = medicationDispenseService
+ .list(new LambdaQueryWrapper().in(MedicationDispense::getEncounterId, encounterIdList)
+ .eq(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
+ .eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
+ // 药品批号匹配
+ if (medicationDispenseList != null && !medicationDispenseList.isEmpty()) {
+ // 获取待发放的药品id
+ List medicationIdList =
+ medicationDispenseList.stream().map(MedicationDispense::getMedicationId).distinct().toList();
+ // 获取发药药房
+ List locationIdList =
+ medicationDispenseList.stream().map(MedicationDispense::getLocationId).distinct().toList();
+
+ // 查询待发放药品的库存明细
+ List inventoryDetailList = commonAppMapper
+ .selectMedicineInventoryDetail(medicationIdList, locationIdList, PublicationStatus.ACTIVE.getValue());
+ if (inventoryDetailList == null || inventoryDetailList.isEmpty()) {
+ return R.fail("发药单生成失败,请检查药品库存");
+ }
+ // 将库存信息根据药品id和库房id进行分组
+ Map> inventoryDetailMap = inventoryDetailList.stream()
+ .collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
+ // 按照效期排序(先进先出)
+ for (List inventoryList : inventoryDetailMap.values()) {
+ inventoryList.sort(Comparator.comparing(InventoryDetailDto::getExpirationDate));
+ }
+
+ // 使用索引循环,以便处理后续添加的拆分单
+ int currentIndex = 0;
+ while (currentIndex < medicationDispenseList.size()) {
+ MedicationDispense medicationDispense = medicationDispenseList.get(currentIndex);
+ currentIndex++;
+ // 根据发放药品和发放药房做key
+ String inventoryKey = medicationDispense.getMedicationId() + CommonConstants.Common.DASH
+ + medicationDispense.getLocationId();
+ // 查询对应的库存信息
+ if (!inventoryDetailMap.containsKey(inventoryKey)) {
+ return R.fail("药品库存不存在,药品ID: " + medicationDispense.getMedicationId());
+ }
+ List inventoryList = inventoryDetailMap.get(inventoryKey);
+
+ // 获取发药数量
+ BigDecimal dispenseQuantity = medicationDispense.getQuantity();
+ // 循环库存信息
+ for (InventoryDetailDto inventoryDetailDto : inventoryList) {
+ // 发药数量不能小于等于0
+ if (dispenseQuantity.compareTo(BigDecimal.ZERO) <= 0) {
+ break;
+ }
+ // 库存剩余数量不能小于等于0
+ if (inventoryDetailDto.getInventoryQuantity().compareTo(BigDecimal.ZERO) <= 0) {
+ continue;
+ }
+ // 发药数量单位转换
+ if (!inventoryDetailDto.getInventoryUnitCode().equals(medicationDispense.getUnitCode())) {
+ dispenseQuantity = dispenseQuantity.multiply(inventoryDetailDto.getPartPercent());
+ }
+
+ // 获取库存剩余数量
+ BigDecimal remainingInventoryQuantity =
+ inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
+ // 如果剩余库存数量大于等于0,则说明当前批号库存充足
+ if (remainingInventoryQuantity.compareTo(BigDecimal.ZERO) >= 0) {
+ medicationDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
+ // 将该批号的库存数量重置为剩余数量
+ inventoryDetailDto.setInventoryQuantity(remainingInventoryQuantity);
+ } else {
+ // 发药数量单位转换
+ if (!inventoryDetailDto.getInventoryUnitCode().equals(medicationDispense.getUnitCode())) {
+ // 发药数量取库存大单位数量
+ dispenseQuantity = inventoryDetailDto.getInventoryQuantity()
+ .divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
+ // 大单位数量不足则跳出循环
+ if (dispenseQuantity.compareTo(BigDecimal.ZERO) == 0) {
+ continue;
+ }
+ } else {
+ // 发药数量取该批号剩余数量
+ dispenseQuantity = inventoryDetailDto.getInventoryQuantity();
+ }
+
+ // 如果剩余数量不足则进行拆分
+ MedicationDispense splitMedicationDispense = new MedicationDispense();
+ BeanUtils.copyProperties(medicationDispense, splitMedicationDispense);
+ // 数量拆分
+ splitMedicationDispense.setQuantity(medicationDispense.getQuantity().subtract(dispenseQuantity))
+ // 重置id与批号
+ .setId(null).setLotNumber(null)
+ // 重新生成发药单编码
+ .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
+ // 将拆分出来的发药单添加到原发药单列表中
+ medicationDispenseList.add(splitMedicationDispense);
+
+ // 更新原发药单
+ medicationDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
+ medicationDispense.setQuantity(dispenseQuantity);
+ // 将该批号的库存数量重置为0
+ inventoryDetailDto.setInventoryQuantity(BigDecimal.ZERO);
+ }
+ break;
+ }
+ }
+ // 校验药品库存
+ for (MedicationDispense medicationDispense : medicationDispenseList) {
+ if (medicationDispense.getLotNumber() == null) {
+ return R.fail("药品:" + medicationDispense.getMedicationId() + "库存不足,请检查药品库存");
+ }
+ }
+ // 新增或更新发药单
+ boolean result = medicationDispenseService.saveOrUpdateBatch(medicationDispenseList);
+ if (!result) {
+ return R.fail("发药单生成失败,请联系管理员");
+ }
+ }
+ // 查询患者待发放的耗材信息
+ List deviceDispenseList = deviceDispenseService
+ .list(new LambdaQueryWrapper().in(DeviceDispense::getEncounterId, encounterIdList)
+ .eq(DeviceDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
+ .eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
+ // 耗材批号匹配
+ if (deviceDispenseList != null && !deviceDispenseList.isEmpty()) {
+ // 获取待发放的耗材id
+ List deviceIdList =
+ deviceDispenseList.stream().map(DeviceDispense::getDeviceDefId).distinct().toList();
+ // 获取发耗材房
+ List locationIdList =
+ deviceDispenseList.stream().map(DeviceDispense::getLocationId).distinct().toList();
+
+ // 查询待发放耗材的库存明细
+ List inventoryDetailList = commonAppMapper.selectDeviceInventoryDetail(deviceIdList,
+ locationIdList, PublicationStatus.ACTIVE.getValue());
+ if (inventoryDetailList == null || inventoryDetailList.isEmpty()) {
+ return R.fail("发耗材单生成失败,请检查耗材库存");
+ }
+ // 将库存信息根据耗材id和库房id进行分组
+ Map> inventoryDetailMap = inventoryDetailList.stream()
+ .collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
+ // 按照效期排序(先进先出)
+ for (List inventoryList : inventoryDetailMap.values()) {
+ inventoryList.sort(Comparator.comparing(InventoryDetailDto::getExpirationDate));
+ }
+
+ // 使用索引循环,以便处理后续添加的拆分单
+ int currentIndex = 0;
+ while (currentIndex < deviceDispenseList.size()) {
+ DeviceDispense deviceDispense = deviceDispenseList.get(currentIndex);
+ currentIndex++;
+ // 根据发放耗材和发放耗材房做key
+ String inventoryKey =
+ deviceDispense.getDeviceDefId() + CommonConstants.Common.DASH + deviceDispense.getLocationId();
+ // 查询对应的库存信息
+ if (!inventoryDetailMap.containsKey(inventoryKey)) {
+ return R.fail("耗材库存不存在,耗材ID: " + deviceDispense.getDeviceDefId());
+ }
+ List inventoryList = inventoryDetailMap.get(inventoryKey);
+
+ // 获取发耗材数量
+ BigDecimal dispenseQuantity = deviceDispense.getQuantity();
+ // 循环库存信息
+ for (InventoryDetailDto inventoryDetailDto : inventoryList) {
+ // 发耗材数量不能小于等于0
+ if (dispenseQuantity.compareTo(BigDecimal.ZERO) <= 0) {
+ break;
+ }
+ // 库存剩余数量不能小于等于0
+ if (inventoryDetailDto.getInventoryQuantity().compareTo(BigDecimal.ZERO) <= 0) {
+ continue;
+ }
+ // 发耗材数量单位转换
+ if (!inventoryDetailDto.getInventoryUnitCode().equals(deviceDispense.getUnitCode())) {
+ dispenseQuantity = dispenseQuantity.multiply(inventoryDetailDto.getPartPercent());
+ }
+
+ // 获取库存剩余数量
+ BigDecimal remainingInventoryQuantity =
+ inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
+ // 如果剩余库存数量大于等于0,则说明当前批号库存充足
+ if (remainingInventoryQuantity.compareTo(BigDecimal.ZERO) >= 0) {
+ deviceDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
+ // 将该批号的库存数量重置为剩余数量
+ inventoryDetailDto.setInventoryQuantity(remainingInventoryQuantity);
+ } else {
+ // 发耗材数量单位转换
+ if (!inventoryDetailDto.getInventoryUnitCode().equals(deviceDispense.getUnitCode())) {
+ // 发耗材数量取库存大单位数量
+ dispenseQuantity = inventoryDetailDto.getInventoryQuantity()
+ .divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
+ // 大单位数量不足则跳出循环
+ if (dispenseQuantity.compareTo(BigDecimal.ZERO) == 0) {
+ continue;
+ }
+ } else {
+ // 发耗材数量取该批号剩余数量
+ dispenseQuantity = inventoryDetailDto.getInventoryQuantity();
+ }
+
+ // 如果剩余数量不足则进行拆分
+ DeviceDispense splitDeviceDispense = new DeviceDispense();
+ BeanUtils.copyProperties(deviceDispense, splitDeviceDispense);
+ // 数量拆分
+ splitDeviceDispense.setQuantity(deviceDispense.getQuantity().subtract(dispenseQuantity))
+ // 重置id与批号
+ .setId(null).setLotNumber(null)
+ // 重新生成发耗材单编码
+ .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
+ // 将拆分出来的发耗材单添加到原发耗材单列表中
+ deviceDispenseList.add(splitDeviceDispense);
+
+ // 更新原发耗材单
+ deviceDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
+ deviceDispense.setQuantity(dispenseQuantity);
+ // 将该批号的库存数量重置为0
+ inventoryDetailDto.setInventoryQuantity(BigDecimal.ZERO);
+ }
+ break;
+ }
+ }
+ // 校验耗材库存
+ for (DeviceDispense deviceDispense : deviceDispenseList) {
+ if (deviceDispense.getLotNumber() == null) {
+ return R.fail("耗材:" + deviceDispense.getDeviceDefId() + "库存不足,请检查耗材库存");
+ }
+ }
+ // 新增或更新发耗材单
+ boolean result = deviceDispenseService.saveOrUpdateBatch(deviceDispenseList);
+ if (!result) {
+ return R.fail("发耗材单生成失败,请联系管理员");
+ }
+ }
+ return R.ok();
+ }
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java
index d3ab926f2f5e0510f12c9330f551e5ea6d8a57c6..797b4fff885b2ee5c61d99b68fbff898f9d587b4 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java
@@ -253,4 +253,24 @@ public class CommonAppController {
return commonService.getActivityDefinition();
}
+ /**
+ * 查询备份单号
+ *
+ * @return 备份单号列表
+ */
+ @GetMapping(value = "/backup-list")
+ public R> getBackupNoList() {
+ return commonService.getBackupNoList();
+ }
+
+ /**
+ * 批号匹配
+ *
+ * @param encounterIdList 就诊id列表
+ * @return 处理结果
+ */
+ @GetMapping("/lot-number-match")
+ public R> lotNumberMatch(@RequestParam(value = "encounterIdList") List encounterIdList) {
+ return commonService.lotNumberMatch(encounterIdList);
+ }
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdviceItemPrintInfoDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdviceItemPrintInfoDto.java
index cb69abe61e53556bf7b9c3409ce53a20d4bbb805..453a5217abc43f6d5234576d697aeacde5d4479e 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdviceItemPrintInfoDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdviceItemPrintInfoDto.java
@@ -92,4 +92,9 @@ public class AdviceItemPrintInfoDto {
* 排序号
*/
private Integer sortNumber;
+
+ /**
+ * 中药付数
+ */
+ private BigDecimal chineseHerbsDoseQuantity;
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdvicePrintInfoDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdvicePrintInfoDto.java
index c807f203219eb1efbd7705f5e46a6671214ea84e..1ca797623f7227fae0a9b2f3917f410cf52e961c 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdvicePrintInfoDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/AdvicePrintInfoDto.java
@@ -3,6 +3,7 @@
*/
package com.openhis.web.common.dto;
+import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java
index 8e1e81ca10efca58a8dc89d8953c5eebf5af2d32..e013d6f8d6adea8635b9d483ce045a1df5311a97 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java
@@ -30,10 +30,14 @@ public class PerformRecordDto {
private Integer statusEnum;
private String statusEnum_enumText;
- /** 执行时间 */
+ /** 预计执行时间 */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date occurrenceTime;
+ /** 实际执行时间 */
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date recordedTime;
+
/** 执行位置 */
private String locationName;
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java
index 195963fc68fcfc4e1bf0422e5b3d57bc91e52d39..8b18b351de8287d7832f40e2e8877a6bb632d9e2 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.administration.domain.TraceNoManage;
import com.openhis.web.common.dto.*;
+import com.openhis.web.pharmacymanage.dto.InventoryDetailDto;
/**
* app常用接口 mapper
@@ -104,4 +105,26 @@ public interface CommonAppMapper {
* @return 诊疗项目
*/
List getActivityDefinition(@Param("statusEnum") Integer statusEnum);
+
+ /**
+ * 查询药品库存详细信息
+ *
+ * @param medicationIdList 药品id列表
+ * @param locationIdList 库房id列表
+ * @param active 库存状态:启用
+ * @return 库存详细信息
+ */
+ List selectMedicineInventoryDetail(@Param("medicationIdList") List medicationIdList,
+ @Param("locationIdList") List locationIdList, @Param("active") Integer active);
+
+ /**
+ * 查询耗材库存详细信息
+ *
+ * @param deviceIdList 耗材id列表
+ * @param locationIdList 库房id列表
+ * @param active 库存状态:启用
+ * @return 库存详细信息
+ */
+ List selectDeviceInventoryDetail(@Param("deviceIdList") List deviceIdList,
+ @Param("locationIdList") List locationIdList, @Param("active") Integer active);
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java
index f4d07e1059b3a4a8a8421d1dc504ee53443e571f..337d245284c7df7247ed197f1046de861767232f 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java
@@ -13,6 +13,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.core.common.enums.DelFlag;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
@@ -25,7 +26,6 @@ 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.core.domain.entity.SysDictData;
-import com.core.common.enums.DeleteFlag;
import com.core.common.utils.*;
import com.core.common.utils.bean.BeanUtils;
import com.core.common.utils.poi.ExcelUtil;
@@ -388,7 +388,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
// 查询机构ID、位置信息供后续使用
Long orgId = SecurityUtils.getLoginUser().getOrgId();
List locationList = locationService.list(new LambdaQueryWrapper()
- .eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
+ .eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
Map> locationNameMap =
locationList.stream().collect(Collectors.groupingBy(Location::getName));
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java
index b539bbd962e417a74e047f02c8a6a93bc6663850..8bc044f4ae1d0d08cdb747f9a151110faaed5637 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java
@@ -12,6 +12,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.core.common.enums.DelFlag;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
@@ -24,7 +25,6 @@ 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.core.domain.entity.SysDictData;
-import com.core.common.enums.DeleteFlag;
import com.core.common.utils.*;
import com.core.common.utils.bean.BeanUtils;
import com.core.common.utils.poi.ExcelUtil;
@@ -479,7 +479,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
// 查询机构ID、位置信息供后续使用
Long orgId = SecurityUtils.getLoginUser().getOrgId();
List locationList = locationService.list(new LambdaQueryWrapper()
- .eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
+ .eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
Map> locationNameMap =
locationList.stream().collect(Collectors.groupingBy(Location::getName));
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java
index 25471fd27b6a71ea706af30efc391b0fac8632a7..7520c81b81dad01cd1e26bd65f7b89d3c8a7522c 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java
@@ -30,7 +30,7 @@ import com.openhis.administration.service.ISupplierService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.constant.PromptMsgConstant;
import com.openhis.common.enums.AssignSeqEnum;
-import com.openhis.common.enums.DelFlag;
+import com.core.common.enums.DelFlag;
import com.openhis.common.enums.SupplierType;
import com.openhis.common.enums.Whether;
import com.openhis.common.utils.EnumUtils;
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java
index f52d7dfcb829b705ba5d084067cb10f184dac2c7..a177127b5d9db5b026e6103b9e42176da43a2678 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java
@@ -24,4 +24,14 @@ public class ActivityChildJsonDto {
*/
private BigDecimal childrenRequestNum;
+ /**
+ * 售价
+ */
+ private BigDecimal retailPrice;
+
+ /**
+ * 诊疗名称
+ */
+ private String name;
+
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java
index c6935d33e6446e837a68d551696601c89827bb68..7e136811848763dd33cf8a4465743511c4ec17e4 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java
@@ -5,14 +5,10 @@ import java.math.BigDecimal;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
-import com.openhis.common.enums.DeviceCategory;
-import com.openhis.common.enums.PublicationStatus;
import lombok.Data;
import lombok.experimental.Accessors;
-import javax.validation.constraints.NotNull;
-
/**
* 器材目录分页检索
*
@@ -118,7 +114,7 @@ public class DeviceManageDto {
/** 供应商 */
@JsonSerialize(using = ToStringSerializer.class)
- @Dict(dictTable = "adm_supplier",dictCode = "id",dictText = "name")
+ @Dict(dictTable = "adm_supplier", dictCode = "id", dictText = "name")
private Long supplyId;
private String supplyId_dictText;
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java
index 2b579dd0099a3a0cb8d262b2463541d1a343f48e..440744bc2b7dbc81280022e273e7ede6b202243b 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java
@@ -3,12 +3,10 @@ package com.openhis.web.datadictionary.dto;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
-import com.openhis.common.enums.DeviceCategory;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -136,7 +134,7 @@ public class DeviceManageUpDto {
/** 医保类别 */
private String ybType;
-
+
/** 医保等级 */
private Integer chrgitmLv;
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java
index 4dcfd3476dc8b7c566f9a72403e65f0f4f3d7677..e4e999f737b7c8872029da64c3c595382617ed78 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java
@@ -5,7 +5,6 @@ import java.util.List;
import javax.annotation.Resource;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -36,17 +35,20 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
@Resource
private AssignSeqUtil assignSeqUtil;
+
@Resource
private ISupplyRequestService supplyRequestService;
+
@Resource
private ISupplyDeliveryService supplyDeliveryService;
- @Autowired
+ @Resource
private IDepartmentCommonService departmentCommonService;
- @Autowired
+ @Resource
private DepartmentCommonMapper departmentCommonMapper;
- @Autowired
+
+ @Resource
private DepartmentIssuanceOrderMapper departmentIssuanceOrderMapper;
/**
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java
index e3e2e07ccbf13949a64e8f4e4a1eab10be20cc52..cbc24236a0e2acee6358a5f496de841bd56e7f1d 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java
@@ -4,7 +4,10 @@ import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
-import com.openhis.web.doctorstation.dto.*;
+import com.openhis.web.doctorstation.dto.AdviceBaseDto;
+import com.openhis.web.doctorstation.dto.AdviceSaveParam;
+import com.openhis.web.doctorstation.dto.OrderBindInfoDto;
+import com.openhis.web.doctorstation.dto.UpdateGroupIdParam;
/**
* 医生站-医嘱/处方 应用Service
@@ -23,11 +26,12 @@ public interface IDoctorStationAdviceAppService {
* @param pageSize 每页多少条
* @param pricingFlag 划价标记
* @param adviceTypes 医嘱类型参数集合
+ * @param orderPricing 医嘱定价来源 | 定时任务调用时传参
* @return 医嘱信息
*/
IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
List adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
- Integer pricingFlag, List adviceTypes);
+ Integer pricingFlag, List adviceTypes, String orderPricing);
/**
* 查询医嘱绑定信息
@@ -87,4 +91,29 @@ public interface IDoctorStationAdviceAppService {
* @return 就诊费用性质
*/
R> getEncounterContract(Long encounterId);
+
+ /**
+ * 查询检验检查开立历史(近30天)
+ *
+ * @param patientId 患者id
+ * @param adviceDefinitionId 医嘱定义id
+ * @return 检验检查开立历史
+ */
+ R> getProofAndTestHistory(Long patientId, Long adviceDefinitionId);
+
+ /**
+ * 查询检验url相关参数
+ *
+ * @param encounterId 就诊id
+ * @return 检验url相关参数
+ */
+ R> getProofResult(Long encounterId);
+
+ /**
+ * 查询检查url相关参数
+ *
+ * @param encounterId 就诊id
+ * @return 检查url相关参数
+ */
+ R> getTestResult(Long encounterId);
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAllergyIntolAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAllergyIntolAppService.java
deleted file mode 100644
index 7e5e70a2899f7cd606d0b72be95a564c2b5f511c..0000000000000000000000000000000000000000
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAllergyIntolAppService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.openhis.web.doctorstation.appservice;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.web.bind.annotation.GetMapping;
-
-import com.core.common.core.domain.R;
-import com.openhis.web.doctorstation.dto.AllergyIntoInfoDto;
-
-/**
- * 医生站-患者过敏与不耐受管理的应用类
- *
- * @author liuhr
- * @date 2025/4/10
- */
-public interface IDoctorStationAllergyIntolAppService {
-
- /**
- * 患者过敏与不耐受数据初始化
- *
- * @return 基础数据
- */
- @GetMapping(value = "/init")
- R> init();
-
- /**
- * 查询患者过敏与不耐受信息
- *
- * @param patientId 患者Id
- * @param pageNo 当前页
- * @param pageSize 每页多少条
- * @return 患者过敏与不耐受信息
- */
- R> getAllergyIntoleranceInfo(Long patientId, Integer pageNo, Integer pageSize, HttpServletRequest request);
-
- /**
- * 作废当条患者过敏与不耐受信息
- *
- * @param allergyIntoInfoDto 患者过敏与不耐受信息
- * @return
- */
- R> invalidateAllergyIntolerance(AllergyIntoInfoDto allergyIntoInfoDto);
-
- /**
- * 新增患者过敏与不耐受信息
- *
- * @param allergyIntoInfoDto 患者过敏与不耐受信息
- * @return
- */
- R> addAllergyIntoleranceInfo(AllergyIntoInfoDto allergyIntoInfoDto);
-
-}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationChineseMedicalAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationChineseMedicalAppService.java
index 4133962666e18e9e95ca96b8548d312c85643291..517a4467b3cb63f5ee14c4f2474ee6067f8356c3 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationChineseMedicalAppService.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationChineseMedicalAppService.java
@@ -43,6 +43,15 @@ public interface IDoctorStationChineseMedicalAppService {
*/
R> saveTcmDiagnosis(SaveDiagnosisParam saveDiagnosisParam);
+
+ /**
+ * 保存中医诊断
+ *
+ * @param saveDiagnosisParam 诊断信息
+ * @return 结果
+ */
+ R> updateTcmDiagnosis(SaveDiagnosisParam saveDiagnosisParam);
+
/**
* 查询中医就诊诊断信息
*
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java
index f7b606ccf150fdafdcee4e7f9d68290f1c2e45f2..c22cb91d847dbe2a72f25930487f17bc72999bec 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java
@@ -69,6 +69,14 @@ public interface IDoctorStationDiagnosisAppService {
*/
R> saveDoctorDiagnosis(SaveDiagnosisParam saveDiagnosisParam);
+ /**
+ * 医生保存诊断
+ *
+ * @param saveDiagnosisParam 诊断信息
+ * @return 结果
+ */
+ R> saveDoctorDiagnosisNew(SaveDiagnosisParam saveDiagnosisParam);
+
/**
* 查询诊断定义业务分类数据
*
@@ -101,4 +109,13 @@ public interface IDoctorStationDiagnosisAppService {
* @return 查询结果
*/
R> getDiagnosisList(String searchKey, HttpServletRequest request);
+
+ /**
+ * 查询诊断信息
+ *
+ * @param searchKey 目标字符
+ * @param encounterId 请求
+ * @return 查询结果
+ */
+ R> getEncounterDiagnosisByEncounterId(Long encounterId, String searchKey);
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java
index 08588506d2a9240a864b7e7ca27ab50a95339699..b0b9df1b1f85f5dce40c005ea6e2a4da7bd8ee9f 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java
@@ -1,5 +1,13 @@
package com.openhis.web.doctorstation.appservice.impl;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -37,13 +45,8 @@ import com.openhis.workflow.service.IActivityDefinitionService;
import com.openhis.workflow.service.IDeviceDispenseService;
import com.openhis.workflow.service.IDeviceRequestService;
import com.openhis.workflow.service.IServiceRequestService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
+import lombok.extern.slf4j.Slf4j;
/**
* 医生站-医嘱/处方 应用实现类
@@ -97,60 +100,66 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
/**
* 查询医嘱信息
*
- * @param adviceBaseDto 查询条件
- * @param searchKey 模糊查询关键字
- * @param locationId 药房id
+ * @param adviceBaseDto 查询条件
+ * @param searchKey 模糊查询关键字
+ * @param locationId 药房id
* @param adviceDefinitionIdParamList 医嘱定义id参数集合
- * @param organizationId 患者挂号对应的科室id
- * @param pageNo 当前页
- * @param pageSize 每页多少条
- * @param pricingFlag 划价标记
- * @param adviceTypes 医嘱类型参数集合
+ * @param organizationId 患者挂号对应的科室id
+ * @param pageNo 当前页
+ * @param pageSize 每页多少条
+ * @param pricingFlag 划价标记
+ * @param adviceTypes 医嘱类型参数集合
+ * @param orderPricing 医嘱定价来源 | 定时任务调用时传参
* @return 医嘱信息
*/
@Override
public IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
- List adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
- Integer pricingFlag, List adviceTypes) {
+ List adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
+ Integer pricingFlag, List adviceTypes, String orderPricing) {
+ // 设置默认科室 (不取前端传的了)
+ organizationId = SecurityUtils.getLoginUser().getOrgId();
+
// 医嘱定价来源
String orderPricingSource = TenantOptionUtil.getOptionContent(TenantOptionDict.ORDER_PRICING_SOURCE);
- if (StringUtils.isEmpty(orderPricingSource)) {
+ if (StringUtils.isEmpty(orderPricingSource) && StringUtils.isEmpty(orderPricing)) {
throw new ServiceException("租户配置项【医嘱定价来源】未配置");
+ } else if (StringUtils.isNotEmpty(orderPricing)) {
+ orderPricingSource = orderPricing;
}
// 构建查询条件
QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(adviceBaseDto, searchKey,
- new HashSet<>(Arrays.asList("advice_name", "py_str", "wb_str")), null);
+ new HashSet<>(Arrays.asList("advice_name", "py_str", "wb_str")), null);
IPage adviceBaseInfo = doctorStationAdviceAppMapper.getAdviceBaseInfo(
- new Page<>(pageNo, pageSize), PublicationStatus.ACTIVE.getValue(), organizationId,
- CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
- CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, pricingFlag, adviceDefinitionIdParamList, adviceTypes,
- queryWrapper);
+ new Page<>(pageNo, pageSize), PublicationStatus.ACTIVE.getValue(), organizationId,
+ CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
+ CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, pricingFlag, adviceDefinitionIdParamList, adviceTypes,
+ queryWrapper);
List adviceBaseDtoList = adviceBaseInfo.getRecords();
// 医嘱定义ID集合
List adviceDefinitionIdList =
- adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId).collect(Collectors.toList());
+ adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId).collect(Collectors.toList());
// 费用定价主表ID集合
List chargeItemDefinitionIdList =
- adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId).collect(Collectors.toList());
+ adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId).collect(Collectors.toList());
// 医嘱库存集合
List adviceInventoryList =
- doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList,
- CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
+ doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList,
+ CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
// 待发放个数信息
List adviceDraftInventoryList = doctorStationAdviceAppMapper.getAdviceDraftInventory(
- CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
- DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
+ CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
+ DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
// 预减库存
List adviceInventory =
- adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
+ adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
// 查询取药科室配置
List medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId);
// 费用定价子表信息
List childCharge = doctorStationAdviceAppMapper
- .getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList);
+ .getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList);
// 费用定价主表信息
List mainCharge =
- doctorStationAdviceAppMapper.getMainCharge(chargeItemDefinitionIdList, PublicationStatus.ACTIVE.getValue());
+ doctorStationAdviceAppMapper.getMainCharge(chargeItemDefinitionIdList, PublicationStatus.ACTIVE.getValue());
String unitCode = ""; // 包装单位
Long chargeItemDefinitionId; // 费用定价主表ID
for (AdviceBaseDto baseDto : adviceBaseDtoList) {
@@ -158,24 +167,23 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
case CommonConstants.TableName.MED_MEDICATION_DEFINITION: // 药品
// 是否皮试
baseDto
- .setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getSkinTestFlag()));
+ .setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getSkinTestFlag()));
// 是否为注射药物
baseDto.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getInjectFlag()));
case CommonConstants.TableName.ADM_DEVICE_DEFINITION: // 耗材
// 每一条医嘱的库存集合信息 , 包装单位库存前端计算
- List<
- AdviceInventoryDto> inventoryList =
- adviceInventory.stream()
- .filter(e -> baseDto.getAdviceDefinitionId().equals(e.getItemId())
- && baseDto.getAdviceTableName().equals(e.getItemTable()))
- .collect(Collectors.toList());
+ List inventoryList = adviceInventory.stream()
+ .filter(e -> baseDto.getAdviceDefinitionId().equals(e.getItemId())
+ && baseDto.getAdviceTableName().equals(e.getItemTable())
+ && (baseDto.getPositionId() == null || baseDto.getPositionId().equals(e.getLocationId())))
+ .collect(Collectors.toList());
// 库存信息
baseDto.setInventoryList(inventoryList);
// 设置默认产品批号
if (!inventoryList.isEmpty()) {
// 库存大于0
List hasInventoryList = inventoryList.stream()
- .filter(e -> e.getQuantity().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
+ .filter(e -> e.getQuantity().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
if (!hasInventoryList.isEmpty()) {
baseDto.setDefaultLotNumber(hasInventoryList.get(0).getLotNumber());
}
@@ -183,18 +191,19 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
if (!inventoryList.isEmpty() && !medLocationConfig.isEmpty()) {
// 第一步:在medLocationConfig中匹配categoryCode
AdviceInventoryDto result1 = medLocationConfig.stream()
- .filter(dto -> baseDto.getCategoryCode().equals(dto.getCategoryCode())).findFirst()
- .orElse(null);
+ .filter(dto -> baseDto.getCategoryCode().equals(dto.getCategoryCode())).findFirst()
+ .orElse(null);
if (result1 != null) {
// 第二步:在inventoryList中匹配locationId
AdviceInventoryDto result2 = inventoryList.stream()
- .filter(dto -> result1.getLocationId().equals(dto.getLocationId())).findFirst()
- .orElse(null);
+ .filter(dto -> result1.getLocationId().equals(dto.getLocationId())).findFirst()
+ .orElse(null);
if (result2 != null && result2.getLotNumber() != null) {
baseDto.setDefaultLotNumber(result2.getLotNumber());
}
}
}
+
unitCode = baseDto.getUnitCode();
chargeItemDefinitionId = baseDto.getChargeItemDefinitionId();
List priceDtoList = new ArrayList<>();
@@ -204,14 +213,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
String finalUnitCode = unitCode;
// 从定价子表取价格(适用于批次售卖场景)
List childPrice = childCharge.stream()
- .filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId)
- && e.getConditionValue().equals(adviceInventoryDto.getLotNumber()))
- .peek(e -> e.setUnitCode(finalUnitCode)) // 设置 unitCode
- .collect(Collectors.toList());
+ .filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId)
+ && e.getConditionValue().equals(adviceInventoryDto.getLotNumber()))
+ .peek(e -> e.setUnitCode(finalUnitCode)) // 设置 unitCode
+ .collect(Collectors.toList());
// 从定价主表取价格(适用于统一零售价场景)
List mainPrice = mainCharge.stream()
- .filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
- .collect(Collectors.toList());
+ .filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
+ .collect(Collectors.toList());
// 按批次售价
if (OrderPricingSource.BATCH_SELLING_PRICE.getCode().equals(orderPricingSource)) {
priceDtoList.addAll(childPrice);
@@ -224,13 +233,13 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
break;
case CommonConstants.TableName.WOR_ACTIVITY_DEFINITION: // 诊疗
List priceList =
- mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
- .collect(Collectors.toList());
+ mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
+ .collect(Collectors.toList());
// 价格信息
baseDto.setPriceList(priceList);
// 活动类型
baseDto.setActivityType_enumText(
- EnumUtils.getInfoByValue(ActivityType.class, baseDto.getActivityType()));
+ EnumUtils.getInfoByValue(ActivityType.class, baseDto.getActivityType()));
break;
default:
break;
@@ -243,7 +252,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
* 查询医嘱绑定信息
*
* @param typeCode 1:用法绑东西 2:诊疗绑东西
- * @param itemNo 用法的code 或者 诊疗定义id
+ * @param itemNo 用法的code 或者 诊疗定义id
* @return 医嘱绑定信息
*/
@Override
@@ -255,7 +264,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
* 门诊保存/签发医嘱
*
* @param adviceSaveParam 医嘱表单信息
- * @param adviceOpType 医嘱操作类型
+ * @param adviceOpType 医嘱操作类型
* @return 结果
*/
@Override
@@ -266,21 +275,21 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
List adviceSaveList = adviceSaveParam.getAdviceSaveList();
// 药品
List medicineList = adviceSaveList.stream()
- .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
+ .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
// 耗材
List deviceList = adviceSaveList.stream()
- .filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
+ .filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
// 诊疗活动
List activityList = adviceSaveList.stream()
- .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
+ .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
/**
* 保存时,校验库存
*/
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
List needCheckList =
- adviceSaveList.stream().filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())
- && !ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
+ adviceSaveList.stream().filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())
+ && !ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
// 校验库存
String tipRes = adviceUtils.checkInventory(needCheckList);
if (tipRes != null) {
@@ -295,7 +304,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
/**
* 处理药品请求
*/
- this.handMedication(medicineList, curDate, adviceOpType, organizationId, signCode);
+ List medRequestIdList =
+ this.handMedication(medicineList, curDate, adviceOpType, organizationId, signCode);
/**
* 处理诊疗项目请求
@@ -311,25 +321,26 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {
// 签发的医嘱id集合
List requestIds = adviceSaveList.stream()
- .filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
- .collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
+ .filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
+ .collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
// 就诊id
Long encounterId = adviceSaveList.get(0).getEncounterId();
iChargeItemService.update(new LambdaUpdateWrapper()
- .set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
- .eq(ChargeItem::getEncounterId, encounterId)
- .eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
- .in(ChargeItem::getServiceId, requestIds));
+ .set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
+ .eq(ChargeItem::getEncounterId, encounterId)
+ .eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
+ .in(ChargeItem::getServiceId, requestIds));
}
- return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"门诊医嘱"}));
+ return R.ok(medRequestIdList,
+ MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊医嘱"}));
}
/**
* 处理药品
*/
- private void handMedication(List medicineList, Date curDate, String adviceOpType,
- Long organizationId, String signCode) {
+ private List handMedication(List medicineList, Date curDate, String adviceOpType,
+ Long organizationId, String signCode) {
// 当前登录账号的科室id
Long orgId = SecurityUtils.getLoginUser().getOrgId();
// 保存操作
@@ -342,11 +353,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
ChargeItem chargeItem;
// 新增 + 修改
List insertOrUpdateList =
- medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
- || DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
+ medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
+ || DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
// 删除
List deleteList = medicineList.stream()
- .filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
+ .filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
// 校验删除的医嘱是否已经收费
List delRequestIdList = deleteList.stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
if (!delRequestIdList.isEmpty()) {
@@ -365,12 +376,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
// 删除费用项
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.MED_MEDICATION_REQUEST,
- adviceSaveDto.getRequestId());
+ adviceSaveDto.getRequestId());
// 删除基于这个药品生成的需要执行的诊疗请求
iServiceRequestService.remove(
- new LambdaQueryWrapper().eq(ServiceRequest::getBasedOnId, adviceSaveDto.getRequestId())
- .isNotNull(ServiceRequest::getBasedOnTable)
- .eq(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue()));
+ new LambdaQueryWrapper().eq(ServiceRequest::getBasedOnId, adviceSaveDto.getRequestId())
+ .isNotNull(ServiceRequest::getBasedOnTable)
+ .eq(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue()));
}
// 签发时
if (is_sign) {
@@ -378,7 +389,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
prescriptionUtils.generatePrescriptionNumbers(insertOrUpdateList);
}
+ List medRequestIdList = new ArrayList<>();
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
+ boolean firstTimeSave = false;// 第一次保存
medicationRequest = new MedicationRequest();
medicationRequest.setId(adviceSaveDto.getRequestId()); // 主键id
medicationRequest.setStatusEnum(is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue()); // 请求状态
@@ -419,12 +432,17 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
medicationRequest.setInfusionFlag(adviceSaveDto.getInjectFlag()); // 输液标志
medicationRequest.setSortNumber(adviceSaveDto.getSortNumber()); // 排序号
}
+ if (medicationRequest.getId() == null) {
+ firstTimeSave = true;
+ }
iMedicationRequestService.saveOrUpdate(medicationRequest);
-
+ if (firstTimeSave) {
+ medRequestIdList.add(medicationRequest.getId().toString());
+ }
if (is_save) {
// 处理药品发放
Long dispenseId =
- iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
+ iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
// 保存药品费用项
chargeItem = new ChargeItem();
@@ -459,6 +477,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
}
}
+ return medRequestIdList;
}
/**
@@ -476,11 +495,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
ChargeItem chargeItem;
// 新增 + 修改
List insertOrUpdateList =
- deviceList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
- || DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
+ deviceList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
+ || DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
// 删除
List deleteList = deviceList.stream()
- .filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
+ .filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
// 校验删除的医嘱是否已经收费
List delRequestIdList = deleteList.stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
if (!delRequestIdList.isEmpty()) {
@@ -499,7 +518,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
iDeviceDispenseService.deleteDeviceDispense(adviceSaveDto.getRequestId());
// 删除费用项
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_DEVICE_REQUEST,
- adviceSaveDto.getRequestId());
+ adviceSaveDto.getRequestId());
}
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
@@ -536,7 +555,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
if (is_save) {
// 处理耗材发放
Long dispenseId =
- iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceSaveDto.getDbOpType());
+ iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceSaveDto.getDbOpType());
// 保存耗材费用项
chargeItem = new ChargeItem();
@@ -575,7 +594,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
* 处理诊疗
*/
private void handService(List activityList, Date curDate, String adviceOpType, Long organizationId,
- String signCode) {
+ String signCode) {
// 当前登录账号的科室id
Long orgId = SecurityUtils.getLoginUser().getOrgId();
// 保存操作
@@ -587,11 +606,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
ChargeItem chargeItem;
// 新增 + 修改
List insertOrUpdateList =
- activityList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
- || DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
+ activityList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
+ || DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
// 删除
List deleteList = activityList.stream()
- .filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
+ .filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
// 校验删除的医嘱是否已经收费
List delRequestIdList = deleteList.stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
if (!delRequestIdList.isEmpty()) {
@@ -607,10 +626,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
for (AdviceSaveDto adviceSaveDto : deleteList) {
iServiceRequestService.removeById(adviceSaveDto.getRequestId());// 删除诊疗
iServiceRequestService.remove(
- new LambdaQueryWrapper().eq(ServiceRequest::getParentId, adviceSaveDto.getRequestId()));// 删除诊疗套餐对应的子项
+ new LambdaQueryWrapper().eq(ServiceRequest::getParentId, adviceSaveDto.getRequestId()));// 删除诊疗套餐对应的子项
// 删除费用项
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST,
- adviceSaveDto.getRequestId());
+ adviceSaveDto.getRequestId());
}
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
@@ -639,6 +658,13 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
serviceRequest.setYbClassEnum(adviceSaveDto.getYbClassEnum());// 类别医保编码
serviceRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
serviceRequest.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
+
+ // 基于皮试药品生成的皮试检查
+ if (adviceSaveDto.getBasedOnId() != null) {
+ serviceRequest.setBasedOnId(adviceSaveDto.getBasedOnId());
+ serviceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
+ }
+
}
iServiceRequestService.saveOrUpdate(serviceRequest);
@@ -675,7 +701,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// 第一次保存时,处理诊疗套餐的子项信息
if (adviceSaveDto.getRequestId() == null) {
ActivityDefinition activityDefinition =
- iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
+ iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
String childrenJson = activityDefinition.getChildrenJson();
if (childrenJson != null) {
// 诊疗子项参数类
@@ -698,17 +724,17 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
try {
// 查询诊疗定义
ActivityDefinition activityDefinition =
- iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
+ iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
if (activityDefinition != null) {
// 检验 或 检查
if (ActivityType.PROOF.getValue().equals(activityDefinition.getTypeEnum())
- || ActivityType.TEST.getValue().equals(activityDefinition.getTypeEnum())) {
+ || ActivityType.TEST.getValue().equals(activityDefinition.getTypeEnum())) {
doctorStationSendApplyUtil.sendCrossSystemApply(adviceSaveDto, organizationId, curDate);
}
}
} catch (Exception e) {
if (!Whether.YES.getCode()
- .equals(TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_PACS_ERROR_IGNORE))) {
+ .equals(TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_PACS_ERROR_IGNORE))) {
throw e;
}
log.error(e.getMessage(), e);
@@ -729,22 +755,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
// 医嘱请求数据
List requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, null,
- CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
- CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
- GenerateSource.DOCTOR_PRESCRIPTION.getValue());
+ CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
+ CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
+ GenerateSource.DOCTOR_PRESCRIPTION.getValue());
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
// 请求状态
requestBaseDto
- .setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
+ .setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
// 是否皮试
requestBaseDto
- .setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
+ .setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
// 是否为注射药物
requestBaseDto
- .setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
+ .setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
// 收费状态
requestBaseDto.setChargeStatus_enumText(
- EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
+ EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
}
return R.ok(requestBaseInfo);
}
@@ -802,7 +828,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
/**
* 查询历史医嘱请求数据
*
- * @param patientId 病人id
+ * @param patientId 病人id
* @param encounterId 就诊id
* @return 历史医嘱请求数据
*/
@@ -812,22 +838,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
// 医嘱请求数据
List requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, patientId,
- CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
- CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
- GenerateSource.DOCTOR_PRESCRIPTION.getValue());
+ CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
+ CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
+ GenerateSource.DOCTOR_PRESCRIPTION.getValue());
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
// 请求状态
requestBaseDto
- .setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
+ .setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
// 是否皮试
requestBaseDto
- .setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
+ .setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
// 是否为注射药物
requestBaseDto
- .setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
+ .setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
// 收费状态
requestBaseDto.setChargeStatus_enumText(
- EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
+ EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
}
return R.ok(requestBaseInfo);
}
@@ -842,7 +868,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
public void updateGroupId(UpdateGroupIdParam updateGroupIdParam) {
List groupList = updateGroupIdParam.getGroupList();
List idsToSetNull = groupList.stream().filter(dto -> dto.getGroupId() == null)
- .map(UpdateGroupDto::getRequestId).collect(Collectors.toList());
+ .map(UpdateGroupDto::getRequestId).collect(Collectors.toList());
if (!idsToSetNull.isEmpty()) {
// 创建更新条件
@@ -855,8 +881,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// 处理非null的情况
List medicationRequestList = groupList.stream().filter(dto -> dto.getGroupId() != null)
- .map(dto -> new MedicationRequest().setId(dto.getRequestId()).setGroupId(dto.getGroupId()))
- .collect(Collectors.toList());
+ .map(dto -> new MedicationRequest().setId(dto.getRequestId()).setGroupId(dto.getGroupId()))
+ .collect(Collectors.toList());
if (!medicationRequestList.isEmpty()) {
iMedicationRequestService.saveOrUpdateBatch(medicationRequestList);
@@ -874,4 +900,60 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
return R.ok(doctorStationAdviceAppMapper.getEncounterContract(encounterId));
}
+ /**
+ * 查询检验检查开立历史(近30天)
+ *
+ * @param patientId 患者id
+ * @param adviceDefinitionId 医嘱定义id
+ * @return 检验检查开立历史
+ */
+ @Override
+ public R> getProofAndTestHistory(Long patientId, Long adviceDefinitionId) {
+ return R.ok(doctorStationAdviceAppMapper.getProofAndTestHistory(patientId, adviceDefinitionId,
+ RequestStatus.COMPLETED.getValue()));
+ }
+
+ /**
+ * 查询检验url相关参数
+ *
+ * @param encounterId 就诊id
+ * @return 检验url相关参数
+ */
+ @Override
+ public R> getProofResult(Long encounterId) {
+ // LIS查看报告地址
+ String lisReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_REPORT_URL);
+ if (StringUtils.isEmpty(lisReportUrl)) {
+ throw new ServiceException("租户配置项【LIS查看报告地址】未配置");
+ }
+ List proofResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
+ RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
+ for (ProofAndTestResultDto proofAndTestResultDto : proofResult) {
+ proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
+ }
+
+ return R.ok(proofResult);
+ }
+
+ /**
+ * 查询检查url相关参数
+ *
+ * @param encounterId 就诊id
+ * @return 检查url相关参数
+ */
+ @Override
+ public R> getTestResult(Long encounterId) {
+ // PACS查看报告地址
+ String pacsReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_REPORT_URL);
+ if (StringUtils.isEmpty(pacsReportUrl)) {
+ throw new ServiceException("租户配置项【PACS查看报告地址】未配置");
+ }
+ List testResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
+ RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
+ for (ProofAndTestResultDto proofAndTestResultDto : testResult) {
+ proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
+ }
+ return R.ok(testResult);
+ }
+
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAllergyIntolAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAllergyIntolAppServiceImpl.java
deleted file mode 100644
index 55994afc670f81b0ce268533078e26abdbde774d..0000000000000000000000000000000000000000
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAllergyIntolAppServiceImpl.java
+++ /dev/null
@@ -1,195 +0,0 @@
-package com.openhis.web.doctorstation.appservice.impl;
-
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.core.common.core.domain.R;
-import com.core.common.utils.DateUtils;
-import com.core.common.utils.MessageUtils;
-import com.core.common.utils.SecurityUtils;
-import com.openhis.clinical.domain.AllergyIntolerance;
-import com.openhis.clinical.mapper.AllergyIntoleranceMapper;
-import com.openhis.clinical.service.IAllergyIntoleranceService;
-import com.openhis.common.constant.CommonConstants;
-import com.openhis.common.constant.PromptMsgConstant;
-import com.openhis.common.enums.ClinicalStatus;
-import com.openhis.common.enums.Criticality;
-import com.openhis.common.enums.Severity;
-import com.openhis.common.enums.VerificationStatus;
-import com.openhis.common.utils.EnumUtils;
-import com.openhis.common.utils.HisPageUtils;
-import com.openhis.common.utils.HisQueryUtils;
-import com.openhis.web.doctorstation.appservice.IDoctorStationAllergyIntolAppService;
-import com.openhis.web.doctorstation.dto.AllergyIntoInfoDto;
-import com.openhis.web.doctorstation.dto.AllergyIntoInitDto;
-
-/**
- * 医生站-患者过敏与不耐受管理的实现
- *
- * @author liuhr
- * @date 2025/4/10
- */
-@Service
-public class DoctorStationAllergyIntolAppServiceImpl implements IDoctorStationAllergyIntolAppService {
-
- @Autowired
- private IAllergyIntoleranceService allergyIntoleranceService;
-
- @Autowired
- private AllergyIntoleranceMapper allergyIntoleranceMapper;
-
- /**
- * 患者过敏与不耐受数据初始化
- *
- * @return 基础数据
- */
- @Override
- public R> init() {
-
- AllergyIntoInitDto initDto = new AllergyIntoInitDto();
-
- // 获取临床状况列表
- List statusEnumOption1 = Stream.of(ClinicalStatus.values())
- .map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
- .collect(Collectors.toList());
- initDto.setClinicalStatusOptions(statusEnumOption1);
-
- // 获取临床状况列表
- List statusEnumOption2 = Stream.of(VerificationStatus.values())
- .map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
- .collect(Collectors.toList());
- initDto.setVerificationStatusOptions(statusEnumOption2);
-
- // 获取危险程度列表
- List statusEnumOption3 = Stream.of(Criticality.values())
- .map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
- .collect(Collectors.toList());
- initDto.setCriticalityOptions(statusEnumOption3);
-
- // 获取严重程度列表
- List statusEnumOption4 = Stream.of(Severity.values())
- .map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
- .collect(Collectors.toList());
- initDto.setSeverityOptions(statusEnumOption4);
-
- return R.ok(initDto);
-
- }
-
- /**
- * 查询患者过敏与不耐受信息
- *
- * @param patientId 患者Id
- * @param pageNo 当前页
- * @param pageSize 每页多少条
- * @return 患者过敏与不耐受信息
- */
- @Override
- public R> getAllergyIntoleranceInfo(Long patientId, Integer pageNo, Integer pageSize,
- HttpServletRequest request) {
-
- // 构建查询条件
- QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, null, null, request);
-
- // 根据患者ID查询过敏与不耐受记录
- queryWrapper.eq(CommonConstants.FieldName.PatientId, patientId);
- // 设置排序
- queryWrapper.orderByAsc(CommonConstants.FieldName.CreateTime);
- // 分页查询
- Page allergyIntolerancePage =
- HisPageUtils.selectPage(allergyIntoleranceMapper, queryWrapper, pageNo, pageSize, AllergyIntoInfoDto.class);
-
- allergyIntolerancePage.getRecords().forEach(e -> {
- // 临床状况回显赋值
- e.setClinicalStatusEnum_enumText(EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum()));
- // 验证状态回显赋值
- e.setVerificationStatusEnum_enumText(
- EnumUtils.getInfoByValue(VerificationStatus.class, e.getVerificationStatusEnum()));
- // 危险程度回显赋值
- e.setCriticalityEnum_enumText(EnumUtils.getInfoByValue(Criticality.class, e.getCriticalityEnum()));
- // 严重程度回显赋值
- e.setSeverityEnum_enumText(EnumUtils.getInfoByValue(Severity.class, e.getSeverityEnum()));
-
- });
-
- // 返回【患者过敏与不耐受信息】分页
- return R.ok(allergyIntolerancePage);
-
- }
-
- /**
- * 作废当条患者过敏与不耐受信息
- *
- * @param allergyIntoInfoDto 患者过敏与不耐受信息
- * @return
- */
- @Override
- public R> invalidateAllergyIntolerance(AllergyIntoInfoDto allergyIntoInfoDto) {
-
- AllergyIntolerance allergyIntolerance = new AllergyIntolerance();
-
- // 获取当前登录账号的参与者id
- Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
-
- allergyIntolerance.setId(allergyIntoInfoDto.getId()).setClinicalStatusEnum(ClinicalStatus.RESOLVED.getValue())
- .setVerificationStatusEnum(VerificationStatus.REFUTED.getValue())
- .setTypeEnum(allergyIntoInfoDto.getTypeEnum()).setCategoryCode(allergyIntoInfoDto.getCategoryCode())
- .setCriticalityEnum(allergyIntoInfoDto.getCriticalityEnum()).setCode(allergyIntoInfoDto.getCode())
- .setPatientId(allergyIntoInfoDto.getPatientId()).setDescription(allergyIntoInfoDto.getDescription())
- .setSeverityEnum(allergyIntoInfoDto.getSeverityEnum())
- .setOnsetDateTime(allergyIntoInfoDto.getOnsetDateTime()).setCheckPractitionerId(practitionerId)
- .setLastReactionOccurrence(allergyIntoInfoDto.getLastReactionOccurrence())
- .setNote(allergyIntoInfoDto.getNote());
-
- boolean result = allergyIntoleranceService.saveOrUpdateAllergyIntolerance(allergyIntolerance);
-
- if (result) {
- return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"过敏与不耐受"}));
- } else {
- return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
- }
-
- }
-
- /**
- * 新增患者过敏与不耐受信息
- *
- * @param allergyIntoInfoDto 患者过敏与不耐受信息
- * @return
- */
- @Override
- public R> addAllergyIntoleranceInfo(AllergyIntoInfoDto allergyIntoInfoDto) {
-
- AllergyIntolerance allergyIntolerance = new AllergyIntolerance();
- // 获取当前登录账号的参与者id
- Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
-
- allergyIntolerance.setId(allergyIntoInfoDto.getId()).setClinicalStatusEnum(ClinicalStatus.ACTIVE.getValue())
- .setVerificationStatusEnum(VerificationStatus.CONFIRMED.getValue())
- .setTypeEnum(allergyIntoInfoDto.getTypeEnum()).setCategoryCode(allergyIntoInfoDto.getCategoryCode())
- .setCriticalityEnum(allergyIntoInfoDto.getCriticalityEnum()).setCode(allergyIntoInfoDto.getCode())
- .setPatientId(allergyIntoInfoDto.getPatientId()).setDescription(allergyIntoInfoDto.getDescription())
- .setSeverityEnum(allergyIntoInfoDto.getSeverityEnum())
- .setOnsetDateTime(allergyIntoInfoDto.getOnsetDateTime()).setPractitionerId(practitionerId)
- .setRecordedDate(DateUtils.getNowDate())
- .setLastReactionOccurrence(allergyIntoInfoDto.getLastReactionOccurrence())
- .setNote(allergyIntoInfoDto.getNote());
-
- boolean result = allergyIntoleranceService.saveOrUpdateAllergyIntolerance(allergyIntolerance);
-
- if (result) {
- return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"过敏与不耐受"}));
- } else {
- return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null));
- }
- }
-
-}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java
index ff0aa6a8e29b5265dd9ff74e9f3321bd12e90ce7..c8851ae202dfdf7be32be59626d660a0e742b77b 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java
@@ -186,19 +186,97 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
}
// 保存就诊诊断
EncounterDiagnosis encounterDiagnosis;
+
+ //中医获取排序号起始值
+ int startNo=0;
+ List diagnosisList = iEncounterDiagnosisService.getDiagnosisList(encounterId);
+ List newdiagnosisList = new ArrayList<>();
+
+ newdiagnosisList= diagnosisList.stream()
+ .filter(diagno -> diagno.getDeleteFlag().equals("0") && diagno.getDiagSrtNo()!=null)
+ .collect(Collectors.toList());
+
+ newdiagnosisList = newdiagnosisList.stream()
+ .sorted((d1, d2) -> d2.getDiagSrtNo().compareTo(d1.getDiagSrtNo())) // 降序
+ .collect(Collectors.toList());
+ if (newdiagnosisList==null||newdiagnosisList.size()==0) {
+ startNo=1;
+ }else {
+ startNo=newdiagnosisList.get(0).getDiagSrtNo()+1;
+ }
+ int i=0;//循环计数 用来区分 同组的 病 证
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
encounterDiagnosis = new EncounterDiagnosis();
encounterDiagnosis.setId(saveDiagnosisChildParam.getEncounterDiagnosisId());
+ if(saveDiagnosisChildParam.getDiagSrtNo()!=null){
+ startNo=saveDiagnosisChildParam.getDiagSrtNo().intValue();
+ }
encounterDiagnosis.setEncounterId(encounterId);
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
- encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
+ encounterDiagnosis.setDiagSrtNo(startNo); // 排序号
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
encounterDiagnosis.setTcmFlag(Whether.YES.getValue());// 中医标识
encounterDiagnosis.setSyndromeGroupNo(saveDiagnosisChildParam.getSyndromeGroupNo());// 中医证候组号
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
+ if(saveDiagnosisChildParam.getDiagSrtNo()==null){
+ if (i==1){
+ startNo++;
+ i--;
+ }else{
+ i++;
+ }
+
+ }
+
+ }
+ return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"中医诊断"}));
+ }
+
+ @Override
+ public R> updateTcmDiagnosis(SaveDiagnosisParam saveDiagnosisParam) {
+ // 患者id
+ Long patientId = saveDiagnosisParam.getPatientId();
+ // 就诊ID
+ Long encounterId = saveDiagnosisParam.getEncounterId();
+ // 诊断定义集合
+ List diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
+ // 保存诊断管理
+ Condition condition;
+ for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
+ condition = new Condition();
+ condition.setId(saveDiagnosisChildParam.getConditionId());
+ condition.setVerificationStatusEnum(saveDiagnosisChildParam.getVerificationStatusEnum());
+ condition.setPatientId(patientId);
+ condition.setDefinitionId(saveDiagnosisChildParam.getDefinitionId());
+ condition.setYbNo(saveDiagnosisChildParam.getYbNo());
+ condition.setTcmFlag(Whether.YES.getValue());// 中医标识
+ condition.setRecordedDatetime(new Date());
+ condition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
+ iConditionService.saveOrUpdate(condition);
+ saveDiagnosisChildParam.setConditionId(condition.getId());
+ }
+ // 保存就诊诊断
+ EncounterDiagnosis encounterDiagnosis;
+
+ for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
+ if (saveDiagnosisChildParam.getUpdateId() != null) {
+ String updateId = saveDiagnosisChildParam.getUpdateId();
+ encounterDiagnosis = new EncounterDiagnosis();
+ encounterDiagnosis.setId(Long.parseLong(updateId));
+ encounterDiagnosis.setEncounterId(encounterId);
+ encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
+ encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
+ encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
+ encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
+ encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
+ encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
+ iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
+ }else {
+
+ }
}
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"中医诊断"}));
}
@@ -249,7 +327,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
adviceBaseDto.setAdviceType(1); // 医嘱类型为药品
adviceBaseDto.setCategoryCode(MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue());// 中草药
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId,
- adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3));
+ adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3), null);
}
/**
@@ -263,6 +341,10 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
public R> saveOrSignTcmAdvice(AdviceSaveParam adviceSaveParam, String adviceOpType) {
// 医嘱分类信息 (中草药)
List medicineList = adviceSaveParam.getAdviceSaveList();
+ if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
+ //保存时——中医处方去掉不修改的药方
+ medicineList=medicineList.stream().filter(e ->e.getAdviceDefinitionId()!=null).collect(Collectors.toUnmodifiableList());
+ }
// 保存操作
boolean is_save = AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType);
// 签发操作
@@ -371,7 +453,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
medicationRequest.setRateCode(adviceSaveDto.getRateCode()); // 用药频次
medicationRequest.setDose(adviceSaveDto.getDose()); // 单次剂量
medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); // 剂量单位
- // medicationRequest.setDispensePerDuration(adviceSaveDto.getDispensePerDuration()); // 每次发药供应天数
+ medicationRequest.setDispensePerDuration(adviceSaveDto.getDispensePerDuration()); // 每次发药供应天数
medicationRequest.setContentJson(adviceSaveDto.getContentJson()); // 请求内容json
medicationRequest.setYbClassEnum(adviceSaveDto.getYbClassEnum());// 类别医保编码
medicationRequest.setDosageInstruction(adviceSaveDto.getDosageInstruction()); // 用药说明 , 即煎法
@@ -445,7 +527,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
// 对应的诊疗医嘱信息
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null,
- null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3)).getRecords().get(0);
+ null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3), null).getRecords().get(0);
if (activityAdviceBaseDto != null) {
// 费用定价
AdvicePriceDto advicePriceDto = activityAdviceBaseDto.getPriceList().get(0);
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java
index 3fed653e03a5b70214b617358b0102140dce60bf..269e7f05ba8d934bdbe7c5dd67491678420a3f63 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java
@@ -1,9 +1,6 @@
package com.openhis.web.doctorstation.appservice.impl;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
+import java.util.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -239,6 +236,82 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊断"}));
}
+
+ /**
+ * 医生保存诊断
+ *
+ * @param saveDiagnosisParam 诊断信息
+ * @return 结果
+ */
+ @Override
+ public R> saveDoctorDiagnosisNew(SaveDiagnosisParam saveDiagnosisParam) {
+ // 患者id
+ Long patientId = saveDiagnosisParam.getPatientId();
+ // 就诊ID
+ Long encounterId = saveDiagnosisParam.getEncounterId();
+ // 诊断定义集合
+ List diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
+ // 先删除再保存
+ // iEncounterDiagnosisService.deleteEncounterDiagnosisInfos(encounterId);
+ // 保存诊断管理
+ Condition condition;
+ for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
+
+ //中医如果是修改
+ if (saveDiagnosisChildParam.getUpdateId() != null) {
+ continue;
+ }
+ condition = new Condition();
+ condition.setId(saveDiagnosisChildParam.getConditionId());
+ condition.setVerificationStatusEnum(saveDiagnosisChildParam.getVerificationStatusEnum());
+ condition.setPatientId(patientId);
+ condition.setDefinitionId(saveDiagnosisChildParam.getDefinitionId());
+ condition.setYbNo(saveDiagnosisChildParam.getYbNo());
+ condition.setRecordedDatetime(new Date());
+ condition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
+ iConditionService.saveOrUpdate(condition);
+ saveDiagnosisChildParam.setConditionId(condition.getId());
+ }
+
+
+ // 保存就诊诊断
+ EncounterDiagnosis encounterDiagnosis;
+ for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
+ if (saveDiagnosisChildParam.getUpdateId() != null) {
+ String updateId = saveDiagnosisChildParam.getUpdateId();
+ String[] split = updateId.split("-");
+// String[] ConditionIds = saveDiagnosisChildParam.getUpdateConditionId().split("-");
+ int i=1;
+ for (String s : split) {
+ encounterDiagnosis = new EncounterDiagnosis();
+ encounterDiagnosis.setId(Long.parseLong(s));
+ encounterDiagnosis.setEncounterId(encounterId);
+// encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
+ encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
+ encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
+ encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
+ encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
+ encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
+ iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
+ i++;
+ }
+ }else {
+ encounterDiagnosis = new EncounterDiagnosis();
+ encounterDiagnosis.setId(saveDiagnosisChildParam.getEncounterDiagnosisId());
+ encounterDiagnosis.setEncounterId(encounterId);
+ encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
+ encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
+ encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
+ encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
+ encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
+ encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
+ iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
+ }
+
+ }
+ return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊断"}));
+ }
+
/**
* 查询诊断定义业务分类数据
*
@@ -358,4 +431,41 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
return R.ok(conditionDefinitionListBySearchKey);
}
+
+ /**
+ * 查询就诊诊断信息
+ *
+ * @param encounterId 就诊id
+ * @return 就诊诊断信息
+ */
+ @Override
+ public R> getEncounterDiagnosisByEncounterId(Long encounterId,String searchKey) {
+ List encounterDiagnosis = doctorStationDiagnosisAppMapper.getEncounterDiagnosis(encounterId);
+ List encounterDiagnosisKey = new ArrayList<>();
+ for (DiagnosisQueryDto diagnosis : encounterDiagnosis) {
+ // 中医诊断/西医诊断
+ if (ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue()
+ .equals(diagnosis.getSourceEnum())
+ || ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue()
+ .equals(diagnosis.getSourceEnum())) {
+ diagnosis.setTypeName(CommonConstants.BusinessName.TCM_DIAGNOSIS);
+ } else {
+ diagnosis.setTypeName(CommonConstants.BusinessName.WESTERN_MEDICINE_DIAGNOSIS);
+ }
+ // 验证状态
+ diagnosis.setVerificationStatusEnum_enumText(
+ EnumUtils.getInfoByValue(ConditionVerificationStatus.class, diagnosis.getVerificationStatusEnum()));
+ }
+
+ if(searchKey!=null&&!"".equals(searchKey)){
+ for (DiagnosisQueryDto diagnosis : encounterDiagnosis) {
+ if(diagnosis.getName().contains(searchKey)){
+ encounterDiagnosisKey.add(diagnosis);
+ }
+ }
+ return R.ok(encounterDiagnosisKey);
+ }
+
+ return R.ok(encounterDiagnosis);
+ }
}
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java
index e766767eb4c9e294133f3dd5b387b824fea094fd..c1e22c12cea44eaa2b0ece2ccd9469245674ec13 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java
@@ -81,9 +81,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
queryWrapper.orderByDesc("register_time");
}
IPage patientInfo = doctorStationMainAppMapper.getPatientInfo(new Page<>(pageNo, pageSize),
- ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(),
- ClinicalStatus.INACTIVE.getValue(), userId, currentUserOrganizationId, pricingFlag,
- EncounterStatus.PLANNED.getValue(), EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
+ ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
+ currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
+ EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
patientInfo.getRecords().forEach(e -> {
// 性别
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java
index c19cc71812b2bbff5a539adc69a3c2775722a49e..329567c5393bb3ae7e089f6d895f084bf7060615 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java
@@ -32,39 +32,39 @@ public class DoctorStationAdviceController {
/**
* 查询医嘱信息
*
- * @param adviceBaseDto 查询条件
- * @param searchKey 模糊查询关键字
- * @param locationId 药房id
+ * @param adviceBaseDto 查询条件
+ * @param searchKey 模糊查询关键字
+ * @param locationId 药房id
* @param adviceDefinitionIdParamList 医嘱定义id参数集合
- * @param adviceTypes 医嘱类型参数集合
- * @param organizationId 患者挂号对应的科室id
- * @param pageNo 当前页
- * @param pageSize 每页多少条
+ * @param adviceTypes 医嘱类型参数集合
+ * @param organizationId 患者挂号对应的科室id
+ * @param pageNo 当前页
+ * @param pageSize 每页多少条
* @return 医嘱信息
*/
@GetMapping(value = "/advice-base-info")
public R> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto,
- @RequestParam(value = "searchKey", defaultValue = "") String searchKey,
- @RequestParam(value = "locationId", required = false) Long locationId,
- @RequestParam(value = "adviceDefinitionIdParamList", required = false) List adviceDefinitionIdParamList,
- @RequestParam(value = "organizationId", defaultValue = "0") Long organizationId,
- @RequestParam(value = "adviceTypes", defaultValue = "1,2,3") List adviceTypes,
- @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
- @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+ @RequestParam(value = "searchKey", defaultValue = "") String searchKey,
+ @RequestParam(value = "locationId", required = false) Long locationId,
+ @RequestParam(value = "adviceDefinitionIdParamList", required = false) List