diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocRecordAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocRecordAppServiceImpl.java index d39153cbae5bd5896f6713ac2fab2845865f171f..73b90331ce7369a736351411bd291ebcbb183751 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocRecordAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/document/appservice/impl/DocRecordAppServiceImpl.java @@ -32,6 +32,7 @@ import com.core.common.utils.AgeCalculatorUtil; import com.core.common.utils.SecurityUtils; import com.core.common.utils.StringUtils; import com.core.common.utils.bean.BeanUtils; +import com.openhis.administration.domain.Encounter; import com.openhis.common.enums.*; import com.openhis.common.utils.HisQueryUtils; import com.openhis.document.domain.DocRecord; @@ -611,10 +612,15 @@ public class DocRecordAppServiceImpl implements IDocRecordAppService { if (tempId == null) { return R.fail("患者文书记录:文书类型(定义)ID不能为空"); } + // 根据病历ID获取入科时间 + Date admissionDate = getAdmissionDate(encounterId); + if (admissionDate == null) { + return R.fail("患者未入科,无法记录、查看体温单"); + } // 根据病历ID和患者ID获取住院、出院时间 - Map dateMap = getDateByEncounterId(encounterId, patientId); - Date hospDate = dateMap.get("hospDate"); - Date outDate = dateMap.get("outDate"); + Encounter encounter = getInOutDate(encounterId); + Date hospDate = encounter.getStartTime(); + Date outDate = encounter.getEndTime(); // 所有的chartsSmalls List allTrendChartsSmalls = new ArrayList<>(); // 获取体温单信息 @@ -672,10 +678,11 @@ public class DocRecordAppServiceImpl implements IDocRecordAppService { allTrendChartsSmalls.add(trendChartsSmall); } // 体温单信息 - TrendChartsOutput trendChartsOutput = returnTrendChartsOutput(allTrendChartsSmalls, encounterId, hospDate); + TrendChartsOutput trendChartsOutput = + returnTrendChartsOutput(allTrendChartsSmalls, encounterId, hospDate, admissionDate); trendChartsOutput.setOutDate(outDate); // 术后天数 - calculatePostopDay(trendChartsOutput, getPostopDate(encounterId, patientId)); + calculatePostopDay(trendChartsOutput, getPostopDate(encounterId)); return R.ok(trendChartsOutput); } @@ -774,7 +781,7 @@ public class DocRecordAppServiceImpl implements IDocRecordAppService { * @return 封装好的体温单 */ private TrendChartsOutput returnTrendChartsOutput(List allTrendChartsSmalls, Long encounterId, - Date hospDate) { + Date hospDate, Date admissionDate) { allTrendChartsSmalls.sort(Comparator.comparing(TrendChartsSmall::getDate)); // temperaturePulses 集合 List temperaturePulses = new ArrayList<>(); @@ -787,8 +794,6 @@ public class DocRecordAppServiceImpl implements IDocRecordAppService { // isOneDayInAdvance(others); // 移除others数据 allTrendChartsSmalls.removeAll(others); - // 根据病历ID获取入科时间 - Date admissionDate = getDateByEncounterId(encounterId); // 为入科 TrendChartsSmall 准备数据 int weekNo = calculateWeek(hospDate, admissionDate); // 入科 TrendChartsSmall @@ -971,19 +976,10 @@ public class DocRecordAppServiceImpl implements IDocRecordAppService { * 获取住院、出院时间 * * @param encounterId 病历ID - * @param patientId 患者ID * @return 住院时间 */ - private Map getDateByEncounterId(Long encounterId, Long patientId) { - String sql = - "SELECT start_time,end_time FROM adm_encounter WHERE id = ? AND patient_id = ? AND status_enum = ? AND class_enum = ?"; - Object[] params = {encounterId, patientId, EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue(), - EncounterClass.IMP.getValue()}; - Map result = jdbcTemplate.queryForMap(sql, params); - HashMap map = new HashMap<>(); - map.put("hospDate", (Timestamp)result.get("start_time")); - map.put("outTime", (Timestamp)result.get("end_time")); - return map; + private Encounter getInOutDate(Long encounterId) { + return docRecordMapper.getInOutDate(encounterId, EncounterClass.IMP.getValue()); } /** @@ -992,29 +988,22 @@ public class DocRecordAppServiceImpl implements IDocRecordAppService { * @param encounterId 病历ID * @return 入科时间 */ - private Date getDateByEncounterId(Long encounterId) { - String sql = - "SELECT ael.start_time FROM adm_encounter ae INNER JOIN adm_encounter_location ael ON ae.ID=ael.encounter_id AND ael.form_enum=? AND ael.status_enum=? AND ael.delete_flag='0' AND ael.tenant_id=1 LEFT JOIN adm_location al ON ael.location_id=al.ID AND al.delete_flag='0' AND al.tenant_id=1 WHERE ae.ID=? AND ae.delete_flag='0' AND ae.tenant_id=1"; - Object[] params = {LocationForm.BED.getValue(), EncounterActivityStatus.ACTIVE.getValue(), encounterId}; - Timestamp timestamp = jdbcTemplate.queryForObject(sql, params, Timestamp.class); - return Date.from(timestamp.toInstant()); + private Date getAdmissionDate(Long encounterId) { + return docRecordMapper.getAdmissionDate(encounterId, LocationForm.BED.getValue(), + EncounterActivityStatus.ACTIVE.getValue()); } /** * 获取手术时间 * * @param encounterId 病历ID - * @param patientId 患者ID * @return 手术时间列表 */ - private List getPostopDate(Long encounterId, Long patientId) { - String sql = - "SELECT cpp.start_time FROM cli_procedure_performer cpp LEFT JOIN cli_procedure cp ON cpp.procedure_id=cp.ID LEFT JOIN adm_encounter ae ON ae.patient_id=cp.patient_id AND ae.ID=cp.encounter_id AND ae.status_enum=? AND ae.class_enum=? WHERE cp.patient_id=? AND cp.status_enum=? AND cp.encounter_id=? AND cpp.start_time> ae.start_time AND cpp.end_time <= ae.end_time ORDER BY cpp.start_time"; - Object[] params = {EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue(), EncounterClass.IMP.getValue(), - patientId, 5, encounterId}; - List dates = jdbcTemplate.queryForList(sql, Timestamp.class, params); - - return dates.stream().map(date -> date.toLocalDateTime()).toList(); + private List getPostopDate(Long encounterId) { + List dates = + docRecordMapper.getPostopDate(encounterId, EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue(), + EncounterClass.IMP.getValue(), SurgicalStatus.COMPLETED.getValue()); + return dates.stream().map(Timestamp::toLocalDateTime).toList(); } /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java index fd8dfa5f1f4604ae53a907e8311c17e78cc8eedb..4ef4444c0f03f0ef4eb87bf6dd39fb6a0b21ceb0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java @@ -27,6 +27,8 @@ import com.openhis.administration.service.IEncounterLocationService; import com.openhis.administration.service.IEncounterParticipantService; import com.openhis.administration.service.IEncounterService; import com.openhis.administration.service.ILocationService; +import com.openhis.clinical.domain.Procedure; +import com.openhis.clinical.service.IProcedureService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; @@ -94,6 +96,9 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { @Resource private IServiceRequestService serviceRequestService; + @Resource + private IProcedureService procedureService; + /** * 入出转管理页面初始化 * @@ -446,8 +451,48 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue()) .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue()) .eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode())); - if (!medicationRequestList.isEmpty() || !serviceRequestList.isEmpty()) { - return R.fail("有待执行的医嘱,请执行完后再转科"); + List reqIdList = new ArrayList<>(); + // 分别处理长期/临时医嘱 + if (!medicationRequestList.isEmpty()) { + if (medicationRequestList.stream() + .anyMatch(x -> x.getTherapyEnum().equals(TherapyTimeType.LONG_TERM.getValue()))) { + return R.fail("长期医嘱需要先停嘱"); + } + List medReqIdList = medicationRequestList.stream() + .filter(x -> x.getTherapyEnum().equals(TherapyTimeType.TEMPORARY.getValue())) + .map(MedicationRequest::getId).toList(); + reqIdList.addAll(medReqIdList); + } + if (!serviceRequestList.isEmpty()) { + if (serviceRequestList.stream() + .anyMatch(x -> x.getTherapyEnum().equals(TherapyTimeType.LONG_TERM.getValue()))) { + return R.fail("长期医嘱需要先停嘱"); + } + List serReqIdList = + serviceRequestList.stream().filter(x -> x.getTherapyEnum().equals(TherapyTimeType.TEMPORARY.getValue())) + .map(ServiceRequest::getId).toList(); + reqIdList.addAll(serReqIdList); + } + if (!reqIdList.isEmpty()) { + // 获取临时医嘱执行记录 + List procedureRecords = procedureService.getProcedureRecords(reqIdList, null); + // 按照医嘱分组 + Map> proceduresMap = + procedureRecords.stream().collect(Collectors.groupingBy(Procedure::getRequestId)); + // 判断是否存在未执行完的临时医嘱 + for (Long reqId : reqIdList) { + List procedures = proceduresMap.get(reqId); + if (procedures == null || procedures.isEmpty()) { + return R.fail("存在未执行或未完成的临时医嘱,请先执行"); + } + // 按时间排序,获取最后一条记录 + Procedure lastProcedure = + procedures.stream().max(Comparator.comparing(Procedure::getCreateTime)).orElse(null); + if (!EventStatus.STOPPED.getValue().equals(lastProcedure.getStatusEnum()) + || !EventStatus.COMPLETED.getValue().equals(lastProcedure.getStatusEnum())) { + return R.fail("存在未执行或未完成的临时医嘱,请先执行"); + } + } } // 查询患者待取的药品 List medicationDispenseList = medicationDispenseService @@ -512,10 +557,50 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue()) .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue()) .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue()) - .eq(ServiceRequest::getParentId, null) - .eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode())); - if (!medicationRequestList.isEmpty() || !serviceRequestList.isEmpty()) { - return R.fail("有待执行的医嘱,请执行完后再出院"); + .eq(ServiceRequest::getParentId, null).eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode())); + + List reqIdList = new ArrayList<>(); + // 分别处理长期/临时医嘱 + if (!medicationRequestList.isEmpty()) { + if (medicationRequestList.stream() + .anyMatch(x -> x.getTherapyEnum().equals(TherapyTimeType.LONG_TERM.getValue()))) { + return R.fail("长期医嘱需要先停嘱"); + } + List medReqIdList = medicationRequestList.stream() + .filter(x -> x.getTherapyEnum().equals(TherapyTimeType.TEMPORARY.getValue())) + .map(MedicationRequest::getId).toList(); + reqIdList.addAll(medReqIdList); + } + if (!serviceRequestList.isEmpty()) { + if (serviceRequestList.stream() + .anyMatch(x -> x.getTherapyEnum().equals(TherapyTimeType.LONG_TERM.getValue()))) { + return R.fail("长期医嘱需要先停嘱"); + } + List serReqIdList = + serviceRequestList.stream().filter(x -> x.getTherapyEnum().equals(TherapyTimeType.TEMPORARY.getValue())) + .map(ServiceRequest::getId).toList(); + reqIdList.addAll(serReqIdList); + } + if (!reqIdList.isEmpty()) { + // 获取临时医嘱执行记录 + List procedureRecords = procedureService.getProcedureRecords(reqIdList, null); + // 按照医嘱分组 + Map> proceduresMap = + procedureRecords.stream().collect(Collectors.groupingBy(Procedure::getRequestId)); + // 判断是否存在未执行完的临时医嘱 + for (Long reqId : reqIdList) { + List procedures = proceduresMap.get(reqId); + if (procedures == null || procedures.isEmpty()) { + return R.fail("存在未执行或未完成的临时医嘱,请先执行"); + } + // 按时间排序,获取最后一条记录 + Procedure lastProcedure = + procedures.stream().max(Comparator.comparing(Procedure::getCreateTime)).orElse(null); + if (!EventStatus.STOPPED.getValue().equals(lastProcedure.getStatusEnum()) + && !EventStatus.COMPLETED.getValue().equals(lastProcedure.getStatusEnum())) { + return R.fail("存在未执行或未完成的临时医嘱,请先执行"); + } + } } // 查询患者待取的药品 List medicationDispenseList = medicationDispenseService @@ -544,14 +629,10 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { public R terminalCleaning(Long encounterId) { Encounter encounter = encounterService.getById(encounterId); - if (EncounterZyStatus.ALREADY_SETTLED.getValue().equals(encounter.getStatusEnum()) - || EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) { + if (!EncounterZyStatus.ALREADY_SETTLED.getValue().equals(encounter.getStatusEnum()) + && !EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) { return R.fail("请等待出院结算完成后再清床"); } - // 更新患者位置状态:已完成 - encounterLocationService.updateEncounterLocationStatus(encounterId, true); - // 更新患者相关医生状态:已完成 - encounterParticipantService.updateEncounterParticipantsStatus(encounterId); // 更新原病床状态:空闲 List encounterLocationList = encounterLocationService.getEncounterLocationList(encounterId, LocationForm.BED, EncounterActivityStatus.ACTIVE); @@ -559,6 +640,10 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { return R.fail("清床失败,请检查病床状态"); } locationService.updateStatusById(encounterLocationList.get(0).getLocationId(), LocationStatus.IDLE.getValue()); + // 更新患者位置状态:已完成 + encounterLocationService.updateEncounterLocationStatus(encounterId, true); + // 更新患者相关医生状态:已完成 + encounterParticipantService.updateEncounterParticipantsStatus(encounterId); return R.ok("清床完成"); } 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 2a2637e7c5fa1065ab773f4ed5979d052b43dd52..5ba58dbda680a979661e89f71792653d57cdfa4c 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 @@ -139,11 +139,12 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { CommonConstants.FieldName.PatientName, CommonConstants.FieldName.BusNo)), request); // 入院患者分页列表 - Page admissionPatientPage = adviceProcessAppMapper.selectInpatientPage( - new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.IMP.getValue(), - EncounterZyStatus.TO_BE_REGISTERED.getValue(), EncounterZyStatus.REGISTERED.getValue(), - EncounterActivityStatus.ACTIVE.getValue(), LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), - LocationForm.BED.getValue(), AccountType.PERSONAL_CASH_ACCOUNT.getCode()); + Page admissionPatientPage = + adviceProcessAppMapper.selectInpatientPage(new Page<>(pageNo, pageSize), queryWrapper, + EncounterClass.IMP.getValue(), EncounterZyStatus.TO_BE_REGISTERED.getValue(), + EncounterZyStatus.REGISTERED.getValue(), EncounterZyStatus.ALREADY_SETTLED.getValue(), + EncounterActivityStatus.ACTIVE.getValue(), LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), + LocationForm.BED.getValue(), AccountType.PERSONAL_CASH_ACCOUNT.getCode()); admissionPatientPage.getRecords().forEach(e -> { // 性别枚举 e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java index 1fbcd8ed6114fccb974193644229b2a2c85834ff..54bb8207119fad23e97197addfe7f783562cfe87 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java @@ -31,6 +31,7 @@ public interface AdviceProcessAppMapper { * @param imp 就诊类型:住院 * @param toBeRegistered 就诊状态:待登记 * @param registered 就诊状态:待入院 + * @param alreadySettled 就诊状态:已结算出院 * @param active 住院位置状态:使用中 * @param ward 位置类型:病区 * @param house 位置类型:病房 @@ -41,8 +42,9 @@ public interface AdviceProcessAppMapper { Page selectInpatientPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("imp") Integer imp, @Param("toBeRegistered") Integer toBeRegistered, @Param("registered") Integer registered, - @Param("active") Integer active, @Param("ward") Integer ward, @Param("house") Integer house, - @Param("bed") Integer bed, @Param("personalCashAccount") String personalCashAccount); + @Param("alreadySettled") Integer alreadySettled, @Param("active") Integer active, @Param("ward") Integer ward, + @Param("house") Integer house, @Param("bed") Integer bed, + @Param("personalCashAccount") String personalCashAccount); /** * 查询医嘱分页列表 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/IInventorySettlementAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/IInventorySettlementAppServiceImpl.java index 20b6630cc50b92806150a9ec04f8cb478446c91e..f7cacd311ddd352dfe5734fcee17c975408bed24 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/IInventorySettlementAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/IInventorySettlementAppServiceImpl.java @@ -71,9 +71,9 @@ public class IInventorySettlementAppServiceImpl implements IInventorySettlementA return R.fail("请选择库房"); } // 构建查询条件 - QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( - null, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.ItemName, - CommonConstants.FieldName.ItemNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)), + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.ItemName, CommonConstants.FieldName.ItemNo, + CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)), null); // 查询药品目录 Page inventorySettlementPage = diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java index 3a1aabff772098a454970559dcfe6a094d835bde..800931a8130ab36d60ff1a5185c740a3497e96ac 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java @@ -10,8 +10,6 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.core.common.utils.*; -import com.openhis.web.inventorymanage.dto.ProductTransferPageDto; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -22,6 +20,7 @@ import com.core.common.core.domain.R; import com.core.common.core.domain.model.LoginUser; import com.core.common.enums.TenantOptionDict; import com.core.common.exception.NonCaptureException; +import com.core.common.utils.*; import com.core.common.utils.poi.ExcelUtil; import com.core.web.util.TenantOptionUtil; import com.openhis.administration.domain.ChargeItemDefDetail; @@ -100,9 +99,10 @@ public class ProductDetailAppServiceImpl extends ServiceImpl queryWrapper = HisQueryUtils.buildQueryWrapper( - productDetailSearchParam, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.ItemName, - CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)), + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(productDetailSearchParam, + searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.ItemName, CommonConstants.FieldName.BusNo, + CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr, CommonConstants.FieldName.LotNumber)), request); // 根据不同分类拼接查询条件 if (medCategoryCodes != null && !medCategoryCodes.isEmpty()) { @@ -413,29 +413,28 @@ public class ProductDetailAppServiceImpl extends ServiceImpl> result = this.getProductDetailBackupPage(productDetailSearchParam,1,100000,searchKey,request); - if (result.getData() != null){ + public void exportExcel(ProductDetailSearchParam productDetailSearchParam, Integer pageNo, Integer pageSize, + String searchKey, HttpServletRequest request, HttpServletResponse response) { + R> result = + this.getProductDetailBackupPage(productDetailSearchParam, 1, 100000, searchKey, request); + if (result.getData() != null) { Page pageData = result.getData(); List dataList = pageData.getRecords(); for (ProductDetailPageDto productDetailPageDto : dataList) { // 获取单位 - String unitCode = DictUtils.getDictLabel("unit_code",productDetailPageDto.getUnitCode()); - String minUnitCode = DictUtils.getDictLabel("unit_code",productDetailPageDto.getMinUnitCode()); + String unitCode = DictUtils.getDictLabel("unit_code", productDetailPageDto.getUnitCode()); + String minUnitCode = DictUtils.getDictLabel("unit_code", productDetailPageDto.getMinUnitCode()); // 获取数量 BigDecimal number = productDetailPageDto.getNumber(); BigDecimal remainder = productDetailPageDto.getRemainder(); // 拼接 if (remainder.compareTo(BigDecimal.ZERO) > 0) { productDetailPageDto.setNumber_text(number.setScale(0, RoundingMode.HALF_UP) + unitCode - + remainder.setScale(0, RoundingMode.HALF_UP) + minUnitCode); + + remainder.setScale(0, RoundingMode.HALF_UP) + minUnitCode); } else { productDetailPageDto.setNumber_text(number.setScale(0, RoundingMode.HALF_UP) + unitCode); } productDetailPageDto.setQuantity_text( - productDetailPageDto.getQuantity().setScale(0, RoundingMode.HALF_UP) + minUnitCode); + productDetailPageDto.getQuantity().setScale(0, RoundingMode.HALF_UP) + minUnitCode); - // 金额字段拼接 + // 金额字段拼接 BigDecimal purchasePrice = productDetailPageDto.getPurchasePrice(); BigDecimal salePrice = productDetailPageDto.getSalePrice(); BigDecimal totalPurchasePrice = productDetailPageDto.getTotalPurchasePrice(); BigDecimal totalSalePrice = productDetailPageDto.getTotalSalePrice(); if (salePrice != null) { - productDetailPageDto.setExcelSalePrice( - salePrice.setScale(2, RoundingMode.HALF_UP) + ""); + productDetailPageDto.setExcelSalePrice(salePrice.setScale(2, RoundingMode.HALF_UP) + ""); } if (purchasePrice != null) { - productDetailPageDto.setExcelPurchasePrice( - purchasePrice.setScale(2, RoundingMode.HALF_UP) + ""); + productDetailPageDto.setExcelPurchasePrice(purchasePrice.setScale(2, RoundingMode.HALF_UP) + ""); } if (totalPurchasePrice != null) { - productDetailPageDto.setExcelTotalPurchasePrice( - totalPurchasePrice.setScale(2, RoundingMode.HALF_UP) + ""); + productDetailPageDto + .setExcelTotalPurchasePrice(totalPurchasePrice.setScale(2, RoundingMode.HALF_UP) + ""); } if (totalSalePrice != null) { - productDetailPageDto.setExcelTotalSalePrice( - totalSalePrice.setScale(2, RoundingMode.HALF_UP) + ""); + productDetailPageDto.setExcelTotalSalePrice(totalSalePrice.setScale(2, RoundingMode.HALF_UP) + ""); } // 判断项目类别 - String devCategoryCodeDictText = DictUtils.getDictLabel("device_category_code",productDetailPageDto.getDevCategoryCode()); - String medCategoryCodeDictText = DictUtils.getDictLabel("med_category_code",productDetailPageDto.getMedCategoryCode()); - String categoryCodeDictText = StringUtils.isEmpty(devCategoryCodeDictText) ? medCategoryCodeDictText : devCategoryCodeDictText; + String devCategoryCodeDictText = + DictUtils.getDictLabel("device_category_code", productDetailPageDto.getDevCategoryCode()); + String medCategoryCodeDictText = + DictUtils.getDictLabel("med_category_code", productDetailPageDto.getMedCategoryCode()); + String categoryCodeDictText = + StringUtils.isEmpty(devCategoryCodeDictText) ? medCategoryCodeDictText : devCategoryCodeDictText; productDetailPageDto.setCategoryCodeDictText(categoryCodeDictText); - //剂型 - String doseFormCodeDictText = DictUtils.getDictLabel("dose_form_code",productDetailPageDto.getDoseFormCode()); + // 剂型 + String doseFormCodeDictText = + DictUtils.getDictLabel("dose_form_code", productDetailPageDto.getDoseFormCode()); productDetailPageDto.setDoseFormCodeDictText(doseFormCodeDictText); } try { // 导出 - NewExcelUtil newExcelUtil = - new NewExcelUtil<>(ProductDetailPageDto.class); + NewExcelUtil newExcelUtil = new NewExcelUtil<>(ProductDetailPageDto.class); newExcelUtil.exportExcel(response, dataList, CommonConstants.SheetName.INVENTORY_DETAIL_RECORD); } catch (Exception e) { throw new RuntimeException(e); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/InventorySettlementSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/InventorySettlementSearchParam.java index f1e0378adb1c63b1924802d06c74fa3786384202..5de218d6b534143c9b156158923721b1c694151b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/InventorySettlementSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/InventorySettlementSearchParam.java @@ -30,4 +30,5 @@ public class InventorySettlementSearchParam { /** 是否账平 */ private Integer isBalance; + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptPageDto.java index 6c469a9a554d31637576c7870aa2740800388bf2..36dd9fab713e03641a64570fdd35afef23542455 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ReceiptPageDto.java @@ -136,4 +136,8 @@ public class ReceiptPageDto { private BigDecimal totalAmount; private String totalAmountText; + /** + * 发票号 + */ + private String invoiceNo; } 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 0d7f0e0b72d8a5c0bc95ce240777edc95d619a5e..10b6a708f52dbcdfa42c14816083dc5351f1462c 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 @@ -339,7 +339,8 @@ public class PaymentRecServiceImpl implements IPaymentRecService { paymentRecDetailDto = new PaymentRecDetailDto(); paymentRecDetailDto.setPayEnum(paymentRecDetail.getPayEnum()).setId(paymentRecDetail.getId()) - .setAccountId(paymentRecDetail.getAccountId()).setAmount(paymentRecDetail.getAmount()) + .setAccountId(paymentRecDetail.getAccountId()) + .setAmount(paymentRecDetail.getAmount().setScale(2, RoundingMode.HALF_UP)) .setPayEnumText(ybPayment == null ? "" : ybPayment.getInfo()); list.add(paymentRecDetailDto); } @@ -2445,6 +2446,18 @@ public class PaymentRecServiceImpl implements IPaymentRecService { iPaymentReconciliationService.updateById(unPaymentReconciliation); } } + + // 更新收费状态:已退费 + List chargeItemIdList = Arrays.stream(paymentReconciliation.getChargeItemIds().split(",")) + .map(Long::parseLong).collect(Collectors.toList()); + chargeItemService.updatePaymentStatus(chargeItemIdList, ChargeItemStatus.PLANNED.getValue()); + + // 更新患者状态 待出院结算 + iEncounterService.updateEncounterStatus(paymentReconciliation.getEncounterId(), + EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue()); + + logger.info("退费成功:payment:" + JSON.toJSONString(unPaymentReconciliation)); + return R.ok(unPaymentReconciliation, "退款成功"); } 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 205311319cff3aa4295a23e6729706f818356f46..630c0515f3504aa6eca5aa5442216d01c15c8660 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 @@ -106,7 +106,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue(), EncounterActivityStatus.ACTIVE.getValue(), EncounterClass.IMP.getValue(), Whether.YES.getValue(), AccountType.PERSONAL_CASH_ACCOUNT.getCode(), EncounterZyStatus.TO_BE_REGISTERED.getValue(), - EncounterZyStatus.ALREADY_SETTLED.getValue(),EncounterZyStatus.REGISTERED.getValue(), queryWrapper); + EncounterZyStatus.ALREADY_SETTLED.getValue(), EncounterZyStatus.REGISTERED.getValue(), queryWrapper); // 就诊ID集合 List encounterIds = regPatientMainInfo.getRecords().stream().map(RegPatientMainInfoDto::getEncounterId).toList(); @@ -679,12 +679,12 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { public R signOffRegAdvice(List paramList) { // 药品 List medicineList = paramList.stream() - .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).toList(); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); // 诊疗 List activityList = paramList.stream() - .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).toList(); List activityRequestIds = activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); // 查询已完成的药品请求 @@ -736,24 +736,28 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { // 当前时间 Date date = new Date(); // 药品 - List medicineList = paramList.stream() - .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + List medicineList = + paramList.stream().filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).toList(); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); // 诊疗 - List activityList = paramList.stream() - .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + List activityList = + paramList.stream().filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).toList(); List activityRequestIds = activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); if (!medicineRequestIds.isEmpty()) { - iMedicationRequestService.update(new LambdaUpdateWrapper() - .in(MedicationRequest::getId, medicineRequestIds).set(MedicationRequest::getEffectiveDoseEnd, date) - .set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())); + iMedicationRequestService + .update(new LambdaUpdateWrapper().in(MedicationRequest::getId, medicineRequestIds) + .eq(MedicationRequest::getTherapyEnum, TherapyTimeType.LONG_TERM.getValue()) + .set(MedicationRequest::getEffectiveDoseEnd, date) + .set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())); } if (!activityRequestIds.isEmpty()) { - iServiceRequestService.update(new LambdaUpdateWrapper() - .in(ServiceRequest::getId, activityRequestIds).set(ServiceRequest::getOccurrenceEndTime, date) - .set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())); + iServiceRequestService + .update(new LambdaUpdateWrapper().in(ServiceRequest::getId, activityRequestIds) + .eq(ServiceRequest::getTherapyEnum, TherapyTimeType.LONG_TERM.getValue()) + .set(ServiceRequest::getOccurrenceEndTime, date) + .set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())); } return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医嘱停止"})); } diff --git a/openhis-server-new/openhis-application/src/main/resources/application-cloud.yml b/openhis-server-new/openhis-application/src/main/resources/application-cloud.yml new file mode 100644 index 0000000000000000000000000000000000000000..596c0770009bdb9c64a554d484d30d31b7e27b67 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/application-cloud.yml @@ -0,0 +1,87 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: org.postgresql.Driver + druid: + # 主库数据源 + master: + url: jdbc:postgresql://60.188.247.175: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 + # redis 配置 + redis: + # 地址 + host: 60.188.247.175 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码 + 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 \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/application-prod.yml b/openhis-server-new/openhis-application/src/main/resources/application-prod.yml index 919d5b0a0d3d32c569f80c864471fd747aadd07b..34f315c8212b30c73a0b5a115ad30c1cf91b0687 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application-prod.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application-prod.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:postgresql://192.168.2.15:5432/openhis-xz?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 + url: jdbc:postgresql://192.168.2.15:5432/openhis-v1.3?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 username: postgres password: root # 从库数据源 diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ReceiptApprovalMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ReceiptApprovalMapper.xml index 2b82ad60c342abdc56cabe47d48e9cbceff26144..6e885dfd071e5ef83ec8061b1f610ee31e4cb875 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ReceiptApprovalMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/ReceiptApprovalMapper.xml @@ -148,48 +148,49 @@ T2.practitioner_id, T2.tenant_id, T2.purpose_location_id, + T2.invoice_no, CASE WHEN T2.type_enum IN (#{purchaseInventory}, #{productReturn}) THEN T2.supplier_id ELSE NULL END AS supplier_id, T2.total_amount - FROM ( - SELECT T1.bus_no AS supply_bus_no, - T1.status_enum, - T1.type_enum, - T1.approver_id, - T1.approval_time, - T1.applicant_id, - T1.apply_time, - T1.practitioner_id, - T1.tenant_id, - T1.purpose_location_id, - MAX(CASE - WHEN T1.type_enum IN (#{purchaseInventory}, #{productReturn}) THEN T1.supplier_id - ELSE NULL END) AS supplier_id, - SUM(T1.total_price) AS total_amount - FROM wor_supply_request AS T1 - LEFT JOIN adm_supplier T3 - ON T3.id = T1.supplier_id AND T3.delete_flag = '0' AND T3.tenant_id = 1 - LEFT JOIN adm_location T4 - ON T4.id = T1.purpose_location_id AND T4.delete_flag = '0' AND T4.tenant_id = 1 - WHERE T1.status_enum IN (#{approval}, #{agree}, #{reject}) - AND T1.type_enum IN - (#{productBatchTransfer}, #{productTransfer}, #{productReturn}, #{productStocktaking}, - #{productBatchStocktaking}, #{purchaseInventory}, #{lossReportForm}, #{issueInventory}, - #{returnIssue}) - AND T1.delete_flag = '0' - GROUP BY T1.bus_no, - T1.status_enum, - T1.type_enum, - T1.approver_id, - T1.approval_time, - T1.applicant_id, - T1.apply_time, - T1.practitioner_id, - T1.tenant_id, - T1.purpose_location_id - ORDER BY T1.apply_time desc - ) AS T2 + FROM (SELECT T1.bus_no AS supply_bus_no, + T1.status_enum, + T1.type_enum, + T1.approver_id, + T1.approval_time, + T1.applicant_id, + T1.apply_time, + T1.practitioner_id, + T1.tenant_id, + T1.purpose_location_id, + T1.invoice_no, + MAX(CASE + WHEN T1.type_enum IN (#{purchaseInventory}, #{productReturn}) THEN T1.supplier_id + ELSE NULL END) AS supplier_id, + SUM(T1.total_price) AS total_amount + FROM wor_supply_request AS T1 + LEFT JOIN adm_supplier T3 + ON T3.id = T1.supplier_id AND T3.delete_flag = '0' AND T3.tenant_id = 1 + LEFT JOIN adm_location T4 + ON T4.id = T1.purpose_location_id AND T4.delete_flag = '0' AND T4.tenant_id = 1 + WHERE T1.status_enum IN (#{approval}, #{agree}, #{reject}) + AND T1.type_enum IN + (#{productBatchTransfer}, #{productTransfer}, #{productReturn}, #{productStocktaking}, + #{productBatchStocktaking}, #{purchaseInventory}, #{lossReportForm}, #{issueInventory}, + #{returnIssue}) + AND T1.delete_flag = '0' + GROUP BY T1.bus_no, + T1.status_enum, + T1.type_enum, + T1.approver_id, + T1.approval_time, + T1.applicant_id, + T1.apply_time, + T1.practitioner_id, + T1.tenant_id, + T1.purpose_location_id, + T1.invoice_no + ORDER BY T1.apply_time desc) AS T2 ${ew.customSqlSegment} diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalcharge/InHospitalRegisterAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalcharge/InHospitalRegisterAppMapper.xml index 9dd86a07c9edf5d0c6c9378eeaac36160b9d3a23..013a5c1e259b98d1c5aecc07e45bedf3f5d273bb 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalcharge/InHospitalRegisterAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalcharge/InHospitalRegisterAppMapper.xml @@ -129,8 +129,10 @@ ON aed.delete_flag = '0' AND aed.maindise_flag = #{maindiseFlag} AND aed.encounter_id = CASE - WHEN ae.amb_encounter_id IS NOT NULL THEN ae.amb_encounter_id - ELSE ae.ID + -- WHEN ae.amb_encounter_id IS NOT NULL THEN ae.amb_encounter_id + -- ELSE ae.ID + WHEN ae.ID IS NOT NULL THEN ae.ID + ELSE ae.amb_encounter_id END LEFT JOIN cli_condition AS cc ON cc.ID = aed.condition_id 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 15aa547ce11d5be345d6320eecd501c09cb20099..af9f46e64e73aa24bf0311dfec4dc0605b9d028f 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 @@ -82,6 +82,7 @@ AND ae.class_enum = #{imp} AND ae.status_enum != #{toBeRegistered} AND ae.status_enum != #{registered} + AND ae.status_enum != #{alreadySettled} AND aa.type_code = #{personalCashAccount} GROUP BY ae.id, ae.bus_no, 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 7367885c1d7e5cb51270304cc930f93480223203..ad9bc98f1dd537d5fd36c0fbbffca10a9f909f23 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 @@ -445,6 +445,11 @@ public class CommonConstants { * 入科科室ID */ String InHospitalOrgId = "in_hospital_org_id"; + + /** + * 批次号 + */ + String LotNumber = "lot_number"; } /** diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..ed46ac969858ea7e1f6166be153cd9b1148fe1a8 --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java @@ -0,0 +1,49 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 手术类型 + * + * @author swb + * @date 2025-12-25 + */ +@Getter +@AllArgsConstructor +public enum SurgicalStatus implements HisEnumInterface { + PREPARING(1, "1", "准备中"), + + IN_PROGRESS(2, "2", "进行中"), + + NOT_DONE(3, "3", "未做"), + + PAUSE(4, "4", "暂停"), + + STOP(5, "5", "停止"), + + COMPLETED(6, "6", "完成"), + + INPUT_ERROR(7, "7", "输入错误"), + + UNKNOWN(8, "8", "未知"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + public static SurgicalStatus getByValue(Integer value) { + if (value == null) { + return null; + } + for (SurgicalStatus val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/mapper/DocRecordMapper.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/mapper/DocRecordMapper.java index fe046dae5528919462c423febacdaee4b636f4f7..2b4e75b2ae025b4ce3390b3049bd577de7a55190 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/mapper/DocRecordMapper.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/document/mapper/DocRecordMapper.java @@ -1,11 +1,50 @@ package com.openhis.document.mapper; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.openhis.administration.domain.Encounter; import com.openhis.document.domain.DocRecord; -import org.springframework.stereotype.Repository; @Repository public interface DocRecordMapper extends BaseMapper { + /** + * 获取住院、出院时间 + * + * @param encounterId 就诊ID + * @param encounterStatus 就诊类型 + * @return 病历 + */ + Encounter getInOutDate(@Param("encounterId") Long encounterId, @Param("encounterStatus") Integer encounterStatus); + + /** + * 获取入科时间 + * + * @param encounterId 就诊ID + * @param bed 床位 + * @param active 使用中 + * @return 入科时间 + */ + Date getAdmissionDate(@Param("encounterId") Long encounterId, @Param("bed") Integer bed, + @Param("active") Integer active); + + /** + * 获取手术时间 + * + * @param encounterId 就诊ID + * @param encounterZyStatus 住院状态 + * @param encounterStatus 就诊类型 + * @param completed 完成 + * @return 手术时间 + */ + List getPostopDate(@Param("encounterId") Long encounterId, + @Param("encounterZyStatus") Integer encounterZyStatus, @Param("encounterStatus") Integer encounterStatus, + @Param("completed") Integer completed); } diff --git a/openhis-server-new/openhis-domain/src/main/resources/mapper/document/DocRecordMapper.xml b/openhis-server-new/openhis-domain/src/main/resources/mapper/document/DocRecordMapper.xml index abd4bac5bee7a58efed292a5b8b57a80dec903ce..9c87e3a119cda5bd8fa698078101cf119e99b02c 100644 --- a/openhis-server-new/openhis-domain/src/main/resources/mapper/document/DocRecordMapper.xml +++ b/openhis-server-new/openhis-domain/src/main/resources/mapper/document/DocRecordMapper.xml @@ -4,4 +4,34 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/components/PatientList/index.vue b/openhis-ui-vue3/src/components/PatientList/index.vue index f20cc3b88eca8d25eacae4723972b66a9b87e09a..cf3ea2e12f6d03b0ff9fbf5f1fb9f41fad009beb 100644 --- a/openhis-ui-vue3/src/components/PatientList/index.vue +++ b/openhis-ui-vue3/src/components/PatientList/index.vue @@ -167,7 +167,7 @@ diff --git a/openhis-ui-vue3/src/components/patientBar/inPatientBarDoctorFold.vue b/openhis-ui-vue3/src/components/patientBar/inPatientBarDoctorFold.vue index 2e271b58eff61037b4694d7aafd0542b27ec01b2..92be688e9eb04873d9e1ca01dd52aa44fc31945c 100644 --- a/openhis-ui-vue3/src/components/patientBar/inPatientBarDoctorFold.vue +++ b/openhis-ui-vue3/src/components/patientBar/inPatientBarDoctorFold.vue @@ -132,7 +132,8 @@ diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/transferOrganizationDialog.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/transferOrganizationDialog.vue index 3e89dce2a4e65a7161b55c4ea96f3efd18d6f2df..153e64a3082f0960d2c9f367bd249a6e000f703d 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/transferOrganizationDialog.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/transferOrganizationDialog.vue @@ -25,7 +25,11 @@ - + { console.log(patientInfo.value); if (valid) { - form.encounterId = patientInfo.value.encounterId - form.patientId = patientInfo.value.patientId + form.encounterId = patientInfo.value.encounterId; + form.patientId = patientInfo.value.patientId; // 表单校验通过,执行提交逻辑 transferOrganization(form).then((res) => { if (res.code == 200) { proxy.$modal.msgSuccess('转科申请已提交'); dialogVisible.value = false; + emit('success'); } }); } else { @@ -145,4 +154,4 @@ function closeDialog() { defineExpose({ openDialog, }); - \ No newline at end of file + diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index 18c23a6f24afa227197d9c753677300f7b5161da..9016c245a78cd77456a466fffa1372d5a3fc22ab 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -122,7 +122,6 @@ @@ -180,7 +179,8 @@ :popoverVisible="scope.row.showPopover" :adviceQueryParams="adviceQueryParams" :patientInfo="patientInfo" - @selectAdviceBase="(row) => selectAdviceBase(scope.row.uniqueKey, row)" + @selectAdviceBase="(row) => handleSelectAdviceBase(scope.row, scope.$index, row)" + @preventClose="() => handlePreventClose(scope.row, scope.$index)" />