diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/core/redis/RedisCache.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/redis/RedisCache.java index 9522f9cf55b00bdad3244f6e98f69dfcc6debe15..66a23b9a6869a91d92a2cc11845f8d46b985bfad 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/core/redis/RedisCache.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/core/redis/RedisCache.java @@ -5,10 +5,7 @@ import java.util.concurrent.TimeUnit; import com.core.common.exception.UtilException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.BoundSetOperations; -import org.springframework.data.redis.core.HashOperations; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.core.*; import org.springframework.stereotype.Component; /** @@ -256,4 +253,28 @@ public class RedisCache { return this.redisTemplate.opsForValue().increment(key, delta); } } + /** + * 获取所有String类型的键值对(开发环境下使用) + */ + public Map getAllDictDataWithKeys(String pattern) { + pattern+="*"; + Map allDict = new HashMap<>(); + // 1. 获取所有键("*"匹配所有键) + Set allKeys = redisTemplate.keys(pattern); + if (allKeys == null || allKeys.isEmpty()) { + return allDict; + } + // 2. 批量获取值(使用multiGet高效批量查询) + ValueOperations valueOps = redisTemplate.opsForValue(); + List values = valueOps.multiGet(allKeys); + // 3. 组装键值对 + Iterator keyIter = allKeys.iterator(); + for (Object value : values) { + if (keyIter.hasNext()) { + allDict.put(keyIter.next(), value); + } + } + return allDict; + } + } 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 e2107993a2f09a6b38bb2fe8bea659eb0b244922..b6916595f65d712ffb826b495c29b98564da72a4 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 @@ -197,7 +197,39 @@ public enum TenantOptionDict { /** * PACSAppSecret */ - FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47); + FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47), + /** + * 食源性开关 + */ + FOODBORNE_SWITCH("foodborneSwitch", "食源性开关", 48), + /** + * 食源性接口地址 ../goto(格式如下:http://172.16.7.247/infections/goto 需指定到/goto) + */ + FOODBORNE_API_URL("foodborneApiUrl", "食源性接口地址 ../goto", 49), + /** + * 食源性医疗机构 + */ + FOODBORNE_HOSPITAL("foodborneHospital", "食源性医疗机构", 50), + /** + * 食源性登录账号 + */ + FOODBORNE_USER_NAME("foodborneUserName", "食源性登录账号", 51), + /** + * BPC商户号 + */ + BPC_MID("bpcMid", "BPC商户号", 52), + /** + * BPC终端号 + */ + BPC_TID("bpcTid", "BPC终端号", 53), + /** + * BPCMD5签名密钥 + */ + BPC_MD5_SHARED_SECRET("bpcMd5SharedSecret", "BPCMD5签名密钥", 54), + /** + * BPC请求URL + */ + BPC_REQUEST_URL("bpcRequestUrl", "BPC请求URL", 55); private final String code; private final String name; diff --git a/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java index 42ed21725a1944e0553ceb45224123e07d3a61c1..e217d679cc541dd304ae2e9352674cbff8a409e9 100644 --- a/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java @@ -273,7 +273,7 @@ public class SysLoginService { Optional currentTenantOptional = bindTenantList.getData().stream().filter(e -> tenantId.equals(e.getId())).findFirst(); if (currentTenantOptional.isEmpty()) { - throw new ServiceException("所属医院非法"); + throw new ServiceException("所属医院无权限"); } // 租户状态校验 SysTenant currentTenant = currentTenantOptional.get(); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/appservice/ISupplyService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/appservice/ISupplyService.java new file mode 100644 index 0000000000000000000000000000000000000000..ce7cda3dfb85be33fa327ba79c96c00322234149 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/appservice/ISupplyService.java @@ -0,0 +1,22 @@ +package com.openhis.web.adjustprice.appservice; + +import com.openhis.web.adjustprice.dto.SupplyListDto; + +import java.util.List; + +/** + * Desc: + * @Author raymond + * @Date 16:09 2025/10/15 + * @return + **/ +public interface ISupplyService { + /** + * Desc: + * @param + * @Author raymond + * @Date 17:10 2025/10/15 + * @return java.util.List + **/ + List searchAllSupplyList(); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/appservice/impl/SupplyServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/appservice/impl/SupplyServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..55283471b923fa93077fa8e41743a62903885276 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/appservice/impl/SupplyServiceImpl.java @@ -0,0 +1,28 @@ +package com.openhis.web.adjustprice.appservice.impl; + +import com.openhis.web.adjustprice.appservice.ISupplyService; +import com.openhis.web.adjustprice.dto.SupplyListDto; +import com.openhis.web.adjustprice.mapper.SupplyMapper; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @ClassName ChangePriceImpl + * @Description TODO + * @Author raymond + * @Date 2025/10/15 16:10 + * @Version 1.0 + **/ +@Component +public class SupplyServiceImpl implements ISupplyService { + + @Resource + private SupplyMapper supplyMapper; + + @Override + public List searchAllSupplyList() { + return this.supplyMapper.searchAllSupplyList(); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/controller/ChangePriceController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/controller/ChangePriceController.java new file mode 100644 index 0000000000000000000000000000000000000000..21480ed8698935364edf1ad77046887a97a471c9 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/controller/ChangePriceController.java @@ -0,0 +1,112 @@ +package com.openhis.web.adjustprice.controller; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.web.adjustprice.appservice.ISupplyService; +import com.openhis.web.datadictionary.dto.MedicationSearchParam; + +/** + * @ClassName ChargePriceController + * @Description 调价修改药品、耗材、诊疗、挂号接口类 + * @Author raymond + * @Date 2025/10/14 16:56 + * @Version 1.0 + **/ +@RestController +@RequestMapping("/change/price") +public class ChangePriceController { + @Resource + private ISupplyService supplyService; + + /** + * Desc: 查询所有供应商集合 + * + * @param + * @Author raymond + * @Date 16:55 2025/10/15 + * @return com.core.common.core.domain.R + **/ + @GetMapping(value = "searchAllSupply") + public R searchAllSupply() { + return R.ok(this.supplyService.searchAllSupplyList()); + } + + /** + * Desc: 根据供应商和药品名称加载要修改的药品数据 + * + * @Author raymond + * @Date 08:47 2025/10/15 + * @return com.core.common.core.domain.R + **/ + @PostMapping(value = "searchMedicineListToPage") + public R searchMedicineListToPage() { + return R.ok(); + } + + /** + * Desc: + * + * @param medicationSearchParam + * @param searchKey + * @param pageNo + * @param pageSize + * @param request + * @Author raymond + * @Date 13:41 2025/10/15 + * @return com.core.common.core.domain.R + **/ + @PostMapping(value = "searchConsumablesListToPage") + public R searchConsumablesListToPage(MedicationSearchParam medicationSearchParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + + return null; + } + + /** + * Desc: + * + * @param medicationSearchParam + * @param searchKey + * @param pageNo + * @param pageSize + * @param request + * @Author raymond + * @Date 13:41 2025/10/15 + * @return com.core.common.core.domain.R + **/ + @PostMapping(value = "searchDiagnosisListToPage") + public R searchDiagnosisListToPage(MedicationSearchParam medicationSearchParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + + return null; + } + + /** + * Desc: + * + * @param medicationSearchParam + * @param searchKey + * @param pageNo + * @param pageSize + * @param request + * @Author raymond + * @Date 13:41 2025/10/15 + * @return com.core.common.core.domain.R + **/ + @PostMapping(value = "searchHealthCareListToPage") + public R searchRegisterListToPage(MedicationSearchParam medicationSearchParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + + return null; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/SupplyListDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/SupplyListDto.java new file mode 100644 index 0000000000000000000000000000000000000000..9a27fc888a18ee7e8bbe36282c115a992df44449 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/SupplyListDto.java @@ -0,0 +1,22 @@ +package com.openhis.web.adjustprice.dto; + +import lombok.Data; + +/** + * @ClassName SupplyListDto + * @Description TODO + * @Author raymond + * @Date 2025/10/15 16:56 + * @Version 1.0 + **/ +@Data +public class SupplyListDto { + /** + * 供应商ID + */ + private Long supplyId; + /** + * 供应商名称 + */ + private String supplyName; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/mapper/SupplyMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/mapper/SupplyMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..80119327497c159d55912c9b85345754cb8182e8 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/mapper/SupplyMapper.java @@ -0,0 +1,25 @@ +package com.openhis.web.adjustprice.mapper; + +import com.openhis.web.adjustprice.dto.SupplyListDto; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * Desc: + * @Author raymond + * @Date 14:37 2025/10/15 + * @return + **/ +@Component +public interface SupplyMapper { + /** + * Desc: + * @param + * @Author raymond + * @Date 17:10 2025/10/15 + * @return java.util.List + **/ + List searchAllSupplyList(); + +} 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 155c5085bf5909a7280d075d88af72a7cd61e80d..d73b278c886d01f27ca7c607e7e432a224546c57 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 @@ -126,7 +126,6 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi }); return prescriptionDtoList; } - /** * 医保转自费 * 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 d3b7358668e9b52e4122e246db19d5b11345b9bd..0c73f7f7006d93a69206dd0dbacc72d700df443d 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 @@ -387,7 +387,9 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi // 收费状态枚举 e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum())); // 计算年龄 - e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate())); + if (e.getBirthDate() != null) { + e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate())); + } }); return R.ok(encounterPatientPage); } 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 a43d2086a8afb88dc2de361548a050825a909884..e3c5d3be0aeb063a109e6aff6246f4a3483227f6 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 @@ -56,4 +56,5 @@ public interface OutpatientChargeAppMapper { @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); + } 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 684b7a83083f2143629680f09706ae168a9937fb..8e1e81ca10efca58a8dc89d8953c5eebf5af2d32 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 @@ -5,6 +5,7 @@ package com.openhis.web.common.dto; 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; @@ -30,6 +31,7 @@ public class PerformRecordDto { private String statusEnum_enumText; /** 执行时间 */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date occurrenceTime; /** 执行位置 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java index bbdf1494c8457356a6c01a6ea41acec01c0c2f6a..43a0300aae2a1ab9466b1c829188a602864c748c 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java @@ -3,6 +3,9 @@ package com.openhis.web.datadictionary.appservice; import java.util.List; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.web.multipart.MultipartFile; import com.core.common.core.domain.R; import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam; @@ -75,4 +78,18 @@ public interface IDiagTreatMAppService { */ R addDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto); + /** + * 导入诊疗目录 + * + * @param file 文件 + * @return 结果 + */ + R importData(MultipartFile file); + + /** + * 获取导入模板 + * + * @param response 响应 + */ + void importTemplate(HttpServletResponse response); } \ No newline at end of file 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 31fc80169d85b5c7e971f5ae7ffcda377f9d2672..baed3592b7315edfd8ced3c2c54181dc059d8243 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 @@ -3,7 +3,7 @@ */ package com.openhis.web.datadictionary.appservice.impl; -import java.io.IOException; +import java.math.BigDecimal; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; @@ -35,10 +35,14 @@ import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.domain.DeviceDefinition; import com.openhis.administration.domain.Location; import com.openhis.administration.domain.Supplier; -import com.openhis.administration.service.*; +import com.openhis.administration.service.IChargeItemDefinitionService; +import com.openhis.administration.service.IDeviceDefinitionService; +import com.openhis.administration.service.ILocationService; +import com.openhis.administration.service.ISupplierService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.*; +import com.openhis.common.utils.CommonUtil; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.sys.service.IOperationRecordService; @@ -65,10 +69,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { private IDeviceDefinitionService deviceDefinitionService; @Autowired - IChargeItemDefinitionService chargeItemDefinitionService; - - @Autowired - IChargeItemDefDetailService chargeItemDefDetailService; + private IChargeItemDefinitionService chargeItemDefinitionService; @Autowired private ILocationService locationService; @@ -386,7 +387,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { @Override public R importData(MultipartFile file) { // 读取文件 - R> readResult = readExcelFile(file); + R> readResult = CommonUtil.readImportedExcelFile(file, DeviceImportDto.class); if (R.SUCCESS != readResult.getCode()) { return readResult; } @@ -396,9 +397,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { if (R.SUCCESS != validateResult.getCode()) { return validateResult; } - // 查询机构ID、当前时间、位置信息供后续使用 + // 查询机构ID、位置信息供后续使用 Long orgId = SecurityUtils.getLoginUser().getOrgId(); - Date now = DateUtils.getNowDate(); List locationList = locationService.list(new LambdaQueryWrapper() .eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId)); Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId(); @@ -406,7 +406,15 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { locationList.stream().collect(Collectors.groupingBy(Location::getName)); // 创建表数据 for (DeviceImportDto importDto : importDtoList) { - + // 创建器材定义 + DeviceDefinition deviceDefinition = + createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap); + deviceDefinitionService.save(deviceDefinition); + // 创建费用定价和详情 + chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(), + importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(), + importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId, + CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId()); } return R.ok(null, "导入成功!"); } @@ -422,26 +430,6 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { util.importTemplateExcel(response, "器材目录数据"); } - /** - * 读取Excel文件 - * - * @param file 文件 - * @return 读取结果 - */ - private R> readExcelFile(MultipartFile file) { - ExcelUtil util = new ExcelUtil<>(DeviceImportDto.class); - List importDtoList; - try { - importDtoList = util.importExcel(file.getInputStream()); - } catch (IOException e) { - return R.fail("导入失败!文件读取异常"); - } - if (importDtoList.isEmpty()) { - return R.fail("导入失败!文件不能为空"); - } - return R.ok(importDtoList); - } - /** * 导入信息校验 * @@ -449,11 +437,147 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { */ private R validateImportDtoList(List importDtoList) { // 字段校验(必填及数值类型) - + List fieldValidateMsgList = new ArrayList<>(); + for (int i = 0; i < importDtoList.size(); i++) { + DeviceImportDto importDto = importDtoList.get(i); + importDto.setLineNumber(i + 2); + List lineValidateMsgList = new ArrayList<>(); + if (StringUtils.isEmpty(importDto.getName())) { + lineValidateMsgList.add("器材名称必填"); + } + if (StringUtils.isEmpty(importDto.getCategoryCode())) { + lineValidateMsgList.add("器材分类必填"); + } + if (StringUtils.isEmpty(importDto.getUnitCode())) { + lineValidateMsgList.add("包装单位必填"); + } + if (StringUtils.isEmpty(importDto.getSize())) { + lineValidateMsgList.add("包装规格必填"); + } + if (StringUtils.isEmpty(importDto.getItemMinQuantityStr())) { + lineValidateMsgList.add("最小库存警戒数量(常规单位)必填"); + } + BigDecimal itemMinQuantity; + try { + itemMinQuantity = new BigDecimal(importDto.getItemMinQuantityStr()); + importDto.setItemMinQuantity(itemMinQuantity); + } catch (Exception e) { + lineValidateMsgList.add("最小库存警戒数量(常规单位)应为数值类型"); + } + if (StringUtils.isEmpty(importDto.getItemMaxQuantityStr())) { + lineValidateMsgList.add("最大库存警戒数量(常规单位)必填"); + } + BigDecimal itemMaxQuantity; + try { + itemMaxQuantity = new BigDecimal(importDto.getItemMaxQuantityStr()); + importDto.setItemMaxQuantity(itemMaxQuantity); + } catch (Exception e) { + lineValidateMsgList.add("最大库存警戒数量(常规单位)应为数值类型"); + } + if (StringUtils.isEmpty(importDto.getPartPercentStr())) { + lineValidateMsgList.add("拆零比必填"); + } + BigDecimal partPercent; + try { + partPercent = new BigDecimal(importDto.getPartPercentStr()); + importDto.setPartPercent(partPercent); + } catch (Exception e) { + lineValidateMsgList.add("拆零比应为数值类型"); + } + if (StringUtils.isEmpty(importDto.getLocationName())) { + lineValidateMsgList.add("所在位置名称必填"); + } + if (StringUtils.isEmpty(importDto.getHvcmFlag())) { + lineValidateMsgList.add("高值器材标志必填"); + } + if (StringUtils.isEmpty(importDto.getYbFlag())) { + lineValidateMsgList.add("医保标记必填"); + } + if (StringUtils.isEmpty(importDto.getYbMatchFlag())) { + lineValidateMsgList.add("医保对码标记必填"); + } + if (Whether.YES.getCode().equals(importDto.getYbMatchFlag()) && StringUtils.isEmpty(importDto.getYbNo())) { + lineValidateMsgList.add("医保对码时,医保编码必填"); + } + if (StringUtils.isEmpty(importDto.getAllergenFlag())) { + lineValidateMsgList.add("过敏标记必填"); + } + if (StringUtils.isEmpty(importDto.getRxFlag())) { + lineValidateMsgList.add("处方标志必填"); + } + if (StringUtils.isEmpty(importDto.getTypeCode())) { + lineValidateMsgList.add("财务类别必填"); + } + if (StringUtils.isEmpty(importDto.getYbType())) { + lineValidateMsgList.add("医保费用类别必填"); + } + if (StringUtils.isEmpty(importDto.getPurchasePriceStr())) { + lineValidateMsgList.add("购入价必填"); + } + BigDecimal purchasePrice; + try { + purchasePrice = new BigDecimal(importDto.getPurchasePriceStr()); + importDto.setPurchasePrice(purchasePrice); + } catch (Exception e) { + lineValidateMsgList.add("购入价应为数值类型"); + } + if (StringUtils.isEmpty(importDto.getRetailPriceStr())) { + lineValidateMsgList.add("零售价必填"); + } + BigDecimal retailPrice; + try { + retailPrice = new BigDecimal(importDto.getRetailPriceStr()); + importDto.setRetailPrice(retailPrice); + } catch (Exception e) { + lineValidateMsgList.add("零售价应为数值类型"); + } + if (StringUtils.isEmpty(importDto.getMaximumRetailPriceStr())) { + lineValidateMsgList.add("最高零售价必填"); + } + BigDecimal maximumRetailPrice; + try { + maximumRetailPrice = new BigDecimal(importDto.getMaximumRetailPriceStr()); + importDto.setMaximumRetailPrice(maximumRetailPrice); + } catch (Exception e) { + lineValidateMsgList.add("最高零售价应为数值类型"); + } + if (!lineValidateMsgList.isEmpty()) { + fieldValidateMsgList + .add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";"); + } + } + if (!fieldValidateMsgList.isEmpty()) { + return R.fail("导入失败!器材信息填写有误:" + String.join(" ", fieldValidateMsgList)); + } // 重复校验(文件行重复) - + List lineRepeatedValidateMsgList = new ArrayList<>(); + List> importDtoGroupList = new ArrayList<>(importDtoList.stream() + .collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values()); + for (List importDtoGroup : importDtoGroupList) { + if (importDtoGroup.size() > 1) { + lineRepeatedValidateMsgList.add( + "■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString) + .collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;"); + } + } + if (!lineRepeatedValidateMsgList.isEmpty()) { + return R.fail("导入失败!文件中存在重复器材:" + String.join(" ", lineRepeatedValidateMsgList)); + } // 重复校验(文件与数据库重复) - + List dbRepeatedValidateMsgList = new ArrayList<>(); + for (DeviceImportDto importDto : importDtoList) { + List deviceDefinitionList = deviceDefinitionService + .list(new LambdaQueryWrapper().eq(DeviceDefinition::getName, importDto.getName()) + .eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText()) + .eq(DeviceDefinition::getSize, importDto.getSize())); + if (!deviceDefinitionList.isEmpty()) { + dbRepeatedValidateMsgList + .add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;"); + } + } + if (!dbRepeatedValidateMsgList.isEmpty()) { + return R.fail("导入失败!系统中存在重复器材:" + String.join(" ", dbRepeatedValidateMsgList)); + } return R.ok(); } @@ -461,11 +585,37 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { * 创建器材定义实体 * * @param importDto 器材目录导入Dto + * @param orgId 机构ID + * @param defaultLocationId 默认位置ID + * @param locationNameMap 位置名称匹配分组Map * @return 器材定义实体 */ - private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto) { - - return null; + private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto, Long orgId, Long defaultLocationId, + Map> locationNameMap) { + DeviceDefinition deviceDefinition = new DeviceDefinition(); + // 根据输入的所在位置名称获取位置ID + List mapLocationList = locationNameMap.get(importDto.getLocationName()); + if (mapLocationList == null || mapLocationList.isEmpty()) { + deviceDefinition.setLocationId(defaultLocationId); + } else { + deviceDefinition.setLocationId(mapLocationList.get(0).getId()); + } + deviceDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10)) + .setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName())) + .setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName())) + .setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode()) + .setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize()) + .setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity()) + .setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId) + .setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode()) + .setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())) + .setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo()) + .setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())) + .setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv())) + .setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText()) + .setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag())) + .setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())); + return deviceDefinition; } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java index 61f52741525f06679ea0e531c277559375111767..3debdfb1934de309f950ef159a1c4be5b147cbff 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java @@ -1,5 +1,6 @@ package com.openhis.web.datadictionary.appservice.impl; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -10,10 +11,11 @@ import java.util.stream.Stream; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; -import com.openhis.yb.service.YbManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -23,13 +25,16 @@ import com.core.common.core.domain.R; import com.core.common.core.domain.entity.SysDictData; import com.core.common.utils.*; import com.core.common.utils.bean.BeanUtils; +import com.core.common.utils.poi.ExcelUtil; import com.core.system.service.ISysDictTypeService; import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.domain.Organization; +import com.openhis.administration.service.IChargeItemDefinitionService; import com.openhis.administration.service.IOrganizationService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.*; +import com.openhis.common.utils.CommonUtil; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.sys.service.IOperationRecordService; @@ -41,6 +46,7 @@ import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper; import com.openhis.workflow.domain.ActivityDefinition; import com.openhis.workflow.mapper.ActivityDefinitionMapper; import com.openhis.workflow.service.IActivityDefinitionService; +import com.openhis.yb.service.YbManager; /** * 诊疗实现类 @@ -52,7 +58,9 @@ import com.openhis.workflow.service.IActivityDefinitionService; public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { @Autowired - private IActivityDefinitionService iActivityDefinitionService; + private IActivityDefinitionService activityDefinitionService; + @Autowired + private IChargeItemDefinitionService chargeItemDefinitionService; @Autowired private ActivityDefinitionMapper activityDefinitionMapper; @Autowired @@ -110,15 +118,15 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { .collect(Collectors.toList()); diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories); -// // 查询医疗服务项类型 -// List medical_service_items = -// iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode()); -// // 获取医疗服务项List -// List diseaseTreatmentCategoryList = medical_service_items -// .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), -// status.getDictLabel())) -// .toList(); -// List diseaseTreatmentCategories = new ArrayList<>(); + // // 查询医疗服务项类型 + // List medical_service_items = + // iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode()); + // // 获取医疗服务项List + // List diseaseTreatmentCategoryList = medical_service_items + // .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), + // status.getDictLabel())) + // .toList(); + // List diseaseTreatmentCategories = new ArrayList<>(); // // //获取目录分类 // DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory = @@ -233,10 +241,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { activityDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(activityDefinition.getName())); // 更新诊疗信息 - if (iActivityDefinitionService.updateById(activityDefinition)) { + if (activityDefinitionService.updateById(activityDefinition)) { // 调用医保目录对照接口 String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 - if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo()) ) { + if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) { R r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition.getId()); if (200 != r.getCode()) { @@ -294,7 +302,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { iOperationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(), CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids); // 更新诊疗信息 - return iActivityDefinitionService.updateBatchById(ActivityDefinitionList) + return activityDefinitionService.updateBatchById(ActivityDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); @@ -322,7 +330,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { iOperationRecordService.addIdsOperationRecord(DbOpType.START.getCode(), CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids); // 更新诊疗信息 - return iActivityDefinitionService.updateBatchById(ActivityDefinitionList) + return activityDefinitionService.updateBatchById(ActivityDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); @@ -355,10 +363,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { // 新增外来诊疗目录 activityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue()); - if (iActivityDefinitionService.addDiagnosisTreatment(activityDefinition)) { + if (activityDefinitionService.addDiagnosisTreatment(activityDefinition)) { // 调用医保目录对照接口 String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 - if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo()) ) { + if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) { R r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition.getId()); if (200 != r.getCode()) { @@ -387,4 +395,169 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { } + /** + * 导入诊疗目录 + * + * @param file 文件 + * @return 结果 + */ + @Override + public R importData(MultipartFile file) { + // 读取文件 + R> readResult = + CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class); + if (R.SUCCESS != readResult.getCode()) { + return readResult; + } + List importDtoList = readResult.getData(); + // 导入信息校验 + R validateResult = validateImportDtoList(importDtoList); + if (R.SUCCESS != validateResult.getCode()) { + return validateResult; + } + // 查询机构ID供后续使用 + Long orgId = SecurityUtils.getLoginUser().getOrgId(); + // 创建表数据 + for (DiagnosisTreatmentImportDto importDto : importDtoList) { + // 创建诊疗定义 + ActivityDefinition activityDefinition = createActivityDefinitionEntity(importDto, orgId); + activityDefinitionService.save(activityDefinition); + // 创建费用定价和详情 + chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(), + importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(), + importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, + activityDefinition.getId()); + } + return R.ok(null, "导入成功!"); + } + + /** + * 获取导入模板 + * + * @param response 响应 + */ + @Override + public void importTemplate(HttpServletResponse response) { + ExcelUtil util = new ExcelUtil<>(DiagnosisTreatmentImportDto.class); + util.importTemplateExcel(response, "诊疗目录数据"); + } + + /** + * 导入信息校验 + * + * @param importDtoList 器材目录导入数据列表 + */ + private R validateImportDtoList(List importDtoList) { + // 字段校验(必填及数值类型) + List fieldValidateMsgList = new ArrayList<>(); + for (int i = 0; i < importDtoList.size(); i++) { + DiagnosisTreatmentImportDto importDto = importDtoList.get(i); + importDto.setLineNumber(i + 2); + List lineValidateMsgList = new ArrayList<>(); + if (StringUtils.isEmpty(importDto.getName())) { + lineValidateMsgList.add("诊疗名称必填"); + } + if (StringUtils.isEmpty(importDto.getCategoryCode())) { + lineValidateMsgList.add("目录类别必填"); + } + if (StringUtils.isEmpty(importDto.getPermittedUnitCode())) { + lineValidateMsgList.add("使用单位必填"); + } + if (StringUtils.isEmpty(importDto.getYbFlag())) { + lineValidateMsgList.add("医保标记必填"); + } + if (StringUtils.isEmpty(importDto.getYbMatchFlag())) { + lineValidateMsgList.add("医保对码标记必填"); + } + if (Whether.YES.getCode().equals(importDto.getYbMatchFlag()) && StringUtils.isEmpty(importDto.getYbNo())) { + lineValidateMsgList.add("医保对码时,医保编码必填"); + } + if (StringUtils.isEmpty(importDto.getChrgitmLv())) { + lineValidateMsgList.add("医保等级必填"); + } + if (StringUtils.isEmpty(importDto.getTypeCode())) { + lineValidateMsgList.add("财务类别必填"); + } + if (StringUtils.isEmpty(importDto.getYbType())) { + lineValidateMsgList.add("医保费用类别必填"); + } + if (StringUtils.isEmpty(importDto.getRetailPriceStr())) { + lineValidateMsgList.add("零售价必填"); + } + BigDecimal retailPrice; + try { + retailPrice = new BigDecimal(importDto.getRetailPriceStr()); + importDto.setRetailPrice(retailPrice); + } catch (Exception e) { + lineValidateMsgList.add("零售价应为数值类型"); + } + if (StringUtils.isEmpty(importDto.getMaximumRetailPriceStr())) { + lineValidateMsgList.add("最高零售价必填"); + } + BigDecimal maximumRetailPrice; + try { + maximumRetailPrice = new BigDecimal(importDto.getMaximumRetailPriceStr()); + importDto.setMaximumRetailPrice(maximumRetailPrice); + } catch (Exception e) { + lineValidateMsgList.add("最高零售价应为数值类型"); + } + if (!lineValidateMsgList.isEmpty()) { + fieldValidateMsgList + .add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";"); + } + } + if (!fieldValidateMsgList.isEmpty()) { + return R.fail("导入失败!诊疗信息填写有误:" + String.join(" ", fieldValidateMsgList)); + } + // 重复校验(文件行重复) + List lineRepeatedValidateMsgList = new ArrayList<>(); + List> importDtoGroupList = new ArrayList<>( + importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values()); + for (List importDtoGroup : importDtoGroupList) { + if (importDtoGroup.size() > 1) { + lineRepeatedValidateMsgList.add("■ 第" + + importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted() + .map(Object::toString).collect(Collectors.joining(",")) + + "行的【" + importDtoGroup.get(0).getName() + "】重复;"); + } + } + if (!lineRepeatedValidateMsgList.isEmpty()) { + return R.fail("导入失败!文件中存在重复诊疗:" + String.join(" ", lineRepeatedValidateMsgList)); + } + // 重复校验(文件与数据库重复) + List dbRepeatedValidateMsgList = new ArrayList<>(); + for (DiagnosisTreatmentImportDto importDto : importDtoList) { + List deviceDefinitionList = activityDefinitionService.list( + new LambdaQueryWrapper().eq(ActivityDefinition::getName, importDto.getName())); + if (!deviceDefinitionList.isEmpty()) { + dbRepeatedValidateMsgList + .add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;"); + } + } + if (!dbRepeatedValidateMsgList.isEmpty()) { + return R.fail("导入失败!系统中存在重复诊疗:" + String.join(" ", dbRepeatedValidateMsgList)); + } + return R.ok(); + } + + /** + * 创建诊疗定义实体 + * + * @param importDto 器材目录导入Dto + * @param orgId 机构ID + * @return 诊疗定义实体 + */ + private ActivityDefinition createActivityDefinitionEntity(DiagnosisTreatmentImportDto importDto, Long orgId) { + ActivityDefinition activityDefinition = new ActivityDefinition(); + activityDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10)) + .setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode()) + .setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName())) + .setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName())) + .setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId) + .setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo()) + .setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())) + .setStatusEnum(PublicationStatus.ACTIVE.getValue()) + .setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv())); + return activityDefinition; + } } 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 1641339a07c7cf50623807fd248d9550acb99d62..8920f0c2d1649ea82d9cc3ba74d0f7f635b978d2 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 @@ -3,7 +3,6 @@ */ package com.openhis.web.datadictionary.appservice.impl; -import java.io.IOException; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -30,17 +29,16 @@ import com.core.common.utils.*; import com.core.common.utils.bean.BeanUtils; import com.core.common.utils.poi.ExcelUtil; import com.core.system.service.ISysDictTypeService; -import com.openhis.administration.domain.ChargeItemDefDetail; import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.domain.Location; import com.openhis.administration.domain.Supplier; -import com.openhis.administration.service.IChargeItemDefDetailService; import com.openhis.administration.service.IChargeItemDefinitionService; import com.openhis.administration.service.ILocationService; import com.openhis.administration.service.ISupplierService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.*; +import com.openhis.common.utils.CommonUtil; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.medication.domain.Medication; @@ -73,10 +71,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi private IMedicationDefinitionService medicationDefinitionService; @Autowired - IChargeItemDefinitionService chargeItemDefinitionService; - - @Autowired - IChargeItemDefDetailService chargeItemDefDetailService; + private IChargeItemDefinitionService chargeItemDefinitionService; @Autowired private ILocationService locationService; @@ -474,7 +469,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi @Override public R importData(MultipartFile file) { // 读取文件 - R> readResult = readExcelFile(file); + R> readResult = CommonUtil.readImportedExcelFile(file, MedicationImportDto.class); if (R.SUCCESS != readResult.getCode()) { return readResult; } @@ -484,9 +479,8 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi if (R.SUCCESS != validateResult.getCode()) { return validateResult; } - // 查询机构ID、当前时间、位置信息供后续使用 + // 查询机构ID、位置信息供后续使用 Long orgId = SecurityUtils.getLoginUser().getOrgId(); - Date now = DateUtils.getNowDate(); List locationList = locationService.list(new LambdaQueryWrapper() .eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId)); Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId(); @@ -494,21 +488,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi locationList.stream().collect(Collectors.groupingBy(Location::getName)); // 创建表数据 for (MedicationImportDto importDto : importDtoList) { - // 药品定义表 + // 创建药品定义 MedicationDefinition medicationDefinition = createMedicationDefinitionEntity(importDto); medicationDefinitionService.save(medicationDefinition); - // 药品表 + // 创建药品 Medication medication = createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap); medicationService.save(medication); - // 费用定价表 - ChargeItemDefinition chargeItemDefinition = - createChargeItemDefinition(importDto, orgId, medicationDefinition.getId(), now); - chargeItemDefinitionService.save(chargeItemDefinition); - // 费用定价子表 - List chargeItemDefDetailList = - createChargeItemDefDetailList(importDto, chargeItemDefinition.getId()); - chargeItemDefDetailService.saveBatch(chargeItemDefDetailList); + // 创建费用定价和详情 + chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(), + importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(), + importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId, + CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId()); } return R.ok(null, "导入成功!"); } @@ -524,26 +515,6 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi util.importTemplateExcel(response, "药品目录数据"); } - /** - * 读取Excel文件 - * - * @param file 文件 - * @return 读取结果 - */ - private R> readExcelFile(MultipartFile file) { - ExcelUtil util = new ExcelUtil<>(MedicationImportDto.class); - List importDtoList; - try { - importDtoList = util.importExcel(file.getInputStream()); - } catch (IOException e) { - return R.fail("导入失败!文件读取异常"); - } - if (importDtoList.isEmpty()) { - return R.fail("导入失败!文件不能为空"); - } - return R.ok(importDtoList); - } - /** * 导入信息校验 * @@ -797,23 +768,26 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi .setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName())) .setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName())) .setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode()) - .setPartPercent(importDto.getPartPercent()).setDoseFrom(tryParseInt(importDto.getDoseFrom())) - .setApprovalNumber(importDto.getApprovalNumber()).setYbMatchFlag(tryParseInt(importDto.getYbMatchFlag())) - .setYbNo(importDto.getYbNo()).setPharmacologyCategoryCode("1") - .setSkinTestFlag(tryParseInt(importDto.getSkinTestFlag())) - .setInjectFlag(tryParseInt(importDto.getInjectFlag())).setManufacturerText(importDto.getManufacturerText()) - .setRestrictedFlag(tryParseInt(importDto.getRestrictedFlag())) + .setPartPercent(importDto.getPartPercent()).setDoseFrom(CommonUtil.tryParseInt(importDto.getDoseFrom())) + .setApprovalNumber(importDto.getApprovalNumber()) + .setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo()) + .setPharmacologyCategoryCode("1").setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag())) + .setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag())) + .setManufacturerText(importDto.getManufacturerText()) + .setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag())) .setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue()) - .setChildrenFlag(tryParseInt(importDto.getChildrenFlag())) + .setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag())) .setNationalDrugCode(importDto.getNationalDrugCode()) - .setPartAttributeEnum(tryParseInt(importDto.getPartAttributeEnum())) - .setAntibioticCode(importDto.getAntibioticCode()).setSelfFlag(tryParseInt(importDto.getSelfFlag())) - .setAntibioticFlag(tryParseInt(importDto.getAntibioticFlag())) - .setBasicFlag(tryParseInt(importDto.getBasicFlag())) - .setThoPartAttributeEnum(tryParseInt(importDto.getThoPartAttributeEnum())) + .setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum())) + .setAntibioticCode(importDto.getAntibioticCode()) + .setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag())) + .setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag())) + .setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag())) + .setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum())) .setUnitConversionRatio(importDto.getUnitConversionRatio()) - .setChrgitmLv(tryParseInt(importDto.getChrgitmLv())).setRxFlag(tryParseInt(importDto.getRxFlag())) - .setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity()); + .setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv())) + .setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity()) + .setItemMaxQuantity(importDto.getItemMaxQuantity()); return medicationDefinition; } @@ -844,53 +818,4 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi return medication; } - /** - * 创建费用定价实体 - * - * @param importDto 药品目录导入Dto - * @return 药品基本实体 - */ - private ChargeItemDefinition createChargeItemDefinition(MedicationImportDto importDto, Long orgId, - Long medicationDefId, Date effectiveStart) { - ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition(); - chargeItemDefinition.setChargeName(importDto.getName()).setStatusEnum(PublicationStatus.ACTIVE.getValue()) - .setOrgId(orgId).setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION) - .setInstanceId(medicationDefId).setEffectiveStart(effectiveStart).setTypeCode(importDto.getTypeCode()) - .setYbType(importDto.getYbType()).setConditionFlag(Whether.YES.getValue()) - .setPrice(importDto.getRetailPrice()); - return chargeItemDefinition; - } - - /** - * 创建费用定价子实体列表 - * - * @param importDto 药品目录导入Dto - * @param chargeItemDefId 费用定价ID - * @return 费用定价子实体列表 - */ - private List createChargeItemDefDetailList(MedicationImportDto importDto, - Long chargeItemDefId) { - ChargeItemDefDetail defDetailPurchase = new ChargeItemDefDetail().setDefinitionId(chargeItemDefId) - .setConditionCode(ConditionCode.PURCHASE.getCode()).setAmount(importDto.getPurchasePrice()); - ChargeItemDefDetail defDetailRetail = - new ChargeItemDefDetail().setDefinitionId(chargeItemDefId).setConditionCode(ConditionCode.UNIT.getCode()) - .setConditionValue(importDto.getUnitCode()).setAmount(importDto.getRetailPrice()); - ChargeItemDefDetail defDetailMaximumRetail = new ChargeItemDefDetail().setDefinitionId(chargeItemDefId) - .setConditionCode(ConditionCode.LIMIT.getCode()).setAmount(importDto.getMaximumRetailPrice()); - return Arrays.asList(defDetailPurchase, defDetailRetail, defDetailMaximumRetail); - } - - /** - * 尝试转化为int - * - * @param intStr int字符串 - * @return int值 - */ - private Integer tryParseInt(String intStr) { - try { - return Integer.parseInt(intStr); - } catch (Exception e) { - return null; - } - } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 50709be5e8662c5e6a2a678efa726e9d04fe6632..35fa8d712751c05b9aab561dfa74ab5dcd2d7915 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -3,10 +3,12 @@ package com.openhis.web.datadictionary.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import com.core.common.core.domain.R; import com.openhis.web.datadictionary.appservice.IDiagTreatMAppService; @@ -56,8 +58,8 @@ public class DiagnosisTreatmentController { @RequestParam(value = "searchKey", defaultValue = "") String searchKey, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - return diagTreatMAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, - pageSize, request); + return diagTreatMAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, pageSize, + request); } /** @@ -136,4 +138,25 @@ public class DiagnosisTreatmentController { public R exportDiseaseTreatment(@RequestBody DiagnosisTreatmentDto diagnosisTreatmentDto) { return null; } + + /** + * 导入诊疗目录 + * + * @param file 文件 + * @return 结果 + */ + @PostMapping("/import-data") + public R importData(MultipartFile file) { + return diagTreatMAppService.importData(file); + } + + /** + * 获取导入模板 + * + * @param response 响应 + */ + @PostMapping("/import-template") + public void importTemplate(HttpServletResponse response) { + diagTreatMAppService.importTemplate(response); + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java index ce946140ce15983554d9aee8039baae958ffc8bb..2eaec499456cf6048114aac9c947be75b3c98675 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java @@ -20,7 +20,7 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; /** - * TODO:病种目录 + * 病种目录 * * @author lpt * @date 2025-02-20 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceImportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceImportDto.java index fb8ba7bd633a26585c759eb8d155bfb933dbdc2c..8920ca1236b8b3ec2585718c32b5ad34a4462771 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceImportDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceImportDto.java @@ -57,10 +57,6 @@ public class DeviceImportDto { @Excel(name = "最小使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true) private String minUnitCode; - /** 所属科室名称(orgId) */ - @Excel(name = "所属科室名称", prompt = "必填") - private String orgName; - /** 所在位置名称(locationId) */ @Excel(name = "所在位置名称", prompt = "必填") private String locationName; @@ -70,7 +66,7 @@ public class DeviceImportDto { private String hvcmFlag; /** 销售单位 */ - @Excel(name = "最小使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true) + @Excel(name = "销售单位", prompt = "必填", dictType = "unit_code", comboReadDict = true) private String salesUnitCode; /** 批准文号 */ @@ -78,49 +74,61 @@ public class DeviceImportDto { private String approvalNumber; /** 医保标记 */ + @Excel(name = "医保标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是") private String ybFlag; + /** 医保对码标记 */ + @Excel(name = "医保对码标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是") + private String ybMatchFlag; + /** 医保编码 */ @Excel(name = "医保编码", prompt = "医保对码时必填") private String ybNo; /** 医药机构目录编码 */ + @Excel(name = "医药机构目录编码") private String ybOrgNo; - /** 医保对码标记 */ - private Integer ybMatchFlag; - /** 医保等级 */ - private Integer chrgitmLv; - - /** 状态 */ - private Integer statusEnum; - - /** 生产厂家 */ - private Long manufacturerId; + @Excel(name = "医保等级", prompt = "必填", dictType = "chrgitm_lv", comboReadDict = true) + private String chrgitmLv; /** 生产厂家 */ + @Excel(name = "生产厂家文本", prompt = "必填") private String manufacturerText; - /** 供应商 */ - private Long supplyId; + /** 过敏标记 */ + @Excel(name = "过敏标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是") + private String allergenFlag; - /** 说明 */ - private String description; + /** 处方标志 */ + @Excel(name = "处方标志", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是") + private String rxFlag; - /** 适用范围 */ - private String jurisdiction; + // ---------------------- 费用定价 adm_charge_item_definition ---------------------------------------------- - /** 器材版本 */ - private String version; + /** 财务类别 */ + @Excel(name = "财务类别", prompt = "必填", dictType = "fin_type_code", comboReadDict = true) + private String typeCode; - /** 主要成分 */ - private String substanceText; + /** 医保费用类别 */ + @Excel(name = "医保费用类别", prompt = "必填", dictType = "med_chrgitm_type", comboReadDict = true) + private String ybType; - /** 过敏标记 */ - private Integer allergenFlag; + // ---------------------- 费用定价子表 adm_charge_item_def_detail ---------------------------------------------- - /** 处方标志 */ - private Integer rxFlag; + /** 购入价 */ + @Excel(name = "购入价", prompt = "必填,数值类型") + private String purchasePriceStr; + private BigDecimal purchasePrice; + + /** 零售价 */ + @Excel(name = "零售价", prompt = "必填,数值类型") + private String retailPriceStr; + private BigDecimal retailPrice; + /** 最高零售价 */ + @Excel(name = "最高零售价", prompt = "必填,数值类型") + private String maximumRetailPriceStr; + private BigDecimal maximumRetailPrice; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentImportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentImportDto.java new file mode 100644 index 0000000000000000000000000000000000000000..46cf5eeb3256888d052bd5cda57c0122a3dfe82e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentImportDto.java @@ -0,0 +1,75 @@ +package com.openhis.web.datadictionary.dto; + +import java.math.BigDecimal; + +import com.core.common.annotation.Excel; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 诊疗目录导入Dto + * + * @author GuoRui + * @date 2025-09-29 + */ +@Data +@Accessors(chain = true) +public class DiagnosisTreatmentImportDto { + + /** 行号 */ + private Integer lineNumber; + + // ---------------------- 诊疗定义 wor_activity_definition ------------------------------------- + + /** 诊疗名称 */ + @Excel(name = "诊疗名称", prompt = "必填") + private String name; + + /** 目录类别 */ + @Excel(name = "目录类别", prompt = "必填", dictType = "activity_category_code", comboReadDict = true) + private String categoryCode; + + /** 使用单位 */ + @Excel(name = "使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true) + private String permittedUnitCode; + + /** 医保标记 */ + @Excel(name = "医保标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是") + private String ybFlag; + + /** 医保对码标记 */ + @Excel(name = "医保对码标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是") + private String ybMatchFlag; + + /** 医保编码 */ + @Excel(name = "医保编码", prompt = "医保对码时必填") + private String ybNo; + + /** 医保等级 */ + @Excel(name = "医保等级", prompt = "必填", dictType = "chrgitm_lv", comboReadDict = true) + private String chrgitmLv; + + // ---------------------- 费用定价 adm_charge_item_definition ---------------------------------------------- + + /** 财务类别 */ + @Excel(name = "财务类别", prompt = "必填", dictType = "fin_type_code", comboReadDict = true) + private String typeCode; + + /** 医保费用类别 */ + @Excel(name = "医保费用类别", prompt = "必填", dictType = "med_chrgitm_type", comboReadDict = true) + private String ybType; + + // ---------------------- 费用定价子表 adm_charge_item_def_detail ---------------------------------------------- + + /** 零售价 */ + @Excel(name = "零售价", prompt = "必填,数值类型") + private String retailPriceStr; + private BigDecimal retailPrice; + + /** 最高零售价 */ + @Excel(name = "最高零售价", prompt = "必填,数值类型") + private String maximumRetailPriceStr; + private BigDecimal maximumRetailPrice; + +} 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 9dba844b2947f7d45856be253b2a6a31a00d928f..f7b606ccf150fdafdcee4e7f9d68290f1c2e45f2 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 @@ -1,5 +1,7 @@ package com.openhis.web.doctorstation.appservice; +import javax.servlet.http.HttpServletRequest; + import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.openhis.web.doctorstation.dto.ConditionDefinitionMetadata; @@ -91,4 +93,12 @@ public interface IDoctorStationDiagnosisAppService { */ R delEncounterDiagnosis(Long conditionId); + /** + * 查询诊断信息 + * + * @param searchKey 目标字符 + * @param request 请求 + * @return 查询结果 + */ + R getDiagnosisList(String searchKey, HttpServletRequest request); } 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 c54bd6767a895dc02e8360164255d9f7d45f8d8a..6995a5c6b33173eeeff2f90101d7616ea82f35c9 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 @@ -253,7 +253,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp if (deviceId != null) { AdviceBaseDto matchedAdvice = adviceMap.get(deviceId); if (matchedAdvice != null) { - activityBindDeviceInfo.setDeviceDetailInfos(matchedAdvice); + activityBindDeviceInfo.setOrderDetailInfos(matchedAdvice); } } } 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 26a887e8ab159ae5c8452f061acbb0046d052cf7..3fed653e03a5b70214b617358b0102140dce60bf 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 @@ -6,6 +6,7 @@ import java.util.HashSet; import java.util.List; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -23,6 +24,7 @@ import com.openhis.clinical.domain.Condition; import com.openhis.clinical.domain.ConditionDefinition; import com.openhis.clinical.domain.DiagnosisBelongBinding; import com.openhis.clinical.mapper.ConditionDefinitionMapper; +import com.openhis.clinical.service.IConditionDefinitionService; import com.openhis.clinical.service.IConditionService; import com.openhis.clinical.service.IDiagnosisBelongBindingService; import com.openhis.common.constant.CommonConstants; @@ -56,6 +58,9 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn @Resource IEncounterDiagnosisService iEncounterDiagnosisService; + @Resource + IConditionDefinitionService conditionDefinitionService; + /** * 新增诊断归属绑定 * @@ -167,7 +172,7 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn conditionDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue()); QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey, new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null); - queryWrapper.eq("status_enum",PublicationStatus.ACTIVE.getValue()); + queryWrapper.eq("status_enum", PublicationStatus.ACTIVE.getValue()); // 设置排序 queryWrapper.orderByDesc("update_time"); // 拼接 用于区分 西医诊断 [1] 中医诊断 [2] 的查询条件 @@ -338,4 +343,19 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn }); } + /** + * 查询诊断信息 + * + * @param searchKey 目标字符 + * @param request 请求 + * @return 查询结果 + */ + @Override + public R getDiagnosisList(String searchKey, HttpServletRequest request) { + + List conditionDefinitionListBySearchKey = + conditionDefinitionService.getConditionDefinitionListBySearchKey(searchKey, request); + + return R.ok(conditionDefinitionListBySearchKey); + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationElepPrescriptionServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationElepPrescriptionServiceImpl.java index 6f3e6e925c657f624b9cf26af414fe787d4c9978..dab16f5102789039048859c4fbf6dac65d8c4017 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationElepPrescriptionServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationElepPrescriptionServiceImpl.java @@ -6,52 +6,46 @@ import java.util.stream.Stream; import javax.annotation.Resource; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.core.common.core.domain.R; import com.core.common.core.domain.model.LoginUser; +import com.core.common.utils.AssignSeqUtil; import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; import com.core.common.utils.SecurityUtils; import com.openhis.administration.domain.Practitioner; import com.openhis.administration.service.IPractitionerService; -import com.openhis.common.constant.CommonConstants; -import com.openhis.common.constant.YbCommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.AssignSeqEnum; +import com.openhis.common.enums.PrescriptionType; +import com.openhis.common.enums.RequestStatus; import com.openhis.common.enums.ybenums.YbRxItemTypeCode; +import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; -import com.openhis.financial.domain.Contract; import com.openhis.web.doctorstation.appservice.IDoctorStationElepPrescriptionService; +import com.openhis.web.doctorstation.dto.*; import com.openhis.web.doctorstation.mapper.DoctorStationElepPrescriptionMapper; -import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; -import com.openhis.web.reportmanage.dto.ChargeReportSearchParam; import com.openhis.workflow.domain.ElepMedicationRequest; -import com.openhis.workflow.domain.InventoryItem; -import com.openhis.workflow.domain.SupplyRequest; -import com.openhis.workflow.mapper.InventoryItemMapper; import com.openhis.workflow.service.IElepMedicationRequestService; import com.openhis.ybcatalog.domain.CatalogDrugInfo; import com.openhis.ybcatalog.domain.CatalogDrugInfoUsual; import com.openhis.ybcatalog.mapper.CatalogDrugInfoUsualMapper; -import com.openhis.ybcatalog.service.ICatalogDrugInfoService; import com.openhis.ybcatalog.service.ICatalogDrugInfoUsualService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -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.AssignSeqUtil; -import com.core.common.utils.MessageUtils; -import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.enums.*; -import com.openhis.common.utils.EnumUtils; -import com.openhis.web.doctorstation.dto.*; /** * 医生站-电子处方 应用实现类 */ @Service -public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl - implements IDoctorStationElepPrescriptionService { +public class DoctorStationElepPrescriptionServiceImpl extends + ServiceImpl implements IDoctorStationElepPrescriptionService { @Autowired ICatalogDrugInfoUsualService catalogDrugInfoUsualService; @Autowired @@ -75,15 +69,17 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl rxTypeCodeListOptions = Stream.of(YbRxItemTypeCode.values()) - .map(prescriptionType -> new ElepPrescriptionInitDto.commonStatusOption(prescriptionType.getValue(), - prescriptionType.getDescription())) - .collect(Collectors.toList()); -// //获取诊断信息 -// List conditionInfoList = elepPrescriptionMapper.selectConditionInfo(encounterId); -// // 诊断列表 -// List conditionListOptions = conditionInfoList.stream() -// .map(conditionInfo -> new ElepPrescriptionInitDto.conditionStatusOption(conditionInfo.getConditionId(), conditionInfo.getConditionName())) -// .collect(Collectors.toList()); + .map(prescriptionType -> new ElepPrescriptionInitDto.commonStatusOption(prescriptionType.getValue(), + prescriptionType.getDescription())) + .collect(Collectors.toList()); + // //获取诊断信息 + // List conditionInfoList = + // elepPrescriptionMapper.selectConditionInfo(encounterId); + // // 诊断列表 + // List conditionListOptions = conditionInfoList.stream() + // .map(conditionInfo -> new ElepPrescriptionInitDto.conditionStatusOption(conditionInfo.getConditionId(), + // conditionInfo.getConditionName())) + // .collect(Collectors.toList()); initDto.setRxTypeCodeListOptions(rxTypeCodeListOptions); return R.ok(initDto); @@ -92,35 +88,37 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl getAllMedicationUsualInfo(String searchKey, Integer pageNo, Integer pageSize) { - //从yb_catalog_drug_info_usual表中取数据 - IPage medicationUsualInfo = catalogDrugInfoUsualService.selectCatalogDrugInfoUsual(pageNo, pageSize, searchKey); + // 从yb_catalog_drug_info_usual表中取数据 + IPage medicationUsualInfo = + catalogDrugInfoUsualService.selectCatalogDrugInfoUsual(pageNo, pageSize, searchKey); return R.ok(medicationUsualInfo); } /** * 获取药品信息 * - * @param pageNo 当前页 - * @param pageSize 每页多少条 + * @param pageNo 当前页 + * @param pageSize 每页多少条 * @param searchKey 模糊查询关键字 * @return 药品信息 */ @Override public R getAllMedicationInfo(String searchKey, Integer pageNo, Integer pageSize) { // 构建查询条件 - QueryWrapper queryWrapper = - HisQueryUtils.buildQueryWrapper(null, searchKey, - new HashSet<>(Arrays.asList("registered_name", "pinyin_code", "wubi_code", "approval_no","manufacturer_name")), - null); - //从yb_catalog_drug_info表中取数据 - IPage medicationInfo = elepPrescriptionMapper.selectCatalogDrugInfo(new Page<>(pageNo, pageSize), queryWrapper); + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, + new HashSet<>( + Arrays.asList("registered_name", "pinyin_code", "wubi_code", "approval_no", "manufacturer_name")), + null); + // 从yb_catalog_drug_info表中取数据 + IPage medicationInfo = + elepPrescriptionMapper.selectCatalogDrugInfo(new Page<>(pageNo, pageSize), queryWrapper); return R.ok(medicationInfo); } @@ -128,15 +126,15 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl getPrescriptionInfo(Long patientId, Integer pageNo, Integer pageSize) { // 处方信息查询 IPage prescriptionInfo = - elepPrescriptionMapper.selectElepPrescriptionInfo(new Page<>(pageNo, pageSize), patientId); + elepPrescriptionMapper.selectElepPrescriptionInfo(new Page<>(pageNo, pageSize), patientId); // 状态转换 prescriptionInfo.getRecords().forEach(infoDto -> { infoDto.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, infoDto.getStatusEnum())); @@ -149,15 +147,15 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl getMedicationInfo(String prescriptionNo, Integer pageNo, Integer pageSize) { // 药品详细查询 IPage medicationInfo = - elepPrescriptionMapper.selectMedicationInfo(new Page<>(pageNo, pageSize), prescriptionNo); + elepPrescriptionMapper.selectMedicationInfo(new Page<>(pageNo, pageSize), prescriptionNo); return R.ok(medicationInfo); } @@ -189,7 +187,8 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl requestList = elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionInfo.getPrescriptionNo()); + List requestList = elepMedicationRequestService + .selectElepMedicationRequestByPrescriptionNo(prescriptionInfo.getPrescriptionNo()); if (!requestList.isEmpty()) { List idList = requestList.stream().map(ElepMedicationRequest::getId).collect(Collectors.toList()); // 处方信息删除 @@ -205,68 +204,72 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl().eq(CatalogDrugInfoUsual::getMedicalCatalogCode, item.getMedicationId())); + usualInfo = baseMapper.selectOne(new LambdaUpdateWrapper() + .eq(CatalogDrugInfoUsual::getMedicalCatalogCode, item.getMedicationId())); if (usualInfo == null) { drugInfo = elepPrescriptionMapper.selectCatalogDrugInfoByNo(item.getMedicationId(), item.getVersion()); BeanUtils.copyProperties(drugInfo, usualInfoInsert); @@ -292,7 +296,7 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl issuancePrescription(List prescriptionNoList) { // 搜索处方信息 List elepMedicationRequestList = - elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNoList(prescriptionNoList); + elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNoList(prescriptionNoList); // 判断处方是否存在 if (elepMedicationRequestList == null) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); } for (ElepMedicationRequest item : elepMedicationRequestList) { - if(Objects.equals(item.getStatusEnum(), RequestStatus.DRAFT.getValue())|| Objects.equals(item.getStatusEnum(), RequestStatus.ENDED.getValue())){ + if (Objects.equals(item.getStatusEnum(), RequestStatus.DRAFT.getValue()) + || Objects.equals(item.getStatusEnum(), RequestStatus.ENDED.getValue())) { // 处方状态 item.setStatusEnum(RequestStatus.ACTIVE.getValue()); - }else{ + } else { return R.fail("选择了不能签发的处方"); } } @@ -469,6 +478,6 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl getDiagnosisList(@RequestParam(value = "searchKey", required = false) String searchKey, + HttpServletRequest request) { + return iDoctorStationDiagnosisAppService.getDiagnosisList(searchKey, request); + } + /** * 删除就诊诊断信息 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDetailDto.java index 14a7fa4f446e83bf1e19197a818c15a9db2f6d64..1e32e8b3f47281a5f392fb4f10e431988ee3d324 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDetailDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDetailDto.java @@ -4,6 +4,7 @@ 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; @@ -15,6 +16,13 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class ActivityBindDeviceDetailDto { + /** + * 用于搭配Dict切面,无实际业务意义 + */ + @Dict(dictCode = "test_field") + private String testField; + private String testField_dictText; + /** * 诊疗id */ @@ -38,6 +46,6 @@ public class ActivityBindDeviceDetailDto { /** * 耗材详细信息 */ - private AdviceBaseDto deviceDetailInfos; + private AdviceBaseDto orderDetailInfos; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDto.java index d5608c3cc5ef71ffadd3e489473c0450eb31f010..2a47fb4c314f6ce976db4d86bb79446660a6f604 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ActivityBindDeviceDto.java @@ -2,6 +2,7 @@ package com.openhis.web.doctorstation.dto; import java.util.List; +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; @@ -12,6 +13,13 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class ActivityBindDeviceDto { + /** + * 用于搭配Dict切面,无实际业务意义 + */ + @Dict(dictCode = "test_field") + private String testField; + private String testField_dictText; + /** * 诊疗绑定耗材详情 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java index a05693922e6353ebda7ed6c5b6e69d7f5b82fe82..becd16f2e5aba2a04404f2dc43ed604467221670 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java @@ -133,6 +133,10 @@ public class AdviceBaseDto { */ private String supplier; + /** 供应商ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long supplierId; + /** * 生产厂家 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ElepPrescriptionInfoParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ElepPrescriptionInfoParam.java index a2765700d76d2efb9afafae3f009e0b07e881e62..8376054d509d2fa46511bfb874dfefe92c518d8f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ElepPrescriptionInfoParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/ElepPrescriptionInfoParam.java @@ -4,19 +4,13 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; 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 lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; - /** * 电子处方 dto */ @@ -24,104 +18,82 @@ import javax.validation.constraints.Positive; @Accessors(chain = true) public class ElepPrescriptionInfoParam { + /** 药品信息 */ + List medicationInfoList; /** ID */ @JsonSerialize(using = ToStringSerializer.class) private Integer id; - /** 医院内部处方编号 */ private String prescriptionNo; - /** 医院id (前台不传) */ @JsonSerialize(using = ToStringSerializer.class) private Long organizationId; - /** 门诊/住院病历号 (前台不传) */ private String iptOtpNo; - /** 科室病区 (前台不传) */ private String departmentWard; - /** 医保类型 (前台不传) */ private Integer insuranceEnum; - /** 开具日期 (前台不传) */ private Date issueTime; - /** 开具科室 (前台不传) */ @JsonSerialize(using = ToStringSerializer.class) private Long orgId; - /** 患者 */ @JsonSerialize(using = ToStringSerializer.class) private Long patientId; - /** 就诊id */ @JsonSerialize(using = ToStringSerializer.class) private Long encounterId; - /** 诊断id */ @JsonSerialize(using = ToStringSerializer.class) private Long conditionId; - + /** 诊断id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long conditionDefId; + /** 慢病字段 */ + private String opspDiseCode; /** 有效天数 */ private Integer validityDays; - /** 药品定义id */ private String medicationId; - /** 药品剂量 */ private BigDecimal medDosage; /** 药品剂量单位 */ private String medDosageUnitCode; - /** 药品频率 */ private String medFrequency; - /** 药品途径 */ private String medRoute; - /** 开方医师 (前台不传) */ @JsonSerialize(using = ToStringSerializer.class) private Long prescribingDrId; - /** 延长原因 */ private String extensionReason; - /** 处方状态 (前台不传) */ private Integer statusEnum; - /** 请求数量 */ private Integer quantity; - /** 请求单位 */ private String unitCode; - /** 处方类别 */ private Integer rxTypeCode; /** 处方类别 */ private Integer rxItemTypeCode; - /** 支持用药信息 */ private String supportInfo; /** 服药时间(开始) */ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date effectiveDoseStart; - /** 服药时间(结束) */ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date effectiveDoseEnd; /** 给药间隔 */ private String dispenseInterval; - /** 单次发药数 */ private Integer dispensePerQuantity; - /** 每次发药供应天数 */ private Integer dispensePerDuration; - /** 药品版本号 */ private String version; - - /** 药品信息 */ - List medicationInfoList; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java index f8d1cb129600b071865da3531f3f2c7c672362ff..dc87575c2f98de2abb8ece98c9af32478e4c251e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java @@ -2,10 +2,7 @@ package com.openhis.web.doctorstation.utils; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import javax.annotation.Resource; @@ -28,6 +25,7 @@ import com.openhis.web.datadictionary.dto.ActivityChildJsonDto; import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService; import com.openhis.web.doctorstation.dto.*; import com.openhis.web.doctorstation.mapper.DoctorStationAdviceAppMapper; +import com.openhis.web.inhospitalnursestation.dto.MedicationRequestUseExe; import com.openhis.web.personalization.dto.ActivityDeviceDto; import com.openhis.workflow.domain.DeviceRequest; import com.openhis.workflow.domain.ServiceRequest; @@ -121,6 +119,56 @@ public class AdviceUtils { return null; // 校验通过 } + /** + * 执行住院医嘱,校验药品库存 + * + * @param medUseExeList 药品请求信息 + * @return 结果 + */ + public String checkExeMedInventory(List medUseExeList) { + // 医嘱定义id集合 + List adviceDefinitionIdList = + medUseExeList.stream().map(MedicationRequestUseExe::getMedicationId).collect(Collectors.toList()); + // 医嘱库存集合 + List adviceInventoryList = + doctorStationAdviceAppMapper.getAdviceInventory(null, 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()); + // 预减库存 + List adviceInventory = + this.subtractInventory(adviceInventoryList, adviceDraftInventoryList); + // 生命提示信息集合 + List tipsList = new ArrayList<>(); + for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) { + Optional matchedInventory = adviceInventory.stream() + .filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId()) + && CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable()) + && medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId()) + && medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())) + .findFirst(); + // 匹配到库存信息 + if (matchedInventory.isPresent()) { + AdviceInventoryDto inventoryDto = matchedInventory.get(); + if ((medicationRequestUseExe.getExecuteTimesNum() + .multiply(medicationRequestUseExe.getMinUnitQuantity())) + .compareTo(inventoryDto.getQuantity()) > 0) { + tipsList + .add("【" + medicationRequestUseExe.getBusNo() + "】在" + inventoryDto.getLocationName() + "库存不足"); + } + } else { + tipsList.add("【" + medicationRequestUseExe.getBusNo() + "】未匹配到库存信息"); + } + } + if (!tipsList.isEmpty()) { + // 返回库存不足提示信息 + return String.join(";", tipsList); + } + return null; // 校验通过 + } + /** * 预减库存 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/DoctorStationSendApplyUtil.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/DoctorStationSendApplyUtil.java index 02b5ec8e85a22497be18186a6433e76353f305f3..8bea5f32fa103f901f59b007a79570cc22b2e67d 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/DoctorStationSendApplyUtil.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/DoctorStationSendApplyUtil.java @@ -15,7 +15,7 @@ import com.openhis.administration.service.IOrganizationService; import com.openhis.administration.service.IPatientService; import com.openhis.administration.service.IPractitionerService; import com.openhis.common.enums.ActivityDefCategory; -import com.openhis.common.enums.ybenums.YbGender; +import com.openhis.common.enums.AdministrativeGender; import com.openhis.crosssystem.dto.LisApplyDto; import com.openhis.crosssystem.dto.LisApplyGroupDto; import com.openhis.crosssystem.dto.PacsApplyDto; @@ -99,9 +99,9 @@ public class DoctorStationSendApplyUtil { if (patient.getGenderEnum() == null) { lisPatientSex = LisPatientSex.UNKNOWN; } else { - if (YbGender.MALE.getValue().equals(patient.getGenderEnum().toString())) { + if (AdministrativeGender.MALE.getValue().equals(patient.getGenderEnum())) { lisPatientSex = LisPatientSex.MALE; - } else if (YbGender.FEMALE.getValue().equals(patient.getGenderEnum().toString())) { + } else if (AdministrativeGender.FEMALE.getValue().equals(patient.getGenderEnum())) { lisPatientSex = LisPatientSex.FEMALE; } else { lisPatientSex = LisPatientSex.UNKNOWN; @@ -128,9 +128,9 @@ public class DoctorStationSendApplyUtil { if (patient.getGenderEnum() == null) { pacsPatientSex = PacsPatientSex.UNKNOWN; } else { - if (YbGender.MALE.getValue().equals(patient.getGenderEnum().toString())) { + if (AdministrativeGender.MALE.getValue().equals(patient.getGenderEnum())) { pacsPatientSex = PacsPatientSex.MALE; - } else if (YbGender.FEMALE.getValue().equals(patient.getGenderEnum().toString())) { + } else if (AdministrativeGender.FEMALE.getValue().equals(patient.getGenderEnum())) { pacsPatientSex = PacsPatientSex.FEMALE; } else { pacsPatientSex = PacsPatientSex.UNKNOWN; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionAppService.java index 9dc36bb78845bf3b005f39cda8128d885c6e7f8a..9a987dd3a71a5f4d4fadf6b1e201f78ceb8f7277 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionAppService.java @@ -38,8 +38,9 @@ public interface IDocStatisticsDefinitionAppService { */ public List getList(Integer isStatistics); + List getListWithOptionList(Integer isStatistics); /** - * 获取文档统计定义选项列表并按指定格式返回 + * 过时obsolete 获取文档统计定义选项列表并按指定格式返回 (key-value) * * @return 封装了处理结果的响应对象 */ @@ -53,22 +54,4 @@ public interface IDocStatisticsDefinitionAppService { public R deleteDocStatisticsDefinition(Long id); - - /** - * 根据id获取文档统计定义 - * - * @param id - * @return 封装了处理结果的响应对象 - */ - public R getDocStatisticsDefinitionById(Long id); - - /** - * 根据code获取文档统计定义 - * - * @param code - * @return 封装了处理结果的响应对象 - */ - public R getDocStatisticsDefinitionByCode(String code); - - } \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionOptionAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionOptionAppService.java deleted file mode 100644 index 9dd6d5e1e627578c6ae4479147975f02cdd277cc..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/IDocStatisticsDefinitionOptionAppService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.openhis.web.document.appservice; - - -import com.core.common.core.domain.AjaxResult; -import com.core.common.core.domain.R; -import com.openhis.web.document.dto.DocStatisticsDefinitionOptionDto; -import com.openhis.web.document.dto.DocStatisticsDefinitionOptionList; - -import java.util.List; - -/** - * 文档模板 业务接口 - */ -public interface IDocStatisticsDefinitionOptionAppService { - - - /** - * 新增、修改文档模板 统计项选项 - * - * @param docStatisticsDefinitionOptionList - */ - public R add(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList); - - public R createOrEdit(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList); - - public R deleteDocStatisticsDefinitionOptionById(Long id); - - public DocStatisticsDefinitionOptionList getDocStatisticsDefinitionOptionByDefinitionId(Long docStatisticsDefinitionId); - - /** - * 获取文档模板 统计项选项列表 - */ - public AjaxResult getDocStatisticsDefinitionOptionList(); - - -} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionAppServiceImpl.java index 4b824ca9ea715502df4df03641b7f1336929f1f3..77c6767b1da48954949bf28647bc991de762c01d 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionAppServiceImpl.java @@ -3,7 +3,10 @@ package com.openhis.web.document.appservice.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.constant.CacheConstants; import com.core.common.core.domain.R; +import com.core.common.core.domain.entity.SysDictData; +import com.core.common.core.redis.RedisCache; import com.core.common.utils.bean.BeanUtils; import com.openhis.common.utils.HisPageUtils; import com.openhis.common.utils.HisQueryUtils; @@ -11,13 +14,11 @@ import com.openhis.document.domain.DocStatisticsDefinition; import com.openhis.document.mapper.DocStatisticsDefinitionMapper; import com.openhis.document.service.IDocStatisticsDefinitionService; import com.openhis.web.document.appservice.IDocStatisticsDefinitionAppService; -import com.openhis.web.document.appservice.IDocStatisticsDefinitionOptionAppService; -import com.openhis.web.document.dto.DocDefinitionOrganizationDto; import com.openhis.web.document.dto.DocStatisticsDefinitionDto; -import com.openhis.web.document.dto.DocStatisticsDefinitionOptionList; import com.openhis.web.document.dto.OptionDto; import com.openhis.web.document.mapper.DocStatisticsDefinitionAppMapper; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -35,12 +36,11 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi @Resource private IDocStatisticsDefinitionService iDocStatisticsDefinitionService; @Resource - private IDocStatisticsDefinitionOptionAppService iDocStaticsDefinitionOptionAppService; - @Resource private DocStatisticsDefinitionMapper docStatisticsDefinitionMapper; @Resource private DocStatisticsDefinitionAppMapper docStatisticsDefinitionAppMapper; - + @Autowired + private RedisCache redisCache; @Override public R createOrEdit(DocStatisticsDefinitionDto docStatisticsDefinitionDto) { if (docStatisticsDefinitionDto == null) { @@ -95,15 +95,10 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi docStatisticsDefinition.setIsStatistics(docStatisticsDefinitionDto.getIsStatistics()); docStatisticsDefinition.setDisplayOrder(docStatisticsDefinitionDto.getDisplayOrder()); docStatisticsDefinition.setUnit(docStatisticsDefinitionDto.getUnit()); - - + docStatisticsDefinition.setDictType(docStatisticsDefinitionDto.getDictType()); + docStatisticsDefinition.setDictName(docStatisticsDefinitionDto.getDictName()); boolean saveResult = iDocStatisticsDefinitionService.save(docStatisticsDefinition); if (saveResult) { - // 同步保存选项列表(如有) - if (docStatisticsDefinitionDto.getOptionList() != null && !docStatisticsDefinitionDto.getOptionList().getOptions().isEmpty()) { - docStatisticsDefinitionDto.getOptionList().setDocStatisticsDefinitionId(docStatisticsDefinition.getId()); - return iDocStaticsDefinitionOptionAppService.add(docStatisticsDefinitionDto.getOptionList()); - } return R.ok("文档统计定义新增成功"); } else { return R.fail("文档统计定义新增失败"); @@ -131,10 +126,12 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi existingData.setIsStatistics(docStatisticsDefinitionDto.getIsStatistics()); existingData.setDisplayOrder(docStatisticsDefinitionDto.getDisplayOrder()); existingData.setUnit(docStatisticsDefinitionDto.getUnit()); + existingData.setDictType(docStatisticsDefinitionDto.getDictType()); + existingData.setDictName(docStatisticsDefinitionDto.getDictName()); boolean updateResult = iDocStatisticsDefinitionService.updateById(existingData); if (updateResult) { // 同步更新选项列表 - return iDocStaticsDefinitionOptionAppService.createOrEdit(docStatisticsDefinitionDto.getOptionList()); + return R.ok("文档统计定义更新成功"); } else { return R.fail("文档统计定义更新失败"); } @@ -168,12 +165,12 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi */ @Override public R getPageList(Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) { +// Map keyMap = redisCache.getAllDictDataWithKeys(CacheConstants.SYS_DICT_KEY); // 构建查询条件(支持多字段搜索) QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( null, searchKey, new HashSet<>(Arrays.asList("name", "code")), request); // 按记录时间倒序(最新记录在前) queryWrapper.lambda().orderByDesc(DocStatisticsDefinition::getDisplayOrder); - Page recordPage = HisPageUtils.selectPage( docStatisticsDefinitionMapper, queryWrapper, pageNo, pageSize, DocStatisticsDefinitionDto.class); // 转换为分页结果 @@ -181,13 +178,14 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi } /** - * 获取文档统计定义列表(不分页) + * 获取文档统计定义列表(不分页,不包含options) * * @param isStatistics 是否统计 * @return 文档统计定义列表 */ @Override public List getList(Integer isStatistics) { + Map keyMap = redisCache.getAllDictDataWithKeys(CacheConstants.SYS_DICT_KEY); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); if (isStatistics != null) { queryWrapper.eq(DocStatisticsDefinition::getIsStatistics, isStatistics); @@ -201,7 +199,28 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi } return resultList; } - + @Override + public List getListWithOptionList(Integer isStatistics) { + //从redis中获取所有字典数据 + Map keyMap = redisCache.getAllDictDataWithKeys(CacheConstants.SYS_DICT_KEY); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (isStatistics != null) { + queryWrapper.eq(DocStatisticsDefinition::getIsStatistics, isStatistics); + } + List dataList = iDocStatisticsDefinitionService.list(queryWrapper); + List resultList = new ArrayList<>(); + for (DocStatisticsDefinition data : dataList) { + DocStatisticsDefinitionDto dto = new DocStatisticsDefinitionDto(); + BeanUtils.copyProperties(data, dto); + if(keyMap.containsKey(CacheConstants.SYS_DICT_KEY+data.getDictType())) + { + List dictData = (List) keyMap.get(CacheConstants.SYS_DICT_KEY+data.getDictType()); + dto.setOptionList(dictData); + } + resultList.add(dto); + } + return resultList; + } /** * 获取文档统计定义选项列表并按指定格式返回 * @@ -276,62 +295,12 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi } boolean deleteResult = iDocStatisticsDefinitionService.removeById(id); if (deleteResult) { - // 同步删除选项列表 - iDocStaticsDefinitionOptionAppService.deleteDocStatisticsDefinitionOptionById(id); return R.ok("文档统计定义删除成功"); } else { return R.fail("文档统计定义删除失败"); } } - /** - * 获取文档统计定义详情 - * - * @param id 文档统计定义ID - * @return 封装了处理结果的响应对象 - */ - @Override - public R getDocStatisticsDefinitionById(Long id) { - if (id == null) { - return R.fail("获取文档统计定义,参数ID不能为空"); - } - DocStatisticsDefinition data = iDocStatisticsDefinitionService.getById(id); - if (data == null) { - return R.fail("获取文档统计定义失败,目标数据不存在"); - } - // 转换为DTO返回 - DocStatisticsDefinitionDto dto = new DocStatisticsDefinitionDto(); - BeanUtils.copyProperties(data, dto); - DocStatisticsDefinitionOptionList optionList = iDocStaticsDefinitionOptionAppService.getDocStatisticsDefinitionOptionByDefinitionId(id); - dto.setOptionList(optionList); - return R.ok(dto, "文档统计定义获取成功"); - } - /** - * 根据代码获取文档统计定义详情 - * - * @param code 文档统计定义代码 - * @return 封装了处理结果的响应对象 - */ - @Override - public R getDocStatisticsDefinitionByCode(String code) { - if (code == null || code.trim().isEmpty()) { - return R.fail("获取文档统计定义,参数代码不能为空"); - } - // 按代码查询 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(DocStatisticsDefinition::getCode, code); - DocStatisticsDefinition data = iDocStatisticsDefinitionService.getOne(queryWrapper); - if (data == null) { - return R.fail("获取文档统计定义失败,目标数据不存在"); - } - DocStatisticsDefinitionDto dto = new DocStatisticsDefinitionDto(); - if (data != null) { - BeanUtils.copyProperties(data, dto); - } - DocStatisticsDefinitionOptionList optionList = iDocStaticsDefinitionOptionAppService.getDocStatisticsDefinitionOptionByDefinitionId(data.getId()); - dto.setOptionList(optionList); - return R.ok(dto, "文档统计定义获取成功"); - } } \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionOptionAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionOptionAppServiceImpl.java deleted file mode 100644 index 1c199d8d8d6aaa8dacf3cc7aaddfc817a1ee9f57..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocStatisticsDefinitionOptionAppServiceImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -package com.openhis.web.document.appservice.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.core.common.core.domain.AjaxResult; -import com.core.common.core.domain.R; -import com.core.common.utils.bean.BeanUtils; -import com.openhis.document.domain.DocStatisticsDefinitionOption; -import com.openhis.document.mapper.DocStatisticsDefinitionOptionMapper; -import com.openhis.document.service.IDocStatisticsDefinitionOptionService; -import com.openhis.web.document.appservice.IDocStatisticsDefinitionOptionAppService; -import com.openhis.web.document.dto.DocStatisticsDefinitionOptionDto; -import com.openhis.web.document.dto.DocStatisticsDefinitionOptionList; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 文档统计定义选项 业务实现类 - */ -@Slf4j -@Service -public class DocStatisticsDefinitionOptionAppServiceImpl implements IDocStatisticsDefinitionOptionAppService { - - @Resource - private DocStatisticsDefinitionOptionMapper docStatisticsDefinitonOptionMapper; - @Resource - private IDocStatisticsDefinitionOptionService docStatisticsDefinitionOptionService; - - /** - * 新增文档统计定义选项 - * - * @param docStatisticsDefinitionOptionList 选项列表DTO - */ - @Override - public R add(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList) { - // 参数校验 - if (docStatisticsDefinitionOptionList == null) { - return R.fail("统计项选项列表为空,请选择统计项选项"); - } - if (docStatisticsDefinitionOptionList.getOptions() == null || docStatisticsDefinitionOptionList.getOptions().isEmpty()) { - return R.fail("统计项选项不允许为空,请正确填写统计项选项"); - } - if (docStatisticsDefinitionOptionList.getDocStatisticsDefinitionId() == null) { - return R.fail("统计项定义ID为空,请选择统计项定义ID"); - } - - // DTO转实体 - List optionList = new ArrayList<>(); - for (DocStatisticsDefinitionOptionDto dto : docStatisticsDefinitionOptionList.getOptions()) { - DocStatisticsDefinitionOption option = new DocStatisticsDefinitionOption(); - option.setDocStatisticsDefinitionId(docStatisticsDefinitionOptionList.getDocStatisticsDefinitionId()); - option.setOption(dto.getOption()); - option.setDisplayOrder(dto.getDisplayOrder()); - optionList.add(option); - } - - // 批量新增 - boolean saveSuccess = docStatisticsDefinitionOptionService.saveBatch(optionList); - if (saveSuccess) { - return R.ok(optionList, "统计项选项保存成功"); - } else { - return R.fail("统计项选项保存失败"); - } - } - - /** - * 新增/编辑文档统计定义选项(区分增删改) - * - * @param docStatisticsDefinitionOptionList 选项列表DTO - */ - @Override - public R createOrEdit(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList) { - // 参数校验 - if (docStatisticsDefinitionOptionList == null) { - return R.fail("统计项选项列表为空,请选择统计项选项"); - } - Long definitionId = docStatisticsDefinitionOptionList.getDocStatisticsDefinitionId(); - if (definitionId == null) { - return R.fail("统计项定义ID为空,请选择统计项定义ID"); - } - - // 1. 查询原数据列表(按统计定义ID关联) - List oldList = docStatisticsDefinitonOptionMapper.selectList( - new LambdaQueryWrapper() - .eq(DocStatisticsDefinitionOption::getDocStatisticsDefinitionId, definitionId)); - oldList = oldList == null ? Collections.emptyList() : oldList; - - // 2. 处理新数据列表(DTO转实体,避免空指针) - List newList = new ArrayList<>(); - if (docStatisticsDefinitionOptionList.getOptions() != null && !docStatisticsDefinitionOptionList.getOptions().isEmpty()) { - for (DocStatisticsDefinitionOptionDto dto : docStatisticsDefinitionOptionList.getOptions()) { - DocStatisticsDefinitionOption option = new DocStatisticsDefinitionOption(); - BeanUtils.copyProperties(dto, option); // 改用BeanUtils简化赋值 - option.setDocStatisticsDefinitionId(definitionId); // 强制关联父ID,确保数据一致性 - newList.add(option); - } - } - newList = newList == null ? Collections.emptyList() : newList; - - // 3. 构建原数据ID映射(快速查找) - Map oldIdMap = oldList.stream() - .filter(Objects::nonNull) - .filter(item -> item.getId() != null) - .collect(Collectors.toMap(DocStatisticsDefinitionOption::getId, item -> item)); - - // 4. 提取新数据中的有效ID集合 - Set newIds = newList.stream() - .map(DocStatisticsDefinitionOption::getId) - .filter(Objects::nonNull) - .collect(Collectors.toSet()); - - // 5. 确定需要删除的项(原数据存在但新数据不存在) - List deleteIds = oldList.stream() - .map(DocStatisticsDefinitionOption::getId) - .filter(id -> !newIds.contains(id)) - .collect(Collectors.toList()); - - // 6. 区分新增和修改的项 - List addList = new ArrayList<>(); - List updateList = new ArrayList<>(); - for (DocStatisticsDefinitionOption newItem : newList) { - Long newItemId = newItem.getId(); - if (newItemId != null && oldIdMap.containsKey(newItemId)) { - // 有ID且原数据存在 → 修改 - updateList.add(newItem); - } else { - // 无ID或原数据不存在 → 新增 - addList.add(newItem); - } - } - - // 7. 执行删除操作 - if (!deleteIds.isEmpty()) { - boolean deleteSuccess = docStatisticsDefinitionOptionService.removeByIds(deleteIds); - if (!deleteSuccess) { - return R.fail("统计项选项删除失败"); - } - } - - // 8. 执行修改操作 - if (!updateList.isEmpty()) { - boolean updateSuccess = docStatisticsDefinitionOptionService.updateBatchById(updateList); - if (!updateSuccess) { - return R.fail("统计项选项更新失败"); - } - } - - // 9. 执行新增操作 - if (!addList.isEmpty()) { - boolean addSuccess = docStatisticsDefinitionOptionService.saveBatch(addList); - if (!addSuccess) { - return R.fail("统计项选项新增失败"); - } - } - - return R.ok("统计项选项更新成功"); - } - - /** - * 删除单个统计项选项 - * - * @param id 选项ID - */ - @Override - public R deleteDocStatisticsDefinitionOptionById(Long id) { - if (id == null) { - return R.fail("统计项选项ID为空,请选择要删除的统计项选项"); - } - - // 先校验数据是否存在 - DocStatisticsDefinitionOption existingOption = docStatisticsDefinitionOptionService.getById(id); - if (existingOption == null) { - return R.fail("统计项选项不存在,删除失败"); - } - // 执行删除 - boolean deleteSuccess = docStatisticsDefinitionOptionService.removeById(id); - if (deleteSuccess) { - return R.ok("统计项选项删除成功"); - } else { - return R.fail("统计项选项删除失败"); - } - } - - /** - * 根据统计定义ID查询选项列表 - * - * @param docStatisticsDefinitionId 统计定义ID - */ - @Override - public DocStatisticsDefinitionOptionList getDocStatisticsDefinitionOptionByDefinitionId(Long docStatisticsDefinitionId) { - - // 修复原查询条件错误:原逻辑用ID查ID,改为用统计定义ID查关联选项 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(DocStatisticsDefinitionOption::getDocStatisticsDefinitionId, docStatisticsDefinitionId) - .orderByAsc(DocStatisticsDefinitionOption::getDisplayOrder); // 按显示顺序排序 - - List optionList = docStatisticsDefinitonOptionMapper.selectList(queryWrapper); - if (optionList == null || optionList.isEmpty()) { - return null; - } - // 实体转DTO - List dtoList = new ArrayList<>(); - for (DocStatisticsDefinitionOption option : optionList) { - DocStatisticsDefinitionOptionDto dto = new DocStatisticsDefinitionOptionDto(); - dto.setId(option.getId()); - dto.setOption(option.getOption()); - dto.setDisplayOrder(option.getDisplayOrder()); - dtoList.add(dto); - } - - // 封装返回结果 - DocStatisticsDefinitionOptionList resultList = new DocStatisticsDefinitionOptionList(); - resultList.setDocStatisticsDefinitionId(docStatisticsDefinitionId); - resultList.setOptions(dtoList); - - return resultList; - } - - /** - * 获取文档模板 统计项选项列表 - */ - @Override - public AjaxResult getDocStatisticsDefinitionOptionList() { - return null; - } -} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsDefinitionController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsDefinitionController.java index d804e34e95fb9fd7a48274d934e945f9eae206be..33026be9f9a2af568e614a504fcd8e9d285675b0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsDefinitionController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsDefinitionController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -78,29 +79,6 @@ public class DocStatisticsDefinitionController { public R deleteDocStatisticsDefinition(Long id) { return docStatisticsDefinitionAppService.deleteDocStatisticsDefinition(id); } - - /** - * 根据id获取统计定义详情 - * - * @param id - * @return - */ - @GetMapping("/getDocStatisticsDefinitionById") - public R getDocStatisticsDefinitionById(Long id) { - return docStatisticsDefinitionAppService.getDocStatisticsDefinitionById(id); - } - - /** - * 根据code获取统计定义详情 - * - * @param code - * @return - */ - @GetMapping("/getDocStatisticsDefinitionByCode") - public R getDocStatisticsDefinitionByCode(String code) { - return docStatisticsDefinitionAppService.getDocStatisticsDefinitionByCode(code); - } - /** * 分页查询列表-不包含options * @@ -116,9 +94,30 @@ public class DocStatisticsDefinitionController { @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { return docStatisticsDefinitionAppService.getPageList(pageNo, pageSize, searchKey, request); } - /** - * 获取文档统计定义选项列表并按指定格式返回 + * 获取文档统计定义列表-不包含options,即字典数据 + * + * @param isStatistics 文档统计定义是否启用 0:不统计 1:统计 可不传 + * @return + */ + @GetMapping("/getList") + public R getList(Integer isStatistics){ + List list = docStatisticsDefinitionAppService.getList(isStatistics); + return R.ok(list); + } + /** + * 获取文档统计定义列表(包含options,即字典数据) + * + * @param isStatistics 文档统计定义是否启用 0:不统计 1:统计 可不传 + * @return + */ + @GetMapping("/getListWithOptionList") + public RgetListWithOptionList(Integer isStatistics){ + List list = docStatisticsDefinitionAppService.getListWithOptionList(isStatistics); + return R.ok(list); + } + /** + * 获取文档统计定义选项列表并按指定格式返回-已作废 * * @return */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsOptionController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsOptionController.java deleted file mode 100644 index 10ee295535424dd163451ab9bbcd85ddec19ae5f..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/controller/DocStatisticsOptionController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.openhis.web.document.controller; - -import com.openhis.web.document.appservice.IDocRecordAppService; -import com.openhis.web.document.appservice.IDocStatisticsDefinitionOptionAppService; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 文文统计选项 controller - * - * @author wanghaiming - * @date 2025-08-12 - */ -@RestController -@RequestMapping("/document/statisticsOption") -@Slf4j -@AllArgsConstructor -public class DocStatisticsOptionController { - - private final IDocStatisticsDefinitionOptionAppService docStatisticsDefinitionOptionAppService; - - -} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/dto/DocStatisticsDefinitionDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/dto/DocStatisticsDefinitionDto.java index 35769cafacd2e263ff0665634604c06eed558e14..a5b6651049500ad35dddca631eed1dda87c367d3 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/dto/DocStatisticsDefinitionDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/dto/DocStatisticsDefinitionDto.java @@ -1,5 +1,7 @@ package com.openhis.web.document.dto; +import com.core.common.annotation.Excel; +import com.core.common.core.domain.entity.SysDictData; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -48,9 +50,16 @@ public class DocStatisticsDefinitionDto { */ private Integer displayOrder; - /* - 统计类型定义选项值 - */ - private DocStatisticsDefinitionOptionList optionList; + private String defaultValue; + +// /* +// 统计类型定义选项值 +// */ + private List optionList; + /** 字典名称 */ + private String dictName; + + /** 字典类型 */ + private String dictType; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/IBankPosCloudAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/IBankPosCloudAppService.java new file mode 100644 index 0000000000000000000000000000000000000000..78b831cb50c418743d304d2ebe754cbce041e7d3 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/IBankPosCloudAppService.java @@ -0,0 +1,11 @@ +package com.openhis.web.externalintegration.appservice; + +/** + * BPC商户接口Service接口 + * + * @author GuoRui + * @date 2025-10-16 + */ +public interface IBankPosCloudAppService { + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/IFoodborneAcquisitionAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/IFoodborneAcquisitionAppService.java new file mode 100644 index 0000000000000000000000000000000000000000..fc15f5eff7a5182a8a7f8953d9621a250eca7343 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/IFoodborneAcquisitionAppService.java @@ -0,0 +1,20 @@ +package com.openhis.web.externalintegration.appservice; + +import com.core.common.core.domain.R; + +/** + * 食源性疾病病例数据智能采集Service接口 + * + * @author GuoRui + * @date 2025-10-10 + */ +public interface IFoodborneAcquisitionAppService { + + /** + * 是否是食源性诊断 + * + * @param encounterId 就诊ID + * @return 是否 + */ + R isFoodDiseasesNew(Long encounterId); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/impl/BankPosCloudAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/impl/BankPosCloudAppServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..af70afcf9197f004d8045c06f302a5b22b87b15f --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/impl/BankPosCloudAppServiceImpl.java @@ -0,0 +1,418 @@ +package com.openhis.web.externalintegration.appservice.impl; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson.JSON; +import com.core.common.core.domain.R; +import com.core.common.enums.TenantOptionDict; +import com.core.web.util.TenantOptionUtil; +import com.openhis.web.externalintegration.appservice.IBankPosCloudAppService; +import com.openhis.web.externalintegration.dto.BpcTransactionRequestDto; +import com.openhis.web.externalintegration.dto.BpcTransactionResponseDto; +import com.openhis.web.externalintegration.enums.BpcPayType; +import com.openhis.web.externalintegration.enums.BpcTranType; +import com.openhis.web.externalintegration.utils.BpcHttpUtil; +import com.openhis.web.externalintegration.utils.BpcTraceNoGenerator; + +import lombok.extern.slf4j.Slf4j; + +/** + * BPC商户接口Service业务层处理 + * + * @author GuoRui + * @date 2025-10-16 + */ +@Slf4j +@Service +public class BankPosCloudAppServiceImpl implements IBankPosCloudAppService { + + /** + * 被扫消费 + * + * @param txnAmt 交易金额 + * @param merTradeNo 商户系统订单号 + * @param scanCode 二维码信息 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R processConsumerScan(String txnAmt, String merTradeNo, String scanCode, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(txnAmt)) { + return R.fail("交易金额不能为空"); + } + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + if (StringUtils.isEmpty(scanCode)) { + return R.fail("二维码信息不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,被扫消费 + .setTranType(BpcTranType.C.getValue()) + // 交易金额 + .setTxnAmt(txnAmt) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 二维码信息 + .setScanCode(scanCode) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC被扫消费】,交易金额:{},商户系统订单号:{},二维码信息:{},设备终端编号:{}", txnAmt, merTradeNo, scanCode, posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 主扫下单 + * + * @param txnAmt 交易金额 + * @param merTradeNo 商户系统订单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R createMerchantScanOrder(String txnAmt, String merTradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(txnAmt)) { + return R.fail("交易金额不能为空"); + } + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,主扫下单 + .setTranType(BpcTranType.F.getValue()) + // 交易金额 + .setTxnAmt(txnAmt) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC主扫下单】,交易金额:{},商户系统订单号:{},设备终端编号:{}", txnAmt, merTradeNo, posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 消费订单查询 + * + * @param merTradeNo 商户系统订单号 + * @param tradeNo 原交易订单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R queryPaymentOrder(String merTradeNo, String tradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + // if (StringUtils.isEmpty(tradeNo)) { + // return R.fail("原交易订单号不能为空"); + // } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,支付结果查询 + .setTranType(BpcTranType.G.getValue()) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 原交易订单号 + .setTradeNo(tradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC消费订单查询】,商户系统订单号:{},原交易订单号:{},设备终端编号:{}", merTradeNo, tradeNo, posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 关闭订单 + * + * @param merTradeNo 商户系统订单号 + * @param tradeNo 原交易订单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R closeOrder(String merTradeNo, String tradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + if (StringUtils.isEmpty(tradeNo)) { + return R.fail("原交易订单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,关闭订单 + .setTranType(BpcTranType.S.getValue()) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 原交易订单号 + .setTradeNo(tradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC关闭订单】,商户系统订单号:{},原交易订单号:{},设备终端编号:{}", merTradeNo, tradeNo, posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 申请退货 + * + * @param txnAmt 交易金额 + * @param vfTradeNo 退款退订定金单号 + * @param merTradeNo 商户系统订单号 + * @param tradeNo 原交易订单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R applyForRefund(String txnAmt, String vfTradeNo, String merTradeNo, String tradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(txnAmt)) { + return R.fail("交易金额不能为空"); + } + if (StringUtils.isEmpty(vfTradeNo)) { + return R.fail("退款退订定金单号不能为空"); + } + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + if (StringUtils.isEmpty(tradeNo)) { + return R.fail("原交易订单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,退货 + .setTranType(BpcTranType.R.getValue()) + // 交易金额 + .setTxnAmt(txnAmt) + // 退款退订定金单号 + .setVfTradeNo(vfTradeNo) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 原交易订单号 + .setTradeNo(tradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC申请退货】,交易金额:{},退款退订定金单号:{},商户系统订单号:{},原交易订单号:{},设备终端编号:{}", txnAmt, vfTradeNo, merTradeNo, tradeNo, + posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 查询退货订单 + * + * @param vfTradeNo 退款退订定金单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R queryRefundOrder(String vfTradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(vfTradeNo)) { + return R.fail("退款退订定金单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,退款结果查询 + .setTranType(BpcTranType.J.getValue()) + // 退款退订定金单号 + .setVfTradeNo(vfTradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC查询退货订单】,退款退订定金单号:{}", vfTradeNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 消费撤销 + * + * @param txnAmt 交易金额 + * @param vfTradeNo 退款退订定金单号 + * @param merTradeNo 商户系统订单号 + * @param tradeNo 原交易订单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R reversePayment(String txnAmt, String vfTradeNo, String merTradeNo, String tradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(txnAmt)) { + return R.fail("交易金额不能为空"); + } + if (StringUtils.isEmpty(vfTradeNo)) { + return R.fail("退款退订定金单号不能为空"); + } + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + if (StringUtils.isEmpty(tradeNo)) { + return R.fail("原交易订单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,消费撤销 + .setTranType(BpcTranType.D.getValue()) + // 交易金额 + .setTxnAmt(txnAmt) + // 退款退订定金单号 + .setVfTradeNo(vfTradeNo) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 原交易订单号 + .setTradeNo(tradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC消费撤销】,交易金额:{},退款退订定金单号:{},商户系统订单号:{},原交易订单号:{},设备终端编号:{}", txnAmt, vfTradeNo, merTradeNo, tradeNo, + posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 查询撤销订单 + * + * @param merTradeNo 商户系统订单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R queryReversalOrder(String merTradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(merTradeNo)) { + return R.fail("商户系统订单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,撤销结果查询 + .setTranType(BpcTranType.Z.getValue()) + // 商户系统订单号 + .setMerTradeNo(merTradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC查询撤销订单】,商户系统订单号:{},设备终端编号:{}", merTradeNo, posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 银行卡退货功能 + * + * @param txnAmt 交易金额 + * @param pan 银行卡号 + * @param vfTradeNo 退款退订定金单号 + * @param posNo 设备终端编号 + * @return 结果 + */ + public R processCardRefund(String txnAmt, String pan, String vfTradeNo, String posNo) { + // 参数验证 + if (StringUtils.isEmpty(txnAmt)) { + return R.fail("交易金额不能为空"); + } + if (StringUtils.isEmpty(pan)) { + return R.fail("银行卡号不能为空"); + } + if (StringUtils.isEmpty(vfTradeNo)) { + return R.fail("退款退订定金单号不能为空"); + } + if (StringUtils.isEmpty(posNo)) { + return R.fail("设备终端编号不能为空"); + } + // 作成请求参数 + BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto() + // 交易类型,退货 + .setTranType(BpcTranType.R.getValue()) + // 交易金额 + .setTxnAmt(txnAmt) + // 终端流水号 + .setPayType(BpcPayType.BANK_CARD.getValue()) + // 银行卡号 + .setPan(pan) + // 退款退订定金单号 + .setVfTradeNo(vfTradeNo) + // 设备终端编号 + .setPosNo(posNo); + log.info("【BPC银行卡退货功能】,交易金额:{},银行卡号:{},退款退订定金单号:{},设备终端编号:{}", txnAmt, pan, vfTradeNo, posNo); + // 发起交易请求 + return submitTransactionRequest(requestDto); + } + + /** + * 发送交易请求 + * + * @param requestDto 请求参数 + * @return 结果 + */ + private R submitTransactionRequest(BpcTransactionRequestDto requestDto) { + // 验证租户配置 + String mid = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_MID); + if (StringUtils.isEmpty(mid)) { + return R.fail("BPC商户号未配置"); + } + String tid = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_TID); + if (StringUtils.isEmpty(tid)) { + return R.fail("BPC终端号未配置"); + } + String md5SharedSecret = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_MD5_SHARED_SECRET); + if (StringUtils.isEmpty(md5SharedSecret)) { + return R.fail("BPCMD5签名密钥未配置"); + } + String requestUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_REQUEST_URL); + if (StringUtils.isEmpty(requestUrl)) { + return R.fail("BPC请求URL未配置"); + } + // 生成终端流水号 + String traceNo = BpcTraceNoGenerator.nextTraceNo(); + // 设置请求终端流水号 + requestDto.setTraceNo(traceNo); + // 设置其他固定参数 + requestDto.setMid(mid).setTid(tid); + // 将参数转化为json字符串 + String jsonStr = JSON.toJSONString(requestDto); + log.info("【BPC请求报文】:{}", jsonStr); + // 发起post请求 + String postResponse; + try { + postResponse = BpcHttpUtil.httpPost(jsonStr, md5SharedSecret, requestUrl); + } catch (Exception e) { + return R.fail(e.getMessage()); + } + log.info("【BPC响应报文】:{}", postResponse); + // 解析响应报文 + BpcTransactionResponseDto responseDto; + try { + responseDto = JSON.parseObject(postResponse, BpcTransactionResponseDto.class); + if (StringUtils.isNotEmpty(responseDto.getTraceNo()) && !traceNo.equals(responseDto.getTraceNo())) { + return R.fail("终端流水号不一致,交易失败"); + } + } catch (Exception e) { + return R.fail("报文解析失败"); + } + // 返回响应结果 + return R.ok(responseDto); + } +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/impl/FoodborneAcquisitionAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/impl/FoodborneAcquisitionAppServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..af560706f83988cd24a8bd532c7536de2bc11302 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/appservice/impl/FoodborneAcquisitionAppServiceImpl.java @@ -0,0 +1,176 @@ +package com.openhis.web.externalintegration.appservice.impl; + +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.core.common.core.domain.R; +import com.core.common.enums.TenantOptionDict; +import com.core.common.utils.StringUtils; +import com.core.web.util.TenantOptionUtil; +import com.openhis.common.enums.*; +import com.openhis.common.utils.CommonUtil; +import com.openhis.web.externalintegration.appservice.IFoodborneAcquisitionAppService; +import com.openhis.web.externalintegration.dto.FaSimplediseaseAddNopwParam; +import com.openhis.web.externalintegration.mapper.FoodborneAcquisitionAppMapper; + +import lombok.extern.slf4j.Slf4j; + +/** + * 食源性疾病病例数据智能采集Service业务层处理 + * + * @author GuoRui + * @date 2025-10-10 + */ +@Slf4j +@Service +public class FoodborneAcquisitionAppServiceImpl implements IFoodborneAcquisitionAppService { + @Autowired + private FoodborneAcquisitionAppMapper foodborneAcquisitionAppMapper; + + /** + * 是否是食源性诊断 + * + * @param encounterId 就诊ID + * @return 是否 + */ + @Override + public R isFoodDiseasesNew(Long encounterId) { + // 判断食源性开关状态 + String foodborneSwitch = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_SWITCH); + if (!Whether.YES.getCode().equals(foodborneSwitch)) { + // 开关未开启时,返回空OK结果,跳过处理 + return R.ok(); + } + // 判断食源性接口地址是否为空 + String foodborneApiUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_API_URL); + if (StringUtils.isEmpty(foodborneApiUrl)) { + return R.fail("【食源性判断接口】租户配置项「食源性接口地址」未配置"); + } + // 判断食源性医疗机构是否为空 + String foodborneHospital = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_HOSPITAL); + if (StringUtils.isEmpty(foodborneHospital)) { + return R.fail("【食源性判断接口】租户配置项「食源性医疗机构」未配置"); + } + // 判断食源性登录账号是否为空 + String foodborneUserName = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_USER_NAME); + if (StringUtils.isEmpty(foodborneUserName)) { + return R.fail("【食源性判断接口】租户配置项「食源性登录账号」未配置"); + } + // 定义诊断列表参数 + List diagnosisNameList = new ArrayList<>(); + + // TODO:郭睿 等待从doc_statistics表取主诉诊断 + + // 查询就诊诊断内容列表 + List encounterDiagnosisConditionNameList = + foodborneAcquisitionAppMapper.selectEncounterDiagnosisConditionNameList(encounterId); + diagnosisNameList.addAll(encounterDiagnosisConditionNameList); + // 判断诊断是否为空 + if (diagnosisNameList.isEmpty()) { + return R.fail("【食源性判断接口】未找到有效诊断"); + } + // 设置超时时间 + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).setConnectionRequestTimeout(3000) + .setSocketTimeout(30000).build(); + // 创建无视SSL验证的HttpClient + CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig) + .setSSLSocketFactory(CommonUtil.createIgnoreSslSocketFactory()).build(); + CloseableHttpResponse response = null; + // 发起HTTP请求 + try { + // 对参数值进行URL编码 + String encodedDiagnosisName = + URLEncoder.encode(String.join(",", diagnosisNameList), StandardCharsets.UTF_8.toString()); + // 拼接完整的请求URL + String requestUrl = foodborneApiUrl + "/isFoodDiseasesNew?diagnosisName=" + encodedDiagnosisName; + // 创建HttpGet对象并设置URL + HttpGet httpGet = new HttpGet(requestUrl); + // 执行请求 + response = httpClient.execute(httpGet); + // 获取响应 + JSONObject object = + JSON.parseObject(EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8.toString())); + log.info("【食源性判断接口】入参encounterId:{}返回值:{}", encounterId, object.toString()); + // 判断返回的result字段 + String result = String.valueOf(object.getInnerMap().get("result")); + if (!"true".equals(result)) { + // 返回不是true时,返回空OK结果,跳过处理 + return R.ok(); + } + // 查询食源性疾病病例数据智能采集上报跳转页面所需参数 + FaSimplediseaseAddNopwParam simplediseaseAddNopwParam = foodborneAcquisitionAppMapper + .selectSimplediseaseAddNopwParam(encounterId, AdministrativeGender.MALE.getValue(), + AdministrativeGender.FEMALE.getValue(), EncounterType.FOLLOW_UP.getValue(), + EncounterClass.IMP.getValue(), ParticipantType.ADMITTER.getCode()); + if (simplediseaseAddNopwParam == null) { + return R.fail("【食源性判断接口】跳转参数查询失败"); + } + // 返回的标识字段 fillGuid + String fillGuid = String.valueOf(object.getInnerMap().get("fillGuid")); + // 拼装参数,作成跳转URL + String jumpUrl = foodborneApiUrl + "/SimplediseaseAddNopw" + "?diseaseDate=" + + simplediseaseAddNopwParam.getDiseaseDate() + "&diseaseTreattime=" + + simplediseaseAddNopwParam.getDiseaseTreattime() + "&outPatientNumber=" + + URLEncoder.encode(simplediseaseAddNopwParam.getOutPatientNumber(), StandardCharsets.UTF_8.toString()) + + "&patientName=" + + URLEncoder.encode(simplediseaseAddNopwParam.getPatientName(), StandardCharsets.UTF_8.toString()) + + "&diseaseSex=" + simplediseaseAddNopwParam.getDiseaseSex() + "&guarderName=" + + URLEncoder.encode(simplediseaseAddNopwParam.getGuarderName(), StandardCharsets.UTF_8.toString()) + + "&diseaseIsreexam=" + simplediseaseAddNopwParam.getDiseaseIsreexam() + "&diseaseIspaint=" + + simplediseaseAddNopwParam.getDiseaseIspaint() + "&diseaseHospitalno=" + + simplediseaseAddNopwParam.getDiseaseHospitalno() + "&identityCard=" + + Optional.ofNullable(simplediseaseAddNopwParam.getIdentityCard()).orElse("") + "&diseaseBirthday=" + + Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseBirthday()).orElse("") + "&phoneNumber=" + + Optional.ofNullable(simplediseaseAddNopwParam.getPhoneNumber()).orElse("") + "&workUnit=" + + URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getWorkUnit()).orElse(""), + StandardCharsets.UTF_8.toString()) + + "&deathDate=" + Optional.ofNullable(simplediseaseAddNopwParam.getDeathDate()).orElse("") + + "&fillingDoctorName=" + + URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getFillingDoctorName()).orElse(""), + StandardCharsets.UTF_8.toString()) + + "&medicalInstiSeHospital=" + foodborneHospital + "&diseaseHometown=" + "&diseaseProvince=" + + URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseProvince()).orElse(""), + StandardCharsets.UTF_8.toString()) + + "&diseaseCity=" + + URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseCity()).orElse(""), + StandardCharsets.UTF_8.toString()) + + "&diseaseDistrict=" + + URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseDistrict()).orElse(""), + StandardCharsets.UTF_8.toString()) + + "&diseaseAddress=" + + URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseAddress()).orElse(""), + StandardCharsets.UTF_8.toString()) + + "&diseaseOccupation=23009012" + "&uName=" + foodborneUserName + "&fillGuid=" + fillGuid; + // 返回非空OK结果,并携带跳转URL + return R.ok(jumpUrl); + } catch (Exception e) { + log.error(e.getMessage(), e); + return R.fail("【食源性判断接口】发生异常:" + e.getMessage()); + } finally { + if (response != null) { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + } + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/controller/FoodborneAcquisitionAppController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/controller/FoodborneAcquisitionAppController.java new file mode 100644 index 0000000000000000000000000000000000000000..3d4bd70ce72a909c9bd60987c4d2bf568ba90867 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/controller/FoodborneAcquisitionAppController.java @@ -0,0 +1,35 @@ +package com.openhis.web.externalintegration.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import com.openhis.web.externalintegration.appservice.IFoodborneAcquisitionAppService; + +/** + * 食源性疾病病例数据智能采集Controller + * + * @author GuoRui + * @date 2025-10-10 + */ +@RestController +@RequestMapping("/external-integration/foodborne-acquisition") +public class FoodborneAcquisitionAppController { + + @Autowired + private IFoodborneAcquisitionAppService foodborneAcquisitionAppService; + + /** + * 是否是食源性诊断 + * + * @param encounterId 就诊ID + * @return 是否 + */ + @GetMapping("/is-food-diseases-new") + R isFoodDiseasesNew(@RequestParam("encounterId") Long encounterId) { + return foodborneAcquisitionAppService.isFoodDiseasesNew(encounterId); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcDataElementDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcDataElementDto.java new file mode 100644 index 0000000000000000000000000000000000000000..4e1fab55e0b0d69dfc542f0fc6e66597b2fcc8f1 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcDataElementDto.java @@ -0,0 +1,179 @@ +package com.openhis.web.externalintegration.dto; + +import org.hibernate.validator.constraints.Length; + +import com.alibaba.fastjson2.annotation.JSONField; + +import lombok.Data; + +/** + * 【BPC】数据元 + * + * @author GuoRui + * @date 2025-10-16 + */ +@Data +public class BpcDataElementDto { + + /** + * 设备终端编号:设备的唯一编号 + */ + @Length(max = 10) + @JSONField(name = "posNo") + private String posNo; + + /** + * 终端实时经纬度信息:格式为为纬度/经度,+表示北纬、东经,-表示南纬、西 经。例:+37.12/-121.213。例:+37.12/-121.213 + */ + @Length(max = 30) + @JSONField(name = "posGa") + private String posGa; + + /** + * 交易类型:(枚举TranType) + */ + @Length(max = 1) + @JSONField(name = "tranType") + private String tranType; + + /** + * 交易金额:以分为单位的交易金额 + */ + @Length(max = 12) + @JSONField(name = "txnAmt") + private String txnAmt; + + /** + * 支付方式:(枚举PayType) + */ + @Length(max = 4) + @JSONField(name = "payType") + private String payType; + + /** + * 交易流水号 + */ + @Length(max = 32) + @JSONField(name = "sysTrace") + private String sysTrace; + + /** + * 原交易流水号:支付结果查询、退货、退货结果查询交易需要传入 + */ + @Length(max = 32) + @JSONField(name = "orgSysTrace") + private String orgSysTrace; + + /** + * 原交易时间:(yyyyMMddHHmmss)该字段为消费成功后返回的日期时间,在做退货、退货结果查询时,需要传入原消费交易的日期时间 + */ + @Length(max = 14) + @JSONField(name = "orgTxnTime") + private String orgTxnTime; + + /** + * 二维码信息:支付二维码,扫码消费订单查询时传入 + */ + @Length(max = 64) + @JSONField(name = "scanCode") + private String scanCode; + + /** + * 支付订单号:扫码支付交易订单号,扫码支付退货时传入 + */ + @Length(max = 64) + @JSONField(name = "tradeNo") + private String tradeNo; + + /** + * 通知URL:交易延时响应时的交易结果通知URL + */ + @Length(max = 256) + @JSONField(name = "retUrl") + private String retUrl; + + /** + * 清算商户号 + */ + @Length(max = 15) + @JSONField(name = "mid") + private String mid; + + /** + * 商户名称 + */ + @Length(max = 64) + @JSONField(name = "merName") + private String merName; + + /** + * 终端号 + */ + @Length(max = 8) + @JSONField(name = "tid") + private String tid; + + /** + * 商户系统订单号:由商户系统产生 + */ + @Length(max = 64) + @JSONField(name = "merTradeNo") + private String merTradeNo; + + /** + * 银行优惠金额 + */ + @Length(max = 12) + @JSONField(name = "discountAmt") + private String discountAmt; + + /** + * 收款方备注 + */ + @Length(max = 64) + @JSONField(name = "txtRemarks") + private String txtRemarks; + + /** + * 实名认证标志:(枚举RealNameAuthFlag) + */ + @Length(max = 1) + @JSONField(name = "realNameAuth") + private String realNameAuth; + + /** + * 付款人姓名:当realNameAuth为1时必填 + */ + @Length(max = 64) + @JSONField(name = "payerName") + private String payerName; + + /** + * 付款人身份证件类型:(枚举PayerIdType)当realNameAuth为1时必填 + */ + @Length(max = 2) + @JSONField(name = "payerIDType") + private String payerIdType; + + /** + * 付款人身份证件号码:当realNameAuth为1时必填 + */ + @Length(max = 20) + @JSONField(name = "payerID") + private String payerId; + + /** + * 发起方IP地址:支持IPv6格式 + */ + @Length(max = 40) + @JSONField(name = "IP") + private String ip; + + /** + * 终端设备类型:(枚举DeviceType) + */ + @Length(max = 2) + @JSONField(name = "deviceType") + private String deviceType; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcPaymentScanNotifyDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcPaymentScanNotifyDto.java new file mode 100644 index 0000000000000000000000000000000000000000..a516fb57b63f4e42f8f85810bab32234bc3240e1 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcPaymentScanNotifyDto.java @@ -0,0 +1,113 @@ +package com.openhis.web.externalintegration.dto; + +import org.hibernate.validator.constraints.Length; + +import com.alibaba.fastjson2.annotation.JSONField; + +import lombok.Data; + +/** + * 【BPC】主扫支付结果通知 + * + * @author GuoRui + * @date 2025-10-16 + */ +@Data +public class BpcPaymentScanNotifyDto { + + /** + * 商户系统订单号:申码交易商户系统订单号 + */ + @Length(max = 64) + @JSONField(name = "merTradeNo") + private String merTradeNo; + + /** + * 原交易订单号:银行订单号 + */ + @Length(max = 64) + @JSONField(name = "orgSysTrace") + private String orgSysTrace; + + /** + * 银行交易日期 + */ + @JSONField(name = "bankDate") + private String bankDate; + + /** + * 银行交易时间 + */ + @JSONField(name = "bankTime") + private String bankTime; + + /** + * 原申码订单号 + */ + @Length(max = 64) + @JSONField(name = "oldQrOrderNo") + private String oldQrOrderNo; + + /** + * 原商户号 + */ + @JSONField(name = "oldTermId") + private String oldTermId; + + /** + * 原支付方式 + */ + @JSONField(name = "oldPayType") + private String oldPayType; + + /** + * 原银行交易日期 + */ + @JSONField(name = "oldBankDate") + private String oldBankDate; + + /** + * 原银行交易时间 + */ + @JSONField(name = "oldBankTime") + private String oldBankTime; + + /** + * 原交易返回码 + */ + @JSONField(name = "oldRespCode") + private String oldRespCode; + + /** + * 原交易返回信息 + */ + @JSONField(name = "oldRespMsg") + private String oldRespMsg; + + /** + * 微信交易单号:仅OldPayType=WEIX 时此域有值 + */ + @Length(max = 64) + @JSONField(name = "oldTradeId") + private String oldTradeId; + + /** + * 支付宝交易单号:仅OldPayType=ZFBA 时此域有值 + */ + @Length(max = 64) + @JSONField(name = "oldTradeNo") + private String oldTradeNo; + + /** + * 响应码:00 表示成功,其它表示失败 + */ + @JSONField(name = "respCode") + private String respCode; + + /** + * 响应码解释信息 + */ + @JSONField(name = "respMsg") + private String respMsg; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcTransactionRequestDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcTransactionRequestDto.java new file mode 100644 index 0000000000000000000000000000000000000000..a59fe041a72a5578a9fc957954813403f2dd0c03 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcTransactionRequestDto.java @@ -0,0 +1,224 @@ +package com.openhis.web.externalintegration.dto; + +import org.hibernate.validator.constraints.Length; + +import com.alibaba.fastjson2.annotation.JSONField; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 【BPC】交易请求 + * + * @author GuoRui + * @date 2025-10-16 + */ +@Data +@Accessors(chain = true) +public class BpcTransactionRequestDto { + + /** + * 设备终端编号:设备的唯一编号(必填) + */ + @Length(max = 10) + @JSONField(name = "posNo") + private String posNo; + + /** + * 终端实时经纬度信息:(最新,甲方确认可以不传)tranType为C时必填,格式为为纬度/经度,+表示北纬、东经,-表示南纬、西 经。例:+37.12/-121.213。例:+37.12/-121.213 + */ + @Length(max = 30) + @JSONField(name = "posGa") + private String posGa; + + /** + * 交易类型:(枚举TranType) + */ + @Length(max = 1) + @JSONField(name = "tranType") + private String tranType; + + /** + * 交易金额:以分为单位的交易金额 + */ + @Length(max = 12) + @JSONField(name = "txnAmt") + private String txnAmt; + + /** + * 银行优惠金额:撤销、退货交易时填写原消费交易的优惠金额,可以不填 + */ + @Length(max = 12) + @JSONField(name = "discountAmt") + private String discountAmt; + + /** + * 支付方式:(枚举PayType)当tranType为F时,payType不填写返回聚合码scanCode填写则返回订单数据payData(部分收单行支持) + */ + @Length(max = 4) + @JSONField(name = "payType") + private String payType; + + /** + * 二维码信息:被扫交易,采集到的手机支付二维码信息,主扫交易该字段为空 + */ + @Length(max = 64) + @JSONField(name = "scanCode") + private String scanCode; + + /** + * 商户编号 + */ + @Length(max = 15) + @JSONField(name = "mid") + private String mid; + + /** + * 终端编号(可以不填) + */ + @Length(max = 8) + @JSONField(name = "tid") + private String tid; + + /** + * 终端流水号:终端号系统跟踪号,从 000001 开始到 999999 循环,应答报文原值返回,客户端收到应答报文需要验证traceNo字段值,如果不一致则丢包交易失败 + */ + @Length(max = 6) + @JSONField(name = "traceNo") + private String traceNo; + + /** + * 商品名称:自定义商品名称(可以不填,默认为“商品”) + */ + @Length(max = 200) + @JSONField(name = "goodsName") + private String goodsName; + + /** + * 原交易订单号:银行订单号(可以不填) + */ + @Length(max = 64) + @JSONField(name = "tradeNo") + private String tradeNo; + + /** + * 原交易日期时间:(yyyyMMddHHmmss)撤销、退货时填写原消费交易返回的时间日期 + */ + @Length(max = 14) + @JSONField(name = "orgTxnTime") + private String orgTxnTime; + + /** + * 商户系统订单号:商户系统订单号,消费交易、定金交易,商户生成唯一订单号(如果不能生成,可以向扫码平台申请商户系统订单号);支付结果查询、定金支付结果查询、消费撤销、 + * 消费撤销结果查询、退货交易需要传入原消费或定金交易商户系统订单号;退订、定金确认,填写原定金交易订单号;定金确认撤销、定金确认撤销结果查询,填写定金确认订单号 + */ + @Length(max = 64) + @JSONField(name = "merTradeNo") + private String merTradeNo; + + /** + * 退款退订定金单号:商户系统退货、退订、定金确认订单号(如果不能生成,可以向扫码平台申请商户系统订单号);退货结果查询、退订结果查询、定金确认查询,需要传入原商户系统退货单号 + */ + @Length(max = 64) + @JSONField(name = "vfTradeNo") + private String vfTradeNo; + + /** + * 有效时间:主扫二维码有效时间(可以不填,部分收单行不支持) + */ + @Length(max = 6) + @JSONField(name = "qrValidTime") + private String qrValidTime; + + /** + * 通知URL:主扫交易延时响应时的交易结果通知URL(可以不填) + */ + @Length(max = 256) + @JSONField(name = "retUrl") + private String retUrl; + + /** + * 支付成功回调地址:主扫交易当使用微信和支付宝支付成功后,前端可通过此地址回调到商户提供的地址。注意:地址必须以 HTTP 或 HTTPS 开头,且 HTTPS 必须为颁发的有效证书。 + * 回调地址不支持换行符等不可见字符以及特殊字符(可以不填,部分收单行不支持)微信需要对接微信点金计划,详情请参考微信相关文档 + */ + @Length(max = 128) + @JSONField(name = "callBackUrl") + private String callBackUrl; + + /** + * 商户应用ID:当tranType为F时,payType 值为ZFBA或WEIX时需填写 + */ + @Length(max = 32) + @JSONField(name = "subAppId") + private String subAppId; + + /** + * 商户用户openId:当tranType为F时,payType 值为ZFBA或WEIX时需填写。当上送wxApiType字段时,可以不用填写。 + */ + @Length(max = 64) + @JSONField(name = "subOpenId") + private String subOpenId; + + /** + * 微信API类型:当业务场景为微信APP支付时,填写固定值APP,其余交易不送该字段 + */ + @Length(max = 10) + @JSONField(name = "wxApiType") + private String wxApiType; + + /** + * 收款方备注 + */ + @Length(max = 64) + @JSONField(name = "txtRemarks") + private String txtRemarks; + + /** + * 实名标志:(枚举RealNameAuthFlag) + */ + @Length(max = 1) + @JSONField(name = "realNameAuth") + private String realNameAuth; + + /** + * 付款人姓名:当realNameAuth为1时必填 + */ + @Length(max = 64) + @JSONField(name = "payerName") + private String payerName; + + /** + * 付款人身份证件类型:当realNameAuth为1时必填 + */ + @Length(max = 2) + @JSONField(name = "payerIDType") + private String payerIdType; + + /** + * 付款人身份证件号码:当realNameAuth为1时必填 + */ + @Length(max = 20) + @JSONField(name = "payerID") + private String payerId; + + /** + * 发起方IP地址:支持IPv6格式 + */ + @Length(max = 40) + @JSONField(name = "IP") + private String ip; + + /** + * 终端类型:(枚举DeviceType) + */ + @Length(max = 2) + @JSONField(name = "deviceType") + private String deviceType; + + /** + * 银行卡号 + */ + @JSONField(name = "pan") + private String pan; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcTransactionResponseDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcTransactionResponseDto.java new file mode 100644 index 0000000000000000000000000000000000000000..2b35902be2ef9ce2fce652d672610988976c7500 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/BpcTransactionResponseDto.java @@ -0,0 +1,158 @@ +package com.openhis.web.externalintegration.dto; + +import org.hibernate.validator.constraints.Length; + +import com.alibaba.fastjson2.annotation.JSONField; + +import lombok.Data; + +/** + * 【BPC】交易回应 + * + * @author GuoRui + * @date 2025-10-16 + */ +@Data +public class BpcTransactionResponseDto { + + /** + * 响应码:(枚举RespCode)00 表示成功,其它表示失败 + */ + @Length(max = 2) + @JSONField(name = "respCode") + private String respCode; + + /** + * 响应码解释信息(需要Base64解密) + */ + @Length(max = 64) + @JSONField(name = "respMsg") + private String respMsg; + + /** + * 交易类型:(枚举TranType) + */ + @Length(max = 1) + @JSONField(name = "tranType") + private String tranType; + + /** + * 交易金额:以分为单位的交易金额(订单总金额,同请求金额一致) + */ + @Length(max = 12) + @JSONField(name = "txnAmt") + private String txnAmt; + + /** + * 支付方式:(枚举PayType) + */ + @Length(max = 4) + @JSONField(name = "payType") + private String payType; + + /** + * 终端流水号:终端号系统跟踪号,同请求报文原值返回,客户端收到应答报文需要验证traceNo字段值,需与请求报文值一致,如果不一致则丢包交易失败 + */ + @Length(max = 6) + @JSONField(name = "traceNo") + private String traceNo; + + /** + * 交易时间:(yyyyMMddHHmmss) + */ + @Length(max = 14) + @JSONField(name = "txnTime") + private String txnTime; + + /** + * 支付订单号:银行返回系统订单号,需要保存该支付交易订单号 + */ + @Length(max = 64) + @JSONField(name = "tradeNo") + private String tradeNo; + + /** + * 第三方支付订单号 + */ + @Length(max = 64) + @JSONField(name = "transNo") + private String transNo; + + /** + * 商户号 + */ + @Length(max = 15) + @JSONField(name = "mid") + private String mid; + + /** + * 商户名称 + */ + @Length(max = 64) + @JSONField(name = "merName") + private String merName; + + /** + * 终端号 + */ + @Length(max = 8) + @JSONField(name = "tid") + private String tid; + + /** + * 商户系统订单号:同请求一致 + */ + @Length(max = 64) + @JSONField(name = "merTradeNo") + private String merTradeNo; + + /** + * 商户系统退款授权单号:同请求一致 + */ + @Length(max = 64) + @JSONField(name = "vfTradeNo") + private String vfTradeNo; + + /** + * 优惠金额 + */ + @Length(max = 12) + @JSONField(name = "discountAmt") + private String discountAmt; + + /** + * 有效时间:二维码本身的有效时间,是相对时间,单位为秒,以接收方收到报文时间为起始点计时。不同类型的订单以及不同的订单状况会对应不同的默认有效时间和最大有效时间(可以为空) + */ + @Length(max = 8) + @JSONField(name = "qrValidTime") + private String qrValidTime; + + /** + * 二维码信息:主扫支付二维码,以二维码形式显示,手机APP扫二维码码消费 + */ + @Length(max = 128) + @JSONField(name = "scanCode") + private String scanCode; + + /** + * 原交易类型:1、订单查询类交易填写原交易类型(被扫交易必填)2、非订单查询填写交易类型与tranType一致(可以为空) + */ + @Length(max = 1) + @JSONField(name = "orgTranType") + private String orgTranType; + + /** + * 原交易名称:订单查询类交易填写原交易名称,非订单查询填写交易名称(被扫交易必填) + */ + @Length(max = 30) + @JSONField(name = "orgTxnName") + private String orgTxnName; + + /** + * 订单数据:当tranType为F时,payType 值为ZFBA或WEIX时支付宝返回的tradeNo 或者微信返回的prepayId + */ + @Length(max = 64) + @JSONField(name = "payData") + private String payData; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/FaSimplediseaseAddNopwParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/FaSimplediseaseAddNopwParam.java new file mode 100644 index 0000000000000000000000000000000000000000..c7e99d4f081e904caead8be67ef814cdbc91dca4 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/dto/FaSimplediseaseAddNopwParam.java @@ -0,0 +1,113 @@ +package com.openhis.web.externalintegration.dto; + +import lombok.Data; + +/** + * 【食源性】跳转页面所需参数 + * + * @author GuoRui + * @date 2025-10-10 + */ +@Data +public class FaSimplediseaseAddNopwParam { + + /** + * 【必填】发病时间:YYYY-MM-DD HH:mm + */ + private String diseaseDate; + + /** + * 【必填】就诊时间:YYYY-MM-DD HH:mm + */ + private String diseaseTreattime; + + /** + * 门诊ID号 + */ + private String outPatientNumber; + + /** + * 【必填】患者姓名 + */ + private String patientName; + + /** + * 【必填】患者性别:0 女 1 男 + */ + private String diseaseSex; + + /** + * 监护人姓名 + */ + private String guarderName; + + /** + * 【必填】是否复诊:0否 1是 + */ + private String diseaseIsreexam; + + /** + * 【必填】是否住院:0否 1是 + */ + private String diseaseIspaint; + + /** + * 住院号:是否住院为是时必填 + */ + private String diseaseHospitalno; + + /** + * 身份证号 + */ + private String identityCard; + + /** + * 【必填】出生日期:YYYY-MM-DD + */ + private String diseaseBirthday; + + /** + * 【必填】联系电话 + */ + private String phoneNumber; + + /** + * 工作单位 + */ + private String workUnit; + + /** + * 死亡时间:YYYY-MM-DD HH:mm + */ + private String deathDate; + + /** + * 接诊医生 + */ + private String fillingDoctorName; + + /** + * 【必填】现住地址省 + */ + private String diseaseProvince; + + /** + * 【必填】现住地址市 + */ + private String diseaseCity; + + /** + * 【必填】现住地址区 + */ + private String diseaseDistrict; + + /** + * 【必填】现住地址具体 + */ + private String diseaseAddress; + + /** + * 【必填】职业:与国家平台编码保持一致 + */ + private Integer diseaseOccupation; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcPayType.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcPayType.java new file mode 100644 index 0000000000000000000000000000000000000000..ef09f8f0ebdebe1a004334d008fe0776b8cd0d21 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcPayType.java @@ -0,0 +1,59 @@ +package com.openhis.web.externalintegration.enums; + +/** + * 【BPC】支付方式 + * + * @author GuoRui + * @date 2025-10-16 + */ +public enum BpcPayType { + + /** + * 支付宝 + */ + ALIPAY("ZFBA", "支付宝"), + /** + * 微信 + */ + WECHAT("WEIX", "微信"), + /** + * 银联二维码 + */ + UNION_QR("UPAY", "银联二维码"), + /** + * 数字人民币 + */ + DIGITAL_RMB("DCEP", "数字人民币"), + /** + * 银行卡 + */ + BANK_CARD("0001", "银行卡"); + + private final String value; + private final String description; + + BpcPayType(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static BpcPayType getByValue(String value) { + if (value == null || "".equals(value.trim())) { + return null; + } + for (BpcPayType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcPayerIdType.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcPayerIdType.java new file mode 100644 index 0000000000000000000000000000000000000000..85246531b2ee8d1b517e918153ec09330bb7dc20 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcPayerIdType.java @@ -0,0 +1,83 @@ +package com.openhis.web.externalintegration.enums; + +/** + * 【BPC】付款人身份证件类型 + * + * @author GuoRui + * @date 2025-10-16 + */ +public enum BpcPayerIdType { + + /** + * 身份证 + */ + ID_CARD("0", "身份证"), + /** + * 护照 + */ + PASSPORT("1", "护照"), + /** + * 军官证 + */ + MILITARY_OFFICER_CERT("2", "军官证"), + /** + * 士兵证 + */ + SOLDIER_CERT("3", "士兵证"), + /** + * 港澳居民来往内地通行证(原名回乡证) + */ + HOME_RETURN_PERMIT("4", "回乡证"), + /** + * 临时身份证 + */ + TEMP_ID_CARD("5", "临时身份证"), + /** + * 户口本 + */ + HOUSEHOLD_REGISTER("6", "户口本"), + /** + * 其他 + */ + OTHER("7", "其他"), + /** + * 警官证 + */ + POLICE_OFFICER_CERT("9", "警官证"), + /** + * 识别证 + */ + IDENTIFICATION_CERT("10", "识别证"), + /** + * 驾驶执照 + */ + DRIVING_LICENSE("11", "驾驶执照"); + + private final String value; + private final String description; + + BpcPayerIdType(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static BpcPayerIdType getByValue(String value) { + if (value == null || "".equals(value.trim())) { + return null; + } + for (BpcPayerIdType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcRealNameAuthFlag.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcRealNameAuthFlag.java new file mode 100644 index 0000000000000000000000000000000000000000..aa3b8b8533c0ff769aeb7231fdd1e44ed4d7c240 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcRealNameAuthFlag.java @@ -0,0 +1,47 @@ +package com.openhis.web.externalintegration.enums; + +/** + * 【BPC】实名认证标志 + * + * @author GuoRui + * @date 2025-10-16 + */ +public enum BpcRealNameAuthFlag { + + /** + * 或不存在:无需实名认证 + */ + NO_NEED("0", "无需实名认证"), + /** + * 实名支付,支付通道需验证支付账户所有人和以下payerName/payerID/payerIDType信息一致 + */ + NEED("1", "实名支付"); + + private final String value; + private final String description; + + BpcRealNameAuthFlag(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static BpcRealNameAuthFlag getByValue(String value) { + if (value == null || "".equals(value.trim())) { + return null; + } + for (BpcRealNameAuthFlag val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcRespType.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcRespType.java new file mode 100644 index 0000000000000000000000000000000000000000..4be7f6146ab65d6f988a66f17aae8e623f7381aa --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcRespType.java @@ -0,0 +1,55 @@ +package com.openhis.web.externalintegration.enums; + +/** + * 【BPC】交易返回应答码 + * + * @author GuoRui + * @date 2025-10-16 + */ +public enum BpcRespType { + + /** + * 交易成功(终态) + */ + SUCCESS("00", "交易成功"), + /** + * 订单失败(终态) + */ + FAILED("77", "订单失败,无需继续订单查询"), + /** + * 等待付款(需重试查询) + */ + WAITING_PAYMENT("88", "等待付款(输密码),应再次发起订单查询"), + /** + * 交易状态未明(需重试查询) + */ + UNKNOWN("99", "交易状态未明,应再次发起订单查询"); + + private final String value; + private final String description; + + BpcRespType(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static BpcRespType getByValue(String value) { + if (value == null || "".equals(value.trim())) { + return null; + } + for (BpcRespType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcTranType.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcTranType.java new file mode 100644 index 0000000000000000000000000000000000000000..23c2705a4a243522bf5c1853649edf3353cacbff --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/enums/BpcTranType.java @@ -0,0 +1,91 @@ +package com.openhis.web.externalintegration.enums; + +/** + * 【BPC】交易类型 + * + * @author GuoRui + * @date 2025-10-16 + */ +public enum BpcTranType { + + /** + * 被扫消费 + */ + C("C", "被扫消费"), + /** + * 退货 + */ + R("R", "退货"), + /** + * 数字人民币主扫下单 + */ + E("E", "数字人民币主扫下单"), + /** + * 主扫下单(微信/支付宝/云闪付) + */ + F("F", "主扫下单"), + /** + * 关闭订单(部分收单行不支持) + */ + S("S", "关闭订单"), + /** + * 消费撤销(部分收单行不支持) + */ + D("D", "消费撤销"), + /** + * 定金支付(微信、支付宝,部分收单行不支持) + */ + A("A", "定金支付"), + /** + * 退定(微信、支付宝,部分收单行不支持) + */ + V("V", "退定"), + /** + * 定金确认(微信、支付宝,部分收单行不支持) + */ + B("B", "定金确认"), + /** + * 定金确认撤销(微信、支付宝,部分收单行不支持) + */ + W("W", "定金确认撤销"), + /** + * 表示订单支付结果查询、定金支付结果查询 + */ + G("G", "支付结果查询"), + /** + * 表示消费撤销订单查询、定金确认撤销结果查询 + */ + Z("Z", "撤销结果查询"), + /** + * 表示退货结果查询、退定结果查询、定金确认结果查询 + */ + J("J", "退款结果查询"); + + private final String value; + private final String description; + + BpcTranType(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static BpcTranType getByValue(String value) { + if (value == null || "".equals(value.trim())) { + return null; + } + for (BpcTranType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/mapper/FoodborneAcquisitionAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/mapper/FoodborneAcquisitionAppMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..290e206e433d31b80371850581cbf9fc36f8cdfb --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/mapper/FoodborneAcquisitionAppMapper.java @@ -0,0 +1,43 @@ +package com.openhis.web.externalintegration.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.openhis.web.externalintegration.dto.FaSimplediseaseAddNopwParam; + +/** + * 食源性疾病病例数据智能采集Mapper + * + * @author GuoRui + * @date 2025-10-10 + */ +@Repository +public interface FoodborneAcquisitionAppMapper { + + /** + * 查询就诊诊断内容列表 + * + * @param encounterId 就诊ID + * @return 就诊诊断内容列表 + */ + List selectEncounterDiagnosisConditionNameList(@Param("encounterId") Long encounterId); + + /** + * 查询食源性疾病病例数据智能采集上报跳转页面所需参数 + * + * @param encounterId 就诊ID + * @param genderEnumMale 性别枚举-男 + * @param genderEnumFemale 性别枚举-女 + * @param firstEnumFollowUp 初复诊标识-复诊 + * @param encounterClassEnumImp 就诊类型-住院 + * @param participantTypeAdmitter 参与者类型-接诊医生 + * @return 所需参数 + */ + FaSimplediseaseAddNopwParam selectSimplediseaseAddNopwParam(@Param("encounterId") Long encounterId, + @Param("genderEnumMale") Integer genderEnumMale, @Param("genderEnumFemale") Integer genderEnumFemale, + @Param("firstEnumFollowUp") Integer firstEnumFollowUp, + @Param("encounterClassEnumImp") Integer encounterClassEnumImp, + @Param("participantTypeAdmitter") String participantTypeAdmitter); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/utils/BpcHttpUtil.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/utils/BpcHttpUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..c03ced6df352713186529af76b1c3338dfbcbb5a --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/utils/BpcHttpUtil.java @@ -0,0 +1,105 @@ +package com.openhis.web.externalintegration.utils; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +import org.springframework.stereotype.Component; + +import lombok.extern.slf4j.Slf4j; + +/** + * 【BPC】HTTP请求共通方法 + * + * @author GuoRui + * @date 2025-10-16 + */ +@Slf4j +@Component +public class BpcHttpUtil { + + /** + * 发起post请求 + * + * @param jsonData JSON数据 + * @param md5SharedSecret MD5签名密钥 + * @param requestUrl 请求URL + * @return 请求结果 + */ + public static String httpPost(String jsonData, String md5SharedSecret, String requestUrl) throws Exception { + HttpsURLConnection conn = null; + try { + // 生成MD5签名 + String rawData = jsonData + "&" + md5SharedSecret; + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] digestBytes = md.digest(rawData.getBytes()); + StringBuilder hexString = new StringBuilder(); + for (byte b : digestBytes) { + hexString.append(String.format("%02x", b & 0xff)); + } + String md5Sign = hexString.toString(); + // 发起请求 + URL obj = new URL(requestUrl); + conn = (HttpsURLConnection)obj.openConnection(); + TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) {} + + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) {} + }}; + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, trustAllCerts, new SecureRandom()); + conn.setSSLSocketFactory(sslContext.getSocketFactory()); + conn.setHostnameVerifier((hostname, session) -> true); + conn.setRequestMethod("POST"); + conn.setConnectTimeout(30_000); + conn.setReadTimeout(60_000); + conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); + conn.setRequestProperty("sign", md5Sign); + conn.setDoOutput(true); + try (OutputStream os = conn.getOutputStream()) { + byte[] input = jsonData.getBytes(StandardCharsets.UTF_8); + os.write(input, 0, input.length); + } + int responseCode = conn.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + try (BufferedReader br = + new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) { + StringBuilder response = new StringBuilder(); + String line; + while ((line = br.readLine()) != null) { + response.append(line); + } + return response.toString(); + } + } else { + throw new RuntimeException("HTTP请求失败,返回" + responseCode); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new Exception("HTTP请求发生未知异常"); + } finally { + if (conn != null) { + conn.disconnect(); + } + } + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/utils/BpcTraceNoGenerator.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/utils/BpcTraceNoGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..ef3462f17435506c7c65c5b69bc4a3d3a3928951 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/externalintegration/utils/BpcTraceNoGenerator.java @@ -0,0 +1,20 @@ +package com.openhis.web.externalintegration.utils; + +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 【BPC】终端流水号生成器 + * + * @author GuoRui + * @date 2025-10-16 + */ +public class BpcTraceNoGenerator { + private static final AtomicInteger COUNTER = new AtomicInteger(1); + private static final int MAX_VALUE = 999999; + + public static String nextTraceNo() { + int nextValue = COUNTER.getAndUpdate(current -> current >= MAX_VALUE ? 1 : current + 1); + // 补零至6位 + return String.format("%06d", nextValue); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IAdviceProcessAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IAdviceProcessAppService.java index 853122870efbfb35d245f673581d0fdea6f999e2..9739acf44e1076585029b4a2ee521dda305f4429 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IAdviceProcessAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IAdviceProcessAppService.java @@ -71,16 +71,16 @@ public interface IAdviceProcessAppService { /** * 医嘱取消执行 * - * @param performInfoList 医嘱信息集合 + * @param adviceExecuteParam 取消执行参数 * @return 操作结果 */ - R adviceCancel(List performInfoList); + R adviceCancel(AdviceExecuteParam adviceExecuteParam); /** * 医嘱不执行 * - * @param performInfoList 医嘱信息集合 + * @param adviceExecuteParam 不执行参数 * @return 操作结果 */ - R adviceVoid(List performInfoList); + R adviceVoid(AdviceExecuteParam adviceExecuteParam); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IInpatientMedicineCollectionAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IMedicineSummaryAppService.java similarity index 95% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IInpatientMedicineCollectionAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IMedicineSummaryAppService.java index 55d1ea60fa1020a922706b49cb285e45fb7c3e5c..6d581d5c8feb95a42734e8cc41c9078075bbf584 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IInpatientMedicineCollectionAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/IMedicineSummaryAppService.java @@ -7,7 +7,6 @@ import javax.servlet.http.HttpServletRequest; import com.core.common.core.domain.R; import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto; import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineSearchParam; -import com.openhis.workflow.domain.InventoryItem; /** * 住院领药 应用实现接口 @@ -15,7 +14,7 @@ import com.openhis.workflow.domain.InventoryItem; * @author yuxj * @date 2025/8/18 */ -public interface IInpatientMedicineCollectionAppService { +public interface IMedicineSummaryAppService { /** * 分页查询在科病人列表 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java index 3a6660933a3afb4988b8f34b43f9d75181797609..f692f8e762dfab4dd351c3f5aebc6934f12bb939 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java @@ -4,6 +4,10 @@ package com.openhis.web.inhospitalnursestation.appservice.impl; import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -14,13 +18,17 @@ 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; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.core.common.utils.AgeCalculatorUtil; 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.administration.service.IEncounterService; +import com.openhis.clinical.domain.Procedure; import com.openhis.clinical.service.IProcedureService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; @@ -28,17 +36,24 @@ import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.medication.domain.MedicationDefinition; +import com.openhis.medication.domain.MedicationDispense; import com.openhis.medication.domain.MedicationRequest; import com.openhis.medication.service.IMedicationDefinitionService; import com.openhis.medication.service.IMedicationDispenseService; import com.openhis.medication.service.IMedicationRequestService; import com.openhis.web.common.dto.PerformInfoDto; import com.openhis.web.common.dto.PerformRecordDto; +import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService; +import com.openhis.web.doctorstation.dto.AdviceBaseDto; +import com.openhis.web.doctorstation.dto.AdvicePriceDto; +import com.openhis.web.doctorstation.utils.AdviceUtils; import com.openhis.web.inhospitalnursestation.appservice.IAdviceProcessAppService; import com.openhis.web.inhospitalnursestation.dto.*; import com.openhis.web.inhospitalnursestation.mapper.AdviceProcessAppMapper; import com.openhis.web.outpatientmanage.mapper.OutpatientTreatmentAppMapper; +import com.openhis.workflow.domain.DeviceDispense; import com.openhis.workflow.domain.ServiceRequest; +import com.openhis.workflow.service.IDeviceDispenseService; import com.openhis.workflow.service.IServiceRequestService; /** @@ -68,12 +83,24 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { @Resource private IMedicationDispenseService medicationDispenseService; + @Resource + private IDeviceDispenseService deviceDispenseService; + @Resource private IEncounterService encounterService; @Resource private IMedicationDefinitionService medicationDefinitionService; + @Resource + private IChargeItemService chargeItemService; + + @Resource + private AdviceUtils adviceUtils; + + @Resource + private IDoctorStationAdviceAppService iDoctorStationAdviceAppService; + /** * 住院患者分页列表 * @@ -140,7 +167,6 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList(); queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIdList); } - // 入院患者分页列表 Page inpatientAdvicePage = adviceProcessAppMapper.selectInpatientAdvicePage(new Page<>(pageNo, pageSize), queryWrapper, @@ -339,65 +365,27 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { // 诊疗 List activityList = adviceExecuteDetailList.stream() .filter(e -> CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(e.getAdviceTable())).toList(); - // -------------------------------------------整体校验药品库存 + // -------------------------------------------药品 if (!medicineList.isEmpty()) { - // 药品请求id集合 - List medicineRequestIdList = - medicineList.stream().map(AdviceExecuteDetailParam::getRequestId).collect(Collectors.toList()); - // 药品请求集合 - List MedicationRequestList = medicationRequestService - .list(new LambdaQueryWrapper().in(MedicationRequest::getId, medicineRequestIdList)); - // 药品定义id集合 - List medicationDefinitionIdList = - MedicationRequestList.stream().map(MedicationRequest::getMedicationId).collect(Collectors.toList()); - // 药品定义集合 - List medicationDefinitionList = - medicationDefinitionService.list(new LambdaQueryWrapper() - .in(MedicationDefinition::getId, medicationDefinitionIdList)); - // 组装MedicationRequestUseExe数据结构 - List MedUseExeList = MedicationRequestList.stream().map(medicationRequest -> { - // 创建 MedicationRequestUseExe 对象,并复制 MedicationRequest 的属性 - MedicationRequestUseExe useExe = new MedicationRequestUseExe(); - BeanUtils.copyProperties(medicationRequest, useExe); - // 匹配 executeTimes:根据 medicationRequest 的 id 在 medicineList 中查找匹配的 executeTimes - List matchedExecuteTimes = - medicineList.stream().filter(medicine -> medicine.getRequestId().equals(medicationRequest.getId())) - .findFirst().map(AdviceExecuteDetailParam::getExecuteTimes).orElse(null); - useExe.setExecuteTimes(matchedExecuteTimes); - // 计算 executeTimesNum:executeTimes 的集合大小,转换为 BigDecimal - if (matchedExecuteTimes != null) { - useExe.setExecuteTimesNum(BigDecimal.valueOf(matchedExecuteTimes.size())); - } else { - useExe.setExecuteTimesNum(BigDecimal.ZERO); - } - // 匹配 minUnitQuantity:根据 medicationId 在 medicationDefinitionList 中查找匹配的药品定义 - MedicationDefinition matchedDefinition = medicationDefinitionList.stream() - .filter(definition -> definition.getId().equals(medicationRequest.getMedicationId())).findFirst() - .orElse(null); - if (matchedDefinition != null) { - // 判断 minUnitCode 是否等于 unitCode - if (matchedDefinition.getMinUnitCode().equals(medicationRequest.getUnitCode())) { - useExe.setMinUnitQuantity(medicationRequest.getQuantity()); - } else { - // 若不相等,则计算 quantity * partPercent - BigDecimal partPercent = matchedDefinition.getPartPercent(); - if (partPercent == null) { - partPercent = BigDecimal.ONE; // 避免空指针,默认设为1 - } - useExe.setMinUnitQuantity(medicationRequest.getQuantity().multiply(partPercent)); - } - } else { - // 若未找到匹配的药品定义,设为 null 或默认值 - useExe.setMinUnitQuantity(null); + // 组装药品请求用于执行的数据结构 + List medUseExeList = this.assemblyMedication(medicineList); + // 校验药品库存 + if (!medUseExeList.isEmpty()) { + String tipRes = adviceUtils.checkExeMedInventory(medUseExeList); + if (tipRes != null) { + return R.fail(null, tipRes); } - return useExe; - }).toList(); - - // -------------------------------------------处理药品执行 - + } + // 处理药品执行 + this.exeMedication(medUseExeList); + } + // -------------------------------------------诊疗 + if (!activityList.isEmpty()) { + // 组装诊疗请求用于执行的数据结构 + List actUseExeList = this.assemblyActivity(activityList); + // 处理诊疗执行 + this.exeActivity(actUseExeList); } - - // -------------------------------------------处理诊疗执行 return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医嘱执行"})); } @@ -405,22 +393,135 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { /** * 医嘱取消执行 * - * @param performInfoList 医嘱信息集合 + * @param adviceExecuteParam 取消执行参数 * @return 操作结果 */ @Override - public R adviceCancel(List performInfoList) { - return null; + public R adviceCancel(AdviceExecuteParam adviceExecuteParam) { + + // 长期医嘱执行id + List longProcIdList = adviceExecuteParam.getAdviceExecuteDetailList().stream() + .filter(x -> x.getTherapyEnum().equals(TherapyTimeType.LONG_TERM.getValue())) + .map(AdviceExecuteDetailParam::getProcedureId).distinct().toList(); + // 药品临时医嘱执行id + List tempProcIdList = adviceExecuteParam.getAdviceExecuteDetailList().stream() + .filter(x -> x.getTherapyEnum().equals(TherapyTimeType.TEMPORARY.getValue())) + .map(AdviceExecuteDetailParam::getProcedureId).distinct().toList(); + + // 分别处理长期和临时的医嘱 + // 长期已发放药品 + List longMedDispensedList = new ArrayList<>(); + // 长期未发放药品 + List longMedUndispenseList = new ArrayList<>(); + // 长期已发放耗材 + List longDevDispensedList = new ArrayList<>(); + // 长期未发放耗材 + List longDevUndispenseList = new ArrayList<>(); + // 处理长期医嘱 + if (!longProcIdList.isEmpty()) { + // 长期药品 + List longMedDispenseList = + medicationDispenseService.getMedDispenseByProcedureId(longProcIdList); + // 长期耗材 + List longDevDispenseList = + deviceDispenseService.getDevDispenseByProcedureId(longProcIdList); + // 分离已发药发药单和未发药发药单 + for (MedicationDispense medicationDispense : longMedDispenseList) { + if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getDispenseEnum())) { + longMedDispensedList.add(medicationDispense); + } else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getDispenseEnum())) { + longMedUndispenseList.add(medicationDispense); + } + } + // 分离已发耗材单和未发耗材单 + for (DeviceDispense deviceDispense : longDevDispenseList) { + if (DispenseStatus.COMPLETED.getValue().equals(deviceDispense.getStatusEnum())) { + longDevDispensedList.add(deviceDispense); + } else if (DispenseStatus.PREPARATION.getValue().equals(deviceDispense.getStatusEnum())) { + longDevUndispenseList.add(deviceDispense); + } + } + // 查询账单 + List chargeItemList = chargeItemService.getChargeItemByProcedureId(longProcIdList); + if (chargeItemList != null && !chargeItemList.isEmpty()) { + for (ChargeItem chargeItem : chargeItemList) { + // 因执行医嘱时创建了账单,取消执行时需要软删除账单 + chargeItemService.removeById(chargeItem); + } + } + } + + // 临时已发放药品 + List tempMedDispensedList = new ArrayList<>(); + // 临时未发放药品 + List tempMedUndispenseList = new ArrayList<>(); + // 临时已发放耗材 + List tempDevDispensedList = new ArrayList<>(); + // 临时未发放耗材 + List tempDevUndispenseList = new ArrayList<>(); + // 处理临时医嘱 + if (!tempProcIdList.isEmpty()) { + // 长期药品 + List tempMedDispenseList = + medicationDispenseService.getMedDispenseByProcedureId(tempProcIdList); + // 长期耗材 + List tempDevDispenseList = + deviceDispenseService.getDevDispenseByProcedureId(tempProcIdList); + // 分离已发药发药单和未发药发药单 + for (MedicationDispense medicationDispense : tempMedDispenseList) { + if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getDispenseEnum())) { + tempMedDispensedList.add(medicationDispense); + } else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getDispenseEnum())) { + tempMedUndispenseList.add(medicationDispense); + } + } + // 分离已发耗材单和未发耗材单 + for (DeviceDispense deviceDispense : tempDevDispenseList) { + if (DispenseStatus.COMPLETED.getValue().equals(deviceDispense.getStatusEnum())) { + tempDevDispensedList.add(deviceDispense); + } else if (DispenseStatus.PREPARATION.getValue().equals(deviceDispense.getStatusEnum())) { + tempDevUndispenseList.add(deviceDispense); + } + } + // 查询账单 + List chargeItemList = chargeItemService.getChargeItemByProcedureId(tempProcIdList); + if (chargeItemList != null && !chargeItemList.isEmpty()) { + // 临时医嘱取消执行时,将临时医嘱的收费项目状态改为待收费 + chargeItemService + .updatePlannedChargeStatus(chargeItemList.stream().map(ChargeItem::getProcedureId).toList()); + } + } + // 统一处理已发放药品或耗材 + List medDispensedList = new ArrayList<>(tempMedDispensedList); + medDispensedList.addAll(longMedDispensedList); + // 统一处理已发放药品或耗材 + List devDispensedList = new ArrayList<>(tempDevDispensedList); + devDispensedList.addAll(longDevDispensedList); + // 合并长期和临时的执行记录 + List procedureIdList = new ArrayList<>(longProcIdList); + procedureIdList.addAll(tempProcIdList); + // 查询执行记录 + List procedureList = procedureService.listByIds(procedureIdList); + if (procedureList != null && !procedureList.isEmpty()) { + for (Procedure procedure : procedureList) { + // 根据执行记录新增取消执行记录 + procedureService.addProcedureRecord(procedure.getEncounterId(), procedure.getPatientId(), + procedure.getRequestId(), procedure.getRequestTable(), EventStatus.CANCEL, + ProcedureCategory.INPATIENT_ADVICE, null, procedure.getOccurrenceTime(), procedure.getGroupId(), + procedure.getId()); + } + } + return R.ok("取消执行成功"); } /** * 医嘱不执行 * - * @param performInfoList 医嘱信息集合 + * @param adviceExecuteParam 不执行参数 * @return 操作结果 */ @Override - public R adviceVoid(List performInfoList) { + public R adviceVoid(AdviceExecuteParam adviceExecuteParam) { // 长期临时都可以不执行,长期不执行的是某一时间点,也可以不执行这一整个医嘱(更新serviceRequest状态为7) // 已执行的时间点不能不执行,需要先取消 // 增加不执行记录 @@ -428,4 +529,375 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { return null; } + /** + * 执行药品医嘱 + * + * @param medUseExeList 药品医嘱 + */ + private void exeMedication(List medUseExeList) { + // 长期医嘱 + List longMedication = medUseExeList.stream() + .filter(e -> TherapyTimeType.LONG_TERM.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList()); + // 临时医嘱 + List tempMedication = medUseExeList.stream() + .filter(e -> TherapyTimeType.TEMPORARY.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList()); + // 药品定义id集合 + List medicationDefinitionIdList = + medUseExeList.stream().map(MedicationRequestUseExe::getMedicationId).collect(Collectors.toList()); + // 医嘱详细信息 + List medicationInfos = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, + medicationDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(1)).getRecords(); + + // 当前时间 + Date curDate = new Date(); + // 参与者id + Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); + // 当前登录账号的科室id + Long orgId = SecurityUtils.getLoginUser().getOrgId(); + + // 长期 + MedicationRequest longMedicationRequest; + ChargeItem chargeItem; + for (MedicationRequestUseExe medicationRequestUseExe : longMedication) { + for (String executeTime : medicationRequestUseExe.getExecuteTimes()) { + longMedicationRequest = new MedicationRequest(); + BeanUtils.copyProperties(medicationRequestUseExe, longMedicationRequest); + + // 生成执行记录 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 转换为 LocalDateTime + LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter); + // 转换为 Date + Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + // 执行记录id + Long procedureId = procedureService.addProcedureRecord(longMedicationRequest.getEncounterId(), + longMedicationRequest.getPatientId(), longMedicationRequest.getId(), + CommonConstants.TableName.MED_MEDICATION_REQUEST, EventStatus.COMPLETED, + ProcedureCategory.INPATIENT_ADVICE, null, exeDate, longMedicationRequest.getGroupId(), null); + + // 生成药品发放 + medicationDispenseService.generateMedicationDispense(longMedicationRequest, procedureId); + + // 生成账单 + chargeItem = new ChargeItem(); + chargeItem.setStatusEnum(ChargeItemStatus.BILLABLE.getValue()); // 收费状态 + chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(longMedicationRequest.getBusNo())); + chargeItem.setPrescriptionNo(longMedicationRequest.getPrescriptionNo()); // 处方号 + chargeItem.setPatientId(longMedicationRequest.getPatientId()); // 患者 + chargeItem.setContextEnum(ChargeItemContext.MEDICATION.getValue()); // 类型 + chargeItem.setEncounterId(longMedicationRequest.getEncounterId()); // 就诊id + chargeItem.setEntererId(practitionerId);// 开立人ID + chargeItem.setRequestingOrgId(orgId); // 开立科室 + chargeItem.setEnteredDate(curDate); // 开立时间 + chargeItem.setServiceTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);// 医疗服务类型 + chargeItem.setServiceId(longMedicationRequest.getId()); // 医疗服务ID + chargeItem.setProductTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION);// 产品所在表 + chargeItem.setProductId(longMedicationRequest.getMedicationId());// 收费项id + chargeItem.setAccountId(medicationRequestUseExe.getAccountId());// 关联账户ID + chargeItem.setConditionId(longMedicationRequest.getConditionId()); // 诊断id + chargeItem.setEncounterDiagnosisId(longMedicationRequest.getEncounterDiagnosisId()); // 就诊诊断id + chargeItem.setProcedureId(procedureId); + // ------------------------------ 匹配定价信息 + // 根据 medicationId 查找对应的医嘱信息 + MedicationRequest finalLongMedicationRequest = longMedicationRequest; + Optional matchedAdvice = medicationInfos.stream() + .filter( + advice -> finalLongMedicationRequest.getMedicationId().equals(advice.getAdviceDefinitionId())) + .findFirst(); + if (!matchedAdvice.isPresent()) { + throw new RuntimeException( + "未找到对应的医嘱信息,medicationId: " + finalLongMedicationRequest.getMedicationId()); + } + AdviceBaseDto advice = matchedAdvice.get(); + // 获取拆零比 + BigDecimal partPercent = advice.getPartPercent(); + + // 在 priceList 中查找匹配的定价信息 + Optional matchedPrice = advice.getPriceList().stream() + .filter(price -> finalLongMedicationRequest.getLotNumber().equals(price.getConditionValue())) + .findFirst(); + if (!matchedPrice.isPresent()) { + throw new RuntimeException("未找到匹配的定价信息,lotNumber: " + finalLongMedicationRequest.getLotNumber()); + } + AdvicePriceDto priceDto = matchedPrice.get(); + // 计算价格 + BigDecimal price; + if (finalLongMedicationRequest.getUnitCode().equals(priceDto.getUnitCode())) { + // unitCode 匹配,直接取 price + price = priceDto.getPrice(); + } else { + // unitCode 不匹配,计算 price / partPercent + price = priceDto.getPrice().divide(partPercent, RoundingMode.HALF_UP); + } + chargeItem.setDefinitionId(priceDto.getDefinitionId()); // 费用定价ID + chargeItem.setDefDetailId(priceDto.getDefinitionDetailId()); // 定价子表主键 + chargeItem.setQuantityValue(longMedicationRequest.getQuantity()); // 数量 + chargeItem.setQuantityUnit(longMedicationRequest.getUnitCode()); // 单位 + chargeItem.setUnitPrice(price); // 单价 + chargeItem.setTotalPrice( + longMedicationRequest.getQuantity().multiply(price).setScale(4, RoundingMode.HALF_UP)); // 总价 + + chargeItemService.saveOrUpdate(chargeItem); + } + } + + // 临时 + MedicationRequest tempMedicationRequest; + for (MedicationRequestUseExe medicationRequestUseExe : tempMedication) { + for (String executeTime : medicationRequestUseExe.getExecuteTimes()) { + tempMedicationRequest = new MedicationRequest(); + BeanUtils.copyProperties(medicationRequestUseExe, tempMedicationRequest); + + // 生成执行记录 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 转换为 LocalDateTime + LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter); + // 转换为 Date + Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + // 执行记录id + Long procedureId = procedureService.addProcedureRecord(tempMedicationRequest.getEncounterId(), + tempMedicationRequest.getPatientId(), tempMedicationRequest.getId(), + CommonConstants.TableName.MED_MEDICATION_REQUEST, EventStatus.COMPLETED, + ProcedureCategory.INPATIENT_ADVICE, null, exeDate, tempMedicationRequest.getGroupId(), null); + + // 更新药品放发状态 + medicationDispenseService.update(new LambdaUpdateWrapper() + .eq(MedicationDispense::getMedReqId, tempMedicationRequest.getId()) + .set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())); + + // 更新账单状态 + chargeItemService.update( + new LambdaUpdateWrapper().eq(ChargeItem::getServiceId, tempMedicationRequest.getId()) + .set(ChargeItem::getProcedureId, procedureId) + .set(ChargeItem::getStatusEnum, ChargeItemStatus.BILLABLE.getValue())); + } + } + + } + + /** + * 执行诊疗医嘱 + * + * @param actUseExeList 诊疗医嘱 + */ + private void exeActivity(List actUseExeList) { + // 长期医嘱 + List longActivity = actUseExeList.stream() + .filter(e -> TherapyTimeType.LONG_TERM.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList()); + // 临时医嘱 + List tempActivity = actUseExeList.stream() + .filter(e -> TherapyTimeType.TEMPORARY.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList()); + // 诊疗定义id集合 + List activityDefinitionIdList = + actUseExeList.stream().map(ServiceRequestUseExe::getActivityId).collect(Collectors.toList()); + // 医嘱详细信息 + List activityInfos = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, + activityDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(3)).getRecords(); + + // 当前时间 + Date curDate = new Date(); + // 参与者id + Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); + // 当前登录账号的科室id + Long orgId = SecurityUtils.getLoginUser().getOrgId(); + + // 长期 + ServiceRequest longServiceRequest; + ChargeItem chargeItem; + for (ServiceRequestUseExe serviceRequestUseExe : longActivity) { + for (String executeTime : serviceRequestUseExe.getExecuteTimes()) { + longServiceRequest = new ServiceRequest(); + BeanUtils.copyProperties(serviceRequestUseExe, longServiceRequest); + + // 生成执行记录 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 转换为 LocalDateTime + LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter); + // 转换为 Date + Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + // 执行记录id + Long procedureId = procedureService.addProcedureRecord(longServiceRequest.getEncounterId(), + longServiceRequest.getPatientId(), longServiceRequest.getId(), + CommonConstants.TableName.WOR_SERVICE_REQUEST, EventStatus.COMPLETED, + ProcedureCategory.INPATIENT_ADVICE, null, exeDate, null, null); + + // 生成账单 + chargeItem = new ChargeItem(); + chargeItem.setStatusEnum(ChargeItemStatus.BILLABLE.getValue()); // 收费状态 + chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(longServiceRequest.getBusNo())); + chargeItem.setPatientId(longServiceRequest.getPatientId()); // 患者 + chargeItem.setContextEnum(ChargeItemContext.ACTIVITY.getValue()); // 类型 + chargeItem.setEncounterId(longServiceRequest.getEncounterId()); // 就诊id + chargeItem.setEntererId(practitionerId);// 开立人ID + chargeItem.setRequestingOrgId(orgId); // 开立科室 + chargeItem.setEnteredDate(curDate); // 开立时间 + chargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);// 医疗服务类型 + chargeItem.setServiceId(longServiceRequest.getId()); // 医疗服务ID + chargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);// 产品所在表 + chargeItem.setProductId(longServiceRequest.getActivityId());// 收费项id + chargeItem.setAccountId(serviceRequestUseExe.getAccountId());// 关联账户ID + chargeItem.setConditionId(longServiceRequest.getConditionId()); // 诊断id + chargeItem.setEncounterDiagnosisId(longServiceRequest.getEncounterDiagnosisId()); // 就诊诊断id + chargeItem.setProcedureId(procedureId); + // ------------------------------ 匹配定价信息 + // 根据 activityId 查找对应的医嘱信息 + ServiceRequest finalLongServiceRequest = longServiceRequest; + Optional matchedAdvice = activityInfos.stream() + .filter(advice -> finalLongServiceRequest.getActivityId().equals(advice.getAdviceDefinitionId())) + .findFirst(); + if (!matchedAdvice.isPresent()) { + throw new RuntimeException("未找到对应的医嘱信息,activityId: " + finalLongServiceRequest.getActivityId()); + } + // 医嘱信息 + AdviceBaseDto advice = matchedAdvice.get(); + // 定价信息 + AdvicePriceDto priceDto = advice.getPriceList().get(0); + // 计算价格 + BigDecimal price = priceDto.getPrice(); + + chargeItem.setDefinitionId(priceDto.getDefinitionId()); // 费用定价ID + chargeItem.setQuantityValue(longServiceRequest.getQuantity()); // 数量 + chargeItem.setQuantityUnit(longServiceRequest.getUnitCode()); // 单位 + chargeItem.setUnitPrice(price); // 单价 + chargeItem + .setTotalPrice(longServiceRequest.getQuantity().multiply(price).setScale(4, RoundingMode.HALF_UP)); // 总价 + chargeItemService.saveOrUpdate(chargeItem); + } + } + + // 临时 + ServiceRequest tempServiceRequest; + for (ServiceRequestUseExe serviceRequestUseExe : tempActivity) { + for (String executeTime : serviceRequestUseExe.getExecuteTimes()) { + tempServiceRequest = new ServiceRequest(); + BeanUtils.copyProperties(serviceRequestUseExe, tempServiceRequest); + + // 生成执行记录 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 转换为 LocalDateTime + LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter); + // 转换为 Date + Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + // 执行记录id + Long procedureId = procedureService.addProcedureRecord(tempServiceRequest.getEncounterId(), + tempServiceRequest.getPatientId(), tempServiceRequest.getId(), + CommonConstants.TableName.WOR_SERVICE_REQUEST, EventStatus.COMPLETED, + ProcedureCategory.INPATIENT_ADVICE, null, exeDate, null, null); + + // 更新账单状态 + chargeItemService.update( + new LambdaUpdateWrapper().eq(ChargeItem::getServiceId, tempServiceRequest.getId()) + .set(ChargeItem::getProcedureId, procedureId) + .set(ChargeItem::getStatusEnum, ChargeItemStatus.BILLABLE.getValue())); + } + } + + } + + /** + * 组装药品请求用于执行的数据结构 + * + * @param medicineList 药品执行参数 + * @return 用于执行的药品请求 + */ + private List assemblyMedication(List medicineList) { + // 药品请求id集合 + List medicineRequestIdList = + medicineList.stream().map(AdviceExecuteDetailParam::getRequestId).collect(Collectors.toList()); + // 药品请求集合 + List medicationRequestList = medicationRequestService + .list(new LambdaQueryWrapper().in(MedicationRequest::getId, medicineRequestIdList)); + // 药品定义id集合 + List medicationDefinitionIdList = + medicationRequestList.stream().map(MedicationRequest::getMedicationId).collect(Collectors.toList()); + // 药品定义集合 + List medicationDefinitionList = medicationDefinitionService.list( + new LambdaQueryWrapper().in(MedicationDefinition::getId, medicationDefinitionIdList)); + // 组装MedicationRequestUseExe数据结构 + List medUseExeList = medicationRequestList.stream().map(medicationRequest -> { + // 创建 MedicationRequestUseExe 对象,并复制 MedicationRequest 的属性 + MedicationRequestUseExe useExe = new MedicationRequestUseExe(); + // 账号id赋值 + AdviceExecuteDetailParam adviceExecuteDetailParam = medicineList.stream() + .filter(param -> medicationRequest.getId().equals(param.getRequestId())).findFirst().orElse(null); + if (adviceExecuteDetailParam != null) { + useExe.setAccountId(adviceExecuteDetailParam.getAccountId()); + } + BeanUtils.copyProperties(medicationRequest, useExe); + // 匹配 executeTimes:根据 medicationRequest 的 id 在 medicineList 中查找匹配的 executeTimes + List matchedExecuteTimes = + medicineList.stream().filter(medicine -> medicine.getRequestId().equals(medicationRequest.getId())) + .findFirst().map(AdviceExecuteDetailParam::getExecuteTimes).orElse(null); + useExe.setExecuteTimes(matchedExecuteTimes); + // 计算 executeTimesNum:executeTimes 的集合大小,转换为 BigDecimal + if (matchedExecuteTimes != null) { + useExe.setExecuteTimesNum(BigDecimal.valueOf(matchedExecuteTimes.size())); + } else { + useExe.setExecuteTimesNum(BigDecimal.ZERO); + } + // 匹配 minUnitQuantity:根据 medicationId 在 medicationDefinitionList 中查找匹配的药品定义 + MedicationDefinition matchedDefinition = medicationDefinitionList.stream() + .filter(definition -> definition.getId().equals(medicationRequest.getMedicationId())).findFirst() + .orElse(null); + if (matchedDefinition != null) { + // 判断 minUnitCode 是否等于 unitCode + if (matchedDefinition.getMinUnitCode().equals(medicationRequest.getUnitCode())) { + useExe.setMinUnitQuantity(medicationRequest.getQuantity()); + } else { + // 若不相等,则计算 quantity * partPercent + BigDecimal partPercent = matchedDefinition.getPartPercent(); + if (partPercent == null) { + partPercent = BigDecimal.ONE; // 避免空指针,默认设为1 + } + useExe.setMinUnitQuantity(medicationRequest.getQuantity().multiply(partPercent)); + } + } else { + // 若未找到匹配的药品定义,设为 null 或默认值 + useExe.setMinUnitQuantity(null); + } + return useExe; + }).toList(); + return medUseExeList; + } + + /** + * 组装诊疗请求用于执行的数据结构 + * + * @param activityList 诊疗执行参数 + * @return 用于执行的诊疗请求 + */ + private List assemblyActivity(List activityList) { + // 诊疗请求id集合 + List activityRequestIdList = + activityList.stream().map(AdviceExecuteDetailParam::getRequestId).collect(Collectors.toList()); + // 诊疗请求集合 + List activityRequestList = serviceRequestService + .list(new LambdaQueryWrapper().in(ServiceRequest::getId, activityRequestIdList)); + // 组装ServiceRequestUseExe数据结构 + List actUseExeList = activityRequestList.stream().map(serviceRequest -> { + // 创建 ServiceRequestUseExe 对象,并复制 ServiceRequest 的属性 + ServiceRequestUseExe useExe = new ServiceRequestUseExe(); + // 账号id赋值 + AdviceExecuteDetailParam adviceExecuteDetailParam = activityList.stream() + .filter(param -> serviceRequest.getId().equals(param.getRequestId())).findFirst().orElse(null); + if (adviceExecuteDetailParam != null) { + useExe.setAccountId(adviceExecuteDetailParam.getAccountId()); + } + BeanUtils.copyProperties(serviceRequest, useExe); + // 匹配 executeTimes:根据 serviceRequest 的 id 在 activityList 中查找匹配的 executeTimes + List matchedExecuteTimes = + activityList.stream().filter(activity -> activity.getRequestId().equals(serviceRequest.getId())) + .findFirst().map(AdviceExecuteDetailParam::getExecuteTimes).orElse(null); + useExe.setExecuteTimes(matchedExecuteTimes); + // 计算 executeTimesNum:executeTimes 的集合大小,转换为 BigDecimal + if (matchedExecuteTimes != null) { + useExe.setExecuteTimesNum(BigDecimal.valueOf(matchedExecuteTimes.size())); + } else { + useExe.setExecuteTimesNum(BigDecimal.ZERO); + } + return useExe; + }).toList(); + return actUseExeList; + } + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/InpatientMedicineCollectionAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java similarity index 97% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/InpatientMedicineCollectionAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java index ae559bc05fd56bc08590058d7ebccb5f1a49c631..898a84583a22ea66260d1b7a0f947b9a3a3d80c2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/InpatientMedicineCollectionAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java @@ -7,20 +7,15 @@ import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import com.core.common.constant.HttpStatus; -import com.core.common.utils.*; -import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService; -import com.openhis.web.pharmacymanage.dto.InventoryDto; -import com.openhis.workflow.domain.SupplyDelivery; -import com.openhis.workflow.domain.SupplyRequest; -import com.openhis.workflow.service.IDeviceDispenseService; 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.constant.HttpStatus; import com.core.common.core.domain.R; import com.core.common.exception.ServiceException; +import com.core.common.utils.*; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.*; @@ -28,10 +23,17 @@ import com.openhis.common.enums.ybenums.YbDrordType; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.medication.service.IMedicationDispenseService; -import com.openhis.web.inhospitalnursestation.dto.*; +import com.openhis.web.inhospitalnursestation.appservice.IMedicineSummaryAppService; +import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineEncounterInfoDto; +import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto; +import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineSearchParam; import com.openhis.web.inhospitalnursestation.mapper.InpatientMedicineCollectionMapper; +import com.openhis.web.pharmacymanage.dto.InventoryDto; import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper; import com.openhis.workflow.domain.InventoryItem; +import com.openhis.workflow.domain.SupplyDelivery; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.IDeviceDispenseService; import com.openhis.workflow.service.ISupplyDeliveryService; import com.openhis.workflow.service.ISupplyRequestService; @@ -42,7 +44,7 @@ import com.openhis.workflow.service.ISupplyRequestService; * @date 2025/8/18 */ @Service -public class InpatientMedicineCollectionAppServiceImpl implements IInpatientMedicineCollectionAppService { +public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService { @Resource private AssignSeqUtil assignSeqUtil; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/AdviceProcessController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/AdviceProcessController.java index c5a1996c10b2341c0479ef5c792cb0e5b2192568..c7703b1e81bc8cf5ce9cb30bb585e00bf97e6620 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/AdviceProcessController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/AdviceProcessController.java @@ -75,7 +75,7 @@ public class AdviceProcessController { * @return 操作结果 */ @PutMapping(value = "/advice-verify") - public R adviceVerify(List performInfoList) { + public R adviceVerify(@RequestBody List performInfoList) { return adviceProcessAppService.adviceVerify(performInfoList); } @@ -86,7 +86,7 @@ public class AdviceProcessController { * @return 操作结果 */ @PutMapping(value = "/advice-reject") - public R adviceReject(List performInfoList) { + public R adviceReject(@RequestBody List performInfoList) { return adviceProcessAppService.adviceReject(performInfoList); } @@ -104,22 +104,22 @@ public class AdviceProcessController { /** * 医嘱取消执行 * - * @param performInfoList 医嘱信息集合 + * @param adviceExecuteParam 取消执行参数 * @return 操作结果 */ @PostMapping(value = "/advice-cancel") - public R adviceCancel(List performInfoList) { - return adviceProcessAppService.adviceCancel(performInfoList); + public R adviceCancel(@RequestBody AdviceExecuteParam adviceExecuteParam) { + return adviceProcessAppService.adviceCancel(adviceExecuteParam); } /** * 医嘱不执行 * - * @param performInfoList 医嘱信息集合 + * @param adviceExecuteParam 不执行参数 * @return 操作结果 */ @PostMapping(value = "/advice-void") - public R adviceVoid(List performInfoList) { - return adviceProcessAppService.adviceVoid(performInfoList); + public R adviceVoid(AdviceExecuteParam adviceExecuteParam) { + return adviceProcessAppService.adviceVoid(adviceExecuteParam); } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/InpatientMedicineCollectionController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/MedicineSummaryController.java similarity index 90% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/InpatientMedicineCollectionController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/MedicineSummaryController.java index 67261f91eeeb734a40a8c4c35f56103452085de3..4d8ccd7f9127ac1a59733831850f6a5d66274904 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/InpatientMedicineCollectionController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/controller/MedicineSummaryController.java @@ -5,7 +5,7 @@ import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService; +import com.openhis.web.inhospitalnursestation.appservice.IMedicineSummaryAppService; import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto; import org.springframework.web.bind.annotation.*; @@ -22,13 +22,13 @@ import lombok.extern.slf4j.Slf4j; * @date 2025/8/18 */ @RestController -@RequestMapping("/nurse-station/inpatient-medicine-collection") +@RequestMapping("/nurse-station/medicine-summary") @Slf4j @AllArgsConstructor -public class InpatientMedicineCollectionController { +public class MedicineSummaryController { @Resource - public IInpatientMedicineCollectionAppService medicineCollectionService; + public IMedicineSummaryAppService medicineCollectionService; /** * 分页查询在科病人列表 @@ -56,7 +56,7 @@ public class InpatientMedicineCollectionController { * @param pageSize 查询条数 * @param request 请求数据 */ - @GetMapping("/prescription-list") + @GetMapping("/advice-list") public R getPatientInfoList(InpatientMedicineSearchParam searchParam, String searchKey, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/AdviceExecuteDetailParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/AdviceExecuteDetailParam.java index 63666f44fba0b989a7a09254307b124ea90bbd21..9a2456fc5b8ef8cbba4e7fc2744e71bd4831dc66 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/AdviceExecuteDetailParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/AdviceExecuteDetailParam.java @@ -25,6 +25,17 @@ public class AdviceExecuteDetailParam { @JsonSerialize(using = ToStringSerializer.class) private Long requestId; + /** 账号id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long accountId; + + /** 执行id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long procedureId; + + /** 医嘱类型 */ + private Integer therapyEnum; + /** 医嘱请求所在表 */ private String adviceTable; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java index f41a05d75dfde437e6d0d952eb35ad689015faa4..809c9b14f55ff6c66684b50b35782200b7dbf7ae 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java @@ -30,6 +30,10 @@ public class InpatientAdviceDto { @JsonSerialize(using = ToStringSerializer.class) private Long encounterId; + /** 患者id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long patientId; + /** 医嘱所在表 */ private String adviceTable; // 1:药品 , 2: 耗材 , 3:项目 /** @@ -199,7 +203,7 @@ public class InpatientAdviceDto { private String patientName; /** 床位名称 */ - private String badName; + private String bedName; /** 性别 */ private Integer genderEnum; @@ -226,4 +230,16 @@ public class InpatientAdviceDto { /** 余额 */ private BigDecimal balanceAmount; + + /** + * 账号id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long accountId; + + /** + * 校对人id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long performerCheckId; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceParam.java index 3b11a4d86ecfa11b8eda9ae37792e117f65b8d1f..3a363cc2a65d611ab0aabb55adae9cdf9d3b5122 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceParam.java @@ -3,6 +3,8 @@ */ package com.openhis.web.inhospitalnursestation.dto; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/MedicationRequestUseExe.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/MedicationRequestUseExe.java index 32a6f80642a9f2f8969c13ce1de17dc11426d877..d1f816da26072ee79375d135adb2ecea8bce5eff 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/MedicationRequestUseExe.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/MedicationRequestUseExe.java @@ -6,6 +6,8 @@ package com.openhis.web.inhospitalnursestation.dto; import java.math.BigDecimal; import java.util.List; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.medication.domain.MedicationRequest; import lombok.Data; @@ -21,6 +23,12 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class MedicationRequestUseExe extends MedicationRequest { + /** + * 账号id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long accountId; + /** 执行时间点集合 */ private List executeTimes; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/ServiceRequestUseExe.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/ServiceRequestUseExe.java new file mode 100644 index 0000000000000000000000000000000000000000..a71b117b2bb87cb51296c7af7c97c08d2665fbe7 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/ServiceRequestUseExe.java @@ -0,0 +1,40 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.inhospitalnursestation.dto; + +import java.math.BigDecimal; +import java.util.List; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.workflow.domain.ServiceRequest; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 诊疗请求用于执行 + * + * @author zwh + * @date 2025-07-28 + */ +@Data +@Accessors(chain = true) +public class ServiceRequestUseExe extends ServiceRequest { + + /** + * 账号id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long accountId; + + /** 执行时间点集合 */ + private List executeTimes; + + /** + * 执行时间点集合数量 + */ + private BigDecimal executeTimesNum; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/LossReportFormAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/LossReportFormAppServiceImpl.java index 8482ad899cc1c4362807f1404b1591a166780692..b6acee1e0c87892d0d9d705bccd8d4999f0c7225 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/LossReportFormAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/LossReportFormAppServiceImpl.java @@ -157,8 +157,8 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService { */ private List buildTree(List records) { // 按b_no的层级排序,确保父节点先处理 - List sortedRecords = records.stream() - .sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList()); + List sortedRecords = + records.stream().sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).toList(); Map nodeMap = new HashMap<>(); List tree = new ArrayList<>(); @@ -228,8 +228,7 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService { List idList = new ArrayList<>(); // 单据号取得 - List busNoList = - lossReportFormDtoList.stream().map(LossReportFormDto::getBusNo).collect(Collectors.toList()); + List busNoList = lossReportFormDtoList.stream().map(LossReportFormDto::getBusNo).toList(); // 请求数据取得 List requestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0)); if (!requestList.isEmpty()) { @@ -245,20 +244,20 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService { SupplyRequest supplyRequest = new SupplyRequest(); BeanUtils.copyProperties(lossReportFormDto, supplyRequest); supplyRequest.setPurposeLocationId(lossReportFormDto.getLossLocationId()) - .setPurposeLocationStoreId(lossReportFormDto.getLossLocationStoreId()) - .setPurposeTypeEnum(lossReportFormDto.getLossTypeEnum()).setReason(lossReportFormDto.getLossReason()); + .setPurposeLocationStoreId(lossReportFormDto.getLossLocationStoreId()) + .setPurposeTypeEnum(lossReportFormDto.getLossTypeEnum()).setReason(lossReportFormDto.getLossReason()); // 生成待发送的报损单据 supplyRequest - // id - .setId(null) - // 单据分类:库存供应 - .setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue()) - // 单据类型:报损单 - .setTypeEnum(SupplyType.LOSS_REPORT_FORM.getValue()) - // 制单人 - .setApplicantId(SecurityUtils.getLoginUser().getPractitionerId()) - // 制单日期 - .setApplyTime(DateUtils.getNowDate()); + // id + .setId(null) + // 单据分类:库存供应 + .setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue()) + // 单据类型:报损单 + .setTypeEnum(SupplyType.LOSS_REPORT_FORM.getValue()) + // 制单人 + .setApplicantId(SecurityUtils.getLoginUser().getPractitionerId()) + // 制单日期 + .setApplyTime(DateUtils.getNowDate()); supplyRequestList.add(supplyRequest); } @@ -269,8 +268,7 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService { // 请求id取得 List supplyRequestIdList = supplyRequestService.getSupplyByBusNo(busNoList.get(0)); // 返回请求id列表 - List requestIdList = - supplyRequestIdList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + List requestIdList = supplyRequestIdList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); for (Long list : requestIdList) { idList.add(list.toString()); } @@ -320,6 +318,7 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService { return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)) : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + /** * 报损单据详情 * @@ -331,12 +330,14 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService { * @return 单据详情 */ @Override - public R getMonthlySettlementDetail(Long locationId, String startTime, String endTime,Integer pageNo, Integer pageSize){ - - Page receiptDetailList = lossReportFormMapper.getMonthlySettlementDetail(new Page<>(pageNo, pageSize), - locationId,startTime, endTime,ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), - CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,SupplyType.LOSS_REPORT_FORM.getValue(), - SupplyStatus.AGREE.getValue()); + public R getMonthlySettlementDetail(Long locationId, String startTime, String endTime, Integer pageNo, + Integer pageSize) { + + Page receiptDetailList = + lossReportFormMapper.getMonthlySettlementDetail(new Page<>(pageNo, pageSize), locationId, startTime, + endTime, ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), + CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION, + SupplyType.LOSS_REPORT_FORM.getValue(), SupplyStatus.AGREE.getValue()); return R.ok(receiptDetailList); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java index bf8c73ae14447a64bd818a4469e367d26bbcc345..260b0305bf647bc2bd5d2bf21b7aa32fce73ef93 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java @@ -251,7 +251,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now); if (!aBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } } } @@ -296,6 +296,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (agreedList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + // 获取审批通过后的供应请求id列表 + List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + + // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + if (validation) { + throw new ServiceException("请勿重复审批"); + } // 根据单据,生成供应发放单 List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); if (deliveredList.isEmpty()) { @@ -340,7 +348,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService Boolean aBoolean = inventoryItemService.updateInventoryQuantity(inventoryItem.getId(), minQuantity, now); if (!aBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } } } @@ -385,6 +393,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (agreedList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + // 获取审批通过后的供应请求id列表 + List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + + // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + if (validation) { + throw new ServiceException("请勿重复审批"); + } // 根据单据,发放物品 List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); if (deliveredList.isEmpty()) { @@ -418,7 +434,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null)); + throw new ServiceException("操作失败,库存数量不足"); } else { // 源仓库库存-(调拨数量*拆零比) minQuantity = minQuantity.subtract( @@ -427,7 +443,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null)); + throw new ServiceException("操作失败,库存数量不足"); } else { // 供应申请的物品计量单位与最小单位相同 // 源仓库库存-调拨数量 @@ -438,7 +454,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService Boolean aBoolean = inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now); if (!aBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } // 添加到出库列表 @@ -459,6 +475,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (inventoryItemPurpose == null) { // 供应申请的物品计量单位与最小单位相同 if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + //todo:不理解的代码,可能会因为四舍五入影响总价值 // 采购单价=单价*拆零比 supplyItemDetailDto .setPrice(supplyItemDetailDto.getPrice().multiply(supplyItemDetailDto.getPartPercent())); @@ -485,7 +502,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now); if (!bBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } } // 添加到入库列表 @@ -526,7 +543,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (agreedList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + // 获取审批通过后的供应请求id列表 + List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + if (validation) { + throw new ServiceException("请勿重复审批"); + } // 根据单据,发放物品 List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); if (deliveredList.isEmpty()) { @@ -555,7 +579,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null)); + throw new ServiceException("操作失败,库存数量不足"); } else { // 仓库库存-(退货数量*拆零比) minQuantity = minQuantity.subtract( @@ -564,7 +588,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null)); + throw new ServiceException("操作失败,库存数量不足"); } else { // 供应申请的物品计量单位与最小单位相同 // 仓库库存-退货数量 @@ -577,7 +601,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now); if (!aBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } // 退货数量等于库存数量时,删除库存数据 @@ -617,6 +641,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (agreedList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + // 获取审批通过后的供应请求id列表 + List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + + // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + if (validation) { + throw new ServiceException("请勿重复审批"); + } // 根据单据,生成供应发放单 List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); if (deliveredList.isEmpty()) { @@ -644,7 +676,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail("操作失败,库存数量不足"); + throw new ServiceException("操作失败,库存数量不足"); } else { // 目的仓库库存-(报损数量*拆零比) minQuantity = minQuantity.subtract( @@ -653,7 +685,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail("操作失败,库存数量不足"); + throw new ServiceException("操作失败,库存数量不足"); } else { // 供应申请的物品计量单位与最小单位相同 // 目的仓库库存-报损数量 @@ -664,7 +696,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService Boolean aBoolean = inventoryItemService.updateInventoryQuantity(inventoryItem.getId(), minQuantity, now); if (!aBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } } } @@ -701,6 +733,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (agreedList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + // 获取审批通过后的供应请求id列表 + List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + + // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + if (validation) { + throw new ServiceException("请勿重复审批"); + } // 根据单据,发放物品 List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); if (deliveredList.isEmpty()) { @@ -727,7 +767,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null)); + throw new ServiceException("操作失败,库存数量不足"); } else { // 源仓库库存-(领用数量*拆零比) minQuantity = minQuantity.subtract( @@ -736,7 +776,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { // 库存数量不足 - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null)); + throw new ServiceException("操作失败,库存数量不足"); } else { // 供应申请的物品计量单位与最小单位相同 // 源仓库库存-领用数量 @@ -786,6 +826,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService if (agreedList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + // 获取审批通过后的供应请求id列表 + List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + + // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + if (validation) { + throw new ServiceException("请勿重复审批"); + } // 根据单据,发放物品 List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); if (deliveredList.isEmpty()) { @@ -831,7 +879,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService Boolean bBoolean = inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now); if (!bBoolean) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + throw new ServiceException("系统异常,请稍后重试"); } } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/LossReportFormDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/LossReportFormDto.java index bf0cd94cc0ac85e84769eba2053f4cfac820b97e..ce471351f2521417c0f1b12323cb8cb4163922b5 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/LossReportFormDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/LossReportFormDto.java @@ -6,7 +6,6 @@ package com.openhis.web.inventorymanage.dto; import java.math.BigDecimal; import java.util.Date; -import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import com.baomidou.mybatisplus.annotation.IdType; @@ -43,6 +42,10 @@ public class LossReportFormDto { @NotNull private BigDecimal itemQuantity; + /** 合计数量 */ + @NotNull + private BigDecimal totalQuantity; + /** 物品编码 */ @NotNull private Long itemId; @@ -78,7 +81,7 @@ public class LossReportFormDto { private Date applyTime; /** 审批人 */ - //@NotNull + // @NotNull private Long approverId; /** 审批日期 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptDetailDto.java index 9b202e2f122a3539ec548c8d7fc54339971e0ba3..ca86a90647df1c34a7491957bbad0e609ff8e3ca 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptDetailDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptDetailDto.java @@ -12,8 +12,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; - import com.openhis.web.common.dto.UnitDto; + import lombok.Data; import lombok.experimental.Accessors; @@ -38,6 +38,9 @@ public class ReceiptDetailDto { /** 当前库存总数/实盘数量 */ private BigDecimal totalQuantity; + /** 报损前数量 */ + private BigDecimal oldQuantity; + /** 数量 */ private BigDecimal itemQuantity; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/IReviewPrescriptionRecordsAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/IReviewPrescriptionRecordsAppService.java index 94cbba129fde63c1614473916308ce918655182e..1efbfbc6f4656a38eb144abe2ea53831ece96fe5 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/IReviewPrescriptionRecordsAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/IReviewPrescriptionRecordsAppService.java @@ -16,4 +16,20 @@ public interface IReviewPrescriptionRecordsAppService { */ R reviewPrescription(ReviewPrescriptionRecordsDto reviewPrescriptionRecordsDto); + /** + * 通过处方号查询审方记录 + * + * @param prescriptionNo 处方号 + * @return 审方记录 + */ + R getReviewByPrescriptionNo(String prescriptionNo); + + /** + * 通过就诊id查询审方记录 + * + * @param encounterId 就诊id + * @return 审方记录 + */ + R getReviewByEncounterId(Long encounterId); + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/impl/ReviewPrescriptionRecordsAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/impl/ReviewPrescriptionRecordsAppServiceImpl.java index f9061cff40b3e5fc923b24263487f7598c6980a2..ad4d19a36af982b2b69aaec0a4d712858d5ccbf2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/impl/ReviewPrescriptionRecordsAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/appservice/impl/ReviewPrescriptionRecordsAppServiceImpl.java @@ -18,6 +18,7 @@ import com.openhis.administration.domain.ChargeItem; import com.openhis.administration.service.IChargeItemService; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.ChargeItemStatus; +import com.openhis.common.enums.Whether; import com.openhis.jlau.domain.ReviewPrescriptionRecords; import com.openhis.jlau.service.IReviewPrescriptionRecordsService; import com.openhis.web.jlau.appservice.IReviewPrescriptionRecordsAppService; @@ -92,4 +93,30 @@ public class ReviewPrescriptionRecordsAppServiceImpl implements IReviewPrescript return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"审核处方"})); } + /** + * 通过处方号查询审方记录 + * + * @param prescriptionNo 处方号 + * @return 审方记录 + */ + @Override + public R getReviewByPrescriptionNo(String prescriptionNo) { + List reviewPrescriptionRecords = + reviewPrescriptionRecordsAppMapper.getReviewPrescriptionRecords(prescriptionNo, null, null); + return R.ok(reviewPrescriptionRecords); + } + + /** + * 通过就诊id查询审方记录 + * + * @param encounterId 就诊id + * @return 审方记录 + */ + @Override + public R getReviewByEncounterId(Long encounterId) { + List reviewPrescriptionRecords = + reviewPrescriptionRecordsAppMapper.getReviewPrescriptionRecords(null, encounterId, Whether.YES.getValue()); + return R.ok(reviewPrescriptionRecords); + } + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/controller/ReviewPrescriptionRecordsController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/controller/ReviewPrescriptionRecordsController.java index 2f13b8d3295941f2fe5bf4e48a53e786a7062dd5..e8d9656a48ab1f8a87661d955821a6ef311cb0c8 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/controller/ReviewPrescriptionRecordsController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/controller/ReviewPrescriptionRecordsController.java @@ -3,15 +3,11 @@ */ package com.openhis.web.jlau.controller; -import com.core.common.core.domain.R; -import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto; -import com.openhis.web.regdoctorstation.dto.NursingOrdersSaveDto; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import com.core.common.core.domain.R; import com.openhis.web.jlau.appservice.IReviewPrescriptionRecordsAppService; +import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -38,4 +34,26 @@ public class ReviewPrescriptionRecordsController { return iReviewPrescriptionRecordsAppService.reviewPrescription(reviewPrescriptionRecordsDto); } + /** + * 通过处方号查询审方记录 + * + * @param prescriptionNo 处方号 + * @return 审方记录 + */ + @GetMapping(value = "/review-by-prescription-no") + public R getReviewByPrescriptionNo(@RequestParam(value = "prescriptionNo") String prescriptionNo) { + return iReviewPrescriptionRecordsAppService.getReviewByPrescriptionNo(prescriptionNo); + } + + /** + * 通过就诊id查询审方记录 + * + * @param encounterId 就诊id + * @return 审方记录 + */ + @GetMapping(value = "/review-by-encounter") + public R getReviewByEncounterId(@RequestParam(value = "encounterId") Long encounterId) { + return iReviewPrescriptionRecordsAppService.getReviewByEncounterId(encounterId); + } + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/dto/ReviewPrescriptionRecordsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/dto/ReviewPrescriptionRecordsDto.java index ea79d4c52552e064c55704f0133583ca681bd6f8..a75bbdd949cfd7dac699f253bc8fb06bc57ff22b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/dto/ReviewPrescriptionRecordsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/dto/ReviewPrescriptionRecordsDto.java @@ -47,4 +47,9 @@ public class ReviewPrescriptionRecordsDto { */ private String reasonText; + /** + * 审方人 + */ + private String practitionerName; + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/mapper/ReviewPrescriptionRecordsAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/mapper/ReviewPrescriptionRecordsAppMapper.java index e5cb7a53c78359b715f135d06e5314121410310b..9011001682194f9edb75378dc42071e63c1c0dd1 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/mapper/ReviewPrescriptionRecordsAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/jlau/mapper/ReviewPrescriptionRecordsAppMapper.java @@ -1,11 +1,27 @@ package com.openhis.web.jlau.mapper; +import java.util.List; + +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto; + /** * 农大审方记录 应用Mapper */ @Repository public interface ReviewPrescriptionRecordsAppMapper { + /** + * 查询农大审方记录 + * + * @param prescriptionNo 处方号 + * @param encounterId 就诊id + * @param passFlag 通过标识 + * @return 农大审方记录 + */ + List getReviewPrescriptionRecords(@Param("prescriptionNo") String prescriptionNo, + @Param("encounterId") Long encounterId, @Param("passFlag") Integer passFlag); + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientTreatmentAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientTreatmentAppServiceImpl.java index cb249bf3a8d87d82fe0dd06bca5b4048b79fa2c3..6cc2c89be76bfda09c07368d5d456737ccfccf56 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientTreatmentAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientTreatmentAppServiceImpl.java @@ -306,19 +306,19 @@ public class OutpatientTreatmentAppServiceImpl implements IOutpatientTreatmentAp // 判断该项目是否已经执行了 if (performCount - cancelCount < exeCount) { // 未执行则新增执行记录 - boolean result = procedureService.addProcedureRecord(encounterId, patientId, requestId, + Long procedureId = procedureService.addProcedureRecord(encounterId, patientId, requestId, performInfoDto.getRequestTable(), EventStatus.COMPLETED, - ProcedureCategory.OUTPATIENT_ADVICE, null, groupId, null); - if (!result) { + ProcedureCategory.OUTPATIENT_ADVICE, null, DateUtils.getNowDate(), groupId, null); + if (procedureId == null) { throw new ServiceException("执行失败,请联系管理员"); } } } else { // 新增执行记录 - boolean result = procedureService.addProcedureRecord(encounterId, patientId, requestId, + Long procedureId = procedureService.addProcedureRecord(encounterId, patientId, requestId, performInfoDto.getRequestTable(), EventStatus.COMPLETED, ProcedureCategory.OUTPATIENT_ADVICE, - null, groupId, null); - if (!result) { + null, DateUtils.getNowDate(), groupId, null); + if (procedureId == null) { throw new ServiceException("执行失败,请联系管理员"); } } @@ -469,11 +469,11 @@ public class OutpatientTreatmentAppServiceImpl implements IOutpatientTreatmentAp // 判断该项目是否已经执行了 if (performCount - cancelCount > 0) { // 已执行则新增取消执行记录 - boolean result = procedureService.addProcedureRecord(procedure.getEncounterId(), + Long procedureId = procedureService.addProcedureRecord(procedure.getEncounterId(), procedure.getPatientId(), procedure.getRequestId(), procedure.getRequestTable(), EventStatus.CANCEL, ProcedureCategory.OUTPATIENT_ADVICE, performInfoDto.getLocationId(), - performInfoDto.getGroupId(), null); - if (!result) { + DateUtils.getNowDate(), performInfoDto.getGroupId(), null); + if (procedureId == null) { throw new ServiceException("取消执行失败,请联系管理员"); } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java index 30313f131a75caffed7eaa5b8816c5b703e66214..3bb6e966dfc8e37cf7161d6c4a89450e602177d8 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java @@ -166,22 +166,13 @@ public class PatientInformationServiceImpl implements IPatientInformationService public R editPatient(PatientInformationDto patientInformationDto) { // 如果患者没有输入身份证号则根据年龄自动生成 String idCard = patientInformationDto.getIdCard(); - Date birthday = null; -// if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) { -// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge()); -// Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); -// patientInformationDto.setIdCard(idCard).setBirthDate(birthday); -// } - if (idCard != null && !idCard.isEmpty()) { - birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); - patientInformationDto.setIdCard(idCard).setBirthDate(birthday); + if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) { + if (patientInformationDto.getAge() != null) { + idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge()); + Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); + patientInformationDto.setIdCard(idCard).setBirthDate(birthday); + } } - // if(idCard==null&&patientInformationDto.getAge() != null) -// { -// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge()); -// birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); -// patientInformationDto.setIdCard(idCard).setBirthDate(birthday); -// } Patient patient = new Patient(); BeanUtils.copyProperties(patientInformationDto, patient); @@ -232,22 +223,13 @@ public class PatientInformationServiceImpl implements IPatientInformationService public R addPatient(PatientInformationDto patientInformationDto) { // 如果患者没有输入身份证号则根据年龄自动生成 String idCard = patientInformationDto.getIdCard(); - Date birthday = null; -// if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) { -// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge()); -// Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); -// patientInformationDto.setIdCard(idCard).setBirthDate(birthday); -// } - if (idCard != null && !idCard.isEmpty()) { - birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); - patientInformationDto.setIdCard(idCard).setBirthDate(birthday); + if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) { + if (patientInformationDto.getAge() != null) { + idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge()); + Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); + patientInformationDto.setIdCard(idCard).setBirthDate(birthday); + } } -// if(idCard==null&&patientInformationDto.getAge() != null) -// { -// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge()); -// birthday = IdCardUtil.extractBirthdayFromIdCard(idCard); -// patientInformationDto.setIdCard(idCard).setBirthDate(birthday); -// } Patient patient = new Patient(); BeanUtils.copyProperties(patientInformationDto, patient); patient.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10)); @@ -269,9 +251,8 @@ public class PatientInformationServiceImpl implements IPatientInformationService .setIdentifierNo(patientInformationDto.getIdentifierNo()) // 标识状态默认:常规 .setStateEnum(IdentifierStatusEnum.USUAL.getValue()); - boolean resPatId = patientIdentifierService.save(patientIdentifier); - - return resPatient && resPatId + boolean result = patientIdentifierService.save(patientIdentifier); + return result ? R.ok(patient, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"})) : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"})); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/IPaymentRecService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/IPaymentRecService.java index 296ae89d41e70c8aa81b0fc9665dc388caa99254..9396443865c8f437f5f8eb6876c58f4570c488ee 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/IPaymentRecService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/IPaymentRecService.java @@ -59,7 +59,7 @@ public interface IPaymentRecService { * @param request 请求参数 * @return 结果 */ - IPage getPage(String searchKey, Integer kingEnum, Integer pageNo, Integer pageSize, + IPage getPage(String searchKey, Integer kingEnum,String invoiceNo, Integer pageNo, Integer pageSize, HttpServletRequest request); /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java index abed2fe88148a4f53f34a9e99e8ed6f88eb02426..5a0ddd68872b68b29af10415f3dd40a3883cbb99 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java @@ -749,16 +749,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService { * @return 结果 */ @Override - public IPage getPage(String searchKey, Integer kingEnum, Integer pageNo, Integer pageSize, + public IPage getPage(String searchKey, Integer kingEnum, String invoiceNo,Integer pageNo, Integer pageSize, HttpServletRequest request) { // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(new PaymentVO(), searchKey, - new HashSet<>(Arrays.asList(CommonConstants.FieldName.EncounterId, CommonConstants.FieldName.ContractNo, - CommonConstants.FieldName.paymentNo)), + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.paymentNo)), request); // queryWrapper.eq(PaymentVO::getStatusEnum,PaymentStatus.SUCCESS.getValue()).or().eq(PaymentVO::getStatusEnum,PaymentStatus.REFUND_ALL.getValue()); queryWrapper.in("status_enum", PaymentStatus.SUCCESS.getValue(), PaymentStatus.REFUND_ALL.getValue()); - IPage paymentDtoIPage = paymentMapper.getPage(new Page<>(pageNo, pageSize), kingEnum, queryWrapper); + IPage paymentDtoIPage = paymentMapper.getPage(new Page<>(pageNo, pageSize), kingEnum, invoiceNo,queryWrapper); for (PaymentVO record : paymentDtoIPage.getRecords()) { record.setPaymentId(record.getId().toString()); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/controller/PaymentReconciliationController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/controller/PaymentReconciliationController.java index 856bf94906bbda330bb5e69ae7fe7a04af1d123e..b97889d78369e866238978968fa24145478af60e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/controller/PaymentReconciliationController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/controller/PaymentReconciliationController.java @@ -3,11 +3,13 @@ */ package com.openhis.web.paymentmanage.controller; +import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; +import com.core.common.utils.SecurityUtils; import com.openhis.web.paymentmanage.dto.CancelPaymentInpatientDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -84,14 +86,18 @@ public class PaymentReconciliationController { if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) { paymentRecon = (PaymentReconciliation)result.getData(); } - R eleResult = eleInvoiceService.invoiceMZMake(paymentRecon.getId(), paymentDto.getEncounterId()); - Map detail = iChargeBillService.getDetail(paymentRecon.getId()); - if (eleResult.getCode() != 200) { - // 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok - return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg()); + Map detail=iChargeBillService.getDetail(paymentRecon.getId()); + if("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) { + return R.ok(detail); + }else { + R eleResult = eleInvoiceService.invoiceMZMake(paymentRecon.getId(), paymentDto.getEncounterId()); + if (eleResult.getCode() != 200) { + // 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok + return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg()); + } } + // Map detail = iChargeBillService.getDetail(paymentRecon.getId()); - return R.ok(detail); } return result; } @@ -110,12 +116,15 @@ public class PaymentReconciliationController { if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) { paymentRecon = (PaymentReconciliation)result.getData(); } - R eleResult = - eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelPaymentDto.getReason()); - if (eleResult.getCode() != 200) { - // 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok - return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg()); + if(!"0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) { + R eleResult = + eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelPaymentDto.getReason()); + if (eleResult.getCode() != 200) { + // 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok + return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg()); + } } + } return result; } @@ -132,9 +141,10 @@ public class PaymentReconciliationController { @GetMapping("/page") public R paymentPage(@RequestParam(value = "searchKey", defaultValue = "") String searchKey, @RequestParam(value = "kinsEnum", defaultValue = "") Integer kinsEnum, + @RequestParam(value = "invoiceNo", defaultValue = "") String invoiceNo, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - return R.ok(paymentReconciliationService.getPage(searchKey, kinsEnum, pageNo, pageSize, request)); + return R.ok(paymentReconciliationService.getPage(searchKey, kinsEnum, invoiceNo,pageNo, pageSize, request)); } /** @@ -168,21 +178,24 @@ public class PaymentReconciliationController { @PostMapping("/reg-pay") public R regPay(@Valid @RequestBody OutpatientRegistrationSettleParam outpatientRegistrationAddParam) { R result = paymentReconciliationService.regPay(outpatientRegistrationAddParam, - outpatientRegistrationAddParam.getChrgBchno(), outpatientRegistrationAddParam.getPaymentDetails()); + outpatientRegistrationAddParam.getChrgBchno(), outpatientRegistrationAddParam.getPaymentDetails()); // 付款成功后,开具发票 if (result.getCode() == 200) { PaymentReconciliation paymentRecon = null; if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) { paymentRecon = (PaymentReconciliation)result.getData(); } - Long encounterId = paymentRecon.getEncounterId(); - R eleResult = eleInvoiceService.invoiceRegMake(paymentRecon.getId(), encounterId); Map detail = iChargeBillService.getDetail(paymentRecon.getId()); - if (eleResult.getCode() != 200) { - // 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok - return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg()); + Long encounterId = paymentRecon.getEncounterId(); + if("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) { + return R.ok(detail); + }else { + R eleResult = eleInvoiceService.invoiceRegMake(paymentRecon.getId(), encounterId); + if (eleResult.getCode() != 200) { + // 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok + return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg()); + } } - return R.ok(detail); } return result; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/PaymentMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/PaymentMapper.java index 3c7dfd3ff43bbca88374e10af1a0bfcaca3f5f5d..ed0bf6e4c78e8509fd7943b4e83d1d9c30d9a77e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/PaymentMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/PaymentMapper.java @@ -32,7 +32,7 @@ public interface PaymentMapper { * @param queryWrapper * @return */ - IPage getPage(@Param("page") Page page, @Param("kindEnum") Integer kindEnum, + IPage getPage(@Param("page") Page page, @Param("kindEnum") Integer kindEnum, @Param("invoiceNo") String invoiceNo, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInpatientMedicineSummaryDispenseAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/ISummaryDispenseMedicineAppService.java similarity index 70% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInpatientMedicineSummaryDispenseAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/ISummaryDispenseMedicineAppService.java index 3f429999a426da97f8ac547d80404d5375997d70..2c38eaffac5d1a86ae02bf32eb61458bd5ac6ad6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInpatientMedicineSummaryDispenseAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/ISummaryDispenseMedicineAppService.java @@ -1,11 +1,11 @@ package com.openhis.web.pharmacymanage.appservice; +import java.util.List; + import javax.servlet.http.HttpServletRequest; import com.core.common.core.domain.R; -import com.openhis.web.pharmacymanage.dto.InpatientMedicineSearchParam; - -import java.util.List; +import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam; /** * 住院汇总发药 应用实现接口 @@ -13,7 +13,7 @@ import java.util.List; * @author yuxj * @date 2025/6/3 */ -public interface IInpatientMedicineSummaryDispenseAppService { +public interface ISummaryDispenseMedicineAppService { /** * 页面初始化 @@ -31,7 +31,7 @@ public interface IInpatientMedicineSummaryDispenseAppService { * @param pageSize 查询条数 * @param request 请求数据 */ - R getMedicationSummaryInfo(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo, + R getMedicationSummaryInfo(MedicineSummarySearchParam searchParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request); /** @@ -40,7 +40,7 @@ public interface IInpatientMedicineSummaryDispenseAppService { * @param searchParam 条件 * @return 处理结果 */ - R medicineDispense(List searchParam); + R SummaryDispenseMedicine(List searchParam); /** * 作废 @@ -49,5 +49,5 @@ public interface IInpatientMedicineSummaryDispenseAppService { * @param notPerformedReasonEnum 未发原因 * @return 处理结果 */ - R medicineCancel(List deliveryIdList, Integer notPerformedReasonEnum); + R dispenseCancel(List deliveryIdList, Integer notPerformedReasonEnum); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/ReturnMedicineAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/ReturnMedicineAppServiceImpl.java index 2d3ab162adc2b99aa94574b39eb3c56040478f72..3621e58242de40ec6e14026519a8ce9071e53468 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/ReturnMedicineAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/ReturnMedicineAppServiceImpl.java @@ -8,6 +8,9 @@ import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import com.openhis.yb.dto.MedicalInventory3511Output; +import com.openhis.yb.dto.MedicalInventory3511Param; +import com.openhis.yb.service.YbHttpUtils; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONArray; @@ -117,6 +120,9 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService { @Resource private ReceiptApprovalAppServiceImpl receiptApprovalAppService; + @Resource + private YbHttpUtils ybHttpUtils; + /** * 获取页面初始化信息 * @@ -421,31 +427,43 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService { // 调用医保商品销售退货接口 String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 if (Whether.YES.getCode().equals(ybSwitch)) { - if (!medicationRefundList.isEmpty() || !devRefundList.isEmpty()) { + List deviceDefinitions = new ArrayList<>(); + List medicationDefinitions = new ArrayList<>(); + if (!medicationRefundList.isEmpty()) { // 设置进销存参数 - List medicationDefinitions = - medicationDefinitionService.listByIds(supplyItemDetailList.stream() - .filter(x -> x.getItemTable().equals(CommonConstants.TableName.MED_MEDICATION_DEFINITION)) - .map(SupplyItemDetailDto::getItemId).collect(Collectors.toList())); - List deviceDefinitions = deviceDefinitionService.listByIds(supplyItemDetailList - .stream().filter(x -> x.getItemTable().equals(CommonConstants.TableName.ADM_DEVICE_DEFINITION)) + medicationDefinitions = medicationDefinitionService.listByIds(supplyItemDetailList.stream() + .filter(x -> x.getItemTable().equals(CommonConstants.TableName.MED_MEDICATION_DEFINITION)) .map(SupplyItemDetailDto::getItemId).collect(Collectors.toList())); + } + if (!devRefundList.isEmpty()) { + deviceDefinitions = deviceDefinitionService.listByIds(supplyItemDetailList.stream() + .filter(x -> x.getItemTable().equals(CommonConstants.TableName.ADM_DEVICE_DEFINITION)) + .map(SupplyItemDetailDto::getItemId).collect(Collectors.toList())); + } - // 用itemId分组 - Map medicationMap = medicationDefinitions.stream() - .collect(Collectors.toMap(MedicationDefinition::getId, Function.identity())); - Map deviceMap = - deviceDefinitions.stream().collect(Collectors.toMap(DeviceDefinition::getId, Function.identity())); + // 创建映射表,添加空集合保护 + Map medicationMap = + medicationDefinitions != null ? medicationDefinitions.stream().filter(Objects::nonNull) + .collect(Collectors.toMap(MedicationDefinition::getId, Function.identity())) : new HashMap<>(); - // 设置库存变更参数 - for (SupplyItemDetailDto dto : supplyItemDetailList) { - if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(dto.getItemTable())) { + Map deviceMap = + deviceDefinitions != null ? deviceDefinitions.stream().filter(Objects::nonNull) + .collect(Collectors.toMap(DeviceDefinition::getId, Function.identity())) : new HashMap<>(); + + // 设置库存变更参数,添加完整判空 + for (SupplyItemDetailDto dto : supplyItemDetailList) { + if (dto == null) + continue; + if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(dto.getItemTable())) { + if (dto.getItemId() != null) { MedicationDefinition med = medicationMap.get(dto.getItemId()); if (med != null) { dto.setItemBusNo(med.getBusNo()).setPartPercent(med.getPartPercent()) .setRxFlag(med.getRxFlag()).setYbNo(med.getYbNo()); } - } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dto.getItemTable())) { + } + } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dto.getItemTable())) { + if (dto.getItemId() != null) { DeviceDefinition dev = deviceMap.get(dto.getItemId()); if (dev != null) { dto.setItemBusNo(dev.getBusNo()).setPartPercent(dev.getPartPercent()) @@ -453,14 +471,14 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService { } } } - uploadFailedNoList = this.ybReturnIntegrated(medDispenseIdList, devDispenseIdList); - uploadFailedNoList = receiptApprovalAppService.ybInventoryIntegrated(supplyItemDetailList, - YbInvChgType.OTHER_OUT, DateUtils.getNowDate()); - if (uploadFailedNoList != null) { - returnMsg = "3506商品销售退货上传错误,错误项目编码" + uploadFailedNoList; - } else { - returnMsg = "3506商品销售退货上传成功"; - } + } + uploadFailedNoList = this.ybReturnIntegrated(medDispenseIdList, devDispenseIdList); + uploadFailedNoList = receiptApprovalAppService.ybInventoryIntegrated(supplyItemDetailList, + YbInvChgType.OTHER_OUT, DateUtils.getNowDate()); + if (uploadFailedNoList != null) { + returnMsg = "3506商品销售退货上传错误,错误项目编码" + uploadFailedNoList; + } else { + returnMsg = "3506商品销售退货上传成功"; } } // 返回退药成功信息 @@ -618,6 +636,21 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService { } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dispenseInventoryDto.getItemTable())) { medical3506Param.setFixmedinsHilistName(CommonConstants.TableName.ADM_DEVICE_DEFINITION); } + MedicalInventory3511Output medicalInventory3511Output = + ybHttpUtils.querySalesInfo(getMedical3511Param(dispenseInventoryDto)); + medical3506Param.setMedinsProdSelNo(medicalInventory3511Output.getMedinsProdSelNo()); return medical3506Param; } + + private MedicalInventory3511Param getMedical3511Param(DispenseInventoryDto dispenseInventoryDto) { + MedicalInventory3511Param medicalInventory3511Param = new MedicalInventory3511Param(); + + String fixmedinsCode = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE); + // TODO + medicalInventory3511Param.setFixmedinsCode(fixmedinsCode).setMedinsListCodg(dispenseInventoryDto.getYbNo()) + .setFixmedinsBchno(dispenseInventoryDto.getLotNumber()).setBegndate(dispenseInventoryDto.getDispenseTime()).setEnddate(dispenseInventoryDto.getDispenseTime()); + + return medicalInventory3511Param; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InpatientMedicineSummaryDispenseAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/SummaryDispenseMedicineAppServiceImpl.java similarity index 89% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InpatientMedicineSummaryDispenseAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/SummaryDispenseMedicineAppServiceImpl.java index f3ddafaa73d9f13c725533419410dd2f7d21178a..d1fe464a4ef48d7f8c3894af4fbc539c679ebd02 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InpatientMedicineSummaryDispenseAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/SummaryDispenseMedicineAppServiceImpl.java @@ -7,7 +7,6 @@ import java.util.stream.Stream; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import com.openhis.web.pharmacymanage.dto.InpatientMedicineSummaryDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -32,12 +31,13 @@ import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.medication.domain.MedicationDispense; import com.openhis.medication.service.IMedicationDispenseService; -import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService; -import com.openhis.web.pharmacymanage.appservice.IInpatientMedicineSummaryDispenseAppService; -import com.openhis.web.pharmacymanage.dto.InpatientMedicineInitDto; -import com.openhis.web.pharmacymanage.dto.InpatientMedicineSearchParam; -import com.openhis.web.pharmacymanage.mapper.InpatientMedicineSummaryDispenseMapper; +import com.openhis.web.inhospitalnursestation.appservice.IMedicineSummaryAppService; +import com.openhis.web.pharmacymanage.appservice.ISummaryDispenseMedicineAppService; +import com.openhis.web.pharmacymanage.dto.MedicineSummaryDto; +import com.openhis.web.pharmacymanage.dto.MedicineSummaryInitDto; +import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam; import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper; +import com.openhis.web.pharmacymanage.mapper.SummaryDispenseMedicineMapper; import com.openhis.workflow.domain.DeviceDispense; import com.openhis.workflow.domain.InventoryItem; import com.openhis.workflow.domain.SupplyDelivery; @@ -54,7 +54,7 @@ import com.openhis.workflow.service.ISupplyRequestService; * @date 2025/6/3 */ @Service -public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatientMedicineSummaryDispenseAppService { +public class SummaryDispenseMedicineAppServiceImpl implements ISummaryDispenseMedicineAppService { @Autowired private IMedicationDispenseService medicationDispenseService; @@ -66,7 +66,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien private IInventoryItemService iInventoryItemService; @Autowired - private InpatientMedicineSummaryDispenseMapper inpatientMedicineDispenseMapper; + private SummaryDispenseMedicineMapper inpatientMedicineDispenseMapper; @Autowired private ReturnMedicineMapper returnMedicineMapper; @@ -85,7 +85,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien private WesternMedicineDispenseAppServiceImpl westernMedicineDispenseAppServiceImpl; @Autowired - private IInpatientMedicineCollectionAppService inpatientMedicineCollectionAppService; + private IMedicineSummaryAppService inpatientMedicineCollectionAppService; /** * 获取页面初始化信息 @@ -95,7 +95,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien @Override public R init() { - InpatientMedicineInitDto initDto = new InpatientMedicineInitDto(); + MedicineSummaryInitDto initDto = new MedicineSummaryInitDto(); // // 获取科室下拉选列表 todo 前台直接调用共通方法 // List organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), @@ -105,9 +105,9 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien // organization.getName())).collect(Collectors.toList()); // 未发药原因下拉选列表 - List notPerformedReasonOptions = + List notPerformedReasonOptions = Stream.of(NotPerformedReasonEnum.values()) - .map(notPerformedReason -> new InpatientMedicineInitDto.IntegerOptions(notPerformedReason.getValue(), + .map(notPerformedReason -> new MedicineSummaryInitDto.IntegerOptions(notPerformedReason.getValue(), notPerformedReason.getInfo())) .collect(Collectors.toList()); @@ -115,12 +115,12 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien List applicantList = practitionerService.getList(); // 发药状态 - List dispenseStatusOptions = new ArrayList<>(); - dispenseStatusOptions.add(new InpatientMedicineInitDto.IntegerOptions(DispenseStatus.SUMMARIZED.getValue(), + List dispenseStatusOptions = new ArrayList<>(); + dispenseStatusOptions.add(new MedicineSummaryInitDto.IntegerOptions(DispenseStatus.SUMMARIZED.getValue(), DispenseStatus.SUMMARIZED.getInfo())); - dispenseStatusOptions.add(new InpatientMedicineInitDto.IntegerOptions(DispenseStatus.COMPLETED.getValue(), + dispenseStatusOptions.add(new MedicineSummaryInitDto.IntegerOptions(DispenseStatus.COMPLETED.getValue(), DispenseStatus.COMPLETED.getInfo())); - dispenseStatusOptions.add(new InpatientMedicineInitDto.IntegerOptions(DispenseStatus.DECLINED.getValue(), + dispenseStatusOptions.add(new MedicineSummaryInitDto.IntegerOptions(DispenseStatus.DECLINED.getValue(), DispenseStatus.DECLINED.getInfo())); initDto// .setDepartmentOptions(organizationOptions) @@ -139,37 +139,35 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien * @param request 请求数据 */ @Override - public R getMedicationSummaryInfo(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo, + public R getMedicationSummaryInfo(MedicineSummarySearchParam searchParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) { // 构建查询条件 - QueryWrapper queryWrapper = + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(searchParam, searchKey, null, request); queryWrapper.orderByDesc(CommonConstants.FieldName.applyTime); // 查询医嘱详细信息 - Page prescriptionItemInfoPageDto = + Page prescriptionItemInfoPageDto = inpatientMedicineDispenseMapper.selectMedicationSummaryInfo(new Page<>(pageNo, pageSize), queryWrapper, CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION, SupplyType.DISPENSING_ORDER.getValue(), SupplyCategory.INPATIENT_PATIENT_SUMMARY_DISPENSING.getValue()); - List unitList; + List unitList; // 个别项目设定 - for (InpatientMedicineSummaryDto prescriptionInfoDto : prescriptionItemInfoPageDto - .getRecords()) { + for (MedicineSummaryDto prescriptionInfoDto : prescriptionItemInfoPageDto.getRecords()) { // 状态 prescriptionInfoDto.setStatusEnum_enumText( EnumUtils.getInfoByValue(DispenseStatus.class, prescriptionInfoDto.getStatusEnum())); // 追溯码单位列表 unitList = new ArrayList<>(); - unitList.add(new InpatientMedicineSummaryDto.Option(prescriptionInfoDto.getMaxUnitCode(), + unitList.add(new MedicineSummaryDto.Option(prescriptionInfoDto.getMaxUnitCode(), prescriptionInfoDto.getMaxUnitCode_dictText())); - unitList.add(new InpatientMedicineSummaryDto.Option(prescriptionInfoDto.getMinUnitCode(), + unitList.add(new MedicineSummaryDto.Option(prescriptionInfoDto.getMinUnitCode(), prescriptionInfoDto.getMinUnitCode_dictText())); prescriptionInfoDto.setUnitList(unitList); } ; - return R.ok(prescriptionItemInfoPageDto); } @@ -180,10 +178,10 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien * @return 处理结果 */ @Override - public R medicineDispense(List searchParam) { + public R SummaryDispenseMedicine(List searchParam) { // 构建供应发放Id到追溯码的映射 Map traceNoMap = new HashMap<>(); - for (InpatientMedicineSearchParam param : searchParam) { + for (MedicineSummarySearchParam param : searchParam) { if (param != null && param.getDeliveryId() != null) { traceNoMap.put(param.getDeliveryId(), param.getTraceNo()); } @@ -191,7 +189,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien // 供应发放idList List deliveryIdList = - searchParam.stream().map(InpatientMedicineSearchParam::getDeliveryId).collect(Collectors.toList()); + searchParam.stream().map(MedicineSummarySearchParam::getDeliveryId).collect(Collectors.toList()); // 获取供应发放信息列表 List supplyDeliveryInfoList = supplyDeliveryService.selectByIdList(deliveryIdList); // 供应申请idList @@ -214,7 +212,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien idList = Arrays.stream(idArray).map(String::trim) // 去除每个元素前后的空格 .filter(str -> !str.isEmpty()) // 过滤空字符串(如连续逗号导致的空值) .map(Long::parseLong) // 转换为Long类型 - .collect(Collectors.toList()); // 收集为List + .toList(); // 收集为List // 设置发放ID列表,追溯码映射 if (item.getBasedOnTable().equals(CommonConstants.TableName.MED_MEDICATION_DISPENSE)) { // 耗材发放ID列表 @@ -426,7 +424,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien * @return 处理结果 */ @Override - public R medicineCancel(List deliveryIdList, Integer notPerformedReasonEnum) { + public R dispenseCancel(List deliveryIdList, Integer notPerformedReasonEnum) { // 获取供应发放信息列表 List supplyDeliveryInfoList = supplyDeliveryService.selectByIdList(deliveryIdList); List supplyRequestInfoList; @@ -448,7 +446,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien idList = Arrays.stream(idArray).map(String::trim) // 去除每个元素前后的空格 .filter(str -> !str.isEmpty()) // 过滤空字符串(如连续逗号导致的空值) .map(Long::parseLong) // 转换为Long类型 - .collect(Collectors.toList()); // 收集为List + .toList(); // 收集为List // 设置发放ID列表,追溯码映射 if (item.getBasedOnTable().equals(CommonConstants.TableName.MED_MEDICATION_DISPENSE)) { // 耗材发放ID列表 @@ -482,7 +480,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien } // 获取发耗材单id列表 - List devDispenseInfoList = deviceDispenseService.selectByIdList(devDispenseIdList); + List devDispenseInfoList = deviceDispenseService.listByIds(devDispenseIdList); if (devDispenseInfoList != null) { for (DeviceDispense deviceDispense : devDispenseInfoList) { // 耗材发放状态 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InpatientMedicineSummaryDispenseController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/SummaryDispenseMedicineController.java similarity index 63% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InpatientMedicineSummaryDispenseController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/SummaryDispenseMedicineController.java index 6ad8a280c78d3cd49cb40113b564724134665d82..4be5f20f569cd21616c13feea8204d4f09425bb2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InpatientMedicineSummaryDispenseController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/SummaryDispenseMedicineController.java @@ -1,19 +1,19 @@ package com.openhis.web.pharmacymanage.controller; +import java.util.List; + import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.*; import com.core.common.core.domain.R; -import com.openhis.web.pharmacymanage.appservice.IInpatientMedicineSummaryDispenseAppService; -import com.openhis.web.pharmacymanage.dto.InpatientMedicineSearchParam; +import com.openhis.web.pharmacymanage.appservice.ISummaryDispenseMedicineAppService; +import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import java.util.List; - /** * 住院汇总发药 * @@ -21,13 +21,13 @@ import java.util.List; * @date 2025/6/3 */ @RestController -@RequestMapping("/pharmacy-manage/inpatient-medicine-summary-dispense") +@RequestMapping("/pharmacy-manage/summary-dispense-medicine") @Slf4j @AllArgsConstructor -public class InpatientMedicineSummaryDispenseController { +public class SummaryDispenseMedicineController { @Resource - public IInpatientMedicineSummaryDispenseAppService medicineSummaryDispenseService; + public ISummaryDispenseMedicineAppService medicineSummaryDispenseService; /** * 获取页面初始化信息 @@ -48,8 +48,8 @@ public class InpatientMedicineSummaryDispenseController { * @param pageSize 查询条数 * @param request 请求数据 */ - @GetMapping("/medicationSummary-list") - public R getMedicationSummaryInfo(InpatientMedicineSearchParam searchParam, String searchKey, + @GetMapping("/medication_summary-list") + public R getMedicationSummaryInfo(MedicineSummarySearchParam searchParam, String searchKey, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { return medicineSummaryDispenseService.getMedicationSummaryInfo(searchParam, searchKey, pageNo, pageSize, @@ -57,14 +57,14 @@ public class InpatientMedicineSummaryDispenseController { } /** - * 核对发药 + * 汇总发药 * * @param searchParam 条件 * @return 处理结果 */ - @PutMapping("/medicine-dispense") - public R medicineDispense(@RequestBody List searchParam) { - return medicineSummaryDispenseService.medicineDispense(searchParam); + @PutMapping("/summary-dispense-medicine") + public R SummaryDispenseMedicine(@RequestBody List searchParam) { + return medicineSummaryDispenseService.SummaryDispenseMedicine(searchParam); } /** @@ -74,9 +74,9 @@ public class InpatientMedicineSummaryDispenseController { * @param notPerformedReasonEnum 未发原因 * @return 处理结果 */ - @PutMapping("/medicine-cancel") - public R medicineCancel(@RequestBody List deliveryIdList, Integer notPerformedReasonEnum) { - return medicineSummaryDispenseService.medicineCancel(deliveryIdList, notPerformedReasonEnum); + @PutMapping("/dispense-cancel") + public R dispenseCancel(@RequestBody List deliveryIdList, Integer notPerformedReasonEnum) { + return medicineSummaryDispenseService.dispenseCancel(deliveryIdList, notPerformedReasonEnum); } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineSummaryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummaryDto.java similarity index 96% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineSummaryDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummaryDto.java index 9f5c83dd730fe5056252041fefb69a80c76acb12..9ade417254151c43a6ff97129ec9d862b39b6616 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineSummaryDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummaryDto.java @@ -21,7 +21,7 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -public class InpatientMedicineSummaryDto { +public class MedicineSummaryDto { /** * 单据号 @@ -110,7 +110,7 @@ public class InpatientMedicineSummaryDto { /** * 单位列表 */ - private List unitList; + private List unitList; @Data public static class Option { diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummaryInitDto.java similarity index 97% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummaryInitDto.java index 576b392491c299b972008113a5b0d5bd329766a4..a894e0a548eb160cfcf6e1b35b815f86161efff0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummaryInitDto.java @@ -20,7 +20,7 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -public class InpatientMedicineInitDto { +public class MedicineSummaryInitDto { /** 科室列表 */ private List departmentOptions; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummarySearchParam.java similarity index 86% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineSearchParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummarySearchParam.java index 4297dd64b5f94ca2c0c3017cb53c67afb0e1ccb6..6d5e13ad51b8ed0eaa57e5eb09247aca41f9d154 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/InpatientMedicineSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/MedicineSummarySearchParam.java @@ -4,12 +4,10 @@ package com.openhis.web.pharmacymanage.dto; import java.io.Serializable; -import java.util.List; 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; @@ -21,7 +19,7 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -public class InpatientMedicineSearchParam implements Serializable { +public class MedicineSummarySearchParam implements Serializable { /** 科室 */ @JsonSerialize(using = ToStringSerializer.class) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InpatientMedicineSummaryDispenseMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/SummaryDispenseMedicineMapper.java similarity index 40% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InpatientMedicineSummaryDispenseMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/SummaryDispenseMedicineMapper.java index 74a622d15b61c7a86e98fdb91c1484e3e4e7c290..838b4cbc64e855ee8556e1813e1ca6433aad5714 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InpatientMedicineSummaryDispenseMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/SummaryDispenseMedicineMapper.java @@ -3,31 +3,29 @@ */ package com.openhis.web.pharmacymanage.mapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Constants; -import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.openhis.web.pharmacymanage.dto.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.pharmacymanage.dto.MedicineSummaryDto; +import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam; @Repository -public interface InpatientMedicineSummaryDispenseMapper { +public interface SummaryDispenseMedicineMapper { /** - * 医嘱列表查询 + * 汇总药品信息列表查询 * - * @param page 分页 - * @param queryWrapper 查询条件 + * @param page 分页 + * @param queryWrapper 查询条件 * @param medicationDefinition 药品定义 * @param deviceDefinition 耗材定义 - * @return 医嘱信息 + * @return 汇总药品信息 */ - Page selectMedicationSummaryInfo( - @Param("page") Page page, - @Param(Constants.WRAPPER) QueryWrapper queryWrapper, - @Param("medicationDefinition") String medicationDefinition, - @Param("deviceDefinition") String deviceDefinition, @Param("typeEnum") Integer typeEnum,@Param("categoryEnum") Integer categoryEnum - ); + Page selectMedicationSummaryInfo(@Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper, + @Param("medicationDefinition") String medicationDefinition, @Param("deviceDefinition") String deviceDefinition, + @Param("typeEnum") Integer typeEnum, @Param("categoryEnum") Integer categoryEnum); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java index f60180b1552e565f8eea9ed298f80d348258a486..8bc51a188028b78bed325c53c0a890f704390449 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java @@ -260,9 +260,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { longMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间 longMedicationRequest .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); - longMedicationRequest.setQuantity(regAdviceSaveDto.getDose()); // 请求数量 | 长期医嘱保持和单次剂量一致 + longMedicationRequest.setQuantity(regAdviceSaveDto.getQuantity()); // 请求数量 longMedicationRequest.setExecuteNum(regAdviceSaveDto.getExecuteNum()); // 执行次数 - longMedicationRequest.setUnitCode(regAdviceSaveDto.getDoseUnitCode()); // 请求单位编码 | 长期医嘱保持和单次剂量一致 + longMedicationRequest.setUnitCode(regAdviceSaveDto.getUnitCode()); // 请求单位编码 longMedicationRequest.setLotNumber(regAdviceSaveDto.getLotNumber()); // 产品批号 longMedicationRequest.setCategoryEnum(regAdviceSaveDto.getCategoryEnum()); // 请求类型 longMedicationRequest.setMedicationId(regAdviceSaveDto.getAdviceDefinitionId());// 医嘱定义id @@ -553,7 +553,12 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { List regRequestBaseInfo = adviceManageAppMapper.getRegRequestBaseInfo(encounterId, null, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode()); - for (RegRequestBaseDto regRequestBaseDto : regRequestBaseInfo) { + // 根据 requestId 过滤重复医嘱信息 + List distinctList = regRequestBaseInfo.stream() + .collect(Collectors.toMap(RegRequestBaseDto::getRequestId, dto -> dto, (existing, replacement) -> existing // 如果key冲突,保留已存在的(第一条) + )).values().stream().collect(Collectors.toList()); + + for (RegRequestBaseDto regRequestBaseDto : distinctList) { // 请求状态 regRequestBaseDto.setStatusEnum_enumText( EnumUtils.getInfoByValue(RequestStatus.class, regRequestBaseDto.getStatusEnum())); @@ -570,7 +575,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { regRequestBaseDto.setTherapyEnum_enumText( EnumUtils.getInfoByValue(TherapyTimeType.class, regRequestBaseDto.getTherapyEnum())); } - return R.ok(regRequestBaseInfo); + return R.ok(distinctList); } /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IDepartmentRevenueStatisticsAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IDepartmentRevenueStatisticsAppService.java new file mode 100644 index 0000000000000000000000000000000000000000..9fe10c9b46068aa0463b1b99443fc7401904603c --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IDepartmentRevenueStatisticsAppService.java @@ -0,0 +1,30 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice; + +import javax.servlet.http.HttpServletRequest; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam; + +/** + * 科室收入统计 controller + * + * @author yuxj + * @date 2025-09-23 + */ +public interface IDepartmentRevenueStatisticsAppService { + + /** + * 药品用量明细列表 + * + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return + */ + R getPage( Integer pageNo, Integer pageSize, + String searchKey, HttpServletRequest request); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IReportStatisticsAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IReportStatisticsAppService.java new file mode 100644 index 0000000000000000000000000000000000000000..a7ad09248147ea3cd6ff6d961ca8c5ae94e8bdb4 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IReportStatisticsAppService.java @@ -0,0 +1,36 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice; + +import javax.servlet.http.HttpServletRequest; + +import com.core.common.core.domain.R; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 报表统计 controller + * + * @author yuxj + * @date 2025-09-23 + */ +public interface IReportStatisticsAppService { + + /** + * 月报明细列表 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + R getDailyReport(String startTime, String endTime); + + /** + * 年报明细列表 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + R getAnnualRreport(String startTime, String endTime); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/DepartmentRevenueStatisticsAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/DepartmentRevenueStatisticsAppServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..2be6f79c68dda131917c939ba4be5a4efbe4cefc --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/DepartmentRevenueStatisticsAppServiceImpl.java @@ -0,0 +1,60 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice.impl; + +import javax.servlet.http.HttpServletRequest; + +import com.openhis.web.reportmanage.appservice.IDepartmentRevenueStatisticsAppService; +import com.openhis.web.reportmanage.dto.DepartmentRevenueStatisticsPageDto; +import com.openhis.web.reportmanage.mapper.DepartmentRevenueStatisticsMapper; +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.openhis.common.enums.DispenseStatus; +import com.openhis.common.enums.RequestStatus; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.reportmanage.appservice.IDrugDosageSettlementAppService; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementPageDto; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam; +import com.openhis.web.reportmanage.mapper.DrugDosageSettlementMapper; + +/** + * 科室收入统计 controller + * + * @author yuxj + * @date 2025-09-23 + */ +@Service +public class DepartmentRevenueStatisticsAppServiceImpl implements IDepartmentRevenueStatisticsAppService { + + @Autowired + private DepartmentRevenueStatisticsMapper departmentRevenueStatisticsMapper; + + /** + * 科室收入统计 + * + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return + */ + @Override + public R getPage(Integer pageNo, Integer pageSize, + String searchKey, HttpServletRequest request) { + + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( + null, searchKey, null, request); + + Page drugDosageReportPage = + departmentRevenueStatisticsMapper.selectPage(new Page<>(pageNo, pageSize), queryWrapper, + DispenseStatus.COMPLETED.getValue(), RequestStatus.COMPLETED.getValue()); + + return R.ok(drugDosageReportPage); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/ReportStatisticsAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/ReportStatisticsAppServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..424d72eb509dd68947a18a8d81f0e1e29c5d7100 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/ReportStatisticsAppServiceImpl.java @@ -0,0 +1,156 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice.impl; + +import javax.servlet.http.HttpServletRequest; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.core.common.utils.bean.BeanUtils; +import com.openhis.common.enums.*; +import com.openhis.common.enums.ybenums.YbMedChrgItmType; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.reportmanage.dto.AnnualReportStatisticsPageDto; +import com.openhis.web.reportmanage.dto.DailyReportStatisticsPageDto; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.appservice.IReportStatisticsAppService; +import com.openhis.web.reportmanage.mapper.ReportStatisticsMapper; + +/** + * 科室收入统计 controller + * + * @author yuxj + * @date 2025-09-23 + */ +@Service +public class ReportStatisticsAppServiceImpl implements IReportStatisticsAppService { + + @Autowired + private ReportStatisticsMapper reportStatisticsMapper; + + /** + * 月报明细列表 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + @Override + public R getDailyReport(String startTime, String endTime) { + + DailyReportStatisticsPageDto dailyReport = new DailyReportStatisticsPageDto(); + // -------------------------- 1. 卫生技术人员统计 -------------------------- + // todo 中医执业(助理)医师数 没查询 人员没有添加时间条件,查询的都是当前的状态 + DailyReportStatisticsPageDto.StaffStatDTO staffStat = + reportStatisticsMapper.getStaffStat(PractitionerRoles.DOCTOR.getCode(), PractitionerRoles.NURSE.getCode()); + dailyReport.setStaffStat(staffStat); + // -------------------------- 2. 床位与床日统计 -------------------------- + // TODO 实际开放总床日数、实际占用总床日数、出院者占用总床日数 没查询 床位没有添加时间条件,查询的都是当前的状态 + DailyReportStatisticsPageDto.BedStatDTO bedStat = + reportStatisticsMapper.getBedStat(LocationForm.BED.getValue()); + dailyReport.setBedStat(bedStat); + // -------------------------- 3. 收入统计(单位:千元) -------------------------- + // todo 疫苗收入给0 、结算差额给0 时间筛选用的update_time,不确定对不对 + DailyReportStatisticsPageDto.RevenueStatDTO revenueStat = this.getRevenueStat(startTime,endTime); + dailyReport.setRevenueStat(revenueStat); + // -------------------------- 4. 费用统计(单位:千元) -------------------------- + // todo 费用的查询没写 + // DailyReportStatisticsPageDto.ExpenseStatDTO expenseStat=reportStatisticsMapper + // dailyReport.setExpenseStat(expenseStat); + // -------------------------- 5. 诊疗与服务量统计 -------------------------- + // todo 只查了门诊人次数,系统里应该不存在急诊 + DailyReportStatisticsPageDto.TreatmentStatDTO treatmentStat = + reportStatisticsMapper.getTreatmentStat(EncounterClass.AMB.getValue(), startTime, endTime); + dailyReport.setTreatmentStat(treatmentStat); + // -------------------------- 6. 死亡人数统计 -------------------------- + // todo 死亡人数没写 + // DailyReportStatisticsPageDto.DeathStatDTO deathStat=reportStatisticsMapper + // dailyReport.setDeathStat(deathStat); + // -------------------------- 7. 健康检查统计 -------------------------- + // todo 健康检查统计的查询没写,给0了 + // Integer healthCheckCount=reportStatisticsMapper + dailyReport.setHealthCheckCount(0); + + return R.ok(dailyReport); + } + + /** + * 年报明细列表 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + @Override + public R getAnnualRreport(String startTime, String endTime) { + AnnualReportStatisticsPageDto annualReportStatistics = new AnnualReportStatisticsPageDto(); + // 6.1 总收入相关字段 + // 6.1.2 事业收入 + // 6.1.2.1 医疗收入 + //todo 只写了 总收入相关字段>事业收入>医疗收入 + AnnualReportStatisticsPageDto.MedicalIncomeDTO medicalIncome = + new AnnualReportStatisticsPageDto.MedicalIncomeDTO(); + DailyReportStatisticsPageDto.RevenueStatDTO revenueStat = this.getRevenueStat(startTime,endTime); + BeanUtils.copyProperties(revenueStat, medicalIncome); + annualReportStatistics.getTotalIncome().getUndertakingIncome().setMedicalIncome(medicalIncome); + // 6.2 总费用相关字段 + // todo 费用的查询没写 + // 8 诊疗人次数相关字段 + // todo 人次的查询没写 + + + return R.ok(annualReportStatistics); + } + + /** + * 医疗收入 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + public DailyReportStatisticsPageDto.RevenueStatDTO getRevenueStat(String startTime, String endTime) { + + DailyReportStatisticsPageDto.RevenueStatDTO revenueStat = + reportStatisticsMapper.getRevenueStat(ChargeItemStatus.BILLED.getValue(), EncounterClass.IMP.getValue(), + EncounterClass.AMB.getValue(), YbMedChrgItmType.REGISTRATION_FEE.getValue(), + YbMedChrgItmType.DIAGNOSTIC_FEE.getValue(), YbMedChrgItmType.CHECK_FEE.getValue(), + YbMedChrgItmType.DIAGNOSTIC_TEST_FEE.getValue(), YbMedChrgItmType.MEDICAL_EXPENSE_FEE.getValue(), + YbMedChrgItmType.OPERATION_FEE.getValue(), YbMedChrgItmType.SANITARY_MATERIALS_FEE.getValue(), + YbMedChrgItmType.WEST_MEDICINE.getValue(), YbMedChrgItmType.CHINESE_MEDICINE_FEE.getValue(), + YbMedChrgItmType.CHINESE_MEDICINE_SLICES_FEE.getValue(), YbMedChrgItmType.OTHER_FEE.getValue(), + YbMedChrgItmType.BED_FEE.getValue(), YbMedChrgItmType.NURSING_FEE.getValue(), startTime, endTime); + // ----总收入 = 医疗收入 = 门急诊收入 + 住院收入 + 结算差额 + // ----药品收入合计 = 西药收入 + 中成药收入 + 中药饮片收入 + // 药品收入合计 + revenueStat.setOutpatientTotalDrugRevenue( + revenueStat.getOutpatientTotalWesternDrugRevenue().add(revenueStat.getOutpatientChinesePatentDrugRevenue()) + .add(revenueStat.getOutpatientChineseHerbRevenue())); + // 门急诊收入合计 + revenueStat.setTotalOutpatientRevenue(revenueStat.getOutpatientRegistrationRevenue() + .add(revenueStat.getOutpatientConsultationRevenue()).add(revenueStat.getOutpatientInspectionRevenue()) + .add(revenueStat.getOutpatientLabTestRevenue()).add(revenueStat.getOutpatientTreatmentRevenue()) + .add(revenueStat.getOutpatientSurgeryRevenue()).add(revenueStat.getOutpatientMedicalMaterialRevenue()) + .add(revenueStat.getOutpatientTotalDrugRevenue()).add(revenueStat.getOtherOutpatientRevenue())); + // 药品收入合计 + revenueStat.setInpatientTotalDrugRevenue(revenueStat.getInpatientTotalWesternDrugRevenue() + .add(revenueStat.getInpatientChinesePatentDrugRevenue()).add(revenueStat.getInpatientChineseHerbRevenue())); + // 住院收入合计 + revenueStat.setTotalInpatientRevenue( + revenueStat.getInpatientBedRevenue().add(revenueStat.getInpatientConsultationRevenue()) + .add(revenueStat.getInpatientInspectionRevenue()).add(revenueStat.getInpatientLabTestRevenue()) + .add(revenueStat.getInpatientTreatmentRevenue()).add(revenueStat.getInpatientSurgeryRevenue()) + .add(revenueStat.getInpatientNursingRevenue()).add(revenueStat.getInpatientMedicalMaterialRevenue()) + .add(revenueStat.getInpatientTotalDrugRevenue()).add(revenueStat.getOtherInpatientRevenue())); + // 医疗收入合计 + revenueStat.setTotalMedicalRevenue( + revenueStat.getTotalOutpatientRevenue().add(revenueStat.getTotalInpatientRevenue())); + // 总收入 + revenueStat.setTotalRevenue(revenueStat.getTotalMedicalRevenue()); + return revenueStat; + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/DepartmentRevenueStatisticsController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/DepartmentRevenueStatisticsController.java new file mode 100644 index 0000000000000000000000000000000000000000..556b64d5c2df36fe764a54bb6dd75e6ce74248f6 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/DepartmentRevenueStatisticsController.java @@ -0,0 +1,51 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.controller; + +import javax.servlet.http.HttpServletRequest; + +import com.openhis.web.reportmanage.appservice.IDepartmentRevenueStatisticsAppService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.appservice.IDrugDosageSettlementAppService; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室收入统计 controller + * + * @author yuxj + * @date 2025-09-23 + */ +@RestController +@RequestMapping("/report-manage/department-revenue-statistics") +@Slf4j +public class DepartmentRevenueStatisticsController { + + @Autowired + private IDepartmentRevenueStatisticsAppService departmentRevenueStatisticsAppService; + + /** + * 收入明细明细列表 todo 还没写 + * + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return + */ + @GetMapping(value = "/page") + public R getPage( + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "searchKey", required = false) String searchKey, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + return departmentRevenueStatisticsAppService.getPage(pageNo, pageSize, searchKey, request); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/MedicationDeviceReportController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/MedicationDeviceReportController.java index 7f25a1f8d6a6c53ea02c4f316a846ce0d732746b..5c22f9ea905eb4d0c934bfa2efabb4bb0d37ba7b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/MedicationDeviceReportController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/MedicationDeviceReportController.java @@ -3,6 +3,8 @@ */ package com.openhis.web.reportmanage.controller; +import javax.servlet.http.HttpServletResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -14,9 +16,6 @@ import com.openhis.web.reportmanage.appservice.IMedicationDeviceReportAppService import lombok.extern.slf4j.Slf4j; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - /** * 药品耗材统计查询用 controller * @@ -60,8 +59,8 @@ public class MedicationDeviceReportController { @RequestParam String dispenseDateETime, @RequestParam(name = "name", required = false) String name, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { - return R - .ok(medicationDeviceReportAppService.selectMedDdevInfo(orgId, name, dispenseDateSTime, dispenseDateETime,pageNo,pageSize)); + return R.ok(medicationDeviceReportAppService.selectMedDdevInfo(orgId, name, dispenseDateSTime, + dispenseDateETime, pageNo, pageSize)); } /** @@ -79,11 +78,9 @@ public class MedicationDeviceReportController { public void makeExcelFile(@RequestParam Long orgId, @RequestParam String dispenseDateSTime, @RequestParam String dispenseDateETime, @RequestParam(name = "name", required = false) String name, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletResponse response) { - medicationDeviceReportAppService.makeExcelFile(orgId, name, dispenseDateSTime, dispenseDateETime,pageNo,pageSize, - response); + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletResponse response) { + medicationDeviceReportAppService.makeExcelFile(orgId, name, dispenseDateSTime, dispenseDateETime, pageNo, + pageSize, response); } - } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/ReportStatisticsController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/ReportStatisticsController.java new file mode 100644 index 0000000000000000000000000000000000000000..b70940071f24529741c86f803afca3bd5f17e0ac --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/ReportStatisticsController.java @@ -0,0 +1,56 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.appservice.IReportStatisticsAppService; + +import lombok.extern.slf4j.Slf4j; + +/** + * 报表统计 controller + * + * @author yuxj + * @date 2025-09-23 + */ +@RestController +@RequestMapping("/report-manage/report-statistics") +@Slf4j +public class ReportStatisticsController { + + @Autowired + private IReportStatisticsAppService reportStatisticsAppService; + + /** + * 月报明细列表 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + @GetMapping(value = "/daily-report") + public R getDailyReport(@RequestParam String startTime, @RequestParam String endTime) { + return reportStatisticsAppService.getDailyReport(startTime,endTime); + } + + /** + * 年报明细列表 + * + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + @GetMapping(value = "/annual-report") + public R getAnnualRreport(@RequestParam String startTime, @RequestParam String endTime) { + return reportStatisticsAppService.getAnnualRreport(startTime,endTime); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java new file mode 100644 index 0000000000000000000000000000000000000000..87f1ccafdc9cb63c4d8ec6e8288dd8146f6e94d6 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java @@ -0,0 +1,625 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 报表统计 dto + * + * @author yuxj + * @date 2025-09-23 + */ +@Data +@Accessors(chain = true) +public class AnnualReportStatisticsPageDto { + // 6.1 总收入相关字段 + private TotalIncomeDTO totalIncome; + + // 6.2 总费用相关字段 + private TotalExpenseDTO totalExpense; + + // 8 诊疗人次数相关字段 + private MedicalTreatmentDTO medicalTreatment; + /** + * 6.1 总收入DTO + */ + @Data + @Accessors(chain = true) + public static class TotalIncomeDTO { + private BigDecimal total; // 总收入合计 + + // 6.1.1 财政拨款收入 + private FinancialAppropriationIncomeDTO financialAppropriationIncome; + + // 6.1.2 事业收入 + private UndertakingIncomeDTO undertakingIncome; + + // 6.1.3 上级补助收入 + private BigDecimal superiorSubsidyIncome; + + // 6.1.4 附属单位上缴收入 + private BigDecimal affiliatedUnitTurnoverIncome; + + // 6.1.5 经营收入 + private BigDecimal operatingIncome; + + // 6.1.6 非同级财政拨款收入 + private BigDecimal nonSameLevelFinancialAppropriationIncome; + + // 6.1.7 投资收益 + private BigDecimal investmentIncome; + + // 6.1.8 捐赠收入 + private BigDecimal donationIncome; + + // 6.1.9 利息收入 + private BigDecimal interestIncome; + + // 6.1.10 租金收入 + private BigDecimal rentIncome; + + // 6.1.11 其他收入 + private BigDecimal otherIncome; + + // 6.1.12 总收入中:来源于职工基本医疗保险基金的收入 + private BigDecimal employeeMedicalInsuranceFundIncome; + + // 6.1.13 来源于城乡居民基本医疗保险基金的收入 + private BigDecimal residentMedicalInsuranceFundIncome; + + // 6.1.14 来源于其他医疗保险的收入 + private BigDecimal otherMedicalInsuranceIncome; + } + + /** + * 6.1.1 财政拨款收入DTO + */ + @Data + @Accessors(chain = true) + public static class FinancialAppropriationIncomeDTO { + private BigDecimal total; // 财政拨款收入合计 + + // 6.1.1.1 其中:财政基本拨款收入 + private BigDecimal basicFinancialAppropriationIncome; + + // 6.1.1.2 财政项目拨款收入 + private BigDecimal projectFinancialAppropriationIncome; + } + + /** + * 6.1.2 事业收入DTO + */ + @Data + @Accessors(chain = true) + public static class UndertakingIncomeDTO { + private BigDecimal total; // 事业收入合计 + + // 6.1.2.1 医疗收入 + private MedicalIncomeDTO medicalIncome; + + // 6.1.2.2 科教收入 + private BigDecimal scienceEducationIncome; + + // 6.1.2.3 非同级财政拨款收入 + private BigDecimal nonSameLevelFinancialAppropriationIncome; + + // 6.1.2.9 门诊和住院药品收入中:基本药物收入 + private BigDecimal essentialDrugsIncome; + } + + /** + * 6.1.2.1 医疗收入DTO + */ + @Data + @Accessors(chain = true) + public static class MedicalIncomeDTO { + /** 医疗收入合计 */ + private BigDecimal totalMedicalRevenue; + + // 门急诊收入细分 + /** 门急诊收入合计 */ + private BigDecimal totalOutpatientRevenue; + /** 挂号收入 */ + private BigDecimal outpatientRegistrationRevenue; + /** 诊察收入(门急诊) */ + private BigDecimal outpatientConsultationRevenue; + /** 检查收入(门急诊) */ + private BigDecimal outpatientInspectionRevenue; + /** 化验收入(门急诊) */ + private BigDecimal outpatientLabTestRevenue; + /** 治疗收入(门急诊) */ + private BigDecimal outpatientTreatmentRevenue; + /** 手术收入(门急诊) */ + private BigDecimal outpatientSurgeryRevenue; + /** 卫生材料收入(门急诊) */ + private BigDecimal outpatientMedicalMaterialRevenue; + // 药品收入细分 + /** 药品收入合计 */ + private BigDecimal outpatientTotalDrugRevenue; + /** 西药收入合计 */ + private BigDecimal outpatientTotalWesternDrugRevenue; + /** 疫苗收入(西药下) */ + private BigDecimal outpatientVaccineRevenue; + /** 中成药收入 */ + private BigDecimal outpatientChinesePatentDrugRevenue; + /** 中药饮片收入 */ + private BigDecimal outpatientChineseHerbRevenue; + /** 其他门诊收入 */ + private BigDecimal otherOutpatientRevenue; + // 住院收入细分 + /** 住院收入合计 */ + private BigDecimal totalInpatientRevenue; + /** 床位收入(住院) */ + private BigDecimal inpatientBedRevenue; + /** 诊察收入(住院) */ + private BigDecimal inpatientConsultationRevenue; + /** 检查收入(住院) */ + private BigDecimal inpatientInspectionRevenue; + /** 化验收入(住院) */ + private BigDecimal inpatientLabTestRevenue; + /** 治疗收入(住院) */ + private BigDecimal inpatientTreatmentRevenue; + /** 手术收入(住院) */ + private BigDecimal inpatientSurgeryRevenue; + /** 护理收入(住院) */ + private BigDecimal inpatientNursingRevenue; + /** 卫生材料收入(住院) */ + private BigDecimal inpatientMedicalMaterialRevenue; + // 药品收入细分(门急诊+住院共用统计维度,无单独区分则合并) + /** 药品收入合计 */ + private BigDecimal inpatientTotalDrugRevenue; + /** 西药收入合计 */ + private BigDecimal inpatientTotalWesternDrugRevenue; + /** 疫苗收入(西药下) */ + private BigDecimal inpatientVaccineRevenue; + /** 中成药收入 */ + private BigDecimal inpatientChinesePatentDrugRevenue; + /** 中药饮片收入 */ + private BigDecimal inpatientChineseHerbRevenue; + /** 其他住院收入 */ + private BigDecimal otherInpatientRevenue; + /** 结算差额 */ + private BigDecimal settlementDifference; + } + + /** + * 6.2 总费用DTO + */ + @Data + @Accessors(chain = true) + public static class TotalExpenseDTO { + private BigDecimal total; // 总费用合计 + + // 6.2.1 业务活动费用 + private BusinessActivityExpenseDTO businessActivityExpense; + + // 6.2.2 单位管理费用 + private UnitManagementExpenseDTO unitManagementExpense; + + // 6.2.3 经营费用 + private BigDecimal operatingExpense; + + // 6.2.4 资产处置费用 + private BigDecimal assetDisposalExpense; + + // 6.2.5 上缴上级费用 + private BigDecimal paymentToSuperiorExpense; + + // 6.2.6 对附属单位补助费用 + private BigDecimal subsidyToAffiliatedUnitsExpense; + + // 6.2.7 所得税费用 + private BigDecimal incomeTaxExpense; + + // 6.2.8 其他费用 + private BigDecimal otherExpense; + } + + /** + * 6.2.1 业务活动费用DTO + */ + @Data + @Accessors(chain = true) + public static class BusinessActivityExpenseDTO { + private BigDecimal total; // 业务活动费用合计 + + // 6.2.1.1 财政基本拨款经费 + private BigDecimal basicFinancialAppropriationFund; + + // 6.2.1.2 财政项目拨款经费 + private BigDecimal projectFinancialAppropriationFund; + + // 6.2.1.3 科教经费 + private BigDecimal scienceEducationFund; + + // 6.2.1.4 其他经费 + private BigDecimal otherFund; + + // 6.2.1.5 业务活动费用中:人员经费 + private PersonnelExpenseDTO personnelExpense; + + // 6.2.1.6 固定资产折旧费 + private BigDecimal fixedAssetDepreciation; + + // 6.2.1.7 卫生材料费 + private BigDecimal healthMaterialsExpense; + + // 6.2.1.8 药品费 + // 药品费合计 + private BigDecimal totalDrugExpense; + + // 其中:基本药物费用 + private BigDecimal essentialDrugsExpense; + } + + /** + * 人员经费DTO(包含业务活动和单位管理) + */ + @Data + @Accessors(chain = true) + public static class PersonnelExpenseDTO { + private BigDecimal total; // 人员经费合计 + + // 工资福利费用 + // 工资福利费用合计 + private BigDecimal totalSalaryWelfareExpense; + + // 其中:卫生技术人员人均工资性收入 + private HealthTechnicalPersonnelSalaryDTO healthTechnicalPersonnelSalary; + + // 对个人和家庭的补助费用 + private BigDecimal subsidyToIndividualsAndFamilies; + + } + + /** + * 卫生技术人员工资DTO + */ + @Data + @Accessors(chain = true) + public static class HealthTechnicalPersonnelSalaryDTO { + private BigDecimal average; // 平均工资 + + // 其中:执业(助理)医师 + private PracticingPhysicianSalaryDTO practicingPhysicianSalary; + + // 注册护士 + private RegisteredNurseSalaryDTO registeredNurseSalary; + + // 药师(士) + private BigDecimal pharmacistSalary; + + // 技师(士) + private BigDecimal technicianSalary; + + } + + /** + * 执业(助理)医师工资DTO + */ + @Data + @Accessors(chain = true) + public static class PracticingPhysicianSalaryDTO { + private BigDecimal total; // 合计 + + // 其中:主任医师 + private BigDecimal chiefPhysician; + + // 副主任医师 + private BigDecimal associateChiefPhysician; + + // 主治医师 + private BigDecimal attendingPhysician; + + // 医师(士) + private BigDecimal physician; + + } + + /** + * 注册护士工资DTO + */ + @Data + @Accessors(chain = true) + public static class RegisteredNurseSalaryDTO { + private BigDecimal total; // 合计 + + // 其中:主任护师 + private BigDecimal chiefNurse; + + // 副主任护师 + private BigDecimal associateChiefNurse; + + // 主管护师 + private BigDecimal chargeNurse; + + // 护师(士) + private BigDecimal nurse; + } + + /** + * 6.2.2 单位管理费用DTO + */ + @Data + @Accessors(chain = true) + public static class UnitManagementExpenseDTO { + private BigDecimal total; // 单位管理费用合计 + + // 6.2.2.1 财政基本拨款经费 + private BigDecimal basicFinancialAppropriationFund; + + // 6.2.2.2 财政项目拨款经费 + private BigDecimal projectFinancialAppropriationFund; + + // 6.2.2.3 科教经费 + private BigDecimal scienceEducationFund; + + // 6.2.2.4 其他经费 + private BigDecimal otherFund; + + // 6.2.2.5 单位管理费用中:人员经费 + private PersonnelExpenseDTO personnelExpense; + + // 6.2.2.6 固定资产折旧费 + private BigDecimal fixedAssetDepreciation; + + // 6.2.2.7 卫生材料费 + private BigDecimal healthMaterialsExpense; + + // 6.2.2.8 药品费 + // 药品费合计 + private BigDecimal totalDrugExpense; + + // 其中:基本药物费用 + private BigDecimal essentialDrugsExpense; + } + + /** + * 8 诊疗人次数相关DTO + */ + @Data + @Accessors(chain = true) + public static class MedicalTreatmentDTO { + // 8.1 总诊疗人次数 + private TotalDiagnosisTreatmentsDTO totalDiagnosisTreatments; + + // 8.2 X线电子计算机断层扫描装置检查人次数 + private Long ctScanCount; + + // 8.3 医用磁共振成像设备(核磁)检查人次数 + private Long mriScanCount; + + // 8.4 X线正电子发射断层扫描仪(PET/CT)检查人次数 + private Long petCtScanCount; + + // 8.5 心理咨询人次数 + // 心理咨询人次数合计 + private Long totalPsychologicalConsultation; + + // 8.5.1 其中:门诊人次数 + private Long outpatientPsychologicalConsultationCount; + + // 8.6 体重管理咨询人次数 + // 体重管理咨询人次数合计 + private Long totalWeightManagementConsultation; + + // 8.6.1 其中:门诊人次数 + private Long outpatientWeightManagementConsultationCount; + + // 8.7 多学科会诊(MDT)人次数 + private Long mdtConsultationCount; + + // 8.8 互联网诊疗服务人次数 + private Long internetDiagnosisCount; + + // 8.9 远程医疗服务人次数 + private Long telemedicineServiceCount; + + // 8.10 观察室留观病例数 + // 观察室留观病例数合计 + private Long totalObservationCase; + + // 8.10.1 其中: 死亡人数 + private Long deathCount; + + // 8.11 健康检查人次数 + private Long healthExaminationCount; + + // 8.12 入院人次数 + private Long admissionCount; + + // 8.13 出院人次数 + private DischargeCountDTO dischargeCount; + + // 8.14 住院病人手术人次数 + private InpatientSurgeryCountDTO inpatientSurgeryCount; + + // 8.15 门诊处方总数 + private OutpatientPrescriptionDTO outpatientPrescription; + + // 8.16 医疗纠纷例数 + private Long medicalDisputeCount; + + // 8.17 参与家庭医生签约服务的执业(助理)医师数 + private Long familyDoctorCount; + + // 8.18 家庭医生团队签约人数 + private Long familyDoctorContractCount; + + // 8.19 家庭医生团队服务人次数 + private Long familyDoctorServiceCount; + + // 8.20 当年门诊诊疗过程中开具健康教育处方人次数 + private Long healthEducationPrescriptionCount; + + // 8.21 当年开展住院患者健康教育干预人次数 + private Long inpatientHealthEducationCount; + + // 8.22 举办健康教育讲座次数 + private Long healthLectureCount; + + // 8.23 健康教育讲座参加人数 + private Long healthLectureParticipantCount; + + // 8.24 举办健康教育咨询活动次数 + private Long healthConsultationActivityCount; + + // 8.25 健康教育咨询活动参加人数 + private Long healthConsultationParticipantCount; + + // 8.26 年内举办各类健康主题宣传活动次数 + private Long healthPromotionActivityCount; + } + + /** + * 8.1 总诊疗人次数DTO + */ + @Data + @Accessors(chain = true) + public static class TotalDiagnosisTreatmentsDTO { + private Long total; // 总诊疗人次数合计 + + // 8.1.1 其中:门诊人次数 + private OutpatientVisitDTO outpatientVisit; + + // 8.1.2 急诊人次数 + private EmergencyVisitDTO emergencyVisit; + + // 8.1.3 家庭医疗服务人次数 + private Long homeMedicalServiceCount; + + // 8.1.4 其中:预约诊疗人次数 + private Long appointmentDiagnosisCount; + + // 8.1.5 港澳台居民诊疗人次数 + private Long hongKongTaiwanMacaoPatientCount; + + // 8.1.6 外籍患者诊疗人次数 + private Long foreignPatientCount; + } + + /** + * 8.1.1 门诊人次数DTO + */ + @Data + @Accessors(chain = true) + public static class OutpatientVisitDTO { + private Long totalL; // 门诊人次数合计 + + // 8.1.1.1 其中:普通门诊人次数 + private Long generalOutpatientCountL; + + // 8.1.1.2 专家门诊人次数 + // 专家门诊人次数合计 + private Long totalExpertOutpatientL; + + // 8.1.1.2.1 其中:知名专家门诊人次数 + private Long renownedExpertOutpatientCountL; + + // 8.1.1.3 其中:外请专家门诊人次数 + private Long externalExpertOutpatientCountL; + + // 8.1.1.4 其中:应用中药饮片人次数 + private Long chineseHerbalMedicineUsageCountL; + + // 8.1.1.5 使用中医非药物疗法总人次数 + private Long tcmNonDrugTherapyCountL; + + // 8.1.1.6 应用中成药人次数 + private Long chinesePatentMedicineUsageCountL; + + // 8.1.1.7 药学门诊人次数 + private Long pharmacyClinicCountL; + } + + /** + * 8.1.2 急诊人次数DTO + */ + @Data + @Accessors(chain = true) + public static class EmergencyVisitDTO { + private Long total; // 急诊人次数合计 + + // 8.1.2.1 其中:急危患者(Ⅰ级)人次数 + private Long emergencyLevel1Count; + + // 8.1.2.2 急重患者(Ⅱ级)人次数 + private Long emergencyLevel2Count; + + // 8.1.2.3 急症患者(Ⅲ级)人次数 + private Long emergencyLevel3Count; + + // 8.1.2.4 亚急症或非亚急症患者(Ⅳ级)人次数 + private Long emergencyLevel4Count; + + // 8.1.2.5 其中:急诊人次中死亡人数 + private Long emergencyDeathCount; + } + + /** + * 8.13 出院人次数DTO + */ + @Data + @Accessors(chain = true) + public static class DischargeCountDTO { + private Long total; // 出院人次数合计 + + // 8.13.1 其中:转往基层医疗卫生机构人次数 + private Long transferredToPrimaryCareCount; + + // 8.13.2 日间手术人次数 + private Long daySurgeryCount; + + // 8.13.3 住院分娩人次数 + private Long inpatientDeliveryCount; + + // 8.13.4 死亡人数 + private Long deathCount; + } + + /** + * 8.14 住院病人手术人次数DTO + */ + @Data + @Accessors(chain = true) + public static class InpatientSurgeryCountDTO { + private Long total; // 住院病人手术人次数合计 + + // 8.14.1 其中:手术室手术人次数 + private Long operatingRoomSurgeryCount; + + // 8.14.2 介入室手术人次数 + private Long interventionalSurgeryCount; + + // 8.14.3 内镜室手术人次数 + private Long endoscopySurgeryCount; + } + + /** + * 8.15 门诊处方总数DTO + */ + @Data + @Accessors(chain = true) + public static class OutpatientPrescriptionDTO { + private Long total; // 门诊处方总数合计 + + // 8.15.1 其中:使用抗菌药物的处方数 + private Long antibioticPrescriptionCount; + + // 8.15.2 中医处方数 + // 中医处方数合计 + private Long totalTcmPrescription; + + // 8.15.2.1 中药饮片处方数 + private Long chineseHerbalPrescriptionCount; + + // 8.15.2.2 中成药处方数 + private Long chinesePatentMedicinePrescriptionCount; + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java new file mode 100644 index 0000000000000000000000000000000000000000..5f70e7fe696f31a5ee3aa90683972479cfb14228 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java @@ -0,0 +1,216 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 报表统计 dto + * + * @author yuxj + * @date 2025-09-23 + */ +@Data +@Accessors(chain = true) +public class DailyReportStatisticsPageDto { + // -------------------------- 1. 卫生技术人员统计 -------------------------- + private StaffStatDTO staffStat; + + // -------------------------- 2. 床位与床日统计 -------------------------- + private BedStatDTO bedStat; + + // -------------------------- 3. 收入统计(单位:千元) -------------------------- + private RevenueStatDTO revenueStat; + + // -------------------------- 4. 费用统计(单位:千元) -------------------------- + private ExpenseStatDTO expenseStat; + + // -------------------------- 5. 诊疗与服务量统计 -------------------------- + private TreatmentStatDTO treatmentStat; + + // -------------------------- 6. 死亡人数统计 -------------------------- + private DeathStatDTO deathStat; + + // -------------------------- 7. 健康检查统计 -------------------------- + /** 健康检查人次数 */ + private Integer healthCheckCount; + + // ======================== 1. 卫生技术人员统计(单位:人) ======================== + @Data + @Accessors(chain = true) + public static class StaffStatDTO { + /** + * 卫生技术人员总数 + */ + private Integer totalMedicalStaff; + /** + * 执业(助理)医师总数 + */ + private Integer totalPracticingDoctor; + /** + * 中医执业(助理)医师数 + */ + private Integer tcmPracticingDoctor; + /** + * 注册护士数 + */ + private Integer registeredNurse; + } + + // ======================== 2. 床位与床日统计 ======================== + @Data + @Accessors(chain = true) + public static class BedStatDTO { + /** 实有床位(单位:张) */ + private Integer actualBedCount; + /** 实际开放总床日数 */ + private Integer totalOpenBedDays; + /** 实际占用总床日数 */ + private Integer totalOccupiedBedDays; + /** 出院者占用总床日数 */ + private Integer dischargedBedDays; + } + + // ======================== 3. 收入统计(单位:千元) ======================== + @Data + @Accessors(chain = true) + public static class RevenueStatDTO { + /** 总收入 */ + private BigDecimal totalRevenue; + /** 医疗收入合计 */ + private BigDecimal totalMedicalRevenue; + // 门急诊收入细分 + /** 门急诊收入合计 */ + private BigDecimal totalOutpatientRevenue; + /** 挂号收入 */ + private BigDecimal outpatientRegistrationRevenue; + /** 诊察收入(门急诊) */ + private BigDecimal outpatientConsultationRevenue; + /** 检查收入(门急诊) */ + private BigDecimal outpatientInspectionRevenue; + /** 化验收入(门急诊) */ + private BigDecimal outpatientLabTestRevenue; + /** 治疗收入(门急诊) */ + private BigDecimal outpatientTreatmentRevenue; + /** 手术收入(门急诊) */ + private BigDecimal outpatientSurgeryRevenue; + /** 卫生材料收入(门急诊) */ + private BigDecimal outpatientMedicalMaterialRevenue; + // 药品收入细分 + /** 药品收入合计 */ + private BigDecimal outpatientTotalDrugRevenue; + /** 西药收入合计 */ + private BigDecimal outpatientTotalWesternDrugRevenue; + /** 疫苗收入(西药下) */ + private BigDecimal outpatientVaccineRevenue; + /** 中成药收入 */ + private BigDecimal outpatientChinesePatentDrugRevenue; + /** 中药饮片收入 */ + private BigDecimal outpatientChineseHerbRevenue; + /** 其他门诊收入 */ + private BigDecimal otherOutpatientRevenue; + // 住院收入细分 + /** 住院收入合计 */ + private BigDecimal totalInpatientRevenue; + /** 床位收入(住院) */ + private BigDecimal inpatientBedRevenue; + /** 诊察收入(住院) */ + private BigDecimal inpatientConsultationRevenue; + /** 检查收入(住院) */ + private BigDecimal inpatientInspectionRevenue; + /** 化验收入(住院) */ + private BigDecimal inpatientLabTestRevenue; + /** 治疗收入(住院) */ + private BigDecimal inpatientTreatmentRevenue; + /** 手术收入(住院) */ + private BigDecimal inpatientSurgeryRevenue; + /** 护理收入(住院) */ + private BigDecimal inpatientNursingRevenue; + /** 卫生材料收入(住院) */ + private BigDecimal inpatientMedicalMaterialRevenue; + // 药品收入细分(门急诊+住院共用统计维度,无单独区分则合并) + /** 药品收入合计 */ + private BigDecimal inpatientTotalDrugRevenue; + /** 西药收入合计 */ + private BigDecimal inpatientTotalWesternDrugRevenue; + /** 疫苗收入(西药下) */ + private BigDecimal inpatientVaccineRevenue; + /** 中成药收入 */ + private BigDecimal inpatientChinesePatentDrugRevenue; + /** 中药饮片收入 */ + private BigDecimal inpatientChineseHerbRevenue; + /** 其他住院收入 */ + private BigDecimal otherInpatientRevenue; + /** 结算差额 */ + private BigDecimal settlementDifference; + } + + // ======================== 4. 费用统计(单位:千元) ======================== + @Data + @Accessors(chain = true) + public static class ExpenseStatDTO { + /** 总费用 */ + private BigDecimal totalExpense; + /** 业务活动费用合计 */ + private BigDecimal totalBusinessActivityExpense; + /** 药品费合计(业务活动费用下) */ + private BigDecimal totalDrugExpense; + /** 中药饮片费用(药品费下) */ + private BigDecimal chineseHerbExpense; + /** 卫生材料费(业务活动费用下) */ + private BigDecimal medicalMaterialExpense; + /** 单位管理费用 */ + private BigDecimal unitManagementExpense; + /** 其他费用 */ + private BigDecimal otherExpense; + /** 公共卫生支出 */ + private BigDecimal publicHealthExpense; + } + + // ======================== 5. 诊疗与服务量统计 ======================== + @Data + @Accessors(chain = true) + public static class TreatmentStatDTO { + /** 总诊疗人次数 */ + private Integer totalTreatmentCount; + /** 门诊和急诊人次数合计 */ + private Integer totalOutpatientEmergencyCount; + /** 预约门诊人次数 */ + private Integer reservedOutpatientCount; + /** 网上预约门诊人次数 */ + private Integer onlineReservedOutpatientCount; + /** 普通门诊人次数 */ + private Integer generalOutpatientCount; + /** 中医诊疗人次数 */ + private Integer tcmTreatmentCount; + /** 急诊人次数 */ + private Integer emergencyCount; + /** 发热门诊人次数 */ + private Integer feverClinicCount; + /** 互联网诊疗服务人次数 */ + private Integer internetTreatmentCount; + /** 远程医疗服务人次数 */ + private Integer telemedicineCount; + /** 出院人次数 */ + private Integer dischargedCount; + } + + // ======================== 6. 死亡人数统计 ======================== + @Data + @Accessors(chain = true) + public static class DeathStatDTO { + /** 总死亡人数 */ + private Integer totalDeathCount; + /** 急诊死亡人数 */ + private Integer emergencyDeathCount; + /** 住院死亡人数 */ + private Integer inpatientDeathCount; + /** 观察室死亡人数 */ + private Integer observationRoomDeathCount; + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java new file mode 100644 index 0000000000000000000000000000000000000000..0a61f1a40b378dd6c86479bc07df83b8acf17958 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java @@ -0,0 +1,46 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; +import java.util.Date; + +import com.openhis.common.annotation.Dict; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 科室收入统计 dto + * + * @author yuxj + * @date 2025-09-23 + */ +@Data +@Accessors(chain = true) +public class DepartmentRevenueStatisticsPageDto { + + /** 发药日期 */ + private Date dispenseTime; + /** 药品项目 */ + private String medicationName; + + /** 项目编码 */ + private String busNo; + + /** 规格 */ + private String totalVolume; + + /** 发药单位 */ + @Dict(dictCode = "unit_code") + private String unitCode; + private String unitCode_dictText; + + /** 发药数量 */ + private Integer dispenseQuantity; + + /** 发药金额 */ + private BigDecimal dispensePrice; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/DepartmentRevenueStatisticsMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/DepartmentRevenueStatisticsMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..4c203f786205a0b469483ba24e4828225f0f87c6 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/DepartmentRevenueStatisticsMapper.java @@ -0,0 +1,38 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.mapper; + +import com.openhis.web.reportmanage.dto.DepartmentRevenueStatisticsPageDto; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementPageDto; +import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam; + +/** + * 科室收入统计 mapper + * + * @author yuxj + * @date 2025-09-23 + */ +@Repository +public interface DepartmentRevenueStatisticsMapper { + + /** + * 查询药品用量明细 + * + * @param page 分页 + * @param queryWrapper 查询条件 + * @param disCompleted 发药状态:已发放 + * @param reqCompleted 请求状态:已完成 + * @param antibioticFlg 抗生素flg + * @return 药品用量明细 + */ + Page selectPage(@Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper, + @Param("disCompleted") Integer disCompleted, @Param("reqCompleted") Integer reqCompleted); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/ReportStatisticsMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/ReportStatisticsMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..a414aa3f9002eb7272dacbd54db9a6540339353c --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/ReportStatisticsMapper.java @@ -0,0 +1,78 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.mapper; + +import com.openhis.web.reportmanage.dto.DailyReportStatisticsPageDto; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +/** + * 报表统计 mapper + * + * @author yuxj + * @date 2025-09-23 + */ +@Repository +public interface ReportStatisticsMapper { + + /** + * 卫生技术人员统计 + * + * @param doctor 医生 + * @param nurse 护士 + * @return + */ + DailyReportStatisticsPageDto.StaffStatDTO getStaffStat(@Param("doctor") String doctor, + @Param("nurse") String nurse); + + /** + * 床位与床日统计 + * + * @param bed 病床 + * @return + */ + DailyReportStatisticsPageDto.BedStatDTO getBedStat(@Param("bed") Integer bed); + + /** + * 收入统计 + * + * @param billed 已收费 + * @param imp 住院 + * @param amb 门诊 + * @param registrationFee 挂号费 + * @param diagnosticFee 诊察费 + * @param checkFee 检查费 + * @param diagnosticTestFee 化验费 + * @param medicalExpenseFee 治疗费 + * @param operationFee 手术费 + * @param sanitaryMaterialsFee 卫生材料费 + * @param westMedicine 西药费 + * @param chineseMedicineFee 中成药费 + * @param chineseMedicineSlicesFee 中药饮片费 + * @param otherFee 其他门诊 费 + * @param bedFee 床位费 + * @param nursingFee 护理费 + * @param startTime 开始日期 + * @param endTime 结束日期 + * @return + */ + DailyReportStatisticsPageDto.RevenueStatDTO getRevenueStat(@Param("billed") Integer billed, + @Param("imp") Integer imp, @Param("amb") Integer amb, @Param("registrationFee") String registrationFee, + @Param("diagnosticFee") String diagnosticFee, @Param("checkFee") String checkFee, + @Param("diagnosticTestFee") String diagnosticTestFee, @Param("medicalExpenseFee") String medicalExpenseFee, + @Param("operationFee") String operationFee, @Param("sanitaryMaterialsFee") String sanitaryMaterialsFee, + @Param("westMedicine") String westMedicine, @Param("chineseMedicineFee") String chineseMedicineFee, + @Param("chineseMedicineSlicesFee") String chineseMedicineSlicesFee, @Param("otherFee") String otherFee, + @Param("bedFee") String bedFee, @Param("nursingFee") String nursingFee, @Param("startTime") String startTime, + @Param("endTime") String endTime); + + /** + * 诊疗与服务量统计 + * + * @param amb 门诊 + * @return + */ + DailyReportStatisticsPageDto.TreatmentStatDTO getTreatmentStat(@Param("amb") Integer amb, + @Param("startTime") String startTime, @Param("endTime") String endTime); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/controller/YbElepController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/controller/YbElepController.java index 57dcec66be9a3988b8a164d5e9dd85872e5e65fb..384a5c7da1be125313be382a5025054c6b42ded9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/controller/YbElepController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/controller/YbElepController.java @@ -3,18 +3,21 @@ */ package com.openhis.web.ybmanage.controller; +import java.rmi.ServerException; +import java.util.Date; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.*; + import com.core.common.core.domain.R; import com.openhis.web.ybmanage.dto.VeriPrescriptionParam; import com.openhis.web.ybmanage.service.IYbEleBaseService; import com.openhis.web.ybmanage.service.IYbEleHttpService; import com.openhis.ybelep.domain.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.Map; /** * 医保电子处方业务接口 @@ -36,17 +39,17 @@ public class YbElepController { * 医保电子处方查询 * * @param veriPrescriptionParam 查询条件 - * @param searchKey 模糊查询关键字 - * @param pageNo 当前页 - * @param pageSize 每页多少条 - * @param request 请求数据 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求数据 * @return 处方信息 */ @GetMapping(value = "/get-PrescriptionInfo") public R getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, - @RequestParam(value = "searchKey", defaultValue = "") String searchKey, - @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { return ybEleBaseService.getVeriPrescriptionInfo(veriPrescriptionParam, searchKey, pageNo, pageSize, request); } @@ -87,7 +90,7 @@ public class YbElepController { * 医保电子处方状态更新(撤销) * * @param prescriptionNo 处方号 - * @param quashReason 撤销原因 + * @param quashReason 撤销原因 * @return 处方信息 */ @PutMapping(value = "/quashPrescriptionStatus") @@ -99,28 +102,30 @@ public class YbElepController { * 电子处方上传预核验 * * @param prescriptionNo 处方信息 - * @param authNo 电子凭证线上身份核验流水号 - * @param ecToken 电子凭证令牌 - * @param tenantId 租户Id + * @param authNo 电子凭证线上身份核验流水号 + * @param ecToken 电子凭证令牌 + * @param tenantId 租户Id * @return */ @GetMapping("/pre-verification") - public R preVerification(String prescriptionNo, String ecToken, String authNo, Integer tenantId) { + public R preVerification(String prescriptionNo, String ecToken, String authNo, Integer tenantId) throws ServerException { + PreCheckPrescription pcp = ybEleBaseService.makePreCheckPrescription(prescriptionNo, tenantId); - //查类型和审核医生名称 - Map map = ybEleBaseService.getMedTypeAndDoctorName(prescriptionNo, tenantId); - R result = ybEleHttpService.preCheck(pcp,map.get("medType"),map.get("doctorName")); + // 查类型和审核医生名称 + Map map = ybEleBaseService.getMedTypeAndDoctorName(prescriptionNo, tenantId); + + R result = ybEleHttpService.preCheck(pcp, map.get("medType"), map.get("doctorName")); // 入参和出参 保存 if (pcp != null) { pcp.getMdtrtinfo().setPrescriptionNo(prescriptionNo); ybEleBaseService.savePreCheckPrescription(pcp); } - //成功时保存出参 + // 成功时保存出参 if (result.getCode() == 200) { ElepVeriPrescriptionOutput pcpResult = null; if (ElepVeriPrescriptionOutput.class.isAssignableFrom(result.getData().getClass())) { - pcpResult = (ElepVeriPrescriptionOutput) result.getData(); + pcpResult = (ElepVeriPrescriptionOutput)result.getData(); pcpResult.setPrescriptionNo(prescriptionNo); ybEleBaseService.saveEleVeriPrescriptionOutput(pcpResult); return R.ok(pcpResult); @@ -132,30 +137,30 @@ public class YbElepController { /** * 电子处方医保电子签名 * - * @param hiRxno 医保处方编号 + * @param hiRxno 医保处方编号 * @param practitionerId 审方药师Id - * @param checkDate 审方时间 - * @param tenantId 租户Id + * @param checkDate 审方时间 + * @param tenantId 租户Id * @return */ @GetMapping("/pre-signature") public R eleSignature(String hiRxno, Long practitionerId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) { ElepSignatureInput eleSignature = - ybEleBaseService.makeEleSignature(hiRxno, practitionerId, checkDate, tenantId); - R result = ybEleHttpService.eleSign(eleSignature); + ybEleBaseService.makeEleSignature(hiRxno, practitionerId, checkDate, tenantId); + R result = ybEleHttpService.eleSign(eleSignature); // 入参和出参都保存 if (eleSignature != null) { eleSignature.setHiRxno(hiRxno); ybEleBaseService.saveEleSignature(eleSignature); } - //成功时保存出参 + // 成功时保存出参 if (result.getCode() == 200) { ElepSignatureOutput esResult = null; if (ElepSignatureOutput.class.isAssignableFrom(result.getData().getClass())) { - esResult = (ElepSignatureOutput) result.getData(); + esResult = (ElepSignatureOutput)result.getData(); esResult.setHiRxno(hiRxno); ybEleBaseService.saveEleSignatureOutput(esResult); return R.ok(esResult); @@ -167,28 +172,28 @@ public class YbElepController { /** * 电子处方上传 * - * @param hiRxno 医保处方编号 + * @param hiRxno 医保处方编号 * @param practitionerId 审方药师Id - * @param checkDate 审方时间 - * @param tenantId 租户Id + * @param checkDate 审方时间 + * @param tenantId 租户Id * @return */ @GetMapping("/pre-upload") public R uploadElePrescription(String hiRxno, Long practitionerId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) { - ElepUploadInput eleUploadInput = - ybEleBaseService.makeEleUploadInput(hiRxno, practitionerId, checkDate, tenantId); - R result = ybEleHttpService.uploadElePre(eleUploadInput); + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) { + ElepUploadInput eleUploadInput = + ybEleBaseService.makeEleUploadInput(hiRxno, practitionerId, checkDate, tenantId); + R result = ybEleHttpService.uploadElePre(eleUploadInput); // 入参和出参都保存 if (eleUploadInput != null) { ybEleBaseService.saveEleUploadInput(eleUploadInput); } - //成功时保存出参 + // 成功时保存出参 if (result.getCode() == 200) { ElepUploadOutput euResult = null; if (ElepUploadOutput.class.isAssignableFrom(result.getData().getClass())) { - euResult = (ElepUploadOutput) result.getData(); + euResult = (ElepUploadOutput)result.getData(); ybEleBaseService.saveEleUploadOutput(euResult); return R.ok(euResult); } @@ -199,28 +204,28 @@ public class YbElepController { /** * 电子处方撤销 * - * @param hiRxno 医保处方编号 + * @param hiRxno 医保处方编号 * @param practitionerId 撤销医师Id - * @param description 撤销原因 - * @param revokeDate 撤销时间 - * @param tenantId 租户Id + * @param description 撤销原因 + * @param revokeDate 撤销时间 + * @param tenantId 租户Id * @return */ @GetMapping("/pre-revoke") public R revokePrescription(String hiRxno, Long practitionerId, String description, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date revokeDate, Integer tenantId) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date revokeDate, Integer tenantId) { ElepRevokeInput eleRevokeInput = - ybEleBaseService.makeEleRevokeInput(hiRxno, practitionerId, description, revokeDate, tenantId); // 入参和出参都保存 - R result = ybEleHttpService.revokePre(eleRevokeInput); + ybEleBaseService.makeEleRevokeInput(hiRxno, practitionerId, description, revokeDate, tenantId); // 入参和出参都保存 + R result = ybEleHttpService.revokePre(eleRevokeInput); if (eleRevokeInput != null) { ybEleBaseService.saveEleRevokeInput(eleRevokeInput); } - //成功时保存出参 + // 成功时保存出参 if (result.getCode() == 200) { ElepRevokeOutput ereResult = null; if (ElepRevokeOutput.class.isAssignableFrom(result.getData().getClass())) { - ereResult = (ElepRevokeOutput) result.getData(); + ereResult = (ElepRevokeOutput)result.getData(); ybEleBaseService.saveEleRevokeOutput(ereResult); return R.ok(ereResult); } @@ -243,11 +248,11 @@ public class YbElepController { if (eleQueryPreResultInput != null) { ybEleBaseService.saveEleQueryPrescriptionInput(eleQueryPreResultInput); } - //成功时保存出参 + // 成功时保存出参 if (result.getCode() == 200) { QueryPrescription emrResult = null; if (QueryPrescription.class.isAssignableFrom(result.getData().getClass())) { - emrResult = (QueryPrescription) result.getData(); + emrResult = (QueryPrescription)result.getData(); ybEleBaseService.saveEleMedResultOut(emrResult); return R.ok(emrResult); } @@ -264,16 +269,16 @@ public class YbElepController { @GetMapping("/med-query") public R queryMedPrescription(String hiRxno) { - ElepMedresultInput eleMedInput = ybEleBaseService.makeEleMedResultInput(hiRxno); // 入参和出参都保存 + ElepMedresultInput eleMedInput = ybEleBaseService.makeEleMedResultInput(hiRxno); // 入参和出参都保存 R result = ybEleHttpService.queryMedPre(eleMedInput); if (eleMedInput != null) { ybEleBaseService.saveEleMedResultInput(eleMedInput); } - //成功时保存出参 + // 成功时保存出参 if (result.getCode() == 200) { MedicationResultInquiry medResult = null; if (MedicationResultInquiry.class.isAssignableFrom(result.getData().getClass())) { - medResult = (MedicationResultInquiry) result.getData(); + medResult = (MedicationResultInquiry)result.getData(); ybEleBaseService.saveMedicationResultInquiry(medResult); return R.ok(medResult); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/IYbEleBaseService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/IYbEleBaseService.java index b96e2bad91d1ffa1c62cc51a9fdc7c8d283c1c4d..8801def4f6b353b41caf70058fc7fd88cdf9ebe0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/IYbEleBaseService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/IYbEleBaseService.java @@ -3,17 +3,16 @@ */ package com.openhis.web.ybmanage.service; +import java.rmi.ServerException; import java.util.Date; import java.util.Map; -import com.baomidou.mybatisplus.core.metadata.IPage; +import javax.servlet.http.HttpServletRequest; + import com.core.common.core.domain.R; -import com.openhis.web.doctorstation.dto.AdviceBaseDto; import com.openhis.web.ybmanage.dto.VeriPrescriptionParam; import com.openhis.ybelep.domain.*; -import javax.servlet.http.HttpServletRequest; - /** * * @author yuxj @@ -31,8 +30,8 @@ public interface IYbEleBaseService { * @param request 请求数据 * @return 处方信息 */ - R getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, String searchKey, - Integer pageNo, Integer pageSize, HttpServletRequest request); + R getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request); /** * 医保电子处方查看 @@ -65,7 +64,7 @@ public interface IYbEleBaseService { * @param quashReason 撤销原因 * @return 处方信息 */ - R quashPrescriptionStatus(String prescriptionNo,String quashReason); + R quashPrescriptionStatus(String prescriptionNo, String quashReason); /** * 做成电子处方上传预核验入参信息 @@ -74,8 +73,7 @@ public interface IYbEleBaseService { * @param tenantId 租户Id * @return 处方信息 */ - PreCheckPrescription makePreCheckPrescription(String prescriptionNo, - Integer tenantId); + PreCheckPrescription makePreCheckPrescription(String prescriptionNo, Integer tenantId) throws ServerException; /** * 电子处方上传预核验信息保存 @@ -157,7 +155,8 @@ public interface IYbEleBaseService { * @param tenantId 租户Id * @return 电子处方撤销入参 */ - ElepRevokeInput makeEleRevokeInput(String hiRxno, Long practitionerId,String description, Date checkDate, Integer tenantId); + ElepRevokeInput makeEleRevokeInput(String hiRxno, Long practitionerId, String description, Date checkDate, + Integer tenantId); /** * 保存电子处方撤销入参 @@ -223,5 +222,13 @@ public interface IYbEleBaseService { */ void saveMedicationResultInquiry(MedicationResultInquiry medResInquiry); - Map getMedTypeAndDoctorName(String prescriptionNo, Integer tenantId); + /** + * 查类型和审核医生名称 + * + * @param prescriptionNo 处方号 + * @param tenantId 租户 + * @return 结果 + */ + Map getMedTypeAndDoctorName(String prescriptionNo, Integer tenantId); + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbEleHttpServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbEleHttpServiceImpl.java index 5ad26d5ea326c6c06cd48336f49b2926eb9dd8cb..7e9cabb80c70b856ff7ebaf8c0c138c68ba9d3f2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbEleHttpServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbEleHttpServiceImpl.java @@ -3,12 +3,8 @@ */ package com.openhis.web.ybmanage.service.impl; -import com.core.common.core.domain.R; -import com.core.common.exception.ServiceException; -import com.core.common.utils.SecurityUtils; -import com.openhis.yb.dto.BaseInfo; -import com.openhis.yb.dto.BaseParam; -import com.openhis.yb.util.YbParamBuilderUtil; +import java.io.IOException; + import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; @@ -21,14 +17,18 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.alibaba.fastjson2.JSON; +import com.core.common.core.domain.R; +import com.core.common.exception.ServiceException; +import com.core.common.utils.SecurityUtils; import com.fasterxml.jackson.databind.ObjectMapper; import com.openhis.web.ybmanage.config.YbServiceConfig; import com.openhis.web.ybmanage.dto.Result; import com.openhis.web.ybmanage.service.IYbEleHttpService; +import com.openhis.yb.dto.BaseInfo; +import com.openhis.yb.dto.BaseParam; +import com.openhis.yb.util.YbParamBuilderUtil; import com.openhis.ybelep.domain.*; -import java.io.IOException; - /** * http请求接口 * @@ -43,6 +43,7 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { @Autowired YbParamBuilderUtil ybParamBuilderUtil; + /** * 采用HTTP协议中的 POST 方法,发送医保电子处方注册预核验请求,并处理响应结果 * @@ -50,11 +51,12 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { * @return 医保电子处方注册预核验响应出参实体 */ @Override - public R preCheck(PreCheckPrescription pcp, String medType , String dutyDoctorName) { + public R preCheck(PreCheckPrescription pcp, String medType, String dutyDoctorName) { ElepVeriPrescriptionOutput pcpResult = new ElepVeriPrescriptionOutput(); BaseInfo baseInfo = ybParamBuilderUtil.getBaseInfo(medType, dutyDoctorName); // 发送请求 - String s = httpPost( SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/preCheckPrescription", pcp,baseInfo); + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/preCheckPrescription", + pcp, baseInfo); // 参数处理 ObjectMapper mapper = new ObjectMapper(); Result result = null; @@ -66,9 +68,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { if (result != null && result.isSuccess()) { pcpResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepVeriPrescriptionOutput.class);; pcpResult.setPrescriptionNo(pcp.getHospRxno()); - return R.ok(pcpResult); - }else{ - return R.fail(result.getMessage()); + return R.ok(pcpResult); + } else { + return R.fail(result.getMessage()); } } @@ -82,7 +84,8 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { ElepSignatureOutput esResult = new ElepSignatureOutput(); // 发送请求 - String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/signature", eleSign,ybParamBuilderUtil.getBaseInfo("","")); + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/signature", eleSign, + ybParamBuilderUtil.getBaseInfo("", "")); // 参数处理 ObjectMapper mapper = new ObjectMapper(); Result result = null; @@ -93,9 +96,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { } if (result != null && result.isSuccess()) { esResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepSignatureOutput.class); - return R.ok(esResult); - }else{ - return R.fail(result.getMessage()); + return R.ok(esResult); + } else { + return R.fail(result.getMessage()); } } @@ -110,7 +113,8 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { ElepUploadOutput euResult = new ElepUploadOutput(); // 发送请求 - String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/upload", eleUploadInput,ybParamBuilderUtil.getBaseInfo("","")); + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/upload", + eleUploadInput, ybParamBuilderUtil.getBaseInfo("", "")); // 参数处理 ObjectMapper mapper = new ObjectMapper(); Result result = null; @@ -121,9 +125,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { } if (result != null && result.isSuccess()) { euResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepUploadOutput.class); - return R.ok(euResult); - }else{ - return R.fail(result.getMessage()); + return R.ok(euResult); + } else { + return R.fail(result.getMessage()); } } @@ -138,7 +142,8 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { ElepRevokeOutput ereResult = new ElepRevokeOutput(); // 发送请求 - String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/revoke", eleRevokeInput,ybParamBuilderUtil.getBaseInfo("","")); + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/revoke", + eleRevokeInput, ybParamBuilderUtil.getBaseInfo("", "")); // 参数处理 ObjectMapper mapper = new ObjectMapper(); Result result = null; @@ -149,9 +154,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { } if (result != null && result.isSuccess()) { ereResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepRevokeOutput.class); - return R.ok(ereResult); - }else{ - return R.fail(result.getMessage()); + return R.ok(ereResult); + } else { + return R.fail(result.getMessage()); } } @@ -163,14 +168,14 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { */ @Override public R queryPre(ElepQuerPrescriptionInput eleQueryPreInput) { - //拼参数 -// BaseParam baseParam = new BaseParam(); -// baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(eleQueryPreInput); -// baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(o); + // 拼参数 + // BaseParam baseParam = new BaseParam(); + // baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(eleQueryPreInput); + // baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(o); QueryPrescription emrResult = new QueryPrescription(); // 发送请求 - String s = - httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/querPrescription", eleQueryPreInput,ybParamBuilderUtil.getBaseInfo("","")); + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/querPrescription", + eleQueryPreInput, ybParamBuilderUtil.getBaseInfo("", "")); // 参数处理 ObjectMapper mapper = new ObjectMapper(); Result result = null; @@ -181,9 +186,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { } if (result != null && result.isSuccess()) { emrResult = JSON.parseObject(JSON.toJSONString(result.getResult()), QueryPrescription.class); - return R.ok(emrResult); - }else{ - return R.fail(result.getMessage()); + return R.ok(emrResult); + } else { + return R.fail(result.getMessage()); } } @@ -193,12 +198,12 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { * @param eleMedInput 电子处方取药结果查询入参实体 * @return 电子处方取药结果查询出参实体 */ - public R queryMedPre(ElepMedresultInput eleMedInput){ + public R queryMedPre(ElepMedresultInput eleMedInput) { MedicationResultInquiry medResult = new MedicationResultInquiry(); // 发送请求 - String s = - httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/medresult", eleMedInput,ybParamBuilderUtil.getBaseInfo("","")); + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/medresult", + eleMedInput, ybParamBuilderUtil.getBaseInfo("", "")); // 参数处理 ObjectMapper mapper = new ObjectMapper(); Result result = null; @@ -209,28 +214,30 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { } if (result != null && result.isSuccess()) { medResult = JSON.parseObject(JSON.toJSONString(result.getResult()), MedicationResultInquiry.class); - return R.ok(medResult); - }else{ - return R.fail(result.getMessage()); + return R.ok(medResult); + } else { + return R.fail(result.getMessage()); } } + /** * 发送http请求(2025/05/02经测试,若以自带的工具类发送请求失败,故使用原peis系统中成功调用的写法重新封装) + * * @param url 路径 * @param o 参数 * @return */ - private String httpPost(String url, Object o, BaseInfo baseInfo){ + private String httpPost(String url, Object o, BaseInfo baseInfo) { String resultString = ""; -// //拼参数 + //拼参数 BaseParam baseParam = new BaseParam(); baseParam.setBaseInfo(baseInfo).setData(o); - //创建Http请求 - RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setConnectionRequestTimeout(30000) - .setSocketTimeout(30000).build(); + // 创建Http请求(2025/10/13 师大会超时故此由30000-》60000) + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(90000).setConnectionRequestTimeout(90000) + .setSocketTimeout(90000).build(); CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build(); CloseableHttpResponse response = null; - //发送请求 + // 发送请求 try { HttpPost httpPost = new HttpPost(url); StringEntity stringEntity = new StringEntity(JSON.toJSONString(baseParam), ContentType.APPLICATION_JSON); @@ -238,12 +245,10 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService { // 执行http请求 response = httpClient.execute(httpPost); resultString = EntityUtils.toString(response.getEntity(), "utf-8"); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); throw new ServiceException("Http请求异常,请稍后再试。"); - } - finally { + } finally { try { response.close(); } catch (IOException e) { diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbElepBaseServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbElepBaseServiceImpl.java index 68ea55c4075788c6a6782ff51d9f1eb8ba00d008..c8b6dd9bb33ad0694833fed81306246c7c501ac6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbElepBaseServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/service/impl/YbElepBaseServiceImpl.java @@ -3,8 +3,18 @@ */ package com.openhis.web.ybmanage.service.impl; +import java.rmi.ServerException; import java.util.*; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import com.openhis.common.enums.ybenums.YbMedType; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +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.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -19,37 +29,36 @@ import com.openhis.administration.domain.Practitioner; import com.openhis.administration.service.IEncounterService; import com.openhis.administration.service.IPatientService; import com.openhis.administration.service.IPractitionerService; +import com.openhis.clinical.domain.ConditionDefinition; +import com.openhis.clinical.service.IConditionDefinitionService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.constant.YbCommonConstants; import com.openhis.common.enums.PrescriptionType; import com.openhis.common.enums.RequestStatus; +import com.openhis.common.enums.Whether; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; -import com.openhis.financial.domain.Contract; import com.openhis.financial.service.IContractService; import com.openhis.web.ybmanage.dto.VeriPrescriptionDetailInfoDto; import com.openhis.web.ybmanage.dto.VeriPrescriptionInfoDto; import com.openhis.web.ybmanage.dto.VeriPrescriptionParam; import com.openhis.web.ybmanage.mapper.YbElepMapper; -import com.openhis.workflow.domain.ElepMedicationRequest; -import com.openhis.workflow.service.IElepMedicationRequestService; -import com.openhis.yb.service.IPerinfoService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.openhis.web.ybmanage.service.IYbEleBaseService; import com.openhis.web.ybmanage.util.YbEleParamBuilderUtil; +import com.openhis.workflow.domain.ElepMedicationRequest; +import com.openhis.workflow.service.IElepMedicationRequestService; import com.openhis.yb.domain.ClinicReg; +import com.openhis.yb.dto.Clinic2203DiseInfoParam; +import com.openhis.yb.dto.Clinic2203MedicalParam; +import com.openhis.yb.service.IPerinfoService; import com.openhis.yb.service.IRegService; +import com.openhis.yb.service.YbHttpUtils; +import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease; +import com.openhis.ybcatalog.service.ICatalogSpecialDiseaseService; import com.openhis.ybelep.domain.*; import com.openhis.ybelep.service.*; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - /** * 医保表的增删改查接口 * @@ -62,6 +71,12 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { @Autowired IRegService iRegService; @Autowired + YbHttpUtils ybHttpUtils; + @Autowired + ICatalogSpecialDiseaseService catalogSpecialDiseaseService; + @Autowired + IConditionDefinitionService conditionDefinitionService; + @Autowired IPerinfoService perinfoService; @Autowired IContractService contractService; @@ -124,29 +139,29 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { * 医保电子处方查询 * * @param veriPrescriptionParam 查询条件 - * @param searchKey 模糊查询关键字 - * @param pageNo 当前页 - * @param pageSize 每页多少条 - * @param request 请求数据 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求数据 * @return 处方信息 */ @Override public R getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, String searchKey, Integer pageNo, - Integer pageSize, HttpServletRequest request) { + Integer pageSize, HttpServletRequest request) { // 构建查询条件 QueryWrapper queryWrapper = - HisQueryUtils.buildQueryWrapper(veriPrescriptionParam, searchKey, - new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.IptOtpNo)), - request); + HisQueryUtils.buildQueryWrapper(veriPrescriptionParam, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.IptOtpNo)), + request); // 医保电子处方查询 IPage veriPrescriptionInfo = - ybElepMapper.getVeriPrescriptionInfo(new Page<>(pageNo, pageSize), queryWrapper); + ybElepMapper.getVeriPrescriptionInfo(new Page<>(pageNo, pageSize), queryWrapper); // 状态转换 veriPrescriptionInfo.getRecords().forEach(prescriptionInfoDto -> { prescriptionInfoDto.setStatusEnum_enumText( - EnumUtils.getInfoByValue(RequestStatus.class, prescriptionInfoDto.getStatusEnum())); + EnumUtils.getInfoByValue(RequestStatus.class, prescriptionInfoDto.getStatusEnum())); }); return R.ok(veriPrescriptionInfo); @@ -162,7 +177,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { public R getPrescriptionDetailInfo(String prescriptionNo) { // 处方详细查询 List prescriptionDetailInfo = - ybElepMapper.getVeriPrescriptionDetailInfo(prescriptionNo); + ybElepMapper.getVeriPrescriptionDetailInfo(prescriptionNo); // 状态转换 for (VeriPrescriptionDetailInfoDto item : prescriptionDetailInfo) { item.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, item.getStatusEnum())); @@ -186,15 +201,15 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { Date now = DateUtils.getNowDate(); // 获取医保处方号 List prescriptionOutput = - elePresOutputService.list(new LambdaQueryWrapper() - .eq(ElepVeriPrescriptionOutput::getPrescriptionNo, prescriptionNo) - .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + elePresOutputService.list(new LambdaQueryWrapper() + .eq(ElepVeriPrescriptionOutput::getPrescriptionNo, prescriptionNo) + .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (prescriptionOutput == null) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); } // 获取电子处方信息 List elepMedicationRequest = - elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo); + elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo); if (elepMedicationRequest == null) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); } @@ -235,7 +250,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { Date now = DateUtils.getNowDate(); // 获取电子处方信息 List elepMedicationRequest = - elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo); + elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo); if (elepMedicationRequest == null) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); } @@ -257,7 +272,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { * 医保电子处方状态更新(撤销) * * @param prescriptionNo 处方号 - * @param quashReason 撤销原因 + * @param quashReason 撤销原因 * @return 处方信息 */ @Override @@ -269,7 +284,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { Date now = DateUtils.getNowDate(); // 获取电子处方信息 List elepMedicationRequest = - elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo); + elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo); if (elepMedicationRequest == null) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); } @@ -297,17 +312,16 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { * 做成电子处方上传预核验入参信息 * * @param prescriptionNo 处方号 - * @param tenantId 租户Id + * @param tenantId 租户Id * @return 处方信息 */ @Override - public PreCheckPrescription makePreCheckPrescription(String prescriptionNo, - Integer tenantId) { + public PreCheckPrescription makePreCheckPrescription(String prescriptionNo, Integer tenantId) throws ServerException { // 获取药品请求信息(处方表) List medicationRequestList = elepMedicationRequestService.list( - new LambdaQueryWrapper().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo) - .eq(ElepMedicationRequest::getTenantId, tenantId)); + new LambdaQueryWrapper().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo) + .eq(ElepMedicationRequest::getTenantId, tenantId)); if (medicationRequestList == null) { return null; } @@ -315,9 +329,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { // 就诊信息 Encounter encounter = encounterService.getById(medicationRequest.getEncounterId()); - //患者信息 + // 患者信息 Patient patient = patientService.getById(encounter.getPatientId()); - // 获取医保挂号信息 todo clinicReg可能改成一对多 + // 获取医保挂号信息 todo clinicReg可能改成一对多 ClinicReg clinicReg = iRegService.getByBusNo(encounter.getBusNo()); if (clinicReg == null) { return null; @@ -325,19 +339,26 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { // 获取处方信息 PreCheckPrescription prescriptionInfo = - ybEleUtil.getEleVeriPrescriptionInfo(medicationRequest, patient, tenantId); + ybEleUtil.getEleVeriPrescriptionInfo(medicationRequest, patient, tenantId); // 获取处方明细信息 List rxdrugdetail = - ybEleUtil.getEleVeriPrescriptionDetail(prescriptionNo, tenantId); + ybEleUtil.getEleVeriPrescriptionDetail(prescriptionNo, tenantId); // 获取就诊信息和诊断信息 PreCheckPrescription eleVisAndDisInfo = - ybEleUtil.getEleVeriVisitAndDiagnosisInfo(medicationRequest, clinicReg, tenantId); + ybEleUtil.getEleVeriVisitAndDiagnosisInfo(medicationRequest, clinicReg, tenantId); + if(eleVisAndDisInfo==null){ + throw new ServerException("未查询到就诊或诊断信息"); + } // 电子处方上传预核验实体赋值 + prescriptionInfo.setRxdrugdetail(rxdrugdetail).setMdtrtinfo(eleVisAndDisInfo.getMdtrtinfo()) + .setDiseinfo(eleVisAndDisInfo.getDiseinfo()); + + // 需要先进行2203接口上传就诊信息 + this.upload2203(prescriptionInfo, medicationRequest, clinicReg); - prescriptionInfo.setRxdrugdetail(rxdrugdetail) - .setMdtrtinfo(eleVisAndDisInfo.getMdtrtinfo()).setDiseinfo(eleVisAndDisInfo.getDiseinfo()); + iRegService.updateById(clinicReg); return prescriptionInfo; } @@ -351,7 +372,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { @Override public void savePreCheckPrescription(PreCheckPrescription pcpResult) { - //todo dto和表的字段类型不一致 + // todo dto和表的字段类型不一致 ElepVeriPrescriptionInfo prescriptionInfo = new ElepVeriPrescriptionInfo(); BeanUtils.copyProperties(pcpResult, prescriptionInfo); @@ -365,7 +386,6 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { eleVeriDiagnosisInfoService.save(pcpResult.getDiseinfo()); } - /** * 电子处方上传预核验响应出参信息保存 * @@ -380,18 +400,18 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { /** * 做成电子处方医保电子签名入参 * - * @param hiRxno 医保处方编号 + * @param hiRxno 医保处方编号 * @param practitionerId 审方药师Id - * @param checkDate 审方时间 - * @param tenantId 租户Id + * @param checkDate 审方时间 + * @param tenantId 租户Id * @return 处方信息 */ @Override public ElepSignatureInput makeEleSignature(String hiRxno, Long practitionerId, Date checkDate, Integer tenantId) { - List pcpResult = elePresOutputService.list( - new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) - .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + List pcpResult = elePresOutputService + .list(new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) + .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (pcpResult == null) { return null; } @@ -423,22 +443,22 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { /** * 做成电子处方上传入参 * - * @param hiRxno 医保处方编号 + * @param hiRxno 医保处方编号 * @param practitionerId 审方药师Id - * @param checkDate 审方时间 - * @param tenantId 租户Id + * @param checkDate 审方时间 + * @param tenantId 租户Id * @return 电子处方上传入参 */ @Override public ElepUploadInput makeEleUploadInput(String hiRxno, Long practitionerId, Date checkDate, Integer tenantId) { - List pcpResult = elePresOutputService.list( - new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) - .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + List pcpResult = elePresOutputService + .list(new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) + .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); List esResult = eleSignOutService - .list(new LambdaQueryWrapper().eq(ElepSignatureOutput::getHiRxno, hiRxno) - .orderByDesc(ElepSignatureOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + .list(new LambdaQueryWrapper().eq(ElepSignatureOutput::getHiRxno, hiRxno) + .orderByDesc(ElepSignatureOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (pcpResult == null || esResult == null) { return null; @@ -471,32 +491,33 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { /** * 做成电子处方撤销入参 * - * @param hiRxno 医保处方编号 + * @param hiRxno 医保处方编号 * @param practitionerId 撤销药师Id - * @param description 撤销原因 - * @param revokeDate 撤销时间 - * @param tenantId 租户Id + * @param description 撤销原因 + * @param revokeDate 撤销时间 + * @param tenantId 租户Id * @return 电子处方撤销入参 */ @Override public ElepRevokeInput makeEleRevokeInput(String hiRxno, Long practitionerId, String description, Date revokeDate, - Integer tenantId) { + Integer tenantId) { - List pcpResult = elePresOutputService.list( - new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) - .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + List pcpResult = elePresOutputService + .list(new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) + .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (pcpResult == null) { return null; } - List euResult = eleUploadOutputService - .list(new LambdaQueryWrapper().eq(ElepUploadOutput::getHiRxno, pcpResult.get(0).getHiRxno()) - .orderByDesc(ElepUploadOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + List euResult = eleUploadOutputService.list( + new LambdaQueryWrapper().eq(ElepUploadOutput::getHiRxno, pcpResult.get(0).getHiRxno()) + .orderByDesc(ElepUploadOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (euResult == null) { return null; } - return ybEleUtil.getElepRevokeInput(pcpResult.get(0), euResult.get(0), practitionerId, description, revokeDate, tenantId); + return ybEleUtil.getElepRevokeInput(pcpResult.get(0), euResult.get(0), practitionerId, description, revokeDate, + tenantId); } /** @@ -531,9 +552,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { @Override public ElepQuerPrescriptionInput makeEleQueryPrescriptionInput(String hiRxno) { - List pcpResult = elePresOutputService.list( - new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) - .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + List pcpResult = elePresOutputService + .list(new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) + .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (pcpResult == null) { return null; @@ -584,9 +605,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { @Override public ElepMedresultInput makeEleMedResultInput(String hiRxno) { - List pcpResult = elePresOutputService.list( - new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) - .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + List pcpResult = elePresOutputService + .list(new LambdaQueryWrapper().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno) + .orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (pcpResult == null) { return null; @@ -628,8 +649,8 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { HashMap map = new HashMap<>(); // 获取药品请求信息(处方表) List medicationRequestList = elepMedicationRequestService.list( - new LambdaQueryWrapper().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo) - .eq(ElepMedicationRequest::getTenantId, tenantId)); + new LambdaQueryWrapper().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo) + .eq(ElepMedicationRequest::getTenantId, tenantId)); if (medicationRequestList == null) { return null; } @@ -637,9 +658,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { // 就诊信息 Encounter encounter = encounterService.getById(medicationRequest.getEncounterId()); - //患者信息 + // 患者信息 Patient patient = patientService.getById(encounter.getPatientId()); - // 获取医保挂号信息 todo clinicReg可能改成一对多 + // 获取医保挂号信息 todo clinicReg可能改成一对多 ClinicReg clinicReg = iRegService.getByBusNo(encounter.getBusNo()); if (clinicReg == null) { return null; @@ -647,19 +668,19 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { String medicalContractName = ""; String insuplcAdmdvs = clinicReg.getInsuplcAdmdvs(); - if (insuplcAdmdvs.equals("229900") ) { + if (insuplcAdmdvs.equals("229900")) { medicalContractName = "省"; } else if (insuplcAdmdvs.startsWith("2201")) { medicalContractName = "市"; } else { medicalContractName = "省异地"; } -// List contractListByYb = contractService.getContractListByYb(); -// for (Contract contract : contractListByYb) { -// if(insuplcAdmdvs.equals(contract.getAdmVs())){ -// medicalContractName = contract.getContractName(); -// } -// } + // List contractListByYb = contractService.getContractListByYb(); + // for (Contract contract : contractListByYb) { + // if(insuplcAdmdvs.equals(contract.getAdmVs())){ + // medicalContractName = contract.getContractName(); + // } + // } String insutype = clinicReg.getInsutype(); @@ -698,4 +719,51 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService { return map; } + + /** + * 上传2203 + * + * @param prescription 处方信息 + */ + private void upload2203(PreCheckPrescription prescription, ElepMedicationRequest medicationRequest, + ClinicReg clinicReg) throws ServerException { + + // 查询慢病目录 + CatalogSpecialInsuranceDisease catalogSpecialInsuranceDisease = + catalogSpecialDiseaseService.getOne(new LambdaQueryWrapper() + .eq(CatalogSpecialInsuranceDisease::getDiseaseCode, medicationRequest.getOpspDiseCode())); + if (catalogSpecialInsuranceDisease == null) { + return; + } + + // 查询诊断定义 + ConditionDefinition conditionDefinition = + conditionDefinitionService.getConditionDefinitionListById(medicationRequest.getConditionDefId()); + if (conditionDefinition == null) { + throw new ServerException("未查询到诊断定义"); + } + List diseinfos = new ArrayList(); + ElepVeriDiagnosisInfo diseinfo = prescription.getDiseinfo(); + + Clinic2203DiseInfoParam diseinfo2203 = new Clinic2203DiseInfoParam(); + diseinfo2203.setDiagCode(conditionDefinition.getYbNo()).setDiagName(conditionDefinition.getName()) + .setDiagDept(diseinfo.getDiagDept()).setDiseDorName(diseinfo.getDiagDrName()) + .setDiseDorNo(diseinfo.getDiagDrNo()).setDiagTime(diseinfo.getDiagTime()) + .setValiFlag(Whether.YES.getValue().toString()).setDiagType(diseinfo.getDiagType()) + .setDiagSrtNo(diseinfo.getDiagSrtNo()); + + diseinfos.add(diseinfo2203); + + Clinic2203MedicalParam medical2203Param = new Clinic2203MedicalParam(); + + medical2203Param.setMdtrtId(clinicReg.getMdtrtId()).setPsnNo(clinicReg.getPsnNo()) + .setBegntime(clinicReg.getBegntime()).setMedType(YbMedType.CHRONIC_DISEASE_OUTPATIENT.getValue()) + .setMainCondDscr(conditionDefinition.getName()).setInsuplcAdmdvs(clinicReg.getInsuplcAdmdvs()) + .setDiseCodg(medicationRequest.getOpspDiseCode()).setDiseName(conditionDefinition.getName()) + .setDiseinfoList(diseinfos); + clinicReg.setMedType(YbMedType.CHRONIC_DISEASE_OUTPATIENT.getValue()); + prescription.getMdtrtinfo().setDiseCodg(medicationRequest.getOpspDiseCode()); + ybHttpUtils.upload2203Record(medical2203Param, null); + + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/util/YbEleParamBuilderUtil.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/util/YbEleParamBuilderUtil.java index 0cf769e4d2f078c2f853ed158233218386a13f72..ba64c494ce482a169e02155d91c8d8176981025b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/util/YbEleParamBuilderUtil.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/ybmanage/util/YbEleParamBuilderUtil.java @@ -7,6 +7,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.math.BigDecimal; +import java.rmi.ServerException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.Period; @@ -14,34 +15,34 @@ import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.*; -import com.core.common.enums.DeleteFlag; -import com.core.common.utils.SecurityUtils; -import com.openhis.common.constant.CommonConstants; -import com.openhis.common.constant.YbCommonConstants; -import com.openhis.workflow.domain.ElepMedicationRequest; -import com.openhis.workflow.service.IElepMedicationRequestService; -import com.openhis.ybcatalog.domain.CatalogDrugInfo; -import com.openhis.ybcatalog.service.ICatalogDrugInfoService; +import com.core.common.exception.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.core.common.utils.DateUtils; +import com.core.common.utils.SecurityUtils; import com.openhis.administration.domain.*; import com.openhis.administration.service.*; import com.openhis.clinical.domain.Condition; import com.openhis.clinical.domain.ConditionDefinition; import com.openhis.clinical.service.IConditionDefinitionService; import com.openhis.clinical.service.IConditionService; -import com.openhis.common.enums.*; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.YbCommonConstants; +import com.openhis.common.enums.AccountType; +import com.openhis.common.enums.AdministrativeGender; +import com.openhis.common.enums.EncounterClass; +import com.openhis.common.enums.Whether; import com.openhis.common.enums.ybenums.*; -import com.openhis.medication.domain.Medication; -import com.openhis.medication.domain.MedicationDefinition; import com.openhis.medication.service.IMedicationDefinitionService; -import com.openhis.medication.service.IMedicationService; +import com.openhis.workflow.domain.ElepMedicationRequest; +import com.openhis.workflow.service.IElepMedicationRequestService; import com.openhis.yb.domain.ClinicReg; import com.openhis.yb.service.IRegService; +import com.openhis.ybcatalog.domain.CatalogDrugInfo; +import com.openhis.ybcatalog.service.ICatalogDrugInfoService; import com.openhis.ybelep.domain.*; import com.openhis.ybelep.service.IElepVeriPrescriptionInfoService; import com.openhis.ybelep.service.IElepVeriVisitInfoService; @@ -94,36 +95,104 @@ public class YbEleParamBuilderUtil { @Autowired IElepVeriVisitInfoService eleVerVisInfoService; + /** + * 获取BigDecimal类型的年龄 + * + * @param birthDate 出生日期 + * @param beginTime 计算起始日期 + * @return 年龄 + */ + public static BigDecimal calculateAge(Date birthDate, Date beginTime) { + // 验证输入参数是否为空 + if (Objects.isNull(birthDate)) { + System.out.println("出生年月日不能为空!"); + return null; + } + // 验证输入参数是否为空 + if (Objects.isNull(beginTime)) { + beginTime = DateUtils.getNowDate(); + } + + // 将 Date 转换为 LocalDate + LocalDate localBirthDate = birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate localBeginTime = beginTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + + // 计算出生日期到起始日期之间的年份差异 + Period period = Period.between(localBirthDate, localBeginTime); + + int years = period.getYears(); + + // 检查是否已经过了生日,如果没有过,则年份减一 + boolean hasBirthdayPassed = !localBirthDate.plusYears(years).isAfter(localBeginTime); + if (!hasBirthdayPassed) { + years--; + } + + return BigDecimal.valueOf(years); + } + + /** + * 读取文件内容并获取其 Base64 字符值 + * + * @param filePath 文件路径 + * @return 文件内容的 Base64 字符值 + */ + public static String fileToBase64(String filePath) { + File file = new File(filePath); + if (!file.exists()) { + System.out.println("文件不存在!"); + return null; + } + + FileInputStream fileInputStream = null; + try { + fileInputStream = new FileInputStream(file); + byte[] fileContent = new byte[(int)file.length()]; + fileInputStream.read(fileContent); + return Base64.getEncoder().encodeToString(fileContent); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return null; + } + /** * 获取处方信息 * * @param medicationRequest 处方信息 - * @param patient 患者信息 - * @param tenantId 租户Id + * @param patient 患者信息 + * @param tenantId 租户Id * @return 处方信息 */ public PreCheckPrescription getEleVeriPrescriptionInfo(ElepMedicationRequest medicationRequest, Patient patient, - Integer tenantId) { + Integer tenantId) { // 声明处方信息对象 PreCheckPrescription elepVeriPrescriptionInfo = new PreCheckPrescription(); - elepVeriPrescriptionInfo.setMdtrtCertType("02") - .setMdtrtCertNo(patient.getIdCard()) - // 01-定点医疗机构就诊 - .setBizTypeCode("01").setHospRxno(medicationRequest.getPrescriptionNo()) - .setRxTypeCode(medicationRequest.getRxTypeCode().toString()).setPrscTime(medicationRequest.getIssueTime()) - // 处方有效天数 - .setValiDays(medicationRequest.getValidityDays().toString()) - // 计算截止时间 - .setValiEndTime(DateUtils.addDays(medicationRequest.getIssueTime(), medicationRequest.getValidityDays())); + elepVeriPrescriptionInfo.setMdtrtCertType("02").setMdtrtCertNo(patient.getIdCard()) + // 01-定点医疗机构就诊 + .setBizTypeCode("01").setHospRxno(medicationRequest.getPrescriptionNo()) + .setRxTypeCode(medicationRequest.getRxTypeCode().toString()).setPrscTime(medicationRequest.getIssueTime()) + // 处方有效天数 + .setValiDays(medicationRequest.getValidityDays().toString()) + // 计算截止时间 + .setValiEndTime(DateUtils.addDays(medicationRequest.getIssueTime(), medicationRequest.getValidityDays())); // 就诊凭证类型为03”时,填写社会保障卡卡号 if (elepVeriPrescriptionInfo.getMdtrtCertType() == YbMdtrtCertType.MDTRT_CERT_TYPE03.getValue()) { Account account = accountService.getOne( - new LambdaQueryWrapper().eq(Account::getEncounterId, medicationRequest.getEncounterId()) - .eq(Account::getTypeCode, AccountType.SOCIAL_SECURITY_CARD.getValue()) - .eq(Account::getTenantId, tenantId)); + new LambdaQueryWrapper().eq(Account::getEncounterId, medicationRequest.getEncounterId()) + .eq(Account::getTypeCode, AccountType.SOCIAL_SECURITY_CARD.getValue()) + .eq(Account::getTenantId, tenantId)); if (account == null) { return null; } @@ -139,11 +208,11 @@ public class YbEleParamBuilderUtil { // 调用 count 方法 Long countWesternOrChinese = elepMedicationRequestService - .selectWesternOrChineseCount(medicationRequest.getPrescriptionNo(), westernOrChineseList, tenantId); + .selectWesternOrChineseCount(medicationRequest.getPrescriptionNo(), westernOrChineseList, tenantId); // 西药、中成药时为药品的类目数量 elepVeriPrescriptionInfo.setRxDrugCnt(countWesternOrChinese.toString()) - .setRxUsedWayCodg(medicationRequest.getMedRoute()) - .setRxUsedWayName(YbDrugMedWay.getByValue(medicationRequest.getMedRoute()).getDescription()); + .setRxUsedWayCodg(medicationRequest.getMedRoute()) + .setRxUsedWayName(YbDrugMedWay.getByValue(medicationRequest.getMedRoute()).getDescription()); return elepVeriPrescriptionInfo; } @@ -152,14 +221,15 @@ public class YbEleParamBuilderUtil { * 获取处方明细信息 * * @param prescriptionNo 处方号 - * @param tenantId 租户Id + * @param tenantId 租户Id * @return 处方明细信息 */ public List getEleVeriPrescriptionDetail(String prescriptionNo, Integer tenantId) { // 查询该处方所有中药饮片 - List materialObjs = elepMedicationRequestService.list(new LambdaQueryWrapper() - .eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo).eq(ElepMedicationRequest::getTenantId, tenantId)); + List materialObjs = elepMedicationRequestService.list( + new LambdaQueryWrapper().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo) + .eq(ElepMedicationRequest::getTenantId, tenantId)); // 未查到返回空 if (materialObjs == null) { return null; @@ -170,30 +240,30 @@ public class YbEleParamBuilderUtil { // 遍历 materialObjs 列表 for (ElepMedicationRequest materialObj : materialObjs) { CatalogDrugInfo mObj = catalogDrugInfoService.getOne(new LambdaQueryWrapper() - .eq(CatalogDrugInfo::getMedicalCatalogCode, materialObj.getMedicationId()).orderByDesc(CatalogDrugInfo::getCreatedAt).last("LIMIT 1")); + .eq(CatalogDrugInfo::getMedicalCatalogCode, materialObj.getMedicationId()) + .orderByDesc(CatalogDrugInfo::getCreatedAt).last("LIMIT 1")); // 未查到返回空 if (mObj == null) { return null; } ElepVeriPrescriptionDetail eleObj = new ElepVeriPrescriptionDetail(); - eleObj.setMedListCodg(mObj.getMedicalCatalogCode()) - .setDrugGenname(mObj.getRegisteredName()).setDrugDosform(mObj.getDrugForm()) - .setDrugSpec(mObj.getDrugSpecification()).setMedcBegntime(materialObj.getEffectiveDoseStart()) - .setMedcEndtime(materialObj.getEffectiveDoseEnd()) - .setMedcDays(materialObj.getDispensePerDuration().toString()) - .setDrugDosunt(materialObj.getUnitCode()).setDrugCnt(materialObj.getQuantity().toString()) - // todo 医院审批标志,配合目录的限制使用标志使用(目前吉林省不启用),暂时先写死 - .setHospApprFlag("0") - // 院内内部处方号 - .setPrescriptionNo(prescriptionNo) - .setRxItemTypeCode(materialObj.getRxItemTypeCode().toString()) - .setRxItemTypeName(YbRxItemTypeCode.getByValue(materialObj.getRxItemTypeCode().toString()).getDescription()) - .setMedcWayCodg(materialObj.getMedRoute()) - .setMedcWayDscr(YbDrugMedWay.getByValue(materialObj.getMedRoute()).getDescription()) - .setSinDoscnt(materialObj.getMedDosage().stripTrailingZeros().toPlainString()).setSinDosunt(materialObj.getMedDosageUnitCode()) - .setUsedFrquCodg(materialObj.getMedFrequency()) - .setUsedFrquName(YbUsedFrqu.getByValue(materialObj.getMedFrequency()).getDescription()); + eleObj.setMedListCodg(mObj.getMedicalCatalogCode()).setDrugGenname(mObj.getRegisteredName()) + .setDrugDosform(mObj.getDrugForm()).setDrugSpec(mObj.getDrugSpecification()) + .setMedcBegntime(materialObj.getEffectiveDoseStart()).setMedcEndtime(materialObj.getEffectiveDoseEnd()) + .setMedcDays(materialObj.getDispensePerDuration().toString()).setDrugDosunt(materialObj.getUnitCode()) + .setDrugCnt(materialObj.getQuantity().toString()) + // todo 医院审批标志,配合目录的限制使用标志使用(目前吉林省不启用),暂时先写死 + .setHospApprFlag("0") + // 院内内部处方号 + .setPrescriptionNo(prescriptionNo).setRxItemTypeCode(materialObj.getRxItemTypeCode().toString()) + .setRxItemTypeName( + YbRxItemTypeCode.getByValue(materialObj.getRxItemTypeCode().toString()).getDescription()) + .setMedcWayCodg(materialObj.getMedRoute()) + .setMedcWayDscr(YbDrugMedWay.getByValue(materialObj.getMedRoute()).getDescription()) + .setSinDoscnt(materialObj.getMedDosage().stripTrailingZeros().toPlainString()) + .setSinDosunt(materialObj.getMedDosageUnitCode()).setUsedFrquCodg(materialObj.getMedFrequency()) + .setUsedFrquName(YbUsedFrqu.getByValue(materialObj.getMedFrequency()).getDescription()); eleDetList.add(eleObj); } @@ -205,45 +275,47 @@ public class YbEleParamBuilderUtil { * 获取就诊信息和诊断信息 * * @param medicationRequest 处方信息 - * @param clinicReg 医保挂号保存的信息 - * @param tenantId 租户Id + * @param clinicReg 医保挂号保存的信息 + * @param tenantId 租户Id * @return 处方明细信息 */ public PreCheckPrescription getEleVeriVisitAndDiagnosisInfo(ElepMedicationRequest medicationRequest, - ClinicReg clinicReg, Integer tenantId) { + ClinicReg clinicReg, Integer tenantId) { // 电子处方上传预核验信息 PreCheckPrescription preCheckPrescription = new PreCheckPrescription(); // 获取就诊诊断信息 - EncounterDiagnosis encDiagObjs = - encounterDiagnosisService.getOne(new LambdaQueryWrapper() - .eq(EncounterDiagnosis::getEncounterId, medicationRequest.getEncounterId()) - .eq(EncounterDiagnosis::getTenantId, tenantId).eq(EncounterDiagnosis::getConditionId,medicationRequest.getConditionId()) - .eq(EncounterDiagnosis::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode())); + // EncounterDiagnosis encDiagObjs = encounterDiagnosisService.getOne(new + // LambdaQueryWrapper() + // .eq(EncounterDiagnosis::getEncounterId, medicationRequest.getEncounterId()) + // .eq(EncounterDiagnosis::getTenantId, tenantId) + // .eq(EncounterDiagnosis::getConditionId, medicationRequest.getConditionId()) + // .eq(EncounterDiagnosis::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode())); + EncounterDiagnosis encDiagObjs = encounterDiagnosisService.getEncounterDiagnosisByEncounterConDefId( + medicationRequest.getEncounterId(), medicationRequest.getConditionDefId(), tenantId); // 就诊管理 - Encounter encounter = encounterService.getOne(new LambdaQueryWrapper() - .eq(Encounter::getId, medicationRequest.getEncounterId())); + Encounter encounter = encounterService + .getOne(new LambdaQueryWrapper().eq(Encounter::getId, medicationRequest.getEncounterId())); // 患者信息 Patient patient = patientService.getOne(new LambdaQueryWrapper() - .eq(Patient::getId, encounter.getPatientId()).eq(Patient::getTenantId, tenantId)); + .eq(Patient::getId, encounter.getPatientId()).eq(Patient::getTenantId, tenantId)); // 医生所属科室 Organization organization = organizationService.getOne(new LambdaQueryWrapper() - .eq(Organization::getId, medicationRequest.getOrgId()).eq(Organization::getTenantId, tenantId)); + .eq(Organization::getId, medicationRequest.getOrgId()).eq(Organization::getTenantId, tenantId)); // 就诊诊断所属科室 Organization orgDis = organizationService.getOne(new LambdaQueryWrapper() - .eq(Organization::getId, encounter.getOrganizationId()).eq(Organization::getTenantId, tenantId)); + .eq(Organization::getId, encounter.getOrganizationId()).eq(Organization::getTenantId, tenantId)); // 医生信息 Practitioner practitioner = practitionerService.getOne(new LambdaQueryWrapper() - .eq(Practitioner::getId, medicationRequest.getPrescribingDrId()).eq(Practitioner::getTenantId, tenantId)); + .eq(Practitioner::getId, medicationRequest.getPrescribingDrId()).eq(Practitioner::getTenantId, tenantId)); // 医生详细信息 Practitioner praRole = practitionerService.getOne(new LambdaQueryWrapper() - .eq(Practitioner::getId, medicationRequest.getPrescribingDrId()) - .eq(Practitioner::getTenantId, tenantId)); + .eq(Practitioner::getId, medicationRequest.getPrescribingDrId()).eq(Practitioner::getTenantId, tenantId)); // 医生所属科室信息 Organization orgDor = organizationService.getOne(new LambdaQueryWrapper() - .eq(Organization::getId, praRole.getOrgId()).eq(Organization::getTenantId, tenantId)); + .eq(Organization::getId, praRole.getOrgId()).eq(Organization::getTenantId, tenantId)); if (encDiagObjs == null || encounter == null || patient == null || organization == null || orgDis == null - || practitioner == null || praRole == null || orgDor == null) { + || practitioner == null || praRole == null || orgDor == null) { return null; } // 门诊/住院判断 @@ -254,17 +326,19 @@ public class YbEleParamBuilderUtil { otpIptFlag = YbEncounterClass.IMP.getValue(); } - String fixmedinsCode = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE); - String fixmedinsName = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_NAME); + String fixmedinsCode = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE); + String fixmedinsName = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_NAME); // 1-输入-就诊信息 ElepVeriVisitInfo eleInfo = new ElepVeriVisitInfo(); // 诊断信息 Condition condition = conditionService.getOne(new LambdaQueryWrapper() - .eq(Condition::getId, encDiagObjs.getConditionId()).eq(Condition::getTenantId, tenantId)); + .eq(Condition::getId, encDiagObjs.getConditionId()).eq(Condition::getTenantId, tenantId)); // 诊断定义 - ConditionDefinition cdObj = conditionDefinitionService.getOne(new LambdaQueryWrapper() - .eq(ConditionDefinition::getId, condition.getDefinitionId()) + ConditionDefinition cdObj = conditionDefinitionService.getOne( + new LambdaQueryWrapper().eq(ConditionDefinition::getId, condition.getDefinitionId()) .eq(ConditionDefinition::getTenantId, tenantId)); if (condition == null || cdObj == null) { return null; @@ -272,17 +346,17 @@ public class YbEleParamBuilderUtil { // 以挂号时间为截至时间,计算年龄 BigDecimal age = calculateAge(patient.getBirthDate(), clinicReg.getBegntime()); eleInfo.setFixmedinsCode(fixmedinsCode).setFixmedinsName(fixmedinsName).setMdtrtId(clinicReg.getMdtrtId()) - .setIptOtpNo(clinicReg.getIptOtpNo()).setOtpIptFlag(otpIptFlag) - .setPsnNo(clinicReg.getPsnNo()).setPatnName(patient.getName()).setCertno(patient.getIdCard()) - // todo 目前默认都是身份证:01 - .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setPatnAge(age.toString()) - .setPrscDeptName(organization.getName()).setPrscDeptCode(organization.getYbNo()) - .setDrCode(practitioner.getYbNo()).setPrscDrName(praRole.getName()) - .setDrProfttlCodg(practitioner.getDrProfttlCode()) - .setDrProfttlName(YbDoctorTitle.getByValue(practitioner.getDrProfttlCode()).getDescription()) - .setDrDeptCode(orgDor.getYbNo()).setDrDeptName(orgDor.getName()).setMdtrtTime(encounter.getReceptionTime()) - // 院内内部处方号 - .setPrescriptionNo(medicationRequest.getPrescriptionNo()); + .setIptOtpNo(clinicReg.getIptOtpNo()).setOtpIptFlag(otpIptFlag).setPsnNo(clinicReg.getPsnNo()) + .setPatnName(patient.getName()).setCertno(patient.getIdCard()) + // todo 目前默认都是身份证:01 + .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setPatnAge(age.toString()) + .setPrscDeptName(organization.getName()).setPrscDeptCode(organization.getYbNo()) + .setDrCode(practitioner.getYbNo()).setPrscDrName(praRole.getName()) + .setDrProfttlCodg(practitioner.getDrProfttlCode()) + .setDrProfttlName(YbDoctorTitle.getByValue(practitioner.getDrProfttlCode()).getDescription()) + .setDrDeptCode(orgDor.getYbNo()).setDrDeptName(orgDor.getName()).setMdtrtTime(encounter.getReceptionTime()) + // 院内内部处方号 + .setPrescriptionNo(medicationRequest.getPrescriptionNo()); if (clinicReg.getMedType() == null) { eleInfo.setMedType("11"); } else { @@ -305,25 +379,25 @@ public class YbEleParamBuilderUtil { eleInfo.setSpDiseFlag(Whether.NO.getCode()); } // 主诊断标记 -// if (encDiagObjs.getMaindiseFlag() == Whether.YES.getValue()) { - eleInfo.setMaindiagCode(cdObj.getYbNo()).setMaindiagName(cdObj.getName()); -// } + // if (encDiagObjs.getMaindiseFlag() == Whether.YES.getValue()) { + eleInfo.setMaindiagCode(cdObj.getYbNo()).setMaindiagName(cdObj.getName()); + // } // 2-输入-诊断信息 ElepVeriDiagnosisInfo eleVerDisInfo = new ElepVeriDiagnosisInfo(); eleVerDisInfo.setDiagType(cdObj.getTypeCode()).setDiagSrtNo(encDiagObjs.getDiagSrtNo().toString()) - .setDiagCode(cdObj.getYbNo()).setDiagName(cdObj.getName()).setDiagDept(orgDis.getName()) - .setDiagDrNo(practitioner.getYbNo()).setDiagDrName(praRole.getName()) - .setDiagTime(encounter.getReceptionTime()) - // 院内内部处方号 - .setPrescriptionNo(medicationRequest.getPrescriptionNo()); + .setDiagCode(cdObj.getYbNo()).setDiagName(cdObj.getName()).setDiagDept(orgDis.getName()) + .setDiagDrNo(practitioner.getYbNo()).setDiagDrName(praRole.getName()) + .setDiagTime(encounter.getReceptionTime()) + // 院内内部处方号 + .setPrescriptionNo(medicationRequest.getPrescriptionNo()); // 主诊断标记 -// if (encDiagObjs.getMaindiseFlag() == Whether.YES.getValue()) { + // if (encDiagObjs.getMaindiseFlag() == Whether.YES.getValue()) { eleVerDisInfo.setMaindiagFlag(Whether.YES.getValue().toString()); -// } else { -// eleVerDisInfo.setMaindiagFlag(Whether.NO.getValue().toString()); -// } + // } else { + // eleVerDisInfo.setMaindiagFlag(Whether.NO.getValue().toString()); + // } preCheckPrescription.setMdtrtinfo(eleInfo).setDiseinfo(eleVerDisInfo); @@ -334,14 +408,14 @@ public class YbEleParamBuilderUtil { /** * 做成电子处方医保电子签名入参 * - * @param pcpResult 电子处方上传预核验的相响应参数 + * @param pcpResult 电子处方上传预核验的相响应参数 * @param practitionerId 审方药师Id - * @param checkDate 审方时间 - * @param tenantId 租户Id + * @param checkDate 审方时间 + * @param tenantId 租户Id * @return 处方信息 */ public ElepSignatureInput getEleSignatureInput(ElepVeriPrescriptionOutput pcpResult, Long practitionerId, - Date checkDate, Integer tenantId) { + Date checkDate, Integer tenantId) { SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String targetDateStr = targetFormat.format(checkDate); @@ -353,15 +427,15 @@ public class YbEleParamBuilderUtil { // 审方药师信息 Practitioner practitioner = practitionerService.getOne(new LambdaQueryWrapper() - .eq(Practitioner::getUserId, practitionerId).eq(Practitioner::getTenantId, tenantId)); + .eq(Practitioner::getUserId, practitionerId).eq(Practitioner::getTenantId, tenantId)); // 审方药师所属科室信息 Organization orgDor = organizationService.getOne(new LambdaQueryWrapper() - .eq(Organization::getId, practitioner.getOrgId()).eq(Organization::getTenantId, tenantId)); + .eq(Organization::getId, practitioner.getOrgId()).eq(Organization::getTenantId, tenantId)); // 电子处方上传预核验-输入-输入-就诊信息 List eleVerVisInfo = eleVerVisInfoService.list(new LambdaQueryWrapper() - .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) - .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) + .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (practitioner == null || orgDor == null || eleVerVisInfo == null) { return null; @@ -396,7 +470,7 @@ public class YbEleParamBuilderUtil { cpdata.put("pharProfttlCodg", practitioner.getDrProfttlCode() == null ? "" : practitioner.getDrProfttlCode()); // 14 pharProfttlName 审方药师职称名称 字符型 20 cpdata.put("pharProfttlName", practitioner.getDrProfttlCode() == null ? "" - : YbPharmacistTitle.getByValue(practitioner.getDrProfttlCode()).getDescription()); + : YbPharmacistTitle.getByValue(practitioner.getDrProfttlCode()).getDescription()); // 15 pharCode 审方医保药师代码 字符型 20 Y cpdata.put("pharCode", practitioner.getYbNo()); // 16 pharCertType 审方药师证件类型 字符型 6 Y N @@ -430,7 +504,6 @@ public class YbEleParamBuilderUtil { // 格式化日期 String formattedDate = currentDate.format(formatter); - String folderPath = outputPath + formattedDate + "\\"; // Windows 绝对路径,注意末尾的反斜杠 String fileName = pcpResult.getPrescriptionNo() + ".pdf"; // 文件名由处方号拼接而成 // 拼接完整的文件路径 @@ -440,8 +513,8 @@ public class YbEleParamBuilderUtil { ElepSignatureInput eleSinIn = new ElepSignatureInput(); eleSinIn.setFixmedinsCode(fixmedinsCode).setOriginalValue(base64EncodedString).setOriginalRxFile(base64Content) - // 医保处方编号 - .setHiRxno(pcpResult.getHiRxno()).setPrescriptionNo(pcpResult.getPrescriptionNo()); + // 医保处方编号 + .setHiRxno(pcpResult.getHiRxno()).setPrescriptionNo(pcpResult.getPrescriptionNo()); return eleSinIn; @@ -450,29 +523,29 @@ public class YbEleParamBuilderUtil { /** * 做成电子处方上传入参 * - * @param pcpResult 电子处方上传预核验的相响应参数 - * @param esResult 电子处方医保电子签名响应出参 + * @param pcpResult 电子处方上传预核验的相响应参数 + * @param esResult 电子处方医保电子签名响应出参 * @param practitionerId 审方药师Id - * @param checkDate 审方时间 - * @param tenantId 租户Id + * @param checkDate 审方时间 + * @param tenantId 租户Id * @return 电子处方上传入参 */ public ElepUploadInput getEleUploadInput(ElepVeriPrescriptionOutput pcpResult, ElepSignatureOutput esResult, - Long practitionerId, Date checkDate, Integer tenantId) { + Long practitionerId, Date checkDate, Integer tenantId) { SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String targetDateStr = targetFormat.format(checkDate); // 审方药师信息 Practitioner practitioner = practitionerService.getOne(new LambdaQueryWrapper() - .eq(Practitioner::getUserId, practitionerId).eq(Practitioner::getTenantId, tenantId)); + .eq(Practitioner::getUserId, practitionerId).eq(Practitioner::getTenantId, tenantId)); // 审方药师所属科室信息 Organization orgDor = organizationService.getOne(new LambdaQueryWrapper() - .eq(Organization::getId, practitioner.getOrgId()).eq(Organization::getTenantId, tenantId)); + .eq(Organization::getId, practitioner.getOrgId()).eq(Organization::getTenantId, tenantId)); // 电子处方上传预核验-输入-输入-就诊信息 List eleVerVisInfo = eleVerVisInfoService.list(new LambdaQueryWrapper() - .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) - .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) + .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (practitioner == null || orgDor == null || eleVerVisInfo == null) { return null; @@ -480,14 +553,16 @@ public class YbEleParamBuilderUtil { ElepUploadInput eleUploadInput = new ElepUploadInput(); eleUploadInput.setRxTraceCode(pcpResult.getRxTraceCode()).setHiRxno(pcpResult.getHiRxno()) - .setMdtrtId(eleVerVisInfo.get(0).getMdtrtId()).setPatnName(eleVerVisInfo.get(0).getPatnName()) - // todo 默认身份类型是身份证:01 - .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setCertno(eleVerVisInfo.get(0).getCertno()).setPatnName(eleVerVisInfo.get(0).getPatnName()) - .setFixmedinsCode(eleVerVisInfo.get(0).getFixmedinsCode()).setFixmedinsName(eleVerVisInfo.get(0).getFixmedinsName()) - .setDrCode(eleVerVisInfo.get(0).getDrCode()).setPrscDrName(eleVerVisInfo.get(0).getPrscDrName()) - .setPharDeptCode(orgDor.getYbNo()).setPharDeptName(orgDor.getName()).setPharCode(practitioner.getYbNo()) - .setPharName(practitioner.getName()).setPharChkTime(targetDateStr).setRxFile(esResult.getRxFile()) - .setSignDigest(esResult.getSignDigest()).setPharProfttlCodg(practitioner.getDrProfttlCode()).setPharProfttlName(YbPharmacistTitle.getByValue(practitioner.getDrProfttlCode()).getDescription()); + .setMdtrtId(eleVerVisInfo.get(0).getMdtrtId()).setPatnName(eleVerVisInfo.get(0).getPatnName()) + // todo 默认身份类型是身份证:01 + .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setCertno(eleVerVisInfo.get(0).getCertno()) + .setPatnName(eleVerVisInfo.get(0).getPatnName()).setFixmedinsCode(eleVerVisInfo.get(0).getFixmedinsCode()) + .setFixmedinsName(eleVerVisInfo.get(0).getFixmedinsName()).setDrCode(eleVerVisInfo.get(0).getDrCode()) + .setPrscDrName(eleVerVisInfo.get(0).getPrscDrName()).setPharDeptCode(orgDor.getYbNo()) + .setPharDeptName(orgDor.getName()).setPharCode(practitioner.getYbNo()).setPharName(practitioner.getName()) + .setPharChkTime(targetDateStr).setRxFile(esResult.getRxFile()).setSignDigest(esResult.getSignDigest()) + .setPharProfttlCodg(practitioner.getDrProfttlCode()) + .setPharProfttlName(YbPharmacistTitle.getByValue(practitioner.getDrProfttlCode()).getDescription()); return eleUploadInput; @@ -496,28 +571,33 @@ public class YbEleParamBuilderUtil { /** * 做成电子处方撤销入参 * - * @param pcpResult 电子处方上传预核验的相响应参数 - * @param euResult 电子处方上传响应出参 + * @param pcpResult 电子处方上传预核验的相响应参数 + * @param euResult 电子处方上传响应出参 * @param practitionerId 撤销药师Id - * @param description 撤销原因 - * @param revokeDate 撤销时间 - * @param tenantId 租户Id + * @param description 撤销原因 + * @param revokeDate 撤销时间 + * @param tenantId 租户Id * @return 电子处方撤销入参 */ public ElepRevokeInput getElepRevokeInput(ElepVeriPrescriptionOutput pcpResult, ElepUploadOutput euResult, - Long practitionerId, String description, Date revokeDate, Integer tenantId) { + Long practitionerId, String description, Date revokeDate, Integer tenantId) { + //查询原医师信息 + List list = elepMedicationRequestService.list(new LambdaQueryWrapper().eq(ElepMedicationRequest::getPrescriptionNo, pcpResult.getPrescriptionNo())); + if(list==null||list.isEmpty()){ + throw new ServiceException("未查询到处方流转信息"); + } // 撤销时药师信息 Practitioner practitioner = practitionerService.getOne(new LambdaQueryWrapper() - .eq(Practitioner::getUserId, practitionerId).eq(Practitioner::getTenantId, tenantId)); + .eq(Practitioner::getId, list.get(0).getPrescribingDrId()).eq(Practitioner::getTenantId, tenantId)); // 撤销时药师所属科室信息 Organization orgDor = organizationService.getOne(new LambdaQueryWrapper() - .eq(Organization::getId, practitioner.getOrgId()).eq(Organization::getTenantId, tenantId)); + .eq(Organization::getId, practitioner.getOrgId()).eq(Organization::getTenantId, tenantId)); // 电子处方上传预核验-输入-输入-就诊信息 List eleVerVisInfo = eleVerVisInfoService.list(new LambdaQueryWrapper() - .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) - .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) + .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (practitioner == null || orgDor == null || eleVerVisInfo == null) { return null; @@ -525,10 +605,11 @@ public class YbEleParamBuilderUtil { ElepRevokeInput eleRevokeInput = new ElepRevokeInput(); eleRevokeInput.setHiRxno(pcpResult.getHiRxno()).setFixmedinsCode(eleVerVisInfo.get(0).getFixmedinsCode()) - .setDrCode(practitioner.getYbNo()).setUndoDrName(practitioner.getName()) - // todo 默认身份类型是身份证:01 - .setUndoDrCertno(practitioner.getPharPracCertNo()) - .setUndoDrCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setUndoRea(description).setUndoTime(revokeDate); + .setDrCode(practitioner.getYbNo()).setUndoDrName(practitioner.getName()) + // todo 默认身份类型是身份证:01 + .setUndoDrCertno(practitioner.getPharPracCertNo()) + .setUndoDrCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setUndoRea(description) + .setUndoTime(revokeDate); return eleRevokeInput; } @@ -543,8 +624,8 @@ public class YbEleParamBuilderUtil { // 电子处方上传预核验-输入-输入-就诊信息 List eleVerVisInfo = eleVerVisInfoService.list(new LambdaQueryWrapper() - .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) - .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) + .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (eleVerVisInfo == null) { return null; @@ -552,9 +633,9 @@ public class YbEleParamBuilderUtil { ElepQuerPrescriptionInput eleQueryPreObj = new ElepQuerPrescriptionInput(); eleQueryPreObj.setFixmedinsCode(eleVerVisInfo.get(0).getFixmedinsCode()).setHiRxno(pcpResult.getHiRxno()) - .setMdtrtId(eleVerVisInfo.get(0).getMdtrtId()).setPsnName(eleVerVisInfo.get(0).getPatnName()) - // todo 默认身份类型是身份证:01 - .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setCertno(eleVerVisInfo.get(0).getCertno()); + .setMdtrtId(eleVerVisInfo.get(0).getMdtrtId()).setPsnName(eleVerVisInfo.get(0).getPatnName()) + // todo 默认身份类型是身份证:01 + .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setCertno(eleVerVisInfo.get(0).getCertno()); return eleQueryPreObj; } @@ -569,8 +650,8 @@ public class YbEleParamBuilderUtil { // 电子处方上传预核验-输入-输入-就诊信息 List eleVerVisInfo = eleVerVisInfoService.list(new LambdaQueryWrapper() - .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) - .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); + .eq(ElepVeriVisitInfo::getPrescriptionNo, pcpResult.getPrescriptionNo()) + .orderByDesc(ElepVeriVisitInfo::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1)); if (eleVerVisInfo == null) { return null; @@ -578,80 +659,11 @@ public class YbEleParamBuilderUtil { ElepMedresultInput eleQueryPreObj = new ElepMedresultInput(); eleQueryPreObj.setHiRxno(pcpResult.getHiRxno()).setFixmedinsCode(eleVerVisInfo.get(0).getFixmedinsCode()) - .setMdtrtId(eleVerVisInfo.get(0).getMdtrtId()).setPsnName(eleVerVisInfo.get(0).getPatnName()) - // todo 默认身份类型是身份证:01 - .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setCertno(eleVerVisInfo.get(0).getCertno()); + .setMdtrtId(eleVerVisInfo.get(0).getMdtrtId()).setPsnName(eleVerVisInfo.get(0).getPatnName()) + // todo 默认身份类型是身份证:01 + .setPsnCertType(YbIdDocumentType.RESIDENT_ID_CARD.getValue()).setCertno(eleVerVisInfo.get(0).getCertno()); return eleQueryPreObj; } - /** - * 获取BigDecimal类型的年龄 - * - * @param birthDate 出生日期 - * @param beginTime 计算起始日期 - * @return 年龄 - */ - public static BigDecimal calculateAge(Date birthDate, Date beginTime) { - // 验证输入参数是否为空 - if (Objects.isNull(birthDate)) { - System.out.println("出生年月日不能为空!"); - return null; - } - // 验证输入参数是否为空 - if (Objects.isNull(beginTime)) { - beginTime = DateUtils.getNowDate(); - } - - // 将 Date 转换为 LocalDate - LocalDate localBirthDate = birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - LocalDate localBeginTime = beginTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - - // 计算出生日期到起始日期之间的年份差异 - Period period = Period.between(localBirthDate, localBeginTime); - - int years = period.getYears(); - - // 检查是否已经过了生日,如果没有过,则年份减一 - boolean hasBirthdayPassed = !localBirthDate.plusYears(years).isAfter(localBeginTime); - if (!hasBirthdayPassed) { - years--; - } - - return BigDecimal.valueOf(years); - } - - /** - * 读取文件内容并获取其 Base64 字符值 - * - * @param filePath 文件路径 - * @return 文件内容的 Base64 字符值 - */ - public static String fileToBase64(String filePath) { - File file = new File(filePath); - if (!file.exists()) { - System.out.println("文件不存在!"); - return null; - } - - FileInputStream fileInputStream = null; - try { - fileInputStream = new FileInputStream(file); - byte[] fileContent = new byte[(int) file.length()]; - fileInputStream.read(fileContent); - return Base64.getEncoder().encodeToString(fileContent); - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (fileInputStream != null) { - try { - fileInputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return null; - } - } diff --git a/openhis-server-new/openhis-application/src/main/resources/application-local.yml b/openhis-server-new/openhis-application/src/main/resources/application-local.yml index 3584ae64443ed84d6000269067b22f831767c705..04c623fc18870c7a80958ceceecbd423e6d96715 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application-local.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application-local.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:postgresql://kocalhost:5432/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 + url: jdbc:postgresql://localhost:5432/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 username: postgres password: root # 从库数据源 diff --git a/openhis-server-new/openhis-application/src/main/resources/application.yml b/openhis-server-new/openhis-application/src/main/resources/application.yml index c247755606b6d37f349bd20bcf7c176f118e857f..4fd26eb34c729b746b3e7273281164f7576d0ee4 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application.yml @@ -54,7 +54,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: local # (天翼云)cloud (本地测试)test (本地)local (生产)prod (农大) nd (长大) cd (师大)sd + active: local #(本地)local (生产)prod (农大) # 文件上传 servlet: multipart: diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/LossReportFormMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/LossReportFormMapper.xml index 4ffcc1aab7b49e39d8c9b7118cf272879b5c81cc..10f0043ebf0a252ca1801a033c3bd38715aaf0fe 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/LossReportFormMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/LossReportFormMapper.xml @@ -76,7 +76,8 @@ T1.end_time, -- 结束时间 T1.supplier_id, -- 供应商id T9."name" AS supplier_name, -- 供应商名称 - T2.part_percent --拆零比 + T2.part_percent, --拆零比 + T1.total_quantity AS old_quantity --报损前数量 FROM wor_supply_request T1 LEFT JOIN med_medication_definition T2 ON T1.item_id = T2.id @@ -137,7 +138,8 @@ T1.end_time, -- 结束时间 T1.supplier_id, -- 供应商id T9."name" AS supplier_name, -- 供应商名称 - T7.part_percent --拆零比 + T7.part_percent, --拆零比 + T1.total_quantity AS old_quantity --报损前数量 FROM wor_supply_request T1 LEFT JOIN adm_device_definition T7 ON T1.item_id = T7.id diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ProductTransferMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ProductTransferMapper.xml index 7ecee531162699c0a4d7313488ec97078b2117c6..20d2483807a48f39ee7fa08d6111ef824938889d 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ProductTransferMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ProductTransferMapper.xml @@ -235,6 +235,7 @@ AND T1.source_location_id = T9.location_id AND T9.lot_number = T1.lot_number AND T9.delete_flag = '0' + AND T9.inventory_status_enum != 3 LEFT JOIN adm_charge_item_definition AS T10 ON T10.instance_id = T9.item_id AND T10.delete_flag = '0' @@ -248,6 +249,7 @@ AND T1.purpose_location_id = T12.location_id AND T12.lot_number = T1.lot_number AND T12.delete_flag = '0' + AND T12.inventory_status_enum != 3 WHERE T1.bus_no = #{busNo} AND T1.item_table = #{medicationTableName} AND T1.delete_flag = '0' @@ -305,6 +307,7 @@ AND T1.source_location_id = T9.location_id AND T9.lot_number = T1.lot_number AND T9.delete_flag = '0' + AND T9.inventory_status_enum != 3 LEFT JOIN adm_charge_item_definition AS T10 ON T10.instance_id = T9.item_id AND T10.delete_flag = '0' @@ -318,6 +321,7 @@ AND T1.purpose_location_id = T12.location_id AND T12.lot_number = T1.lot_number AND T12.delete_flag = '0' + AND T12.inventory_status_enum != 3 WHERE T1.bus_no = #{busNo} AND T1.item_table = #{deviceTableName} AND T1.delete_flag = '0' diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/adjustprice/SupplyMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/adjustprice/SupplyMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..edc0a49494b38e7efc3d7adb32c9b3f9c251f450 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/adjustprice/SupplyMapper.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml index c318fb49495babf17a7d6c294a08b211542ee055..6ce5ac7e1585645095103d137c31937c72a5cadf 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml @@ -140,4 +140,5 @@ AND T1.context_enum != #{register} AND T1.delete_flag = '0' + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/common/CommonAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/common/CommonAppMapper.xml index 2bc6a49931aa2520803b9545660bbc7d1bf3aa32..ece486d19214c3fe96f78eee15729894e822ddfa 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/common/CommonAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/common/CommonAppMapper.xml @@ -196,6 +196,7 @@ + SELECT T3."name" + FROM adm_encounter_diagnosis T1 + INNER JOIN cli_condition T2 + ON T2.id = T1.condition_id + INNER JOIN cli_condition_definition T3 + ON T3.id = T2.definition_id + WHERE T1.encounter_id = #{encounterId} + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml index 9d4c0ca3a66329573958fa5b05214de5eefd8876..84b1e6f5f2711638fc4278e5a6a7e04e85612ee8 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml @@ -136,13 +136,16 @@ ii.day_times, ii.bus_no, ii."patient_name" AS patient_name, - ii."bad_name" AS bad_name, + ii."bed_name" AS bed_name, ii.gender_enum , ii.birth_date , + ii.patient_id, ii.contract_name , ii.condition_names, ii.admitting_doctor_name AS admitting_doctor_name, - ii.balance_amount AS balance_amount + ii.balance_amount AS balance_amount, + ii.account_id AS account_id, + ii.performer_check_id FROM (( SELECT T1.encounter_id, T1.tenant_id, #{medMedicationRequest} AS advice_table, @@ -154,6 +157,7 @@ T1.skin_test_flag AS skin_test_flag, T1.infusion_flag AS inject_flag, T1.group_id AS group_id, + T1.performer_check_id, T2."name" AS advice_name, T2.id AS item_id, T3.total_volume AS volume, @@ -176,13 +180,15 @@ af.day_times, ae.bus_no, ap."name" AS patient_name, - al2."name" AS bad_name, + al2."name" AS bed_name, ap.gender_enum , ap.birth_date , + ap.id AS patient_id, fc.contract_name , diagnosis.condition_names, pra."name" AS admitting_doctor_name, - personal_account.balance_amount + personal_account.balance_amount, + personal_account.id AS account_id FROM med_medication_request AS T1 LEFT JOIN med_medication_definition AS T2 ON T2.id = T1.medication_id @@ -245,7 +251,8 @@ LEFT JOIN adm_practitioner pra ON aep.practitioner_id = pra.id AND pra.delete_flag = '0' - LEFT JOIN ( SELECT aa.encounter_id, + LEFT JOIN ( SELECT aa.id, + aa.encounter_id, (aa.balance_amount - COALESCE(SUM(CASE WHEN aci.status_enum IN (#{billed}, #{billable}) THEN aci.total_price ELSE 0 END), 0) + @@ -257,7 +264,8 @@ AND aa.delete_flag = '0' WHERE aa.type_code = #{personalCashAccount} AND aa.delete_flag = '0' - GROUP BY aa.encounter_id, + GROUP BY aa.id, + aa.encounter_id, aa.balance_amount ) AS personal_account ON personal_account.encounter_id = ae.id @@ -281,6 +289,7 @@ NULL AS skin_test_flag, NULL AS inject_flag, NULL AS group_id, + T1.performer_check_id, T2."name" AS advice_name, T2.id AS item_id, NULL AS volume, @@ -303,13 +312,15 @@ af.day_times, ae.bus_no, ap."name" AS patient_name, - al2."name" AS bad_name, + al2."name" AS bed_name, ap.gender_enum , ap.birth_date , + ap.id AS patient_id, fc.contract_name , diagnosis.condition_names, pra."name" AS admitting_doctor_name, - personal_account.balance_amount + personal_account.balance_amount, + personal_account.id AS account_id FROM wor_service_request AS T1 LEFT JOIN wor_activity_definition AS T2 ON T2.id = T1.activity_id @@ -367,7 +378,8 @@ LEFT JOIN adm_practitioner pra ON aep.practitioner_id = pra.id AND pra.delete_flag = '0' - LEFT JOIN ( SELECT aa.encounter_id, + LEFT JOIN ( SELECT aa.id, + aa.encounter_id, (aa.balance_amount - COALESCE(SUM(CASE WHEN aci.status_enum IN (#{billed}, #{billable}) THEN aci.total_price ELSE 0 END), 0) + @@ -379,7 +391,8 @@ AND aa.delete_flag = '0' WHERE aa.type_code = #{personalCashAccount} AND aa.delete_flag = '0' - GROUP BY aa.encounter_id, + GROUP BY aa.id, + aa.encounter_id, aa.balance_amount ) AS personal_account ON personal_account.encounter_id = ae.id @@ -395,5 +408,4 @@ ) AS ii ${ew.customSqlSegment} - \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/jlau/ReviewPrescriptionRecordsAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/jlau/ReviewPrescriptionRecordsAppMapper.xml index 42cbdf3124244a8e59834c6058a982ff22e24af8..297dfd1181a23683884c2ee39dad61dce17c6602 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/jlau/ReviewPrescriptionRecordsAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/jlau/ReviewPrescriptionRecordsAppMapper.xml @@ -4,5 +4,27 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/PaymentMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/PaymentMapper.xml index 06a2e9fb3fde7e7524bc738c1da6dac57024989c..a0b6bf028897810df5371a220b855efc58646aed 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/PaymentMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/PaymentMapper.xml @@ -56,6 +56,9 @@ WHERE 1 = 1 AND t.delete_flag = '0' AND t.kind_enum = #{kindEnum} + + AND invoice.bill_no = #{invoiceNo} + ORDER BY t.create_time DESC) as T1 ${ew.customSqlSegment} diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InpatientMedicineSummaryDispenseMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/SummaryDispenseMedicineMapper.xml similarity index 99% rename from openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InpatientMedicineSummaryDispenseMapper.xml rename to openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/SummaryDispenseMedicineMapper.xml index 9433688a128d8c998ab5e7c6ac634c1e9a5391c4..cc5c866e1d075a672fb6704236e110824b913f00 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InpatientMedicineSummaryDispenseMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/SummaryDispenseMedicineMapper.xml @@ -1,7 +1,7 @@ - - SELECT ii.tenant_id, ii.bus_no,--单据号 ii.request_id,--供应请求id diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/DepartmentRevenueStatisticsMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/DepartmentRevenueStatisticsMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..7d74857cc0c37d01030d4d1dc260465839a9c56d --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/DepartmentRevenueStatisticsMapper.xml @@ -0,0 +1,67 @@ + + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/ReportStatisticsMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/ReportStatisticsMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..a04ffca69644aecfb460e1ef7c7e0a0722526e49 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/ReportStatisticsMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-common/pom.xml b/openhis-server-new/openhis-common/pom.xml index ddc5cc7d04e8db279c99ee2d05f9e5ff83c0ba74..89b8d7b50d6f6dea881860edfe93eed430a1dd1e 100644 --- a/openhis-server-new/openhis-common/pom.xml +++ b/openhis-server-new/openhis-common/pom.xml @@ -16,6 +16,10 @@ + + org.apache.httpcomponents + httpclient + diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java index d884700dc7f2930d3dc3166ac4c8b3a50dc66d06..23c80725597d3d64ac194572429d146e4e837a7a 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java @@ -109,6 +109,8 @@ public class DictAspect { e.printStackTrace(); } } + } else { + processDict(fieldValue); // 递归处理 Dto 中的每个元素 } } } diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java index 68df9bab935743e3fd8d4dec529d6546c244bd53..02d2c1551abfc572f1ce6c956e15b798ed72be55 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java @@ -335,6 +335,10 @@ public class CommonConstants { */ String applyTime = "apply_time"; + /** + * 校对人Id + */ + String PerformerCheckId = "performer_check_id"; } /** diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java index db82a797721a277b434843e70c10466910f76b97..1b3e061eb3516d73c1dad959e240243fe0dd9591 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java @@ -307,7 +307,11 @@ public enum AssignSeqEnum { * b * 病历文书 */ - PURCHASE_DOCUMENT("63", "病历文书", "DOC"); + PURCHASE_DOCUMENT("63", "病历文书", "DOC"), + /** + * 调价单 + */ + CHANGE_PRICE_BUZ("64", "调整零售价", "CPB"); private final String code; private final String info; private final String prefix; diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/CommonUtil.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/CommonUtil.java index 24f0b660a4e38ec8f7e3d0af1589c20ee68cef2f..0231c873181fbf623533b29f7a0d80e84f4ca5c1 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/CommonUtil.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/CommonUtil.java @@ -1,5 +1,23 @@ package com.openhis.common.utils; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.util.List; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.springframework.web.multipart.MultipartFile; + +import com.core.common.core.domain.R; +import com.core.common.utils.poi.ExcelUtil; + /** * 共通工具类 * @@ -7,4 +25,69 @@ package com.openhis.common.utils; */ public class CommonUtil { + /** + * 尝试转化为int + * + * @param intStr int字符串 + * @return int值 + */ + public static Integer tryParseInt(String intStr) { + try { + return Integer.parseInt(intStr); + } catch (Exception e) { + return null; + } + } + + /** + * 读取导入的Excel文件 + * + * @param file 文件 + * @param clazz 转换的Class + * @return 转换后的实体列表 + */ + public static R> readImportedExcelFile(MultipartFile file, Class clazz) { + ExcelUtil util = new ExcelUtil<>(clazz); + List importDtoList; + try { + importDtoList = util.importExcel(file.getInputStream()); + } catch (IOException e) { + return R.fail("导入失败!文件读取异常"); + } + if (importDtoList.isEmpty()) { + return R.fail("导入失败!文件不能为空"); + } + return R.ok(importDtoList); + } + + /** + * 创建无视SSL验证的SSLSocketFactory + */ + public static SSLConnectionSocketFactory createIgnoreSslSocketFactory() { + try { + // 创建信任所有证书的TrustManager + X509TrustManager trustAllCert = new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) {} + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) {} + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + }; + + // 初始化SSLContext + SSLContext sslContext = SSLContext.getInstance("SSL"); + sslContext.init(null, new TrustManager[] {trustAllCert}, new SecureRandom()); + + // 创建不验证主机名的SocketFactory + return new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE // 关键:禁用主机名验证 + ); + } catch (NoSuchAlgorithmException | KeyManagementException e) { + throw new RuntimeException("SSL配置失败", e); + } + } } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItem.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItem.java index 20ecc8d7bf99b4fefc60c5383e68d56fd2078860..7a35e5229f75cb05b34db201e7ed2fec1fb8c0ef 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItem.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItem.java @@ -152,4 +152,6 @@ public class ChargeItem extends HisBaseEntity { */ private Integer tcmFlag; + /** 执行id */ + private Long procedureId; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/mapper/EncounterDiagnosisMapper.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/mapper/EncounterDiagnosisMapper.java index 9b1dd12e2a6661b6df60001aaaf46275dd05047b..0e8a2accb43f4fc0bbdd8a5ed24a25627f8b8af6 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/mapper/EncounterDiagnosisMapper.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/mapper/EncounterDiagnosisMapper.java @@ -29,4 +29,14 @@ public interface EncounterDiagnosisMapper extends BaseMapper */ void deleteTcmByEncounterId(@Param("encounterId") Long encounterId); + /** + * 根据就诊id定义id等查询就诊诊断 + * + * @param encounterId 就诊id + * @param conditionDefId 定义id + * @param tenantId 租户 + * @return 查询结果 + */ + EncounterDiagnosis getEncounterDiagnosisByEncounterConDefId(@Param("encounterId") Long encounterId, + @Param("conditionDefId") Long conditionDefId, @Param("tenantId") Integer tenantId); } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemDefinitionService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemDefinitionService.java index 8e7dabbc53459093f2c4d44fbc61d10d0b30ab07..907873076b6e87c09b1cd5b87d7bd116007f90af 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemDefinitionService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemDefinitionService.java @@ -1,5 +1,7 @@ package com.openhis.administration.service; +import java.math.BigDecimal; + import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.openhis.administration.domain.ChargeItemDefinition; @@ -17,8 +19,8 @@ public interface IChargeItemDefinitionService extends IService getPage(ChargeItemDefinition chargeItemDefinition, Integer pageNo, Integer pageSize); @@ -42,11 +44,28 @@ public interface IChargeItemDefinitionService extends IService { */ List getChargeItemDefInfoByIds(List chargeItemIds); + /** + * 根据执行id查询收费项目信息 + * + * @param procedureIdList 执行id列表 + * @return 收费项目信息 + */ + List getChargeItemByProcedureId(List procedureIdList); + + /** + * 根据执行id列表更新账单状态为:待收费 + * + * @param procedureIdList 执行id列表 + */ + void updatePlannedChargeStatus(List procedureIdList); + } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IEncounterDiagnosisService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IEncounterDiagnosisService.java index 77233c222d5066988d3539af076840ac92a2b39a..16cf5d5b87f818131dfcd1101bf2a14dea12c380 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IEncounterDiagnosisService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IEncounterDiagnosisService.java @@ -1,11 +1,11 @@ package com.openhis.administration.service; +import java.util.List; + import com.baomidou.mybatisplus.extension.service.IService; import com.openhis.administration.domain.EncounterDiagnosis; import com.openhis.common.enums.ybenums.YbIptDiseTypeCode; -import java.util.List; - /** * 就诊诊断管理Service接口 * @@ -68,4 +68,15 @@ public interface IEncounterDiagnosisService extends IService * @return 主诊断 */ EncounterDiagnosis getMainDiagnosis(List list); + + /** + * 根据就诊id定义id等查询就诊诊断 + * + * @param encounterId 就诊id + * @param conditionDefId 定义id + * @param tenantId 租户 + * @return 查询结果 + */ + EncounterDiagnosis getEncounterDiagnosisByEncounterConDefId(Long encounterId, Long conditionDefId, + Integer tenantId); } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemDefinitionServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemDefinitionServiceImpl.java index 472e55071f7c347787507bda9b14a75adb3c9bfd..a17e3c05a6bff9992c262c894a5d2b4d63d763f7 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemDefinitionServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemDefinitionServiceImpl.java @@ -1,16 +1,27 @@ package com.openhis.administration.service.impl; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.core.common.utils.DateUtils; +import com.openhis.administration.domain.ChargeItemDefDetail; import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.domain.HealthcareService; import com.openhis.administration.mapper.ChargeItemDefinitionMapper; +import com.openhis.administration.service.IChargeItemDefDetailService; import com.openhis.administration.service.IChargeItemDefinitionService; import com.openhis.common.constant.CommonConstants; +import com.openhis.common.enums.ConditionCode; import com.openhis.common.enums.DelFlag; +import com.openhis.common.enums.PublicationStatus; +import com.openhis.common.enums.Whether; /** * 费用定价管理Service业务层处理 @@ -22,6 +33,9 @@ import com.openhis.common.enums.DelFlag; public class ChargeItemDefinitionServiceImpl extends ServiceImpl implements IChargeItemDefinitionService { + @Autowired + private IChargeItemDefDetailService chargeItemDefDetailService; + /** * 获取分页列表 * @@ -96,4 +110,48 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl chargeItemDefDetailList = new ArrayList<>(); + // 购入价子表(购入价不一定存在) + if (purchasePrice != null) { + ChargeItemDefDetail defDetailPurchase = + new ChargeItemDefDetail().setDefinitionId(chargeItemDefinition.getId()) + .setConditionCode(ConditionCode.PURCHASE.getCode()).setAmount(purchasePrice); + chargeItemDefDetailList.add(defDetailPurchase); + } + // 零售价子表 + ChargeItemDefDetail defDetailRetail = new ChargeItemDefDetail().setDefinitionId(chargeItemDefinition.getId()) + .setConditionCode(ConditionCode.UNIT.getCode()).setConditionValue(unitCode).setAmount(retailPrice); + chargeItemDefDetailList.add(defDetailRetail); + // 最高零售价子表 + ChargeItemDefDetail defDetailMaximumRetail = + new ChargeItemDefDetail().setDefinitionId(chargeItemDefinition.getId()) + .setConditionCode(ConditionCode.LIMIT.getCode()).setAmount(maximumRetailPrice); + chargeItemDefDetailList.add(defDetailMaximumRetail); + chargeItemDefDetailService.saveBatch(chargeItemDefDetailList); + } + } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java index 763fc865232de3ac75a01becba7d0e3fec33d276..2bfded66b8f684abe295eb3246dba01a7bfe50ae 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java @@ -94,7 +94,8 @@ public class ChargeItemServiceImpl extends ServiceImpl chargeItemIdList) { baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.REFUNDING.getValue()), - new LambdaUpdateWrapper().in(ChargeItem::getId, chargeItemIdList)); + new LambdaUpdateWrapper().in(ChargeItem::getId, chargeItemIdList).eq(ChargeItem::getDeleteFlag, + DelFlag.NO.getCode())); } /** @@ -107,7 +108,8 @@ public class ChargeItemServiceImpl extends ServiceImpl chargeItemIdList, Integer value) { baseMapper.update( new ChargeItem().setStatusEnum(value).setPerformerId(SecurityUtils.getLoginUser().getPractitionerId()), - new LambdaUpdateWrapper().in(ChargeItem::getId, chargeItemIdList)); + new LambdaUpdateWrapper().in(ChargeItem::getId, chargeItemIdList).eq(ChargeItem::getDeleteFlag, + DelFlag.NO.getCode())); } /** @@ -149,7 +151,8 @@ public class ChargeItemServiceImpl extends ServiceImpl getChargeItemInfoByReqId(List requestIdList) { - return baseMapper.selectList(new LambdaQueryWrapper().in(ChargeItem::getServiceId, requestIdList)); + return baseMapper.selectList(new LambdaQueryWrapper().in(ChargeItem::getServiceId, requestIdList) + .eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode())); } /** @@ -173,4 +176,30 @@ public class ChargeItemServiceImpl extends ServiceImpl getChargeItemDefInfoByIds(List chargeItemIds) { return baseMapper.getChargeItemDefInfoByIds(chargeItemIds); } + + /** + * 根据执行id查询收费项目信息 + * + * @param procedureIdList 执行id列表 + * @return 收费项目信息 + */ + @Override + public List getChargeItemByProcedureId(List procedureIdList) { + return baseMapper.selectList(new LambdaQueryWrapper() + .in(ChargeItem::getProcedureId, procedureIdList).eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode())); + } + + /** + * 根据执行id列表更新账单状态为:待收费 + * + * @param procedureIdList 执行id列表 + */ + @Override + public void updatePlannedChargeStatus(List procedureIdList) { + for (Long procedureId : procedureIdList) { + baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.PLANNED.getValue()), + new LambdaUpdateWrapper().eq(ChargeItem::getProcedureId, procedureId) + .eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode())); + } + } } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/EncounterDiagnosisServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/EncounterDiagnosisServiceImpl.java index 8e685346ccf44eab9b0faf1e1fd99c76848455d3..dfa8b5baf1bf58a0f95d43caad96e79625de91e2 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/EncounterDiagnosisServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/EncounterDiagnosisServiceImpl.java @@ -6,8 +6,6 @@ import java.util.stream.Collectors; import javax.annotation.Resource; -import com.openhis.common.enums.Whether; -import com.openhis.common.enums.ybenums.YbIptDiseTypeCode; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -16,6 +14,8 @@ import com.openhis.administration.domain.EncounterDiagnosis; import com.openhis.administration.mapper.EncounterDiagnosisMapper; import com.openhis.administration.service.IEncounterDiagnosisService; import com.openhis.clinical.mapper.ConditionMapper; +import com.openhis.common.enums.Whether; +import com.openhis.common.enums.ybenums.YbIptDiseTypeCode; /** * 就诊诊断管理Service业务层处理 @@ -86,6 +86,7 @@ public class EncounterDiagnosisServiceImpl extends ServiceImpl getDiagnosisList(Long encounterId, YbIptDiseTypeCode ybIptDiseTypeCode) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(EncounterDiagnosis::getEncounterId, encounterId); - if(ybIptDiseTypeCode!=null){ - queryWrapper.eq(EncounterDiagnosis::getIptDiseTypeCode,ybIptDiseTypeCode.getValue()); + LambdaQueryWrapper queryWrapper = + new LambdaQueryWrapper().eq(EncounterDiagnosis::getEncounterId, encounterId); + if (ybIptDiseTypeCode != null) { + queryWrapper.eq(EncounterDiagnosis::getIptDiseTypeCode, ybIptDiseTypeCode.getValue()); } return baseMapper.selectList(queryWrapper); } /** * 在诊断中筛选主诊断 + * * @param list 诊断集合 * @return 主诊断 */ @Override public EncounterDiagnosis getMainDiagnosis(List list) { for (EncounterDiagnosis encounterDiagnosis : list) { - if(Whether.YES.getValue()==encounterDiagnosis.getMaindiseFlag()){ + if (Whether.YES.getValue() == encounterDiagnosis.getMaindiseFlag()) { return encounterDiagnosis; } } return null; } + + /** + * 根据就诊id定义id等查询就诊诊断 + * + * @param encounterId 就诊id + * @param conditionDefId 定义id + * @param tenantId 租户 + * @return 查询结果 + */ + @Override + public EncounterDiagnosis getEncounterDiagnosisByEncounterConDefId(Long encounterId, Long conditionDefId, + Integer tenantId) { + return baseMapper.getEncounterDiagnosisByEncounterConDefId(encounterId, conditionDefId, tenantId); + } } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IConditionDefinitionService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IConditionDefinitionService.java index 62aaaabc5e905de451f0c03c99883c25de2e91ba..944593bd146a445078d01e4696307cf212bcb56c 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IConditionDefinitionService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IConditionDefinitionService.java @@ -1,10 +1,12 @@ package com.openhis.clinical.service; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + import com.baomidou.mybatisplus.extension.service.IService; import com.openhis.clinical.domain.ConditionDefinition; -import java.util.List; - /** * 诊断定义管理Service接口 * @@ -36,4 +38,21 @@ public interface IConditionDefinitionService extends IService getConditionDefinitionListByIds(List collect); + + /** + * 根据名称查询诊断定义 + * + * @param searchKey 目标字符 + * @return 诊断定义集合 + */ + List getConditionDefinitionListBySearchKey(String searchKey, HttpServletRequest request); + + /** + * 诊断定义查询 + * + * @param conditionDefId 诊断定义id + * @return 查询结果 + */ + ConditionDefinition getConditionDefinitionListById(Long conditionDefId); + } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IProcedureService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IProcedureService.java index d41c5c4b027ad9b0e5116a86948b51ffae99de81..0e52a28508fbdda13ae3451925adc42065fc255a 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IProcedureService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/IProcedureService.java @@ -1,5 +1,6 @@ package com.openhis.clinical.service; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; @@ -35,12 +36,14 @@ public interface IProcedureService extends IService { * @param eventStatus 执行状态 * @param procedureCategory 执行种类 * @param locationId 执行位置 + * @param exeDate 执行时间 * @param groupId 组号 * @param refundId 取消执行id - * @return 是否成功 + * @return 执行id */ - boolean addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable, - EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Long groupId, Long refundId); + Long addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable, + EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId, + Long refundId); /** * 添加药品执行记录 diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ConditionDefinitionServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ConditionDefinitionServiceImpl.java index b496412acccb49f9af26c129a8ba5ce89aea6cf1..4005a35e76e1e44a2aea2e2076c55b13b630de36 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ConditionDefinitionServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ConditionDefinitionServiceImpl.java @@ -1,16 +1,22 @@ package com.openhis.clinical.service.impl; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; -import com.openhis.common.enums.DelFlag; +import javax.servlet.http.HttpServletRequest; + import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.openhis.clinical.domain.ConditionDefinition; import com.openhis.clinical.mapper.ConditionDefinitionMapper; import com.openhis.clinical.service.IConditionDefinitionService; +import com.openhis.common.enums.DelFlag; +import com.openhis.common.utils.HisQueryUtils; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -72,4 +78,31 @@ public class ConditionDefinitionServiceImpl extends ServiceImpl() .in(ConditionDefinition::getId, collect).eq(ConditionDefinition::getDescription, DelFlag.NO.getCode())); } + + /** + * 根据名称查询诊断定义 + * + * @param searchKey 目标字符 + * @return 诊断定义集合 + */ + @Override + public List getConditionDefinitionListBySearchKey(String searchKey, + HttpServletRequest request) { + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, + new HashSet<>(Arrays.asList("condition_code", "name", "py_str", "wb_str")), request); + return baseMapper.selectList(queryWrapper); + } + + /** + * 诊断定义查询 + * + * @param conditionDefId 诊断定义id + * @return 查询结果 + */ + @Override + public ConditionDefinition getConditionDefinitionListById(Long conditionDefId) { + return baseMapper + .selectOne(new LambdaQueryWrapper().eq(ConditionDefinition::getId, conditionDefId)); + } } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ProcedureServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ProcedureServiceImpl.java index 141218a25e1f23d72e1a6bb47b28f6662a0e2254..65138da063015285e45d01923998a510d4287847 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ProcedureServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/clinical/service/impl/ProcedureServiceImpl.java @@ -60,14 +60,15 @@ public class ProcedureServiceImpl extends ServiceImpl 0) { // 添加执行人子表 - return procedurePerformerService.addPerformRecord(procedure.getId(), now); + boolean performerResult = procedurePerformerService.addPerformRecord(procedure.getId(), exeDate); + if (!performerResult) { + return null; + } } else { - return false; + return null; } + return procedure.getId(); } /** diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/crosssystem/utils/CrossSystemSendApplyUtil.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/crosssystem/utils/CrossSystemSendApplyUtil.java index 9317d37fa1d651dab47ade30c041428ae6229925..5c0bf2408c70e7ff86f45db7144e02abf4ff289c 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/crosssystem/utils/CrossSystemSendApplyUtil.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/crosssystem/utils/CrossSystemSendApplyUtil.java @@ -1,23 +1,13 @@ package com.openhis.crosssystem.utils; import java.io.IOException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; -import org.apache.http.conn.ssl.NoopHostnameVerifier; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; @@ -32,6 +22,7 @@ import com.core.common.exception.ServiceException; import com.core.common.utils.DateUtils; import com.core.common.utils.StringUtils; import com.core.web.util.TenantOptionUtil; +import com.openhis.common.utils.CommonUtil; import com.openhis.crosssystem.dto.*; import com.openhis.crosssystem.enums.LisAgeUnit; import com.openhis.crosssystem.enums.PacsAgeUnit; @@ -119,7 +110,7 @@ public class CrossSystemSendApplyUtil { .setSocketTimeout(30000).build(); // 创建无视SSL验证的HttpClient CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig) - .setSSLSocketFactory(createIgnoreSslSocketFactory()).build(); + .setSSLSocketFactory(CommonUtil.createIgnoreSslSocketFactory()).build(); CloseableHttpResponse response = null; // 发起HTTP请求 try { @@ -221,7 +212,7 @@ public class CrossSystemSendApplyUtil { .setSocketTimeout(30000).build(); // 创建无视SSL验证的HttpClient CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig) - .setSSLSocketFactory(createIgnoreSslSocketFactory()).build(); + .setSSLSocketFactory(CommonUtil.createIgnoreSslSocketFactory()).build(); CloseableHttpResponse response = null; // 发起HTTP请求 try { @@ -255,35 +246,4 @@ public class CrossSystemSendApplyUtil { } } - /** - * 创建无视SSL验证的SSLSocketFactory - */ - private static SSLConnectionSocketFactory createIgnoreSslSocketFactory() { - try { - // 创建信任所有证书的TrustManager - X509TrustManager trustAllCert = new X509TrustManager() { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) {} - - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) {} - - @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[0]; - } - }; - - // 初始化SSLContext - SSLContext sslContext = SSLContext.getInstance("SSL"); - sslContext.init(null, new TrustManager[] {trustAllCert}, new SecureRandom()); - - // 创建不验证主机名的SocketFactory - return new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE // 关键:禁用主机名验证 - ); - } catch (NoSuchAlgorithmException | KeyManagementException e) { - throw new RuntimeException("SSL配置失败", e); - } - } - } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinition.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinition.java index 02b5d9c99ee713d5ef1002d148b7676c59c10a7e..62688f322f330bbc1b45bc9c2aa71f0e52128b15 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinition.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinition.java @@ -45,5 +45,10 @@ public class DocStatisticsDefinition extends HisBaseEntity { 单位 */ private String unit; + /** 字典名称 */ + private String dictName; + + /** 字典类型 */ + private String dictType; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinitionOption.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinitionOption.java index 07aaabbd27cafcb355c73a6fa82db7cc813e5298..5cd737c9defce4ad3453382cba4304faebf57cb9 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinitionOption.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/domain/DocStatisticsDefinitionOption.java @@ -10,6 +10,9 @@ import lombok.experimental.Accessors; @TableName("doc_statistics_definition_option") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) +/** + * 统计定义选项 已作废 + */ public class DocStatisticsDefinitionOption extends HisBaseEntity { private Long id; /* diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDispense.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDispense.java index 290d49d269d9497164a8dc79225ba64c24c04fe1..6361ae29b2999d6e0f8316d1905443ff8b6bfbfe 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDispense.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDispense.java @@ -123,4 +123,7 @@ public class MedicationDispense extends HisBaseEntity { /** 追溯码 */ private String traceNo; + + /** 执行id */ + private Long procedureId; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java index abcb27f0fa53455660e4ec2743c88cc956515d7c..2248a82d56d5e52448320650e2fac2e74a8c6b53 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java @@ -233,4 +233,10 @@ public class MedicationRequest extends HisBaseEntity { * 签发编码 */ private String signCode; + + /** 请求基于什么 */ + private String basedOnTable; + + /** 请求基于什么的ID */ + private Long basedOnId; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java index 182e53291883992cb7b63b43d0c5e88f400c395a..3937ef98b48a7b4d0fcf2ea88ea2a4a6836f0df5 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java @@ -2,11 +2,11 @@ package com.openhis.medication.service; import java.util.List; +import org.apache.ibatis.annotations.Param; + import com.baomidou.mybatisplus.extension.service.IService; -import com.openhis.administration.domain.Practitioner; import com.openhis.medication.domain.MedicationDispense; import com.openhis.medication.domain.MedicationRequest; -import org.apache.ibatis.annotations.Param; /** * 药品发放管理Service接口 @@ -24,6 +24,14 @@ public interface IMedicationDispenseService extends IService */ void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType); + /** + * 医嘱执行生成药品发放,状态为待配药 + * + * @param medicationRequest 药品医嘱请求 + * @param procedureId 执行记录id + */ + void generateMedicationDispense(MedicationRequest medicationRequest,Long procedureId); + /** * 删除药品发放信息 * @@ -68,6 +76,7 @@ public interface IMedicationDispenseService extends IService * @return 发放信息 */ List selectByRequestIdList(List requestIdList); + /** * 通过id获取药品发放信息 * @@ -82,4 +91,12 @@ public interface IMedicationDispenseService extends IService * @param medDispenseId 发放id列表 */ void updateDispenseStatusSummarized(List medDispenseId); + + /** + * 通过执行id获取药品发放信息 + * + * @param procedureIdList 执行id列表 + * @return 发放信息 + */ + List getMedDispenseByProcedureId(List procedureIdList); } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java index 418aed206a36aba6355ec3c1e54b444ab7ee32d1..f801953c8882d943c4bc14257895d8025697443e 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java @@ -105,6 +105,69 @@ public class MedicationDispenseServiceImpl extends ServiceImpl getMedDispenseByProcedureId(List procedureIdList) { + return baseMapper.selectList( + new LambdaQueryWrapper().in(MedicationDispense::getProcedureId, procedureIdList) + .eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode())); + } } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceDispense.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceDispense.java index d7e01ee21b4c0a9531be7b2646f42eac35d1b276..301e232256092a7e50ac044fd1d9796360a387a6 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceDispense.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceDispense.java @@ -1,16 +1,17 @@ package com.openhis.workflow.domain; +import java.math.BigDecimal; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.core.common.core.domain.HisBaseEntity; + import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 器材发放管理Entity实体 * @@ -36,9 +37,10 @@ public class DeviceDispense extends HisBaseEntity { /** 器材发放状态 */ private Integer statusEnum; + // 暂时不要用 /** 请求基于什么 */ private String basedOnTable; - + // 暂时不要用 /** 请求基于什么的ID */ private Long basedOnId; @@ -111,4 +113,6 @@ public class DeviceDispense extends HisBaseEntity { /** 追溯码 */ private String traceNo; + /** 执行id */ + private Long procedureId; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java index e12de6421aaf15486e265126b6948402624b0b8c..1047ca14297b0994d3f27e907219a6f85145225b 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java @@ -165,4 +165,9 @@ public class DeviceRequest extends HisBaseEntity { */ private Long encounterDiagnosisId; + /** 请求基于什么 */ + private String basedOnTable; + + /** 请求基于什么的ID */ + private Long basedOnId; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ElepMedicationRequest.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ElepMedicationRequest.java index bead6e3d716657e83c2a580de63769d996269930..c897f118e99628586e8edb00734664e70c07518a 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ElepMedicationRequest.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ElepMedicationRequest.java @@ -6,9 +6,8 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; - import com.core.common.core.domain.HisBaseEntity; -import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -71,6 +70,12 @@ public class ElepMedicationRequest extends HisBaseEntity { /** 诊断id */ private Long conditionId; + /** 诊断id */ + private Long conditionDefId; + + /** 慢病字段 */ + private String opspDiseCode; + /** 有效天数 */ private Integer validityDays; @@ -100,7 +105,7 @@ public class ElepMedicationRequest extends HisBaseEntity { /** 调配药师 */ private Long dispensingDrId; - /** 发药药师*/ + /** 发药药师 */ private Long issuingDrId; /** 延长原因 */ diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java index 0bf43470fcbfd1e34bce22008a61a3b586d5fb57..9aad1df134628e78b63c027d68750b1bd9d54b06 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java @@ -5,14 +5,9 @@ import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; -import com.core.common.core.domain.model.LoginUser; import com.openhis.administration.domain.Practitioner; -import com.openhis.medication.domain.MedicationDispense; -import com.openhis.medication.domain.MedicationRequest; import com.openhis.workflow.domain.DeviceDispense; import com.openhis.workflow.domain.DeviceRequest; -import com.openhis.workflow.domain.ServiceRequest; -import org.apache.ibatis.annotations.Param; /** * 器材发放管理Service接口 @@ -48,9 +43,10 @@ public interface IDeviceDispenseService extends IService { /** * 获取执行过的器材数据 * - * @param basedOnId 请求基于什么的ID + * @param procedureIdList 执行id列表 + * @return 操作结果 */ - List selectDeviceDispenseByBasedOnId(Long basedOnId); + List getDevDispenseByProcedureId(List procedureIdList); /** * 执行器材发放 @@ -111,12 +107,4 @@ public interface IDeviceDispenseService extends IService { * @param devDispenseId 发放id列表 */ void updateDispenseStatusSummarized(List devDispenseId); - - /** - * 通过id获取耗材发放信息 - * - * @param idList 发放id - * @return 发放信息 - */ - List selectByIdList(@Param("idList") List idList); } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java index d30d3a922b9b96ab88eba1d32c51866be51baf22..ca13926908eac2014de10a9b49b8efbdeaa1ecfd 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java @@ -8,10 +8,6 @@ import java.util.List; import javax.annotation.Resource; -import com.core.common.utils.DateUtils; -import com.openhis.common.enums.DelFlag; -import com.openhis.medication.domain.MedicationDispense; -import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -19,9 +15,9 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.core.common.utils.AssignSeqUtil; import com.openhis.administration.domain.Practitioner; -import com.openhis.common.constant.CommonConstants; import com.openhis.common.enums.AssignSeqEnum; import com.openhis.common.enums.DbOpType; +import com.openhis.common.enums.DelFlag; import com.openhis.common.enums.DispenseStatus; import com.openhis.workflow.domain.DeviceDispense; import com.openhis.workflow.domain.DeviceRequest; @@ -124,13 +120,14 @@ public class DeviceDispenseServiceImpl extends ServiceImpl selectDeviceDispenseByBasedOnId(Long basedOnId) { - return (baseMapper - .selectList(new LambdaQueryWrapper().eq(DeviceDispense::getBasedOnId, basedOnId) - .eq(DeviceDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue()))); + public List getDevDispenseByProcedureId(List procedureIdList) { + return baseMapper + .selectList(new LambdaQueryWrapper().in(DeviceDispense::getProcedureId, procedureIdList) + .eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode())); } /** @@ -147,10 +144,10 @@ public class DeviceDispenseServiceImpl extends ServiceImpl selectByIdList(@Param("idList") List idList) { - return baseMapper.selectList(new LambdaQueryWrapper().in(DeviceDispense::getId, idList) - .eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode())); - } - } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyDeliveryServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyDeliveryServiceImpl.java index eed67d6c98badd467b773fc3c27cab94f47786f8..f4bbe82cfeebe98c3969a50996b90a3e055d9770 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyDeliveryServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyDeliveryServiceImpl.java @@ -3,17 +3,15 @@ package com.openhis.workflow.service.impl; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.stream.Collectors; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.core.common.utils.DateUtils; -import com.core.common.utils.SecurityUtils; -import com.openhis.common.enums.DelFlag; -import com.openhis.common.enums.EventStatus; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.core.common.utils.DateUtils; +import com.core.common.utils.SecurityUtils; +import com.openhis.common.enums.DelFlag; import com.openhis.common.enums.DispenseStatus; import com.openhis.workflow.domain.SupplyDelivery; import com.openhis.workflow.domain.SupplyRequest; @@ -93,11 +91,10 @@ public class SupplyDeliveryServiceImpl extends ServiceImpl supplyReqIdList) { // 根据请求id查询发放状态 - List deliveryList = baseMapper - .selectList(new LambdaQueryWrapper().in(SupplyDelivery::getRequestId, supplyReqIdList)); + List deliveryList = baseMapper.selectList(new LambdaQueryWrapper() + .eq(SupplyDelivery::getDeleteFlag, DelFlag.NO.getCode()).in(SupplyDelivery::getRequestId, supplyReqIdList)); if (!deliveryList.isEmpty()) { - List deliveryStatusList = - deliveryList.stream().map(SupplyDelivery::getStatusEnum).collect(Collectors.toList()); + List deliveryStatusList = deliveryList.stream().map(SupplyDelivery::getStatusEnum).toList(); return deliveryStatusList.stream().anyMatch(x -> x.equals(DispenseStatus.COMPLETED.getValue())); } return false; diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java index e192d14e2214e3bf694a5fd9432d6342935b08cd..406ff3b1716952112a8861ba7084ff8e2ae127aa 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java @@ -4,7 +4,6 @@ import java.util.Date; import java.util.List; import java.util.stream.Collectors; -import com.openhis.medication.domain.MedicationDispense; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -41,7 +40,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl getSupplyByBusNo(String busNo) { - return baseMapper.selectList(new LambdaQueryWrapper().eq(SupplyRequest::getBusNo, busNo)); + return baseMapper.selectList(new LambdaQueryWrapper().eq(SupplyRequest::getBusNo, busNo) + .eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode())); } /** @@ -51,9 +51,11 @@ public class SupplyRequestServiceImpl extends ServiceImpl getSupplyByOriginalBusNo(String originalBusNo){ - return baseMapper.selectList(new LambdaQueryWrapper().eq(SupplyRequest::getOriginalBusNo, originalBusNo)); + public List getSupplyByOriginalBusNo(String originalBusNo) { + return baseMapper + .selectList(new LambdaQueryWrapper().eq(SupplyRequest::getOriginalBusNo, originalBusNo)); } + /** * 同意申请 * @@ -81,14 +83,14 @@ public class SupplyRequestServiceImpl extends ServiceImpl addOriginalBusNo(String busNo,String originalBusNo){ + public List addOriginalBusNo(String busNo, String originalBusNo) { // 更新单据状态 - baseMapper.update(null, - new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo) - .set(SupplyRequest::getOriginalBusNo, originalBusNo)); + baseMapper.update(null, new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo) + .set(SupplyRequest::getOriginalBusNo, originalBusNo)); // 返回单据详情 return this.getSupplyByBusNo(busNo); } + /** * 将原始单据号信息的原始单据号删除 * @@ -97,9 +99,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl().eq(SupplyRequest::getBusNo, busNo) - .set(SupplyRequest::getOriginalBusNo, "")); + int updateCount = baseMapper.update(null, new LambdaUpdateWrapper() + .eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getOriginalBusNo, "")); return updateCount > 0; } @@ -110,12 +111,13 @@ public class SupplyRequestServiceImpl extends ServiceImpl().eq(SupplyRequest::getBusNo, busNo) + public boolean updateStatusEnumByBusNo(String busNo) { + int updateCount = + baseMapper.update(null, new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo) .set(SupplyRequest::getStatusEnum, SupplyStatus.EXPIRED_INVALIDATED.getValue())); return updateCount > 0; } + /** * 提交审批 * @@ -145,6 +147,7 @@ public class SupplyRequestServiceImpl extends ServiceImpl 0; } + /** * 删除单据 * @@ -152,12 +155,12 @@ public class SupplyRequestServiceImpl extends ServiceImpl().eq(SupplyRequest::getBusNo, busNo) - .set(SupplyRequest::getDeleteFlag,DelFlag.YES.getCode() )); + public boolean removeByBusNo(String busNo) { + int updateCount = baseMapper.update(null, new LambdaUpdateWrapper() + .eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getDeleteFlag, DelFlag.YES.getCode())); return updateCount > 0; } + /** * 驳回申请 * @@ -234,7 +237,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl().eq(SupplyRequest::getBusNo, busNo)); @@ -246,19 +250,22 @@ public class SupplyRequestServiceImpl extends ServiceImpl supplyRequestIdList) { + @Override + public void updateCompletedStatusBatch(List supplyRequestIdList) { baseMapper.update(new SupplyRequest().setStatusEnum(SupplyStatus.AGREE.getValue()) - .setApproverId(SecurityUtils.getLoginUser().getPractitionerId()).setApprovalTime(DateUtils.getNowDate()), + .setApproverId(SecurityUtils.getLoginUser().getPractitionerId()).setApprovalTime(DateUtils.getNowDate()), new LambdaUpdateWrapper().in(SupplyRequest::getId, supplyRequestIdList)); } + /** * 根据id,获取供应申请列表 * * @param requestIdList id列表 * @return 供应发放列表 */ - @Override public List selectByIdList(List requestIdList){ - return baseMapper.selectList( new LambdaQueryWrapper().in(SupplyRequest::getId, requestIdList) + @Override + public List selectByIdList(List requestIdList) { + return baseMapper.selectList(new LambdaQueryWrapper().in(SupplyRequest::getId, requestIdList) .eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode())); } } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/MedicalInventory3511Output.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/MedicalInventory3511Output.java new file mode 100644 index 0000000000000000000000000000000000000000..5fc4380925003c3fa08542fb957d7fca09e03742 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/MedicalInventory3511Output.java @@ -0,0 +1,320 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.yb.dto; + +import com.alibaba.fastjson2.annotation.JSONField; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 【3511】返回结果 + * + * @author SunJQ + * @date 2025-09-26 + */ +@Data +public class MedicalInventory3511Output { + /** + * 有效期止 + * 类型:日期型,格式yyyy-MM-dd + */ + @JSONField(name = "expyEnd", format = "yyyy-MM-dd") + private Date expyEnd; + + /** + * 药师证件类型 + * 类型:字符型,长度3,非空 + */ + @JSONField(name = "pharCertType") + private String pharCertType; + + /** + * 销售/退货经办人姓名 + * 类型:字符型,长度50 + */ + @JSONField(name = "selRetnOpterName") + private String selRetnOpterName; + + /** + * 医疗目录编码 + * 类型:字符型,长度50 + */ + @JSONField(name = "medListCodg") + private String medListCodg; + + /** + * 统筹区编号 + * 类型:字符型,长度6 + */ + @JSONField(name = "poolareaNo") + private String poolareaNo; + + /** + * 结算ID + * 类型:字符型,长度30 + */ + @JSONField(name = "setlId") + private String setlId; + + /** + * 创建机构编号 + * 类型:字符型,长度20 + */ + @JSONField(name = "crteOptinsNo") + private String crteOptinsNo; + + /** + * 医药机构目录编码 + * 类型:字符型,长度150 + */ + @JSONField(name = "medinsListCodg") + private String medinsListCodg; + + /** + * 备注 + * 类型:字符型,长度500 + */ + @JSONField(name = "memo") + private String memo; + + /** + * 数据更新时间 + * 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss + */ + @JSONField(name = "updtTime", format = "yyyy-MM-dd HH:mm:ss") + private Date updtTime; + + /** + * 医保费用结算类型 + * 类型:字符型,长度6,非空 + */ + @JSONField(name = "hiFeesetlType") + private String hiFeesetlType; + + /** + * 生产日期 + * 类型:日期型,格式yyyy-MM-dd + */ + @JSONField(name = "manuDate", format = "yyyy-MM-dd") + private Date manuDate; + + /** + * 经办人姓名 + * 类型:字符型,长度50 + */ + @JSONField(name = "opterName") + private String opterName; + + /** + * 人员编号 + * 类型:字符型,长度30 + */ + @JSONField(name = "psnNo") + private String psnNo; + + /** + * 数据唯一记录号 + * 类型:字符型,长度40 + */ + @JSONField(name = "rid") + private String rid; + + /** + * 数据创建时间 + * 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss + */ + @JSONField(name = "crteTime", format = "yyyy-MM-dd HH:mm:ss") + private Date crteTime; + + /** + * 药师证件号码 + * 类型:字符型,长度50 + */ + @JSONField(name = "pharCertno") + private String pharCertno; + + /** + * 有效标志 + * 类型:字符型,长度3,非空 + */ + @JSONField(name = "valiFlag") + private String valiFlag; + + /** + * 证件号码 + * 类型:字符型,长度600 + */ + @JSONField(name = "certno") + private String certno; + + /** + * 定点医药机构编号 + * 类型:字符型,长度30 + */ + @JSONField(name = "fixmedinsCode") + private String fixmedinsCode; + + /** + * 处方药标志 + * 类型:字符型,长度3,非空 + */ + @JSONField(name = "rxFlag") + private String rxFlag; + + /** + * 药师执业资格证号 + * 类型:字符型,长度50 + */ + @JSONField(name = "pharPracCertNo") + private String pharPracCertNo; + + /** + * 目录特项标志 + * 类型:字符型,长度3,非空 + */ + @JSONField(name = "listSpItemFlag") + private String listSpItemFlag; + + /** + * 定点医药机构批次流水号 + * 类型:字符型,长度30 + */ + @JSONField(name = "fixmedinsBchno") + private String fixmedinsBchno; + + /** + * 经办时间 + * 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss + */ + @JSONField(name = "optTime", format = "yyyy-MM-dd HH:mm:ss") + private Date optTime; + + /** + * 人员姓名 + * 类型:字符型,长度50 + */ + @JSONField(name = "psnName") + private String psnName; + + /** + * 电子监管编码 + * 类型:字符型,长度20 + */ + @JSONField(name = "elecSupnCodg") + private String elecSupnCodg; + + /** + * 开单医师姓名 + * 类型:字符型,长度50 + */ + @JSONField(name = "bilgDrName") + private String bilgDrName; + + /** + * 经办人ID + * 类型:字符型,长度20 + */ + @JSONField(name = "opterId") + private String opterId; + + /** + * 生产批号 + * 类型:字符型,长度30 + */ + @JSONField(name = "manuLotnum") + private String manuLotnum; + + /** + * 医药机构目录名称 + * 类型:字符型,长度100 + */ + @JSONField(name = "medinsListName") + private String medinsListName; + + /** + * 人员证件类型 + * 类型:字符型,长度6,非空 + */ + @JSONField(name = "psnCertType") + private String psnCertType; + + /** + * 销售/退货时间 + * 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss + */ + @JSONField(name = "selRetnTime", format = "yyyy-MM-dd HH:mm:ss") + private Date selRetnTime; + + /** + * 销售/退货数量 + * 类型:数值型,长度16,2(16位数字,其中2位小数) + */ + @JSONField(name = "selRetnCnt") + private BigDecimal selRetnCnt; + + /** + * 创建人姓名 + * 类型:字符型,长度50 + */ + @JSONField(name = "crterName") + private String crterName; + + /** + * 药师姓名 + * 类型:字符型,长度50 + */ + @JSONField(name = "pharName") + private String pharName; + + /** + * 开单医师证件类型 + * 类型:字符型,长度3,非空 + */ + @JSONField(name = "prscDrCertType") + private String prscDrCertType; + + /** + * 创建人ID + * 类型:字符型,长度20 + */ + @JSONField(name = "crterId") + private String crterId; + + /** + * 开单医师证件号码 + * 类型:字符型,长度50 + */ + @JSONField(name = "prscDrCertno") + private String prscDrCertno; + + /** + * 经办机构编号 + * 类型:字符型,长度20 + */ + @JSONField(name = "optinsNo") + private String optinsNo; + + /** + * 拆零标志 + * 类型:字符型,长度3,非空 + */ + @JSONField(name = "trdnFlag") + private String trdnFlag; + + /** + * 最终成交单价 + * 类型:数值型,长度16,6(16位数字,其中6位小数) + */ + @JSONField(name = "finlTrnsPric") + private BigDecimal finlTrnsPric; + + /** + * 定点医药机构商品销售流水号 + * 类型:字符型,长度30 + */ + @JSONField(name = "medinsProdSelNo") + private String medinsProdSelNo; +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/MedicalInventory3511Param.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/MedicalInventory3511Param.java new file mode 100644 index 0000000000000000000000000000000000000000..10ee90443eda8c9e8255392111b8f5a1fd0bb779 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/MedicalInventory3511Param.java @@ -0,0 +1,263 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.yb.dto; + +import java.util.Date; + +import com.alibaba.fastjson.annotation.JSONField; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 【3511】 + * + * @author SunJQ + * @date 2025-09-26 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class MedicalInventory3511Param { + /** + * 定点医药机构编号 类型:字符型,长度30,必填项 + */ + @JSONField(name = "fixmedins_code") + private String fixmedinsCode; + + /** + * 医药机构目录编码 类型:字符型,长度150,必填项(与定点医药机构批次流水号二选一) + */ + @JSONField(name = "medins_list_codg") + private String medinsListCodg; + + /** + * 定点医药机构批次流水号 类型:字符型,长度30,必填项(与医药机构目录编码二选一) + */ + @JSONField(name = "fixmedins_bchno") + private String fixmedinsBchno; + + /** + * 开始日期 类型:日期型,格式yyyy-MM-dd,必填项 + */ + @JSONField(name = "begndate", format = "yyyy-MM-dd") + private Date begndate; + + /** + * 结束日期 类型:日期型,格式yyyy-MM-dd,必填项 + */ + @JSONField(name = "enddate", format = "yyyy-MM-dd") + private Date enddate; + + /** + * 定点医药机构商品销售流水号 类型:字符型,长度30,非必填 + */ + @JSONField(name = "medins_prod_sel_no") + private String medinsProdSelNo; + + /** + * 医疗目录编码 类型:字符型,长度50,非必填 + */ + @JSONField(name = "med_list_codg") + private String medListCodg; + + /** + * 医药机构目录名称 类型:字符型,长度100,非必填 + */ + @JSONField(name = "medins_list_name") + private String medinsListName; + + /** + * 开单医师证件类型 类型:字符型,长度3,非必填 + */ + @JSONField(name = "prsc_dr_cert_type") + private String prscDrCertType; + + /** + * 开单医师证件号码 类型:字符型,长度50,非必填 + */ + @JSONField(name = "prsc_dr_certno") + private String prscDrCertno; + + /** + * 开单医师姓名 类型:字符型,长度50,非必填 + */ + @JSONField(name = "bilg_dr_name") + private String bilgDrName; + + /** + * 药师证件类型 类型:字符型,长度3,非必填 + */ + @JSONField(name = "phar_cert_type") + private String pharCertType; + + /** + * 药师证件号码 类型:字符型,长度50,非必填 + */ + @JSONField(name = "phar_certno") + private String pharCertno; + + /** + * 药师姓名 类型:字符型,长度50,非必填 + */ + @JSONField(name = "phar_name") + private String pharName; + + /** + * 药师执业资格证号 类型:字符型,长度50,非必填 + */ + @JSONField(name = "phar_prac_cert_no") + private String pharPracCertNo; + + /** + * 医保费用结算类型 类型:字符型,长度6,必填项 + */ + @JSONField(name = "hi_feesetl_type") + private String hiFeesetlType; + + /** + * 结算ID 类型:字符型,长度30,非必填 + */ + @JSONField(name = "setl_id") + private String setlId; + + /** + * 人员编号 类型:字符型,长度30,非必填 + */ + @JSONField(name = "psn_no") + private String psnNo; + + /** + * 人员证件类型 类型:字符型,长度6,必填项 + */ + @JSONField(name = "psn_cert_type") + private String psnCertType; + + /** + * 证件号码 类型:字符型,长度600,非必填 + */ + @JSONField(name = "certno") + private String certno; + + /** + * 人员姓名 类型:字符型,长度50,非必填 + */ + @JSONField(name = "psn_name") + private String psnName; + + /** + * 生产批号 类型:字符型,长度30,非必填 + */ + @JSONField(name = "manu_lotnum") + private String manuLotnum; + + /** + * 生产日期 类型:日期型,格式yyyy-MM-dd,非必填 + */ + @JSONField(name = "manu_date", format = "yyyy-MM-dd") + private Date manuDate; + + /** + * 有效期止 类型:日期型,格式yyyy-MM-dd,非必填 + */ + @JSONField(name = "expy_end", format = "yyyy-MM-dd") + private Date expyEnd; + + /** + * 电子监管编码 类型:字符型,长度20,非必填 + */ + @JSONField(name = "elec_supn_codg") + private String elecSupnCodg; + + /** + * 处方药标志 类型:字符型,长度3,必填项 + */ + @JSONField(name = "rx_flag") + private String rxFlag; + + /** + * 目录特项标志 类型:字符型,长度3,必填项 + */ + @JSONField(name = "list_sp_item_flag") + private String listSpItemFlag; + + /** + * 拆零标志 类型:字符型,长度3,必填项 + */ + @JSONField(name = "trdn_flag") + private String trdnFlag; + + /** + * 销售/退货时间 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss,非必填 + */ + @JSONField(name = "sel_retn_time", format = "yyyy-MM-dd HH:mm:ss") + private Date selRetnTime; + + /** + * 销售/退货经办人姓名 类型:字符型,长度50,非必填 + */ + @JSONField(name = "sel_retn_opter_name") + private String selRetnOpterName; + + /** + * 备注 类型:字符型,长度500,非必填 + */ + @JSONField(name = "memo") + private String memo; + + /** + * 有效标志 类型:字符型,长度3,必填项 + */ + @JSONField(name = "vali_flag") + private String valiFlag; + + /** + * 数据唯一记录号 类型:字符型,长度40,非必填 + */ + @JSONField(name = "rid") + private String rid; + + /** + * 创建人ID 类型:字符型,长度20,非必填 + */ + @JSONField(name = "crter_id") + private String crterId; + + /** + * 创建人姓名 类型:字符型,长度50,非必填 + */ + @JSONField(name = "crter_name") + private String crterName; + + /** + * 创建机构编号 类型:字符型,长度20,非必填 + */ + @JSONField(name = "crte_optins_no") + private String crteOptinsNo; + + /** + * 经办人ID 类型:字符型,长度20,非必填 + */ + @JSONField(name = "opter_id") + private String opterId; + + /** + * 经办人姓名 类型:字符型,长度50,非必填 + */ + @JSONField(name = "opter_name") + private String opterName; + + /** + * 经办机构编号 类型:字符型,长度20,非必填 + */ + @JSONField(name = "optins_no") + private String optinsNo; + + /** + * 统筹区编号 类型:字符型,长度6,非必填 + */ + @JSONField(name = "poolarea_no") + private String poolareaNo; +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/PaymentDecDetailUniAccountDto.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/PaymentDecDetailUniAccountDto.java index d0c8fdb040fc72a0a7693477570a61ad6e49a917..b3a9c46d7dd7e0ea72179482e3ff31cba1260740 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/PaymentDecDetailUniAccountDto.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/dto/PaymentDecDetailUniAccountDto.java @@ -22,4 +22,10 @@ public class PaymentDecDetailUniAccountDto extends PaymentRecDetail { // 医疗费用总额 private String medfeeSumamt; + + // 医疗费用总额(有退费) + private String returnMedfeeSumamt; + + // 门诊还是住院 + private Integer kindEnum; } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbDao.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbDao.java index 19dd6ceb254af909fd4a4ec9b2cda25eedd78e2e..a2971941f1449961491903b43b07fa2f8fc1d528 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbDao.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbDao.java @@ -1305,6 +1305,14 @@ public class YbDao { public List reconcileGeneralLedgerDetail(Settlement3201WebParam settlement3201WebParam) { // 获取条件 String clrType = settlement3201WebParam.getClrType();// 住院 or 门诊 + Integer kindEnum; + if (clrType.equals(YbClrType.OUTPATIENT_CLINIC.getValue())) { + kindEnum = PaymentKind.OUTPATIENT_CLINIC.getValue(); + } else if (clrType.equals(YbClrType.INPATIENT_CARE.getValue())) { + kindEnum = PaymentKind.INPATIENT_CLINIC.getValue(); + } else { + throw new ServiceException("请选择门诊或住院"); + } String contractNo = settlement3201WebParam.getContractNo();// 省市医保 String insuType = settlement3201WebParam.getInsuType();// 职工 or 居民保险 String stmtBegnDate = settlement3201WebParam.getStmtBegnDate();// 开始时间 @@ -1400,16 +1408,16 @@ public class YbDao { continue; } // 分住院门诊 - Map> paymentDecDetailUniAccountDtoMapGroupByMedType = + Map> paymentDecDetailUniAccountDtoMapGroupByMedType = stringListEntry.getValue().stream() - .collect(Collectors.groupingBy(PaymentDecDetailUniAccountDto::getMedType)); - for (Map.Entry> listEntry : paymentDecDetailUniAccountDtoMapGroupByMedType .entrySet()) { if (listEntry.getValue().isEmpty()) { continue; } - if (!StringUtils.isEmpty(clrType) && !listEntry.getKey().equals(clrType)) { + if (!StringUtils.isEmpty(clrType) && !listEntry.getKey().equals(kindEnum)) { continue; } // 分职工居民 @@ -1425,17 +1433,31 @@ public class YbDao { int count = 0; settlement3201Dto = new Settlement3201DetailDto(); settlement3201Dto.setContractNo(stringListEntry.getKey()) - .setInsutype(Integer.parseInt(entry.getKey())).setClrType(listEntry.getKey()); + .setInsutype(Integer.parseInt(entry.getKey())); + if (PaymentKind.OUTPATIENT_CLINIC.getValue() == listEntry.getKey()) { + settlement3201Dto.setClrType(YbClrType.OUTPATIENT_CLINIC.getValue()); + } else if (PaymentKind.INPATIENT_CLINIC.getValue() == listEntry.getKey()) { + settlement3201Dto.setClrType(YbClrType.INPATIENT_CARE.getValue()); + } for (PaymentDecDetailUniAccountDto paymentDecDetailUniAccountDto : entry.getValue()) { if (YbPayment.YB_FUND_PAY.getValue().equals(paymentDecDetailUniAccountDto.getPayEnum())) { // 基金支付 settlement3201Dto.setFundPaySumAmt( paymentDecDetailUniAccountDto.getAmount().add(settlement3201Dto.getFundPaySumAmt())); - // 合计医疗费用 - settlement3201Dto - .setMedFeeSumAmt(new BigDecimal(paymentDecDetailUniAccountDto.getMedfeeSumamt() == null - ? "0.0" : paymentDecDetailUniAccountDto.getMedfeeSumamt()) - .add(settlement3201Dto.getMedFeeSumAmt())); + if (BigDecimal.ZERO.compareTo(paymentDecDetailUniAccountDto.getAmount()) >= 0 + && paymentDecDetailUniAccountDto.getReturnMedfeeSumamt() != null) { + // 合计医疗费用 + settlement3201Dto.setMedFeeSumAmt( + new BigDecimal(paymentDecDetailUniAccountDto.getReturnMedfeeSumamt() == null ? "0.0" + : paymentDecDetailUniAccountDto.getReturnMedfeeSumamt()) + .add(settlement3201Dto.getMedFeeSumAmt())); + } else { + // 合计医疗费用 + settlement3201Dto.setMedFeeSumAmt( + new BigDecimal(paymentDecDetailUniAccountDto.getMedfeeSumamt() == null ? "0.0" + : paymentDecDetailUniAccountDto.getMedfeeSumamt()) + .add(settlement3201Dto.getMedFeeSumAmt())); + } count++; } if (YbPayment.SELF_YB_ZH_PAY.getValue().equals(paymentDecDetailUniAccountDto.getPayEnum())) { diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbHttpUtils.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbHttpUtils.java index 6b2cf249ad6ee6b34b3ce085b516879e640fd968..d2c4fa2a63d969ae71b3fce96391cbb34d5aa543 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbHttpUtils.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/yb/service/YbHttpUtils.java @@ -13,6 +13,7 @@ import java.util.Comparator; import java.util.List; import java.util.Optional; +import com.openhis.financial.service.impl.ContractServiceImpl; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; @@ -69,6 +70,8 @@ public class YbHttpUtils { IContractService iContractService; Logger logger = LoggerFactory.getLogger(YbHttpUtils.class); + @Autowired + private ContractServiceImpl contractServiceImpl; public Info1101Output getPerInfo(Info1101ReadcardParam readcard) { // 声明参数 @@ -397,17 +400,13 @@ public class YbHttpUtils { public Result reconcileGeneralLedger(Financial3201Param financial3201Param) { // 此处先查询到合同并回填给入参对象 - List redisContractList = iContractService.getContractListByYb(); - Contract contract; - Optional max = redisContractList.stream().max(Comparator.comparingInt(Contract::getSort)); - if (max.isPresent()) { - contract = max.get(); - } else { - throw new ServiceException("没有对合同进行优先级排序"); + Contract contract=iContractService.getContract(financial3201Param.getSetlOptins()); + if(contract==null){ + throw new ServiceException("未查询到合同信息"); } // 发送请求 String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/reconcile", - financial3201Param, contract); + financial3201Param,contract); // 赋值(上述回填的两个参数医保不要,为了避免麻烦,在发送http后进行回填) financial3201Param.setFixmedinsCode(contract.getFixmedinsCode()); @@ -474,7 +473,7 @@ public class YbHttpUtils { public String applyFinancialClearing(Financial3203AParam financial3203AParam) { // 发送请求 String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/apply-clearing", - financial3203AParam, null); + financial3203AParam, iContractService.getContract(financial3203AParam.getClrOptins())); if (StringUtils.isEmpty(s)) { throw new ServiceException("未接收到医保返回参数"); } @@ -644,6 +643,35 @@ public class YbHttpUtils { return result; } + public MedicalInventory3511Output querySalesInfo(MedicalInventory3511Param medicalInventory3511Param) { + // 发送请求 + String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/query-3511-info", + medicalInventory3511Param, null); + if (StringUtils.isEmpty(s)) { + throw new ServiceException("未接收到医保返回参数"); + } + // 参数处理 + ObjectMapper mapper = new ObjectMapper(); + Result result = null; + try { + result = mapper.readValue(s, Result.class); + } catch (Exception e) { + e.printStackTrace(); + } + // 转业务参数 + MedicalInventory3511Output medicalInventory3511Output = null; + if (result == null) { + throw new ServiceException("未接收到医保返回参数"); + } else if (result.getCode() == 200) { + System.out.println(JSON.toJSONString(result.getResult())); + medicalInventory3511Output = + parseObject(JSON.toJSONString(result.getResult()), MedicalInventory3511Output.class); + } else { + throw new ServiceException(result.getMessage()); + } + return medicalInventory3511Output; + } + public Result getClrOptins(Clearing3206AParam clearing3206AParam) { // 发送请求 String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/getclroptins", diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/mapper/CatalogSpecialDiseaseMapper.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/mapper/CatalogSpecialDiseaseMapper.java index fce2ee22590503e7464a7dcd495eea2c25da9f8e..16c6a8a9d24d7ff8742c4b2fa5b90d422f93aba6 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/mapper/CatalogSpecialDiseaseMapper.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/mapper/CatalogSpecialDiseaseMapper.java @@ -3,7 +3,7 @@ package com.openhis.ybcatalog.mapper; import org.springframework.stereotype.Repository; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.openhis.ybcatalog.domain.CatalogSpecialDisease; +import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease; /** * 特慢病目录 Mapper接口 @@ -12,6 +12,6 @@ import com.openhis.ybcatalog.domain.CatalogSpecialDisease; * @date 2025-04-09 */ @Repository -public interface CatalogSpecialDiseaseMapper extends BaseMapper { +public interface CatalogSpecialDiseaseMapper extends BaseMapper { } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/ICatalogSpecialDiseaseService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/ICatalogSpecialDiseaseService.java index 437d05fd3aaeac6d4f10b9a60e75dacf68678a55..a901a3e4d34caefb99cc25e1220985ebbee9bebf 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/ICatalogSpecialDiseaseService.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/ICatalogSpecialDiseaseService.java @@ -1,7 +1,7 @@ package com.openhis.ybcatalog.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.openhis.ybcatalog.domain.CatalogSpecialDisease; +import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease; /** * 特慢病目录 Service接口 @@ -9,6 +9,6 @@ import com.openhis.ybcatalog.domain.CatalogSpecialDisease; * @author system * @date 2025-04-09 */ -public interface ICatalogSpecialDiseaseService extends IService { +public interface ICatalogSpecialDiseaseService extends IService { } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/impl/CatalogSpecialDiseaseServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/impl/CatalogSpecialDiseaseServiceImpl.java index 24fa1c6a60f525bf41f159969902b99361062fab..87e5f6ebee80013a25c6ac227f84be89a00603e0 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/impl/CatalogSpecialDiseaseServiceImpl.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/service/impl/CatalogSpecialDiseaseServiceImpl.java @@ -3,7 +3,7 @@ package com.openhis.ybcatalog.service.impl; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.openhis.ybcatalog.domain.CatalogSpecialDisease; +import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease; import com.openhis.ybcatalog.mapper.CatalogSpecialDiseaseMapper; import com.openhis.ybcatalog.service.ICatalogSpecialDiseaseService; @@ -14,7 +14,7 @@ import com.openhis.ybcatalog.service.ICatalogSpecialDiseaseService; * @date 2025-04-09 */ @Service -public class CatalogSpecialDiseaseServiceImpl extends ServiceImpl - implements ICatalogSpecialDiseaseService { +public class CatalogSpecialDiseaseServiceImpl extends + ServiceImpl implements ICatalogSpecialDiseaseService { } \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/EncounterDiagnosisMapper.xml b/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/EncounterDiagnosisMapper.xml index f206fec3102cb676e96691c16b4630dd30cc90cd..59e8ac007a8ed32029499e1351f342df7cbaa4fc 100644 --- a/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/EncounterDiagnosisMapper.xml +++ b/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/EncounterDiagnosisMapper.xml @@ -17,5 +17,16 @@ WHERE encounter_id = #{encounterId} AND tcm_flag = 0 + \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/resources/mapper/financial/PaymentReconciliationMapper.xml b/openhis-server-new/openhis-domain/src/main/resources/mapper/financial/PaymentReconciliationMapper.xml index b92d50959e2867f85115ee8a9c65488af9425be8..d0c3508149705e5bae7cf89d2dd884a507045146 100644 --- a/openhis-server-new/openhis-domain/src/main/resources/mapper/financial/PaymentReconciliationMapper.xml +++ b/openhis-server-new/openhis-domain/src/main/resources/mapper/financial/PaymentReconciliationMapper.xml @@ -16,6 +16,7 @@ AND payment.delete_flag = '0' AND payment.status_enum IN (#{success}, #{returnAll}) AND payment.kind_enum = #{clinic} + AND account.contract_no IS NOT NULL AND payment.enterer_id = #{entererId} diff --git a/openhis-server-new/openhis-domain/src/main/resources/mapper/yb/MedicalInsuranceMapper.xml b/openhis-server-new/openhis-domain/src/main/resources/mapper/yb/MedicalInsuranceMapper.xml index 951662fd350be384491f29eb05b09eab8b14bd9d..d72d163fcea4d10e7d613bcd1dd975d3f51df4d5 100644 --- a/openhis-server-new/openhis-domain/src/main/resources/mapper/yb/MedicalInsuranceMapper.xml +++ b/openhis-server-new/openhis-domain/src/main/resources/mapper/yb/MedicalInsuranceMapper.xml @@ -123,7 +123,9 @@ t2.contract_no, t5.insutype, t5.med_type, - t7.medfee_sumamt + t6.kind_enum, + t7.medfee_sumamt, + t8.medfee_sumamt as return_medfee_sumamt FROM fin_payment_rec_detail t1 LEFT JOIN adm_account t2 on t1.account_id = t2.id @@ -132,11 +134,13 @@ LEFT JOIN yb_clinc_reg t5 on t4.bus_no = t5.ipt_otp_no AND t4.delete_flag = '0' LEFT JOIN fin_payment_reconciliation t6 on t6.id = t1.reconciliation_id AND t6.delete_flag = '0' LEFT JOIN yb_clinc_settle t7 on t1.pay_trans_text = t7.setl_id + LEFT JOIN yb_clinc_un_settle t8 on t6.yb_settle_ids = t8.settle_id WHERE 1=1 AND t6.bill_date > #{startTime} AND t6.bill_date < #{endTime} AND t6.status_enum != #{draft} + AND t5.med_type IS NOT NULL AND t1.account_id IS NOT NULL AND t1.reconciliation_id IN @@ -144,6 +148,5 @@ #{item} - \ No newline at end of file diff --git a/openhis-server-new/openhis-einvoiceapp/pom.xml b/openhis-server-new/openhis-einvoiceapp/pom.xml deleted file mode 100644 index 0069eb70409e78ac2b8baef0025d78c5b005e0d9..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/pom.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - openhis-server - com.openhis - 0.0.1-SNAPSHOT - - 4.0.0 - - openhis-einvoiceapp - - - 17 - 17 - - - - - - - - - - - - org.springframework.boot - spring-boot-starter - 2.5.15 - - - com.alibaba - fastjson - 2.0.43 - compile - - - org.apache.httpcomponents - httpclient - - - - com.openhis - openhis-common - 0.0.1-SNAPSHOT - - - - - com.yomahub - liteflow-spring-boot-starter - 2.12.4.1 - - - org.springframework.boot - spring-boot-configuration-processor - true - - - cn.hutool - hutool-all - 5.3.8 - - - org.bouncycastle - bcprov-jdk15on - 1.69 - - - com.alibaba - fastjson - 2.0.43 - - - commons-httpclient - commons-httpclient - 3.1 - - - org.apache.httpcomponents - httpclient - 4.5.5 - - - com.itextpdf - kernel - 7.1.2 - - - org.apache.httpcomponents - httpmime - 4.5 - - - - - com.itextpdf - itextpdf - 5.5.12 - - - com.itextpdf - itext-asian - 5.2.0 - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - 2.5.15 - - true - - - - - repackage - - - - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - false - ${project.artifactId} - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 9 - 9 - - - - ${project.artifactId} - - - \ No newline at end of file diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/OpenHisInvoiceApplication.java b/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/OpenHisInvoiceApplication.java deleted file mode 100644 index 5da7d726df0305d982ec8fd94759a4e91b688ea5..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/OpenHisInvoiceApplication.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.openhis; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.core.env.Environment; - -/** - * 启动程序 - * - * @author system - */ -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"}) -public class OpenHisInvoiceApplication { - public static void main(String[] args) throws UnknownHostException { - // System.setProperty("spring.devtools.restart.enabled", "false"); - ConfigurableApplicationContext application = SpringApplication.run(OpenHisInvoiceApplication.class, args); - Environment env = application.getEnvironment(); - String ip = InetAddress.getLocalHost().getHostAddress(); - String port = env.getProperty("server.port"); - String path = env.getProperty("server.servlet.context-path"); - System.out.println("电子处方程序启动"); - - System.out.println("\n----------------------------------------------------------\n\t" - + "Application OpenHis-YB is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port + path - + "/\n\t" + "External: \thttp://" + ip + ":" + port + path + "/\n" - + "----------------------------------------------------------"); - } -} diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/controller/YbController.java b/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/controller/YbController.java deleted file mode 100644 index 9eec242f284674ef92ccc8c2a45995d2ff751daf..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/controller/YbController.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright ©2023 CJB-CNIT Team. All rights reserved - */ -package com.openhis.controller; - -import com.alibaba.fastjson2.JSONObject; -import com.core.common.utils.StringUtils; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.openhis.vo.EleInvioceBillDto; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import com.core.common.annotation.Anonymous; - -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** - * TODO:医保控制层 - * - * @author SunJQ - * @date 2025-03-18 - */ -@RestController -@RequestMapping("/eleInvoice") -public class YbController { - - Logger logger = LoggerFactory.getLogger(YbController.class); - // logger.debug("这是专用日志测试"); - - @PostMapping(value = "/forward") - @Anonymous - public JSONObject signIn(@RequestBody EleInvioceBillDto eleInvioceBillDto) { - - JSONObject result = new JSONObject(); - // 获取当前租户的option信息 - //JSONObject optionJson = SecurityUtils.getLoginUser().getOptionJson(); - - String baseUrl = eleInvioceBillDto.getBaseUrl(); - // 拼接成完整 URL(作为路径) - String cleanUrl = baseUrl + "/" + eleInvioceBillDto.getEndpoint(); // 确保用 "/" 分隔 - String url = cleanUrl.trim().replaceAll("^\"|\"$", "") // 去除首尾引号 - .replaceAll("\\s+", "")// 去除首尾引号 - .replaceAll("\"", ""); // 去除中间引号 - - //String appID = optionJson.getString(CommonConstants.Option.APP_ID); - String appID = eleInvioceBillDto.getAppID(); - //String appKey = optionJson.getString(CommonConstants.Option.KEY); - String appKey = eleInvioceBillDto.getAppKey(); - String data = eleInvioceBillDto.getJsonObject().toJSONString(); - String version = "1.0"; - // 请求随机标识 noise - String noise = UUID.randomUUID().toString(); - - data = Base64.getEncoder().encodeToString(data.getBytes(StandardCharsets.UTF_8)); - - StringBuilder str = new StringBuilder(); - str.append("appid=").append(appID); - str.append("&data=").append(data); - str.append("&noise=").append(noise); - str.append("&key=").append(appKey); - str.append("&version=").append(version); - String sign = DigestUtils.md5Hex(str.toString().getBytes(Charset.forName("UTF-8"))).toUpperCase(); - - Map map = new HashMap<>(); - map.put("appid", appID); - map.put("data", data); - map.put("noise", noise); - map.put("sign", sign); - map.put("version", version); - - try { - HttpPost httpPost = new HttpPost(url); - CloseableHttpClient client = HttpClients.createDefault(); - String respContent = null; - // 请求参数转JOSN字符串 - StringEntity entity = new StringEntity(new ObjectMapper().writeValueAsString(map), "utf-8"); - entity.setContentEncoding("UTF-8"); - entity.setContentType("application/json"); - httpPost.setEntity(entity); - HttpResponse resp = client.execute(httpPost); - - if (resp.getStatusLine().getStatusCode() == 200) { - String rev = EntityUtils.toString(resp.getEntity()); - // System.out.println("返回串--》"+rev); - Map resultData = new ObjectMapper().readValue(rev, Map.class); - String rdata = resultData.get("data").toString(); - String rnoise = resultData.get("noise").toString(); - // 1、拼接返回验签参数 - StringBuilder str1 = new StringBuilder(); - str1.append("appid=").append(appID); - str1.append("&data=").append(rdata); - str1.append("&noise=").append(rnoise); - str1.append("&key=").append(appKey); - str1.append("&version=").append(version); - // 3.MD5加密 生成sign - String rmd5 = DigestUtils.md5Hex(str1.toString().getBytes(Charset.forName("UTF-8"))).toUpperCase(); - String rsign = resultData.get("sign").toString(); - System.out.println("验签-》" + (StringUtils.equals(rsign, rmd5))); - String busData = - new String(Base64.getDecoder().decode(resultData.get("data").toString()), StandardCharsets.UTF_8); - System.out.println("返回业务数据--》" + busData); - Map busDataMap = new ObjectMapper().readValue(busData, Map.class); - System.out - .println("业务信息解密--》" + new String(Base64.getDecoder().decode(busDataMap.get("message").toString()), - StandardCharsets.UTF_8)); - - JSONObject resobj = JSONObject.parseObject(busData); - result.put("success", true); - result.put("result", resobj); - } else { - result.put("msg", "web响应失败!"); - result.put("success", false); - } - } catch (Exception e) { - result.put("msg", e.getMessage()); - result.put("success", false); - } - return result; - } - -} diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/vo/EleInvioceBillDto.java b/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/vo/EleInvioceBillDto.java deleted file mode 100644 index c4f1c3dd2c98afd511dfa2428f738dba93004663..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/java/com/openhis/vo/EleInvioceBillDto.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.openhis.vo; - -import com.alibaba.fastjson2.JSONObject; -import lombok.Data; - -@Data -public class EleInvioceBillDto { - - JSONObject jsonObject; - - String endpoint; - - String baseUrl; - - String appID; - - String appKey; -} diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/application-druid.yml b/openhis-server-new/openhis-einvoiceapp/src/main/resources/application-druid.yml deleted file mode 100644 index fa3440c8ca7dcea44320f46a655c9546ebe2a24c..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/application-druid.yml +++ /dev/null @@ -1,63 +0,0 @@ -# 数据源配置 -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: org.postgresql.Driver - druid: - # 主库数据源 - master: - # url: jdbc:postgresql://localhost:5432/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 - url: jdbc:postgresql://192.168.10.242:5432/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 - # url: jdbc:postgresql://localhost:8020/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 - username: postgres - password: root - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置连接超时时间 - connectTimeout: 30000 - # 配置网络超时时间 - socketTimeout: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - # 配置一个连接在池中最大生存的时间,单位是毫秒 - maxEvictableIdleTimeMillis: 900000 - # 配置检测连接是否有效 - validationQuery: SELECT 1 # FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 设置白名单,不填则允许所有访问 - allow: - url-pattern: /druid/* - # 控制台管理用户名和密码 - login-username: openhis - login-password: 123456 - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/application-prod.yml b/openhis-server-new/openhis-einvoiceapp/src/main/resources/application-prod.yml deleted file mode 100644 index 59aa507d9ffbd762e0f6c8434ccd40a6454209be..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/application-prod.yml +++ /dev/null @@ -1,61 +0,0 @@ -# 数据源配置 -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: org.postgresql.Driver - druid: - # 主库数据源 - master: - url: jdbc:postgresql://localhost:5432/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 - username: postgres - password: root - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置连接超时时间 - connectTimeout: 30000 - # 配置网络超时时间 - socketTimeout: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - # 配置一个连接在池中最大生存的时间,单位是毫秒 - maxEvictableIdleTimeMillis: 900000 - # 配置检测连接是否有效 - validationQuery: SELECT 1 # FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 设置白名单,不填则允许所有访问 - allow: - url-pattern: /druid/* - # 控制台管理用户名和密码 - login-username: openhis - login-password: 123456 - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/application.yml b/openhis-server-new/openhis-einvoiceapp/src/main/resources/application.yml deleted file mode 100644 index 9ad5c9dd4904365e92c536a2238c373471757c08..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/application.yml +++ /dev/null @@ -1,159 +0,0 @@ -# 项目相关配置 -core: - # 名称 - name: OpenHis_eInvoice - # 版本 - version: 0.0.1 - # 版权年份 - copyrightYear: 2025 - # 文件路径 - profile: D:/home/uploadPath - # 获取ip地址开关 - addressEnabled: false - # 验证码类型 math 数字计算 char 字符验证 - captchaType: math - -# 开发环境配置 -server: - # 服务器的HTTP端口,默认为18080 - port: 18078 - servlet: - # 应用的访问路径 - context-path: /openhis/eInvoice - tomcat: - # tomcat的URI编码 - uri-encoding: UTF-8 - # 连接数满后的排队数,默认为100 - accept-count: 1000 - threads: - # tomcat最大线程数,默认为200 - max: 800 - # Tomcat启动初始化的线程数,默认值10 - min-spare: 100 - -# 日志配置 -logging: - level: - com.openhis: debug - org.springframework: warn - -# 用户配置 -user: - password: - # 密码最大错误次数 - maxRetryCount: 5 - # 密码锁定时间(默认10分钟) - lockTime: 10 - -# Spring配置 -spring: - main: - allow-circular-references: true - # 资源信息 - messages: - # 国际化资源文件路径 - basename: i18n/messages - profiles: - active: druid #生产 prod #本地 druid - # 文件上传 - servlet: - multipart: - # 单个文件大小 - max-file-size: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB - # 服务模块 - devtools: - restart: - # 热部署开关 - enabled: true - # redis 配置 - redis: - # 地址 - # host: 127.0.0.1 - host: 192.168.10.242 - # 端口,默认为6379 - port: 6379 - # 数据库索引 - database: 1 - # 密码 - password: redis - # 连接超时时间 - timeout: 10s - lettuce: - pool: - # 连接池中的最小空闲连接 - min-idle: 0 - # 连接池中的最大空闲连接 - max-idle: 8 - # 连接池的最大数据库连接数 - max-active: 8 - # #连接池最大阻塞等待时间(使用负值表示没有限制) - max-wait: -1ms - # 文言 - messages: - basename: i18n/general_message/messages - encoding: utf-8 - -# token配置 -token: - # 令牌自定义标识 - header: Authorization - # 令牌密钥 - secret: abcdefghijklmnopqrstuvwxyz - # 令牌有效期(默认30分钟) - expireTime: 30 - -# MyBatis配置 -mybatis-plus: - # 搜索指定包别名 - typeAliasesPackage: com.core.**.domain,com.openhis.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml - -# PageHelper分页插件 -pagehelper: - #helperDialect: mysql - supportMethodsArguments: true - params: count=countSql - # 分页插件会自动检测当前的数据库链接,自动选择合适的分页方式 - auto-dialect: true - # 默认值为 false。设置为 true 时,允许在运行时根据多数据源自动识别对应方言的分页 - auto-runtime-dialect: true - -# Swagger配置 -swagger: - # 是否开启swagger - enabled: true - # 请求前缀 - pathMapping: /dev-api - -# 防止XSS攻击 -xss: - # 过滤开关 - enabled: true - # 排除链接(多个用逗号分隔) - excludes: /system/notice - # 匹配链接 - urlPatterns: /system/*,/monitor/*,/tool/* - -# flowable相关表 -flowable: - # true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用) - database-schema-update: false - # 关闭定时任务JOB - async-executor-activate: false - -## liteflow配置 -#liteflow: -# #规则文件路径 -# rule-source: config/flow.el.xml -# #liteflow是否开启,默认为true -# enable: true -# #liteflow的banner打印是否开启,默认为true -# print-banner: false - - - diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/banner.txt b/openhis-server-new/openhis-einvoiceapp/src/main/resources/banner.txt deleted file mode 100644 index f95701d84f83c134bd7bb511c910b5c5b7e82aad..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/banner.txt +++ /dev/null @@ -1,10 +0,0 @@ - - :::::::: ::::::::: :::::::::: :::: ::: ::: ::: ::::::::::: :::::::: - :+: :+: :+: :+: :+: :+:+: :+: :+: :+: :+: :+: :+: - +:+ +:+ +:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ - +#+ +:+ +#++:++#+ +#++:++# +#+ +:+ +#+ +#++:++#++ +#+ +#++:++#++ - +#+ +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ -#+# #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# -######## ### ########## ### #### ### ### ########### ######## - -Application Version: ${core.version} diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/flow.el.xml b/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/flow.el.xml deleted file mode 100644 index 049210cf4a9bb8bbf39ab1178b9b49cb321c0243..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/flow.el.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - THEN(a, b, c); - - \ No newline at end of file diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/hospital-config.properties b/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/hospital-config.properties deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/sys-config.properties b/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/sys-config.properties deleted file mode 100644 index b57fd4e8ad1fdeac6535b84781a577b6faa22ece..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/config/sys-config.properties +++ /dev/null @@ -1,21 +0,0 @@ -# ???????? -dev.address=http://88.9.0.126:8080 -dev.time=600 -dev.isEncrypt=false - -# ???????? -prod.address=http://ddjk.jlhs.gov.cn:20215 -prod.time=600 -prod.isEncrypt=true - - -dev.cliPubKey=PubKey -dev.cliPrvKey=PrvKey -dev.clientId=Id -dev.filePath="C:/Users/user/Desktop/" - -prod.cliPubKey=PubKey2 -prod.cliPrvKey=PrvKey2 -prod.clientId=Id2 -prod.filePath="C:/Users/user/Desktop/" -prod.eleAddress=http://10.49.24.194:8080/epc/api/ diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/logback.xml b/openhis-server-new/openhis-einvoiceapp/src/main/resources/logback.xml deleted file mode 100644 index d534b70b818e4e72a443d9b352cd6d952c7c4958..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/logback.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - ${log.pattern} - - - - - - ${log.path}/sys-info.log - - - - ${log.path}/sys-info.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - INFO - - ACCEPT - - DENY - - - - - ${log.path}/sys-error.log - - - - ${log.path}/sys-error.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - ERROR - - ACCEPT - - DENY - - - - - - ${log.path}/sys-user.log - - - ${log.path}/sys-user.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - - - - ${log.path}/e-invoice-service.log - - - ${log.path}/e-invoice-service.%d{yyyy-MM-dd}.log - 60 - - - ${log.pattern} - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/openhis-server-new/openhis-einvoiceapp/src/main/resources/mybatis/mybatis-config.xml b/openhis-server-new/openhis-einvoiceapp/src/main/resources/mybatis/mybatis-config.xml deleted file mode 100644 index c39d4382117f59778e72bb6252e6823a32e625b7..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-einvoiceapp/src/main/resources/mybatis/mybatis-config.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/openhis-server-new/openhis-miniapp/pom.xml b/openhis-server-new/openhis-miniapp/pom.xml deleted file mode 100644 index 7b2515739051683194a7ce59638e7ebb1a0f7034..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - com.openhis - openhis-server - 0.0.1-SNAPSHOT - - - 4.0.0 - openhis-miniapp - 0.0.1-SNAPSHOT - - - 小程序应用 - - - - - - - com.openhis - openhis-domain - 0.0.1-SNAPSHOT - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - 2.5.15 - - true - - - - - repackage - - - - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - false - ${project.artifactId} - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - ${project.artifactId} - - - diff --git a/openhis-server-new/openhis-miniapp/src/main/java/com/openhis/OpenHisMiniApp.java b/openhis-server-new/openhis-miniapp/src/main/java/com/openhis/OpenHisMiniApp.java deleted file mode 100644 index 08547d6d95b0048b0fabc9656f192f109b21bf0f..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/java/com/openhis/OpenHisMiniApp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.openhis; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.core.env.Environment; - -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"}) -public class OpenHisMiniApp { - public static void main(String[] args) throws UnknownHostException { - // System.setProperty("spring.devtools.restart.enabled", "false"); - ConfigurableApplicationContext application = SpringApplication.run(OpenHisMiniApp.class, args); - Environment env = application.getEnvironment(); - String ip = InetAddress.getLocalHost().getHostAddress(); - String port = env.getProperty("server.port"); - String path = env.getProperty("server.servlet.context-path"); - System.out.println("\n----------------------------------------------------------\n\t" - + "Application OpenHis is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port + path - + "/\n\t" + "External: \thttp://" + ip + ":" + port + path + "/\n" - + "----------------------------------------------------------"); - } -} diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/META-INF/spring-devtools.properties b/openhis-server-new/openhis-miniapp/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index 37e7b5806ee4a61e35699d6f114f906efad2e500..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.json=/com.alibaba.fastjson2.*.jar \ No newline at end of file diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/application-druid.yml b/openhis-server-new/openhis-miniapp/src/main/resources/application-druid.yml deleted file mode 100644 index aedc76396359d71b3c29b64b9746a121ace53de9..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/application-druid.yml +++ /dev/null @@ -1,61 +0,0 @@ -# 数据源配置 -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: org.postgresql.Driver - druid: - # 主库数据源 - master: - url: jdbc:postgresql://od32215110g.vicp.fun:15008/openhis?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 - username: postgres - password: root - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置连接超时时间 - connectTimeout: 30000 - # 配置网络超时时间 - socketTimeout: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - # 配置一个连接在池中最大生存的时间,单位是毫秒 - maxEvictableIdleTimeMillis: 900000 - # 配置检测连接是否有效 - validationQuery: SELECT 1 # FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 设置白名单,不填则允许所有访问 - allow: - url-pattern: /druid/* - # 控制台管理用户名和密码 - login-username: openhis - login-password: 123456 - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/application.yml b/openhis-server-new/openhis-miniapp/src/main/resources/application.yml deleted file mode 100644 index f07ee76f60548ab4c5e1443a3a5ba8eaf27ca82c..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/application.yml +++ /dev/null @@ -1,149 +0,0 @@ -# 项目相关配置 -core: - # 名称 - name: OpenHis-MiniApp - # 版本 - version: 0.0.1 - # 版权年份 - copyrightYear: 2025 - # 文件路径 - profile: D:/home/uploadPath - # 获取ip地址开关 - addressEnabled: false - # 验证码类型 math 数字计算 char 字符验证 - captchaType: math - -# 开发环境配置 -server: - # 服务器的HTTP端口,默认为18080,此服务为18081 - port: 18081 - servlet: - # 应用的访问路径 - context-path: /openhis - tomcat: - # tomcat的URI编码 - uri-encoding: UTF-8 - # 连接数满后的排队数,默认为100 - accept-count: 1000 - threads: - # tomcat最大线程数,默认为200 - max: 800 - # Tomcat启动初始化的线程数,默认值10 - min-spare: 100 - -# 日志配置 -logging: - level: - com.openhis: debug - org.springframework: warn - -# 用户配置 -user: - password: - # 密码最大错误次数 - maxRetryCount: 5 - # 密码锁定时间(默认10分钟) - lockTime: 10 - -# Spring配置 -spring: - main: - allow-circular-references: true - # 资源信息 - messages: - # 国际化资源文件路径 - basename: i18n/messages - profiles: - active: druid - # 文件上传 - servlet: - multipart: - # 单个文件大小 - max-file-size: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB - # 服务模块 - devtools: - restart: - # 热部署开关 - enabled: true - # redis 配置 - redis: - # 地址 - host: 192.168.30.199 - # 端口,默认为6379 - port: 6379 - # 数据库索引 - database: 2 - # 密码 - password: redis - # 连接超时时间 - timeout: 10s - lettuce: - pool: - # 连接池中的最小空闲连接 - min-idle: 0 - # 连接池中的最大空闲连接 - max-idle: 8 - # 连接池的最大数据库连接数 - max-active: 8 - # #连接池最大阻塞等待时间(使用负值表示没有限制) - max-wait: -1ms - # 文言 - messages: - basename: i18n/general_message/messages - encoding: utf-8 - -# token配置 -token: - # 令牌自定义标识 - header: Authorization - # 令牌密钥 - secret: abcdefghijklmnopqrstuvwxyz - # 令牌有效期(默认30分钟) - expireTime: 30 - -# MyBatis配置 -mybatis-plus: - # 搜索指定包别名 - typeAliasesPackage: com.core.**.domain,com.openhis.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml - -# PageHelper分页插件 -pagehelper: - #helperDialect: mysql - supportMethodsArguments: true - params: count=countSql - # 分页插件会自动检测当前的数据库链接,自动选择合适的分页方式 - auto-dialect: true - # 默认值为 false。设置为 true 时,允许在运行时根据多数据源自动识别对应方言的分页 - auto-runtime-dialect: true - -# Swagger配置 -swagger: - # 是否开启swagger - enabled: true - # 请求前缀 - pathMapping: /dev-api - -# 防止XSS攻击 -xss: - # 过滤开关 - enabled: true - # 排除链接(多个用逗号分隔) - excludes: /system/notice - # 匹配链接 - urlPatterns: /system/*,/monitor/*,/tool/* - -# flowable相关表 -flowable: - # true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用) - database-schema-update: false - # 关闭定时任务JOB - async-executor-activate: false - - - diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/banner.txt b/openhis-server-new/openhis-miniapp/src/main/resources/banner.txt deleted file mode 100644 index 2e99e749e9269bed23d46fec3c5da4c96be6bc73..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/banner.txt +++ /dev/null @@ -1,10 +0,0 @@ - - :::::::: ::::::::: :::::::::: :::: ::: ::: ::: ::::::::::: :::::::: ::: ::: ::::::::::: :::: ::: ::::::::::: ::: ::::::::: ::::::::: - :+: :+: :+: :+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+:+: :+:+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: - +:+ +:+ +:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ - +#+ +:+ +#++:++#+ +#++:++# +#+ +:+ +#+ +#++:++#++ +#+ +#++:++#++ +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#++:++#++: +#++:++#+ +#++:++#+ - +#+ +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ -#+# #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# -######## ### ########## ### #### ### ### ########### ######## ### ### ########### ### #### ########### ### ### ### ### - -Application Version: ${core.version} diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/i18n/messages.properties b/openhis-server-new/openhis-miniapp/src/main/resources/i18n/messages.properties deleted file mode 100644 index 4550ad8169580f18c081db46ea6c21d8bd22c10a..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/i18n/messages.properties +++ /dev/null @@ -1,46 +0,0 @@ -#错误消息 -not.null=* 必须填写 -user.jcaptcha.error=验证码错误 -user.jcaptcha.expire=验证码已失效 -user.not.exists=用户不存在/密码错误 -user.password.not.match=用户不存在/密码错误 -user.password.retry.limit.count=密码输入错误{0}次 -user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 -user.password.delete=对不起,您的账号已被删除 -user.blocked=用户已封禁,请联系管理员 -role.blocked=角色已封禁,请联系管理员 -login.blocked=很遗憾,访问IP已被列入系统黑名单 -user.logout.success=退出成功 -length.not.valid=长度必须在{min}到{max}个字符之间 -user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 -user.password.not.valid=* 5-50个字符 -user.email.not.valid=邮箱格式错误 -user.mobile.phone.number.not.valid=手机号格式错误 -user.login.success=登录成功 -user.register.success=注册成功 -user.notfound=请重新登录 -user.forcelogout=管理员强制退出,请重新登录 -user.unknown.error=未知错误,请重新登录 -##文件上传消息 -upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! -upload.filename.exceed.length=上传的文件名最长{0}个字符 -##权限 -no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] -no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] -no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] -no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] -no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] -no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] - - - -apl.common.M00001={0}添加成功 -apl.common.M00002={0}保存成功 -apl.common.M00003={0}已经存在 -apl.common.M00004={0}操作成功 -apl.common.M00005={0}删除成功 -apl.common.M00006=操作失败,该数据已被他人删除,请刷新后重试 -apl.common.M00007=操作失败,该数据已被他人更改,请刷新后重试 -apl.common.M00008=请勿重复提交 -apl.common.M00009=查询成功 -apl.common.M00010=操作失败,请联系管理员 diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/logback.xml b/openhis-server-new/openhis-miniapp/src/main/resources/logback.xml deleted file mode 100644 index bc63c1094e18d1fd4b3e94f5e0e1c3332b11575f..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/logback.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - ${log.pattern} - - - - - - ${log.path}/sys-info.log - - - - ${log.path}/sys-info.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - INFO - - ACCEPT - - DENY - - - - - ${log.path}/sys-error.log - - - - ${log.path}/sys-error.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - ERROR - - ACCEPT - - DENY - - - - - - ${log.path}/sys-user.log - - - ${log.path}/sys-user.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/openhis-server-new/openhis-miniapp/src/main/resources/mybatis/mybatis-config.xml b/openhis-server-new/openhis-miniapp/src/main/resources/mybatis/mybatis-config.xml deleted file mode 100644 index c39d4382117f59778e72bb6252e6823a32e625b7..0000000000000000000000000000000000000000 --- a/openhis-server-new/openhis-miniapp/src/main/resources/mybatis/mybatis-config.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/openhis-server-new/package-lock.json b/openhis-server-new/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..9a7a49f3ba9d66086afec7ff2cc8c6ceecdbe527 --- /dev/null +++ b/openhis-server-new/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "openhis-server", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/openhis-server-new/pom.xml b/openhis-server-new/pom.xml index 00cba8427714de080a54e1337f961bc3800d2714..61e75d4e3160bd473b7be2516be3ec096c8ad8a2 100644 --- a/openhis-server-new/pom.xml +++ b/openhis-server-new/pom.xml @@ -300,7 +300,6 @@ - openhis-miniapp openhis-application openhis-domain openhis-common diff --git a/openhis-ui-vue3/.gitignore b/openhis-ui-vue3/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b4d19a6feba680880ec5ce284ef84608fea5779f --- /dev/null +++ b/openhis-ui-vue3/.gitignore @@ -0,0 +1,24 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +**/*.log + +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local + +package-lock.json +yarn.lock +vite.config.js diff --git a/openhis-ui-vue3/HospitalRecordForm.vue b/openhis-ui-vue3/HospitalRecordForm.vue new file mode 100644 index 0000000000000000000000000000000000000000..66fbfcad4bfccee73991b4cf36db5b358b8f2d78 --- /dev/null +++ b/openhis-ui-vue3/HospitalRecordForm.vue @@ -0,0 +1,116 @@ + +// 表单数据 +const formData = reactive({ + admission: { + confirmDate: '2023年10月28日', + dischargeTime: '2023年11月13日 08时14分', + hospitalDays: '17' + }, + diagnosis: { + mainDiagnosis: '腰椎间盘突出症(L4-5)', + otherDiagnosis: '' + } +}); + +// 打印表单 +const printForm = () => { + // 创建一个新的打印窗口 + const printWindow = window.open('', '_blank'); + + // 构建打印内容 + const printContent = ` + + + + 住院病案首页 + + + +
+
吉林大学第一医院
+
+
+
组织机构代码:(${formData.hospital.orgCode || ''})
+
医疗付费方式:(${formData.hospital.paymentMethod || ''})
+
+
+ 住院病案首页 +
+
+
+
+ + + + +
+
住院信息
+
+
+ +
${formData.admission.admitTime || ''}
+
+
+ +
${formData.admission.departmentAdmitTime || ''}
+
+
+ +
${formData.admission.dischargeTime || ''}
+
+
+
+
+ +
${formData.admission.hospitalDays || ''}
+
+
+
+ + + + + + + + `; + + // 将内容写入打印窗口并打印 + printWindow.document.write(printContent); + printWindow.document.close(); +}; diff --git a/openhis-ui-vue3/package-lock.json b/openhis-ui-vue3/package-lock.json index e8b1fcb0550b41b258a41b58a48d3a87d0dc9841..245d498b4e82da7f83b2473dd854fed4ac76ac63 100644 --- a/openhis-ui-vue3/package-lock.json +++ b/openhis-ui-vue3/package-lock.json @@ -58,18 +58,23 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, "node_modules/@babel/helper-string-parser": { "version": "7.25.9", "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", @@ -79,19 +84,19 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.27.0.tgz", - "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", + "version": "7.26.10", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", "dependencies": { - "@babel/types": "^7.27.0" + "@babel/types": "^7.26.10" }, "bin": { "parser": "bin/babel-parser.js" @@ -101,20 +106,17 @@ } }, "node_modules/@babel/runtime": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.27.0.tgz", - "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.27.0.tgz", - "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", + "version": "7.26.10", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -627,9 +629,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.38.0.tgz", - "integrity": "sha512-ldomqc4/jDZu/xpYU+aRxo3V4mGCV9HeTgUBANI3oIQMOL+SsxB+S2lxMpkFp5UamSS3XuTMQVbsS24R4J4Qjg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.35.0.tgz", + "integrity": "sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==", "cpu": [ "arm" ], @@ -640,9 +642,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.38.0.tgz", - "integrity": "sha512-VUsgcy4GhhT7rokwzYQP+aV9XnSLkkhlEJ0St8pbasuWO/vwphhZQxYEKUP3ayeCYLhk6gEtacRpYP/cj3GjyQ==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.35.0.tgz", + "integrity": "sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==", "cpu": [ "arm64" ], @@ -653,9 +655,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.38.0.tgz", - "integrity": "sha512-buA17AYXlW9Rn091sWMq1xGUvWQFOH4N1rqUxGJtEQzhChxWjldGCCup7r/wUnaI6Au8sKXpoh0xg58a7cgcpg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.35.0.tgz", + "integrity": "sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==", "cpu": [ "arm64" ], @@ -666,9 +668,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.38.0.tgz", - "integrity": "sha512-Mgcmc78AjunP1SKXl624vVBOF2bzwNWFPMP4fpOu05vS0amnLcX8gHIge7q/lDAHy3T2HeR0TqrriZDQS2Woeg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.35.0.tgz", + "integrity": "sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==", "cpu": [ "x64" ], @@ -679,9 +681,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.38.0.tgz", - "integrity": "sha512-zzJACgjLbQTsscxWqvrEQAEh28hqhebpRz5q/uUd1T7VTwUNZ4VIXQt5hE7ncs0GrF+s7d3S4on4TiXUY8KoQA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.35.0.tgz", + "integrity": "sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==", "cpu": [ "arm64" ], @@ -692,9 +694,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.38.0.tgz", - "integrity": "sha512-hCY/KAeYMCyDpEE4pTETam0XZS4/5GXzlLgpi5f0IaPExw9kuB+PDTOTLuPtM10TlRG0U9OSmXJ+Wq9J39LvAg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.35.0.tgz", + "integrity": "sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==", "cpu": [ "x64" ], @@ -705,9 +707,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.38.0.tgz", - "integrity": "sha512-mimPH43mHl4JdOTD7bUMFhBdrg6f9HzMTOEnzRmXbOZqjijCw8LA5z8uL6LCjxSa67H2xiLFvvO67PT05PRKGg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.35.0.tgz", + "integrity": "sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==", "cpu": [ "arm" ], @@ -718,9 +720,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.38.0.tgz", - "integrity": "sha512-tPiJtiOoNuIH8XGG8sWoMMkAMm98PUwlriOFCCbZGc9WCax+GLeVRhmaxjJtz6WxrPKACgrwoZ5ia/uapq3ZVg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.35.0.tgz", + "integrity": "sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==", "cpu": [ "arm" ], @@ -731,9 +733,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.38.0.tgz", - "integrity": "sha512-wZco59rIVuB0tjQS0CSHTTUcEde+pXQWugZVxWaQFdQQ1VYub/sTrNdY76D1MKdN2NB48JDuGABP6o6fqos8mA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.35.0.tgz", + "integrity": "sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A==", "cpu": [ "arm64" ], @@ -744,9 +746,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.38.0.tgz", - "integrity": "sha512-fQgqwKmW0REM4LomQ+87PP8w8xvU9LZfeLBKybeli+0yHT7VKILINzFEuggvnV9M3x1Ed4gUBmGUzCo/ikmFbQ==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.35.0.tgz", + "integrity": "sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==", "cpu": [ "arm64" ], @@ -757,9 +759,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.38.0.tgz", - "integrity": "sha512-hz5oqQLXTB3SbXpfkKHKXLdIp02/w3M+ajp8p4yWOWwQRtHWiEOCKtc9U+YXahrwdk+3qHdFMDWR5k+4dIlddg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.35.0.tgz", + "integrity": "sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==", "cpu": [ "loong64" ], @@ -770,9 +772,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.38.0.tgz", - "integrity": "sha512-NXqygK/dTSibQ+0pzxsL3r4Xl8oPqVoWbZV9niqOnIHV/J92fe65pOir0xjkUZDRSPyFRvu+4YOpJF9BZHQImw==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.35.0.tgz", + "integrity": "sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==", "cpu": [ "ppc64" ], @@ -783,22 +785,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.38.0.tgz", - "integrity": "sha512-GEAIabR1uFyvf/jW/5jfu8gjM06/4kZ1W+j1nWTSSB3w6moZEBm7iBtzwQ3a1Pxos2F7Gz+58aVEnZHU295QTg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.38.0.tgz", - "integrity": "sha512-9EYTX+Gus2EGPbfs+fh7l95wVADtSQyYw4DfSBcYdUEAmP2lqSZY0Y17yX/3m5VKGGJ4UmIH5LHLkMJft3bYoA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.35.0.tgz", + "integrity": "sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==", "cpu": [ "riscv64" ], @@ -809,9 +798,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.38.0.tgz", - "integrity": "sha512-Mpp6+Z5VhB9VDk7RwZXoG2qMdERm3Jw07RNlXHE0bOnEeX+l7Fy4bg+NxfyN15ruuY3/7Vrbpm75J9QHFqj5+Q==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.35.0.tgz", + "integrity": "sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==", "cpu": [ "s390x" ], @@ -822,9 +811,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.38.0.tgz", - "integrity": "sha512-vPvNgFlZRAgO7rwncMeE0+8c4Hmc+qixnp00/Uv3ht2x7KYrJ6ERVd3/R0nUtlE6/hu7/HiiNHJ/rP6knRFt1w==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.35.0.tgz", + "integrity": "sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==", "cpu": [ "x64" ], @@ -835,9 +824,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.38.0.tgz", - "integrity": "sha512-q5Zv+goWvQUGCaL7fU8NuTw8aydIL/C9abAVGCzRReuj5h30TPx4LumBtAidrVOtXnlB+RZkBtExMsfqkMfb8g==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.35.0.tgz", + "integrity": "sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg==", "cpu": [ "x64" ], @@ -848,9 +837,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.38.0.tgz", - "integrity": "sha512-u/Jbm1BU89Vftqyqbmxdq14nBaQjQX1HhmsdBWqSdGClNaKwhjsg5TpW+5Ibs1mb8Es9wJiMdl86BcmtUVXNZg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.35.0.tgz", + "integrity": "sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==", "cpu": [ "arm64" ], @@ -861,9 +850,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.38.0.tgz", - "integrity": "sha512-mqu4PzTrlpNHHbu5qleGvXJoGgHpChBlrBx/mEhTPpnAL1ZAYFlvHD7rLK839LLKQzqEQMFJfGrrOHItN4ZQqA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.35.0.tgz", + "integrity": "sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==", "cpu": [ "ia32" ], @@ -874,9 +863,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.38.0.tgz", - "integrity": "sha512-jjqy3uWlecfB98Psxb5cD6Fny9Fupv9LrDSPTQZUROqjvZmcCqNu4UMl7qqhlUUGpwiAkotj6GYu4SZdcr/nLw==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.35.0.tgz", + "integrity": "sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==", "cpu": [ "x64" ], @@ -901,9 +890,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.7", - "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/lodash": { @@ -920,9 +909,9 @@ } }, "node_modules/@types/node": { - "version": "22.13.15", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.13.15.tgz", - "integrity": "sha512-imAbQEEbVni6i6h6Bd5xkCRwLqFc8hihCsi2GbtDoAtUcAFQ6Zs4pFXTZUUbroTkXdImczWM9AI8eZUuybXE3w==", + "version": "22.13.10", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.13.10.tgz", + "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "dev": true, "dependencies": { "undici-types": "~6.20.0" @@ -1681,11 +1670,6 @@ "node": ">=10.0.0" } }, - "node_modules/canvg/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", @@ -1831,14 +1815,11 @@ } }, "node_modules/commander": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz", - "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", - "dependencies": { - "keypress": "0.1.x" - }, + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "engines": { - "node": ">= 0.6.x" + "node": ">= 10" } }, "node_modules/component-emitter": { @@ -1856,6 +1837,20 @@ "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", "dev": true }, + "node_modules/copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmmirror.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -2192,14 +2187,6 @@ "node": ">=12" } }, - "node_modules/d3-dsv/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "engines": { - "node": ">= 10" - } - }, "node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/d3-ease/-/d3-ease-3.0.1.tgz", @@ -2836,6 +2823,20 @@ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.2.tgz", @@ -4194,6 +4195,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmmirror.com/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/is-windows/-/is-windows-1.0.2.tgz", @@ -4241,9 +4250,10 @@ } }, "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "version": "9.0.1", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true }, "node_modules/jsbarcode": { "version": "3.12.1", @@ -4315,6 +4325,34 @@ "node": ">=0.10.0" } }, + "node_modules/less": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/less/-/less-4.2.2.tgz", + "integrity": "sha512-tkuLHQlvWUTeQ3doAqnHbNn8T6WX1KA8yvbKG9x4VtKtIjHsVKQZCH11zRgAfbDAXC2UNIg/K9BYAAcEzUIrNg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "copy-anything": "^2.0.1", + "parse-node-version": "^1.0.1", + "tslib": "^2.3.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "source-map": "~0.6.0" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -4394,6 +4432,21 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/map-cache": { "version": "0.2.2", "resolved": "https://registry.npmmirror.com/map-cache/-/map-cache-0.2.2.tgz", @@ -4468,6 +4521,20 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", @@ -4562,9 +4629,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.9", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.9.tgz", + "integrity": "sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg==", "funding": [ { "type": "github", @@ -4656,6 +4723,24 @@ "node": ">=0.10.0" } }, + "node_modules/needle": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4899,6 +4984,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmmirror.com/pascalcase/-/pascalcase-0.1.1.tgz", @@ -4949,6 +5045,17 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pinia": { "version": "2.1.7", "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.1.7.tgz", @@ -5029,6 +5136,17 @@ } } }, + "node_modules/pinyin/node_modules/commander": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz", + "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", + "dependencies": { + "keypress": "0.1.x" + }, + "engines": { + "node": ">= 0.6.x" + } + }, "node_modules/pkg-types": { "version": "1.3.1", "resolved": "https://registry.npmmirror.com/pkg-types/-/pkg-types-1.3.1.tgz", @@ -5172,10 +5290,18 @@ "@province-city-china/types": "8.5.8" } }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/quansync": { - "version": "0.2.10", - "resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.10.tgz", - "integrity": "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==", + "version": "0.2.8", + "resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.8.tgz", + "integrity": "sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==", "dev": true, "funding": [ { @@ -5319,9 +5445,9 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + "version": "0.13.11", + "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "node_modules/regex-not": { "version": "1.0.2", @@ -5473,12 +5599,12 @@ "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" }, "node_modules/rollup": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.38.0.tgz", - "integrity": "sha512-5SsIRtJy9bf1ErAOiFMFzl64Ex9X5V7bnJ+WlFMb+zmP459OSWCEG7b0ERZ+PEU7xPt4OG3RHbrp1LJlXxYTrw==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.35.0.tgz", + "integrity": "sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==", "dev": true, "dependencies": { - "@types/estree": "1.0.7" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -5488,26 +5614,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.38.0", - "@rollup/rollup-android-arm64": "4.38.0", - "@rollup/rollup-darwin-arm64": "4.38.0", - "@rollup/rollup-darwin-x64": "4.38.0", - "@rollup/rollup-freebsd-arm64": "4.38.0", - "@rollup/rollup-freebsd-x64": "4.38.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.38.0", - "@rollup/rollup-linux-arm-musleabihf": "4.38.0", - "@rollup/rollup-linux-arm64-gnu": "4.38.0", - "@rollup/rollup-linux-arm64-musl": "4.38.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.38.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.38.0", - "@rollup/rollup-linux-riscv64-gnu": "4.38.0", - "@rollup/rollup-linux-riscv64-musl": "4.38.0", - "@rollup/rollup-linux-s390x-gnu": "4.38.0", - "@rollup/rollup-linux-x64-gnu": "4.38.0", - "@rollup/rollup-linux-x64-musl": "4.38.0", - "@rollup/rollup-win32-arm64-msvc": "4.38.0", - "@rollup/rollup-win32-ia32-msvc": "4.38.0", - "@rollup/rollup-win32-x64-msvc": "4.38.0", + "@rollup/rollup-android-arm-eabi": "4.35.0", + "@rollup/rollup-android-arm64": "4.35.0", + "@rollup/rollup-darwin-arm64": "4.35.0", + "@rollup/rollup-darwin-x64": "4.35.0", + "@rollup/rollup-freebsd-arm64": "4.35.0", + "@rollup/rollup-freebsd-x64": "4.35.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.35.0", + "@rollup/rollup-linux-arm-musleabihf": "4.35.0", + "@rollup/rollup-linux-arm64-gnu": "4.35.0", + "@rollup/rollup-linux-arm64-musl": "4.35.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.35.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.35.0", + "@rollup/rollup-linux-riscv64-gnu": "4.35.0", + "@rollup/rollup-linux-s390x-gnu": "4.35.0", + "@rollup/rollup-linux-x64-gnu": "4.35.0", + "@rollup/rollup-linux-x64-musl": "4.35.0", + "@rollup/rollup-win32-arm64-msvc": "4.35.0", + "@rollup/rollup-win32-ia32-msvc": "4.35.0", + "@rollup/rollup-win32-x64-msvc": "4.35.0", "fsevents": "~2.3.2" } }, @@ -5654,6 +5779,14 @@ "node": ">=14.0.0" } }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/scule": { "version": "1.3.0", "resolved": "https://registry.npmmirror.com/scule/-/scule-1.3.0.tgz", @@ -5668,6 +5801,17 @@ "preval.macro": "^4.0.0" } }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz", @@ -6205,12 +6349,6 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/strip-literal/node_modules/js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", - "dev": true - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", @@ -6478,15 +6616,6 @@ "node": ">=10.13.0" } }, - "node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/text-segmentation": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/text-segmentation/-/text-segmentation-1.0.3.tgz", @@ -7000,9 +7129,9 @@ } }, "node_modules/v-dropdown": { - "version": "3.4.0", - "resolved": "https://registry.npmmirror.com/v-dropdown/-/v-dropdown-3.4.0.tgz", - "integrity": "sha512-wgMb9P2jNhwrCVdD4ckcuou2XivK0ac9XNUH4cXithWMi4LRdOYgNNoT/Gl9ltXaIdO0I7izxpOZG/ddRJUkow==", + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/v-dropdown/-/v-dropdown-3.3.0.tgz", + "integrity": "sha512-OkNipbg+V4vQ6xyYLxTk+WQOs3A17nXtoqY9kqHRSAXnpE6mlwdsxar/qIgAAbhDpF0RYI8v4p75809S6ch+Rg==", "dependencies": { "vue": "^3.5.13" }, @@ -7435,13 +7564,20 @@ "dev": true }, "@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "requires": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + } } }, "@babel/helper-string-parser": { @@ -7450,30 +7586,27 @@ "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==" }, "@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==" + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==" }, "@babel/parser": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.27.0.tgz", - "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", + "version": "7.26.10", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", "requires": { - "@babel/types": "^7.27.0" + "@babel/types": "^7.26.10" } }, "@babel/runtime": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.27.0.tgz", - "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", - "requires": { - "regenerator-runtime": "^0.14.0" - } + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==" }, "@babel/types": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.27.0.tgz", - "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", + "version": "7.26.10", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", "requires": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -7740,142 +7873,135 @@ } }, "@rollup/rollup-android-arm-eabi": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.38.0.tgz", - "integrity": "sha512-ldomqc4/jDZu/xpYU+aRxo3V4mGCV9HeTgUBANI3oIQMOL+SsxB+S2lxMpkFp5UamSS3XuTMQVbsS24R4J4Qjg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.35.0.tgz", + "integrity": "sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==", "dev": true, "optional": true }, "@rollup/rollup-android-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.38.0.tgz", - "integrity": "sha512-VUsgcy4GhhT7rokwzYQP+aV9XnSLkkhlEJ0St8pbasuWO/vwphhZQxYEKUP3ayeCYLhk6gEtacRpYP/cj3GjyQ==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.35.0.tgz", + "integrity": "sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==", "dev": true, "optional": true }, "@rollup/rollup-darwin-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.38.0.tgz", - "integrity": "sha512-buA17AYXlW9Rn091sWMq1xGUvWQFOH4N1rqUxGJtEQzhChxWjldGCCup7r/wUnaI6Au8sKXpoh0xg58a7cgcpg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.35.0.tgz", + "integrity": "sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==", "dev": true, "optional": true }, "@rollup/rollup-darwin-x64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.38.0.tgz", - "integrity": "sha512-Mgcmc78AjunP1SKXl624vVBOF2bzwNWFPMP4fpOu05vS0amnLcX8gHIge7q/lDAHy3T2HeR0TqrriZDQS2Woeg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.35.0.tgz", + "integrity": "sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==", "dev": true, "optional": true }, "@rollup/rollup-freebsd-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.38.0.tgz", - "integrity": "sha512-zzJACgjLbQTsscxWqvrEQAEh28hqhebpRz5q/uUd1T7VTwUNZ4VIXQt5hE7ncs0GrF+s7d3S4on4TiXUY8KoQA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.35.0.tgz", + "integrity": "sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==", "dev": true, "optional": true }, "@rollup/rollup-freebsd-x64": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.38.0.tgz", - "integrity": "sha512-hCY/KAeYMCyDpEE4pTETam0XZS4/5GXzlLgpi5f0IaPExw9kuB+PDTOTLuPtM10TlRG0U9OSmXJ+Wq9J39LvAg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.35.0.tgz", + "integrity": "sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.38.0.tgz", - "integrity": "sha512-mimPH43mHl4JdOTD7bUMFhBdrg6f9HzMTOEnzRmXbOZqjijCw8LA5z8uL6LCjxSa67H2xiLFvvO67PT05PRKGg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.35.0.tgz", + "integrity": "sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm-musleabihf": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.38.0.tgz", - "integrity": "sha512-tPiJtiOoNuIH8XGG8sWoMMkAMm98PUwlriOFCCbZGc9WCax+GLeVRhmaxjJtz6WxrPKACgrwoZ5ia/uapq3ZVg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.35.0.tgz", + "integrity": "sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.38.0.tgz", - "integrity": "sha512-wZco59rIVuB0tjQS0CSHTTUcEde+pXQWugZVxWaQFdQQ1VYub/sTrNdY76D1MKdN2NB48JDuGABP6o6fqos8mA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.35.0.tgz", + "integrity": "sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm64-musl": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.38.0.tgz", - "integrity": "sha512-fQgqwKmW0REM4LomQ+87PP8w8xvU9LZfeLBKybeli+0yHT7VKILINzFEuggvnV9M3x1Ed4gUBmGUzCo/ikmFbQ==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.35.0.tgz", + "integrity": "sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==", "dev": true, "optional": true }, "@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.38.0.tgz", - "integrity": "sha512-hz5oqQLXTB3SbXpfkKHKXLdIp02/w3M+ajp8p4yWOWwQRtHWiEOCKtc9U+YXahrwdk+3qHdFMDWR5k+4dIlddg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.35.0.tgz", + "integrity": "sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==", "dev": true, "optional": true }, "@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.38.0.tgz", - "integrity": "sha512-NXqygK/dTSibQ+0pzxsL3r4Xl8oPqVoWbZV9niqOnIHV/J92fe65pOir0xjkUZDRSPyFRvu+4YOpJF9BZHQImw==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.35.0.tgz", + "integrity": "sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==", "dev": true, "optional": true }, "@rollup/rollup-linux-riscv64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.38.0.tgz", - "integrity": "sha512-GEAIabR1uFyvf/jW/5jfu8gjM06/4kZ1W+j1nWTSSB3w6moZEBm7iBtzwQ3a1Pxos2F7Gz+58aVEnZHU295QTg==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-riscv64-musl": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.38.0.tgz", - "integrity": "sha512-9EYTX+Gus2EGPbfs+fh7l95wVADtSQyYw4DfSBcYdUEAmP2lqSZY0Y17yX/3m5VKGGJ4UmIH5LHLkMJft3bYoA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.35.0.tgz", + "integrity": "sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==", "dev": true, "optional": true }, "@rollup/rollup-linux-s390x-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.38.0.tgz", - "integrity": "sha512-Mpp6+Z5VhB9VDk7RwZXoG2qMdERm3Jw07RNlXHE0bOnEeX+l7Fy4bg+NxfyN15ruuY3/7Vrbpm75J9QHFqj5+Q==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.35.0.tgz", + "integrity": "sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==", "dev": true, "optional": true }, "@rollup/rollup-linux-x64-gnu": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.38.0.tgz", - "integrity": "sha512-vPvNgFlZRAgO7rwncMeE0+8c4Hmc+qixnp00/Uv3ht2x7KYrJ6ERVd3/R0nUtlE6/hu7/HiiNHJ/rP6knRFt1w==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.35.0.tgz", + "integrity": "sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==", "dev": true, "optional": true }, "@rollup/rollup-linux-x64-musl": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.38.0.tgz", - "integrity": "sha512-q5Zv+goWvQUGCaL7fU8NuTw8aydIL/C9abAVGCzRReuj5h30TPx4LumBtAidrVOtXnlB+RZkBtExMsfqkMfb8g==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.35.0.tgz", + "integrity": "sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg==", "dev": true, "optional": true }, "@rollup/rollup-win32-arm64-msvc": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.38.0.tgz", - "integrity": "sha512-u/Jbm1BU89Vftqyqbmxdq14nBaQjQX1HhmsdBWqSdGClNaKwhjsg5TpW+5Ibs1mb8Es9wJiMdl86BcmtUVXNZg==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.35.0.tgz", + "integrity": "sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==", "dev": true, "optional": true }, "@rollup/rollup-win32-ia32-msvc": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.38.0.tgz", - "integrity": "sha512-mqu4PzTrlpNHHbu5qleGvXJoGgHpChBlrBx/mEhTPpnAL1ZAYFlvHD7rLK839LLKQzqEQMFJfGrrOHItN4ZQqA==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.35.0.tgz", + "integrity": "sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==", "dev": true, "optional": true }, "@rollup/rollup-win32-x64-msvc": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.38.0.tgz", - "integrity": "sha512-jjqy3uWlecfB98Psxb5cD6Fny9Fupv9LrDSPTQZUROqjvZmcCqNu4UMl7qqhlUUGpwiAkotj6GYu4SZdcr/nLw==", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.35.0.tgz", + "integrity": "sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==", "dev": true, "optional": true }, @@ -7891,9 +8017,9 @@ "dev": true }, "@types/estree": { - "version": "1.0.7", - "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "@types/lodash": { @@ -7910,9 +8036,9 @@ } }, "@types/node": { - "version": "22.13.15", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.13.15.tgz", - "integrity": "sha512-imAbQEEbVni6i6h6Bd5xkCRwLqFc8hihCsi2GbtDoAtUcAFQ6Zs4pFXTZUUbroTkXdImczWM9AI8eZUuybXE3w==", + "version": "22.13.10", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.13.10.tgz", + "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "dev": true, "requires": { "undici-types": "~6.20.0" @@ -8496,13 +8622,6 @@ "rgbcolor": "^1.0.1", "stackblur-canvas": "^2.0.0", "svg-pathdata": "^6.0.3" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - } } }, "chalk": { @@ -8614,12 +8733,9 @@ } }, "commander": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz", - "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", - "requires": { - "keypress": "0.1.x" - } + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" }, "component-emitter": { "version": "1.3.1", @@ -8633,6 +8749,17 @@ "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", "dev": true }, + "copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "is-what": "^3.14.1" + } + }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmmirror.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -8875,13 +9002,6 @@ "commander": "7", "iconv-lite": "0.6", "rw": "1" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" - } } }, "d3-ease": { @@ -9338,6 +9458,17 @@ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "prr": "~1.0.1" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.2.tgz", @@ -10312,6 +10443,14 @@ "get-intrinsic": "^1.2.6" } }, + "is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmmirror.com/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", + "dev": true, + "optional": true, + "peer": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/is-windows/-/is-windows-1.0.2.tgz", @@ -10350,9 +10489,10 @@ "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==" }, "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "version": "9.0.1", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true }, "jsbarcode": { "version": "3.12.1", @@ -10414,6 +10554,26 @@ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true }, + "less": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/less/-/less-4.2.2.tgz", + "integrity": "sha512-tkuLHQlvWUTeQ3doAqnHbNn8T6WX1KA8yvbKG9x4VtKtIjHsVKQZCH11zRgAfbDAXC2UNIg/K9BYAAcEzUIrNg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "copy-anything": "^2.0.1", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "parse-node-version": "^1.0.1", + "source-map": "~0.6.0", + "tslib": "^2.3.0" + } + }, "lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -10479,6 +10639,18 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmmirror.com/map-cache/-/map-cache-0.2.2.tgz", @@ -10535,6 +10707,14 @@ "picomatch": "^2.3.1" } }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "optional": true, + "peer": true + }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", @@ -10607,9 +10787,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==" + "version": "3.3.9", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.9.tgz", + "integrity": "sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg==" }, "nanomatch": { "version": "1.2.13", @@ -10673,6 +10853,18 @@ } } }, + "needle": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", @@ -10853,6 +11045,14 @@ "lines-and-columns": "^1.1.6" } }, + "parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "optional": true, + "peer": true + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmmirror.com/pascalcase/-/pascalcase-0.1.1.tgz", @@ -10891,6 +11091,14 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "optional": true, + "peer": true + }, "pinia": { "version": "2.1.7", "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.1.7.tgz", @@ -10914,6 +11122,16 @@ "integrity": "sha512-SED2wWr1X0QwH6rXIDgg20zS1mAk0AVMO8eM3KomUlOYzC8mNMWZnspZWhhI0M8MBIbF2xwa+5r30jTSjAqNsg==", "requires": { "commander": "~1.1.1" + }, + "dependencies": { + "commander": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz", + "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", + "requires": { + "keypress": "0.1.x" + } + } } }, "pkg-types": { @@ -11027,10 +11245,18 @@ "@province-city-china/types": "8.5.8" } }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true, + "optional": true, + "peer": true + }, "quansync": { - "version": "0.2.10", - "resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.10.tgz", - "integrity": "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==", + "version": "0.2.8", + "resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.8.tgz", + "integrity": "sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==", "dev": true }, "query-string": { @@ -11134,9 +11360,9 @@ } }, "regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + "version": "0.13.11", + "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "regex-not": { "version": "1.0.2", @@ -11243,32 +11469,31 @@ "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" }, "rollup": { - "version": "4.38.0", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.38.0.tgz", - "integrity": "sha512-5SsIRtJy9bf1ErAOiFMFzl64Ex9X5V7bnJ+WlFMb+zmP459OSWCEG7b0ERZ+PEU7xPt4OG3RHbrp1LJlXxYTrw==", - "dev": true, - "requires": { - "@rollup/rollup-android-arm-eabi": "4.38.0", - "@rollup/rollup-android-arm64": "4.38.0", - "@rollup/rollup-darwin-arm64": "4.38.0", - "@rollup/rollup-darwin-x64": "4.38.0", - "@rollup/rollup-freebsd-arm64": "4.38.0", - "@rollup/rollup-freebsd-x64": "4.38.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.38.0", - "@rollup/rollup-linux-arm-musleabihf": "4.38.0", - "@rollup/rollup-linux-arm64-gnu": "4.38.0", - "@rollup/rollup-linux-arm64-musl": "4.38.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.38.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.38.0", - "@rollup/rollup-linux-riscv64-gnu": "4.38.0", - "@rollup/rollup-linux-riscv64-musl": "4.38.0", - "@rollup/rollup-linux-s390x-gnu": "4.38.0", - "@rollup/rollup-linux-x64-gnu": "4.38.0", - "@rollup/rollup-linux-x64-musl": "4.38.0", - "@rollup/rollup-win32-arm64-msvc": "4.38.0", - "@rollup/rollup-win32-ia32-msvc": "4.38.0", - "@rollup/rollup-win32-x64-msvc": "4.38.0", - "@types/estree": "1.0.7", + "version": "4.35.0", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.35.0.tgz", + "integrity": "sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.35.0", + "@rollup/rollup-android-arm64": "4.35.0", + "@rollup/rollup-darwin-arm64": "4.35.0", + "@rollup/rollup-darwin-x64": "4.35.0", + "@rollup/rollup-freebsd-arm64": "4.35.0", + "@rollup/rollup-freebsd-x64": "4.35.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.35.0", + "@rollup/rollup-linux-arm-musleabihf": "4.35.0", + "@rollup/rollup-linux-arm64-gnu": "4.35.0", + "@rollup/rollup-linux-arm64-musl": "4.35.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.35.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.35.0", + "@rollup/rollup-linux-riscv64-gnu": "4.35.0", + "@rollup/rollup-linux-s390x-gnu": "4.35.0", + "@rollup/rollup-linux-x64-gnu": "4.35.0", + "@rollup/rollup-linux-x64-musl": "4.35.0", + "@rollup/rollup-win32-arm64-msvc": "4.35.0", + "@rollup/rollup-win32-ia32-msvc": "4.35.0", + "@rollup/rollup-win32-x64-msvc": "4.35.0", + "@types/estree": "1.0.6", "fsevents": "~2.3.2" } }, @@ -11367,6 +11592,14 @@ "source-map-js": ">=0.6.2 <2.0.0" } }, + "sax": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "dev": true, + "optional": true, + "peer": true + }, "scule": { "version": "1.3.0", "resolved": "https://registry.npmmirror.com/scule/-/scule-1.3.0.tgz", @@ -11381,6 +11614,14 @@ "preval.macro": "^4.0.0" } }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "optional": true, + "peer": true + }, "set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz", @@ -11790,14 +12031,6 @@ "dev": true, "requires": { "js-tokens": "^9.0.1" - }, - "dependencies": { - "js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", - "dev": true - } } }, "supports-color": { @@ -12008,14 +12241,6 @@ "csso": "^4.2.0", "picocolors": "^1.0.0", "stable": "^0.1.8" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } } }, "text-segmentation": { @@ -12421,9 +12646,9 @@ } }, "v-dropdown": { - "version": "3.4.0", - "resolved": "https://registry.npmmirror.com/v-dropdown/-/v-dropdown-3.4.0.tgz", - "integrity": "sha512-wgMb9P2jNhwrCVdD4ckcuou2XivK0ac9XNUH4cXithWMi4LRdOYgNNoT/Gl9ltXaIdO0I7izxpOZG/ddRJUkow==", + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/v-dropdown/-/v-dropdown-3.3.0.tgz", + "integrity": "sha512-OkNipbg+V4vQ6xyYLxTk+WQOs3A17nXtoqY9kqHRSAXnpE6mlwdsxar/qIgAAbhDpF0RYI8v4p75809S6ch+Rg==", "requires": { "vue": "^3.5.13" } diff --git a/openhis-ui-vue3/src/assets/images/ty.jpg b/openhis-ui-vue3/src/assets/images/ty.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a25f3780c78161ce9981482007e565422d44cb91 Binary files /dev/null and b/openhis-ui-vue3/src/assets/images/ty.jpg differ diff --git a/openhis-ui-vue3/src/template/nursingRecordSheet.vue b/openhis-ui-vue3/src/template/nursingRecordSheet.vue new file mode 100644 index 0000000000000000000000000000000000000000..4213e3e3d863b60019bdea7c083c61e6928bf0ed --- /dev/null +++ b/openhis-ui-vue3/src/template/nursingRecordSheet.vue @@ -0,0 +1,392 @@ + + + + + + diff --git a/openhis-ui-vue3/src/template/surgicalPatientHandover.vue b/openhis-ui-vue3/src/template/surgicalPatientHandover.vue index 9cfeb5647cbd8696dc9a8ec2721a9837bc00dbe9..4fda31901fe5a4b4867624b99ff7e84adab58c1b 100644 --- a/openhis-ui-vue3/src/template/surgicalPatientHandover.vue +++ b/openhis-ui-vue3/src/template/surgicalPatientHandover.vue @@ -20,7 +20,7 @@
姓名:{{ state.formData.patientName }}
-
性别:{{ state.formData.gender }}
+
性别:{{ state.formData.sex }}
年龄:{{ state.formData.age }}岁
@@ -89,13 +89,35 @@
手术标识 - - + {{ item.dictLabel }}
- + + +
+ 药物使用方法 + + + +
+
+
@@ -166,7 +188,11 @@
皮肤情况 部位 - + 面积
部位 - + 面积 × - 皮肤情况 部位 - + 面积
部位 - + 面积 × -
- 手术室/麻醉复苏室护士签名 + 手术室/麻醉复苏室护士签名
@@ -491,14 +529,13 @@ mmHg
- +
交接时间
-
@@ -525,6 +562,9 @@ defineOptions({ }); import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue'; import { ElMessageBox, ElMessage, ElLoading, ElTree } from 'element-plus'; +import useOptionsList from './useOptionsList'; +// import { A } from '../../dist/assets/api-DmiMW8YF'; +const { statisticsOptionList, getStatisticsOptionList } = useOptionsList(); const { proxy } = getCurrentInstance(); const emits = defineEmits(['submitOk']); const props = defineProps({}); @@ -533,7 +573,7 @@ const state = reactive({ // 患者基本信息 date: '2025/8/13 13:36:41', patientName: '于学斌', - gender: '男', + sex: '男', age: '46', department: '普外科门诊区', bedNumber: '035', @@ -591,20 +631,22 @@ const state = reactive({ }, }); -const submit = ()=> { +const submit = () => { // ElMessage.success('提交成功'); - emits('submitOk',state.formData) -} + emits('submitOk', state.formData); +}; const setFormData = (data) => { - if (data) { state.formData = data; } -} +}; + onBeforeMount(() => {}); -onMounted(() => {}); - -defineExpose({ state, submit,setFormData }); +onMounted(() => { + // { statisticsOptionList,getStatisticsOptionList } =await useOptionsList(); +}); + +defineExpose({ state, submit, setFormData }); diff --git a/openhis-ui-vue3/src/views/basicmanage/caseTemplatesStatistics/index.vue b/openhis-ui-vue3/src/views/basicmanage/caseTemplatesStatistics/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..b357ace3ddac2ef56972016c295248c145bbc200 --- /dev/null +++ b/openhis-ui-vue3/src/views/basicmanage/caseTemplatesStatistics/index.vue @@ -0,0 +1,298 @@ + + + + diff --git a/openhis-ui-vue3/src/views/basicmanage/caseTemplatesStatistics/index1.vue b/openhis-ui-vue3/src/views/basicmanage/caseTemplatesStatistics/index1.vue new file mode 100644 index 0000000000000000000000000000000000000000..9018cfbbf990d07a34c6d94dc9ec05efc307fd34 --- /dev/null +++ b/openhis-ui-vue3/src/views/basicmanage/caseTemplatesStatistics/index1.vue @@ -0,0 +1,144 @@ + + + diff --git a/openhis-ui-vue3/src/views/catalog/device/components/deviceDialog.vue b/openhis-ui-vue3/src/views/catalog/device/components/deviceDialog.vue index 654bd4592563ae6be958bf6a6fb45cfe009a3f45..490397258f2f23f74520619dee68672ec589bc10 100644 --- a/openhis-ui-vue3/src/views/catalog/device/components/deviceDialog.vue +++ b/openhis-ui-vue3/src/views/catalog/device/components/deviceDialog.vue @@ -136,7 +136,7 @@ - + diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue index 2fe7c55b40e4297f5df703ca4c1cd8f5843fb6a2..773773c09814fdffeb20a7a26633d499478f8293 100644 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue @@ -115,6 +115,11 @@ >启用 + + + 导入 + + 查询 @@ -337,10 +342,34 @@ } " /> + + + + + +
将文件拖到此处,或点击上传
+ +
+ +
- \ No newline at end of file + diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue index d26bfb55caa911d57a4a905ab614d95d0e85014f..961cea090cdfc90cd7a97b1448eb6c6949cc72ac 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue @@ -355,7 +355,7 @@ function getPatientInfo(idCard) { }; getOutpatientRegistrationList(param).then((res) => { console.log(param, 'param'); - if (res.data.records.length > 0) { + if (res.data.records.length == 1) { patientInfo.value = res.data.records[0]; console.log(patientInfo.value, 'patientInfo.value'); // 将表单数据发送给父组件 diff --git a/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/component/template.json b/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/component/template.json index 128854aa1f7e37e9e2647f57d9e2fc4843fc4e08..3e01fed9bbde98877f69bb9ca3788b4e52f9c6b0 100644 --- a/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/component/template.json +++ b/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/component/template.json @@ -6,6 +6,28 @@ "paperType": "A4", "height": 297, "width": 210, + "paperNumberDisabled": true, + "paperNumberContinue": true, + "overPrintOptions": { + "content": "", + "opacity": 0.7, + "type": 1 + }, + "watermarkOptions": { + "content": "", + "fillStyle": "rgba(184, 184, 184, 0.3)", + "fontSize": "14px", + "rotate": 25, + "width": 175, + "height": 200, + "timestamp": false, + "format": "YYYY-MM-DD HH:mm" + }, + "panelLayoutOptions": { + "layoutType": "column", + "layoutRowGap": 0, + "layoutColumnGap": 0 + }, "paperHeader": 0, "paperFooter": 841.8897637795277, "printElements": [ @@ -714,6 +736,46 @@ "type": "text" } }, + { + "options": { + "left": 416.5, + "top": 191.5, + "height": 13.5, + "width": 45, + "title": "体检费", + "coordinateSync": false, + "widthHeightSync": false, + "fontSize": 9, + "qrCodeLevel": 0, + "field": "1" + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, + { + "options": { + "left": 465, + "top": 192, + "height": 13.5, + "width": 84, + "title": "体检费", + "coordinateSync": false, + "widthHeightSync": false, + "fontSize": 9, + "qrCodeLevel": 0, + "field": "9999", + "textAlign": "right", + "testData": "20000.00", + "hideTitle": true, + "formatter": "function(title,value,options,templateData,target,paperNo){\n return value ? value.toFixed(2) + ' 元' : '0.00' + ' 元'\n}" + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, { "options": { "left": 16.5, @@ -1372,8 +1434,8 @@ }, { "options": { - "left": 19, - "top": 368.5, + "left": 16.5, + "top": 363, "height": 13.5, "width": 76.5, "title": "省医保总额", @@ -1388,10 +1450,32 @@ "type": "text" } }, + { + "options": { + "left": 220.5, + "top": 363, + "height": 13.5, + "width": 75, + "title": "文本", + "coordinateSync": false, + "widthHeightSync": false, + "fontSize": 9, + "qrCodeLevel": 0, + "field": "municipalYbTotal", + "textAlign": "right", + "testData": "20000.00", + "hideTitle": true, + "formatter": "function(title,value,options,templateData,target,paperNo){\n return value ? value.toFixed(2) + ' 元' : '0.00' + ' 元'\n}" + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, { "options": { "left": 81.5, - "top": 369.5, + "top": 363.5, "height": 13.5, "width": 75, "title": "文本", @@ -1412,8 +1496,8 @@ }, { "options": { - "left": 164, - "top": 369.5, + "left": 162.5, + "top": 363.5, "height": 13.5, "width": 64.5, "title": "市医保总额", @@ -1430,8 +1514,26 @@ }, { "options": { - "left": 220.5, - "top": 370.5, + "left": 17, + "top": 389, + "height": 13.5, + "width": 76.5, + "title": "现金收入总额", + "coordinateSync": false, + "widthHeightSync": false, + "fontSize": 9, + "qrCodeLevel": 0, + "field": "1" + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, + { + "options": { + "left": 79.5, + "top": 390, "height": 13.5, "width": 75, "title": "文本", @@ -1439,7 +1541,7 @@ "widthHeightSync": false, "fontSize": 9, "qrCodeLevel": 0, - "field": "municipalYbTotal", + "field": "totalCash", "textAlign": "right", "testData": "20000.00", "hideTitle": true, @@ -1450,10 +1552,49 @@ "type": "text" } }, + { + "options": { + "left": 163.5, + "top": 390, + "height": 13.5, + "width": 64.5, + "title": "体检人次", + "coordinateSync": false, + "widthHeightSync": false, + "fontSize": 9, + "qrCodeLevel": 0, + "field": "1" + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, + { + "options": { + "left": 218.5, + "top": 391, + "height": 13.5, + "width": 75, + "title": "体检人次", + "coordinateSync": false, + "widthHeightSync": false, + "fontSize": 9, + "qrCodeLevel": 0, + "field": "physicalExaminationCount", + "textAlign": "right", + "testData": "20000.00", + "hideTitle": true + }, + "printElementType": { + "title": "文本", + "type": "text" + } + }, { "options": { "left": 15, - "top": 397.5, + "top": 426, "height": 9, "width": 567, "borderWidth": "1.5", @@ -1468,7 +1609,7 @@ { "options": { "left": 162, - "top": 411, + "top": 439.5, "height": 13.5, "width": 76.5, "title": "制表人", @@ -1486,7 +1627,7 @@ { "options": { "left": 216, - "top": 411, + "top": 439.5, "height": 13.5, "width": 75, "title": "文本", @@ -1507,7 +1648,7 @@ { "options": { "left": 333, - "top": 411, + "top": 439.5, "height": 13.5, "width": 76.5, "title": "制表时间", @@ -1525,7 +1666,7 @@ { "options": { "left": 390, - "top": 411, + "top": 439.5, "height": 13.5, "width": 129, "title": "文本", @@ -1545,29 +1686,7 @@ } ], "paperNumberLeft": 389, - "paperNumberTop": 573, - "paperNumberDisabled": true, - "paperNumberContinue": true, - "overPrintOptions": { - "content": "", - "opacity": 0.7, - "type": 1 - }, - "watermarkOptions": { - "content": "", - "fillStyle": "rgba(184, 184, 184, 0.3)", - "fontSize": "14px", - "rotate": 25, - "width": 175, - "height": 200, - "timestamp": false, - "format": "YYYY-MM-DD HH:mm" - }, - "panelLayoutOptions": { - "layoutType": "column", - "layoutRowGap": 0, - "layoutColumnGap": 0 - } + "paperNumberTop": 573 } ] } \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/indexccu.vue b/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/indexccu.vue index c5ce414fe9ad66465f61cbc4410d8ff4e097631a..597a2b7e7f1398eea67a29001f80835bcc350f6a 100644 --- a/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/indexccu.vue +++ b/openhis-ui-vue3/src/views/clinicmanagement/dayEnd/indexccu.vue @@ -155,15 +155,15 @@ --> 微信: - {{ formatValue(reportValue['0000cash']) }} + {{ formatValue(reportValue.vxCashSum) }} 支付宝: - {{ '0.00 元' }} + {{ formatValue(reportValue.aliCashSum) }} 网银: - {{ '0.00 元' }} + {{ formatValue(reportValue.peisCnt) }} + @@ -101,6 +113,7 @@ getList(); function getList() { queryParams.value.organizationId = props.patientInfo.orgId; getAdviceBaseInfo(queryParams.value).then((res) => { + console.log('ssssssssss', res.data.records); if (res.data.records.length > 0) { adviceBaseList.value = res.data.records.filter((item) => { if (item.adviceType == 1 || item.adviceType == 2) { @@ -117,7 +130,14 @@ function getList() { } }); } - +// 从priceList列表中获取价格 +function getPriceFromInventory(row) { + if (row.priceList && row.priceList.length > 0) { + const price = row.priceList[0].price || 0; + return Number(price).toFixed(2) + ' 元'; + } + return '-'; +} // 处理键盘事件 const handleKeyDown = (event) => { const key = event.key; @@ -182,9 +202,9 @@ defineExpose({ handleKeyDown, }); - + \ No newline at end of file + diff --git a/openhis-ui-vue3/src/views/doctorstation/components/api.js b/openhis-ui-vue3/src/views/doctorstation/components/api.js index 8158c818ae2648046e398c9149c87c5a3f66709c..69a217a17439515788275e9e64cdf1729708fcba 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/api.js +++ b/openhis-ui-vue3/src/views/doctorstation/components/api.js @@ -179,6 +179,17 @@ export function getEncounterDiagnosis(encounterId) { }) } +/** + * + * 获取诊断集合数据 + */ +export function getDiagnosisList(searchKey) { + return request({ + url: '/doctor-station/diagnosis/get-diagnosis-list?searchKey=' + searchKey, + method: 'get', + }) +} + /** * * 删除就诊诊断 @@ -671,3 +682,25 @@ export function getOrderGroup(data) { params: data }) } + +/** + * 查询诊疗项目耗材绑定信息 + */ +export function getActivityBindDevice(data) { + return request({ + url: '/doctor-station/advice/activity-bind-device-info', + method: 'get', + params: data + }) +} + +/** + * 是否是食源性诊断 + */ +export function isFoodDiseasesNew(params) { + return request({ + url: '/external-integration/foodborne-acquisition/is-food-diseases-new', + method: 'get', + params: params + }) +} diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue index 77359f8964077ff31d63ae2c6387d8591d0c463e..7454ad5b59fa3ac8b26d788901ddd71eecf93dba 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue @@ -85,7 +85,7 @@ - + \ No newline at end of file +:deep(.el-dialog__body) { + max-height: 10vh; /* 设置最大高度为视口高度的 60% */ + overflow-y: auto; /* 超出时显示纵向滚动条 */ +} + diff --git a/openhis-ui-vue3/src/views/doctorstation/components/emr/emrtemplate.vue b/openhis-ui-vue3/src/views/doctorstation/components/emr/emrtemplate.vue index 9d9498a2292bb644e7c882cdc71d344489fa7a54..35fa36d831e9f2740735427b83f5860e5a3cf414 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/emr/emrtemplate.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/emr/emrtemplate.vue @@ -1,22 +1,23 @@ - + \ No newline at end of file + diff --git a/openhis-ui-vue3/src/views/doctorstation/components/eprescriptiondialog.vue b/openhis-ui-vue3/src/views/doctorstation/components/eprescriptiondialog.vue index 4dfb6ab1e8f135f6c41e7542ef454b2e7dd2e410..92d7e8587828b47cf1f2805011a9102ad9a8b3c5 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/eprescriptiondialog.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/eprescriptiondialog.vue @@ -88,18 +88,22 @@ - + @@ -115,6 +119,36 @@ --> + + + + + + + + + +
@@ -393,12 +427,12 @@ \ No newline at end of file + diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index f4c4b3c84bfcd9ab6c4ca5627dbdf0642dcd93e4..5ce3a36cff6bcb90d346b6a32d59ed93d8520f30 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -350,6 +350,11 @@ :label="item.label" @click=" () => { + if (item.type == unitMap['minUnit']) { + scope.row.unitPrice = scope.row.minUnitPrice; + } else { + scope.row.unitPrice = scope.row.unitTempPrice; + } scope.row.unitCode_dictText = item.label; } " @@ -728,6 +733,7 @@ import { updateGroupId, getContract, getAdviceBaseInfo, + getActivityBindDevice, } from '../api'; import adviceBaseList from '../advicebaselist'; import { computed, getCurrentInstance, nextTick, watch } from 'vue'; @@ -736,6 +742,7 @@ import OrderGroupDrawer from './orderGroupDrawer'; import PrescriptionHistory from './prescriptionHistory'; import Decimal from 'decimal.js'; import useUserStore from '@/store/modules/user'; +import { ElMessageBox } from 'element-plus'; const emit = defineEmits(['selectDiagnosis']); const total = ref(0); @@ -986,6 +993,21 @@ function handleChange(value) { * 选择药品回调 */ function selectAdviceBase(key, row) { + if (row.adviceType == 3) { + getActivityBindDevice({ activityId: row.adviceDefinitionId }).then((res) => { + if (res.data.activityBindDeviceInfos?.length > 0) { + ElMessageBox.confirm('该诊疗项目已绑定所需耗材,点击确定将自动添加到医嘱列表', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + closeOnClickModal: false, + closeOnPressEscape: false, + }).then(() => { + handleSaveGroup(res.data.activityBindDeviceInfos); + }); + } + }); + } getOrgList(); unitCodeList.value = []; unitCodeList.value.push({ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' }); @@ -1064,6 +1086,7 @@ function selectAdviceBase(key, row) { prescriptionList.value[rowIndex.value].inventoryId = stock.inventoryId; prescriptionList.value[rowIndex.value].locationId = stock.locationId; prescriptionList.value[rowIndex.value].unitPrice = stock.price; + prescriptionList.value[rowIndex.value].unitTempPrice = stock.price; prescriptionList.value[rowIndex.value].minUnitPrice = new Decimal(stock.price) .div(row.partPercent) .toFixed(2); @@ -1310,14 +1333,17 @@ function handleSaveSign(row, index) { row.minUnitQuantity = row.quantity; } row.conditionId = conditionId.value; - // if (row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit') { - // row.unitPrice = row.unitPrice; - // } else { - // row.unitCode_dictText = row.unitCodeList.find( - // (item) => item.value == row.minUnitCode - // ).label; - // row.unitPrice = row.minUnitPrice; - // } + // 处理总量为小单位情况,需要把单价也保存成小单位的 + if (row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit') { + if (row.adviceType != 3) { + row.unitPrice = row.unitTempPrice; + } + } else { + row.unitCode_dictText = row.unitCodeList.find( + (item) => item.value == row.minUnitCode + ).label; + row.unitPrice = row.minUnitPrice; + } row.conditionDefinitionId = conditionDefinitionId.value; row.encounterDiagnosisId = encounterDiagnosisId.value; row.diagnosisName = diagnosisName.value; @@ -1429,7 +1455,7 @@ function setValue(row) { // 库存列表 + 价格列表拼成批次号的下拉框 if (row.adviceType != 3) { if (row.inventoryList && row.inventoryList.length == 0) { - expandOrder.value = []; + // expandOrder.value = []; proxy.$modal.msgWarning('该项目无库存'); return; } @@ -1457,6 +1483,9 @@ function setValue(row) { prescriptionList.value[rowIndex.value].locationId = stock.locationId; prescriptionList.value[rowIndex.value].unitPrice = stock.price; prescriptionList.value[rowIndex.value].positionName = stock.locationName; + prescriptionList.value[rowIndex.value].minUnitPrice = new Decimal(stock.price) + .div(row.partPercent) + .toFixed(2); } } else { prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId; @@ -1496,6 +1525,7 @@ function handleSaveGroup(orderGroupList) { prescriptionList.value[rowIndex.value] = { ...prescriptionList.value[rowIndex.value], // ...orderGroupValue, + uniqueKey: nextId.value++, patientId: props.patientInfo.patientId, encounterId: props.patientInfo.encounterId, accountId: accountId.value, @@ -1802,10 +1832,14 @@ const groupMarkers = ref([]); // 计算总价 function calculateTotalPrice(row, index) { nextTick(() => { - if (row.unitCode == row.minUnitCode) { - row.totalPrice = new Decimal(row.unitPrice).div(row.partPercent) * row.quantity; - } else { + if (row.adviceType == 3) { row.totalPrice = (row.unitPrice * row.quantity * 100) / 100; + } else { + if (row.unitCode == row.minUnitCode) { + row.totalPrice = row.minUnitPrice * row.quantity; + } else { + row.totalPrice = (row.unitPrice * row.quantity * 100) / 100; + } } }); } diff --git a/openhis-ui-vue3/src/views/hospitalRecord/HospitalRecordForm.vue b/openhis-ui-vue3/src/views/hospitalRecord/HospitalRecordForm.vue new file mode 100644 index 0000000000000000000000000000000000000000..38cff998a094e99d0e5f1d5fb61edec2462cba61 --- /dev/null +++ b/openhis-ui-vue3/src/views/hospitalRecord/HospitalRecordForm.vue @@ -0,0 +1,269 @@ + + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordFirst.vue b/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordFirst.vue new file mode 100644 index 0000000000000000000000000000000000000000..b5b4e91cca3dcba36a512e7a13316d576dae1295 --- /dev/null +++ b/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordFirst.vue @@ -0,0 +1,472 @@ + + + + + diff --git a/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordFirstPrint.json b/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordFirstPrint.json new file mode 100644 index 0000000000000000000000000000000000000000..43e5b1cb22cff4a58d784d1fcab4a7f93253f1bb --- /dev/null +++ b/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordFirstPrint.json @@ -0,0 +1,3 @@ +{ + "printContent": "\n\n\n 住院病案首页\n \n\n\n
\n
吉林大学第一医院
\n
\n
\n
组织机构代码:(${formData.hospital.orgCode || ''})
\n
医疗付费方式:(${formData.hospital.paymentMethod || ''})
\n
\n
\n 住院病案首页\n
\n
\n
条形码
\n
\n
\n
\n
\n
健康卡号:(${formData.patient.healthCardNo || ''})
\n
第(${formData.patient.times || ''})住院
\n
住院ID:(${formData.patient.hospitalizationId || ''})
\n
病案号:(${formData.patient.recordNo || ''})
\n
\n
\n
\n
\n \n
\n
\n
\n \n
${formData.patient.name || ''}
\n
\n
\n \n
${formData.patient.gender === '1' ? '男' : formData.patient.gender === '2' ? '女' : ''}
\n
\n
\n \n
${formData.patient.birthDate || ''}
\n
\n
\n \n
${formData.patient.age || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n \n
\n
\n
\n
\n \n
${formData.patient.birthDate || ''}
\n \n
${formData.patient.birthDate || ''}市
\n
${formData.patient.birthDate || ''}县(区、市)
\n
\n
\n \n
${formData.patient.nativePlace || ''}省(区、市)
\n
\n
\n \n
${formData.patient.ethnicity || ''}
\n
\n
\n
\n
\n \n
${formData.patient.idCardNo || ''}省(区、市)
\n
\n
\n \n
${formData.patient.nationality || ''}省(区、市)
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}省(区、市)
\n
${formData.patient.nationality || ''}市
\n
${formData.patient.birthDate || ''}县(区、市)
\n
${formData.patient.birthDate || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}省(区、市)
\n
${formData.patient.nationality || ''}市
\n
${formData.patient.birthDate || ''}县(区、市)
\n
${formData.patient.birthDate || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n
${'1' || ''}
\n \n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n \n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
出院诊断疾病编码入院病情转归情况
主要诊断:腰椎间盘突出症(L4-5)121
其他诊断:腰椎椎管狭窄(L4-5)122
其他诊断:右下肢不全瘫122
----
----
----
----
----
----
----
----
\n
\n
入院病情:1.有 2.临床未确定 3.情况不明 4.无
\n
转归情况:1.治愈 2.好转 3.未愈 4.死亡 5.其他
\n
\n
\n
\n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n
${formData.patient.nationality || ''}
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n
${'0' || ''}
\n \n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n \n
${formData.patient.nationality || '-'}
\n \n \n
${formData.patient.nationality || '-'}
\n \n \n
${formData.patient.nationality || '-'}
\n \n \n
${formData.patient.nationality || '-'}
\n \n \n
${formData.patient.nationality || '-'}
\n \n
\n
\n
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n
${'1' || ''}
\n \n
\n
\n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n
${'1' || ''}
\n \n
\n
\n \n
${'1' || ''}
\n \n
\n
\n
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n \n
${formData.patient.nationality || '-'}
\n
\n
\n
\n + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordThird.vue b/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordThird.vue new file mode 100644 index 0000000000000000000000000000000000000000..813f16faa2a97574f5edb15b48cece6700ae1c28 --- /dev/null +++ b/openhis-ui-vue3/src/views/hospitalRecord/components/medicalRecordThird.vue @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/index.vue b/openhis-ui-vue3/src/views/index.vue index a5e025f7367deb3cb4f19ac88eb7387e83d41ed5..f084f71c98eeeec41a7467165ccf0ffb41a91391 100644 --- a/openhis-ui-vue3/src/views/index.vue +++ b/openhis-ui-vue3/src/views/index.vue @@ -3,9 +3,9 @@
效期预警 {{total}}
- + + +
diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/api.js b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/api.js index b2fa53b6fba1ddae50872f087c3ded657ebefc32..25415ce263c6f9d49d69182e0bac7d63086e40d7 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/api.js +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/api.js @@ -5,6 +5,7 @@ */ import request from '@/utils/request' +// ====== 文书记录 // 新增记录 export function addRecord(data) { return request({ @@ -22,3 +23,38 @@ export function getRecordByEncounterIdList(params) { params }) } +// 初始化文书定义 +export function init() { + return request({ + url: '/document/record/init', + method: 'get', + }) +} + +// ====== 文书模板 +// 新增模板 +export function addTemplate(data) { + return request({ + url: '/document/template/add', + method: 'post', + data + }) +} +// +export function getListByDefinitionId(definitionId) { + return request({ + url: '/document/template/getListByDefinitionId', + method: 'get', + params: {definitionId} + }) +} +// 更新模板 +export function updateTemplate(data) { + return request({ + url: '/document/template/update', + method: 'put', + data + }) +} + + diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/history.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/history.vue index e52ae7b50675f47ede2188364b3bc343bdc26bac..1824a9d5ad6081dad7e073c0b9ec6235b24a00f4 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/history.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/history.vue @@ -11,7 +11,7 @@
diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/template.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/template.vue new file mode 100644 index 0000000000000000000000000000000000000000..5e741e5b3e273e9d5ea5e0cd6d00c55059783e6c --- /dev/null +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/template.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/templateEdit.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/templateEdit.vue new file mode 100644 index 0000000000000000000000000000000000000000..008f1fbed10bfdf80ce67723b5b975c925e6c5dd --- /dev/null +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/components/templateEdit.vue @@ -0,0 +1,133 @@ + + + diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/index.vue index 61e4f2c0e2ebdc7995870f25920ec7fd2d0b75ed..bae4d7b0e2078a1c833e74be097f3b655e74ab9d 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/emr/index.vue @@ -28,10 +28,9 @@
- 新建 + 存为模版 刷新 - 删除 保存
@@ -44,18 +43,35 @@
- + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/index.vue b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/index.vue index a7a935dccf99c063a70e7c6dfc51c9f3c0a47d91..d7d378a5749ae3ab83e0e7a89e3fe2112298f9e0 100644 --- a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/index.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/index.vue @@ -28,13 +28,20 @@
- - - + + + + - Config - Role - Task
@@ -44,8 +51,63 @@ import PatientList from './components/patientList.vue'; import PrescriptionList from './components/prescriptionList.vue'; -const activeName = ref('first'); +const activeName = ref('unverified'); const active = ref('first'); +const requestStatus = ref(2); + +// 存储子组件引用的对象 +const prescriptionRefs = ref({}); + +// 定义处方列表tabs配置 +const prescriptionTabs = [ + { label: '未校对', name: 'unverified' }, + { label: '已校对', name: 'verified' }, + { label: '已停止', name: 'stopped' }, + { label: '已退回', name: 'cancelled' }, +]; + +// 设置处方组件引用 +function setPrescriptionRef(el, name) { + if (el) { + prescriptionRefs.value[name] = el; + } +} + +function handleTabClick(tabName) { + // tabName是tab的name属性值 + const activeTabName = tabName || activeName.value; + + switch (activeTabName) { + case 'unverified': + requestStatus.value = 2; + break; + case 'verified': + requestStatus.value = 3; + break; + case 'stopped': + requestStatus.value = 6; + break; + case 'cancelled': + requestStatus.value = 1; + break; + } + // 调用子组件方法 + nextTick(() => { + debugger; + console.log(prescriptionRefs.value[activeTabName], '1'); + + if ( + prescriptionRefs.value[activeTabName] && + typeof prescriptionRefs.value[activeTabName].handleGetPrescription === 'function' + ) { + prescriptionRefs.value[activeTabName].handleGetPrescription(); + } + }); +} + +provide('handleGetPrescription', (value) => { + prescriptionRefs.value[activeName.value].handleGetPrescription(); +}); \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/login.vue b/openhis-ui-vue3/src/views/login.vue index 476be277d82cb217c524de6de68a2263344fa4e3..548ec4bc9d28ae4b3acee15b4f345e755ee2df31 100644 --- a/openhis-ui-vue3/src/views/login.vue +++ b/openhis-ui-vue3/src/views/login.vue @@ -51,10 +51,10 @@ /> - - 连接医保 - - + + + + + - + - 添加行 + 添加行 -
+
{ if (res.code == 200) { + pageLoading.value = false proxy.$modal.msgSuccess('操作成功'); tagsViewStore.delView(router.currentRoute.value); store.clearCurrentDataBS(); @@ -1040,6 +1043,8 @@ function handelApply() { query: { type: 'lossReporting' }, }); } + }).catch(() => { + pageLoading.value = false }); } /** 提交审核按钮 */ diff --git a/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/components/api.js b/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/components/api.js new file mode 100644 index 0000000000000000000000000000000000000000..97c3c217d264d4af8ea7ad6ba02cddc6ae7ff6b2 --- /dev/null +++ b/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/components/api.js @@ -0,0 +1,58 @@ +import request from '@/utils/request'; + +// 查询费用定价信息列表 +export function listDefinition (query) { + return request ({ + url: '/dict-dictionary/definition/charge-item-info', + method: 'get', + params: query, + }); +} + +// 初始化下拉选 +export function initOption (query) { + return request ({ + url: '/dict-dictionary/definition/init', + method: 'get', + params: query, + }); +} +// 获取药品列表 +export function getMedicineList (query) { + return request ({ + url: '/doctor-station/advice/advice-base-info', + method: 'get', + params: query, + }); +} +// 修改费用定价信息 +export function updateDefinition (data) { + return request ({ + url: `/dict-dictionary/definition/update-charge-item?id=${data.id}&price=${data.price}`, + method: 'put', + }); +} + +// 修改费用定价信息 +export function getOptions () { + return request ({ + url: '/dict-dictionary/definition/status-enum-option', + method: 'get', + }); +} + +// 修改费用定价信息 +export function getDetail (id) { + return request ({ + url: '/dict-dictionary/definition/charge-item-info-detail?id=' + id, + method: 'get', + }); +} +// 供应商查询 +export function getSupplierList (query) { + return request ({ + url: '/change/price/searchAllSupply', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/components/medicineList.vue b/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/components/medicineList.vue new file mode 100644 index 0000000000000000000000000000000000000000..6efa2c69bc795f8d3ce342c5a57f1b0365ad6911 --- /dev/null +++ b/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/components/medicineList.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..cc3685084197d88ccffda79abd0562a76b679a86 --- /dev/null +++ b/openhis-ui-vue3/src/views/medicationmanagement/priceAdjustmentManagement/index.vue @@ -0,0 +1,636 @@ + + + diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue index 5f454cb7dc12a87edfafcb7668328f612cb682c2..57cb274f0f4d2d2db046833eb2dea9d79dd74093 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue @@ -1,5 +1,5 @@ + + + - +
+ {{ reconciliation }} + + 手动对账 + +
-