From 21d21784f9afc2431883c5bc72212d79d780a7b5 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Wed, 19 Mar 2025 15:37:20 +0800 Subject: [PATCH 001/149] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=8C=BB=E5=98=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IDoctorStationAdviceAppService.java | 11 ++ .../DoctorStationAdviceAppServiceImpl.java | 168 +++++++++++++++++- .../DoctorStationAdviceController.java | 19 +- .../web/doctorstation/dto/AdvicePriceDto.java | 4 + .../web/doctorstation/dto/AdviceSaveDto.java | 34 +++- .../assembler/InventoryManageAssembler.java | 2 +- .../DoctorStationAdviceAppMapper.xml | 1 + .../common/enums/ChargeItemContext.java | 16 +- .../com/openhis/common/enums/ItemType.java | 4 +- .../administration/domain/ChargeItem.java | 2 +- .../medication/domain/MedicationRequest.java | 2 +- .../workflow/domain/DeviceRequest.java | 2 +- .../workflow/domain/ServiceRequest.java | 2 +- 13 files changed, 241 insertions(+), 26 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java index 6af98657..8243acb7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java @@ -1,7 +1,10 @@ package com.openhis.web.doctorstation.appservice; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.core.common.core.domain.R; import com.openhis.web.doctorstation.dto.AdviceBaseDto; +import com.openhis.web.doctorstation.dto.AdviceSaveDto; +import com.openhis.web.doctorstation.dto.AdviceSaveParam; /** * 医生站-医嘱/处方 应用Service @@ -21,4 +24,12 @@ public interface IDoctorStationAdviceAppService { IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId, Integer pageNo, Integer pageSize); + /** + * 门诊保存医嘱 + * + * @param adviceSaveParam 医嘱表单信息 + * @return 结果 + */ + R saveAdvice(AdviceSaveParam adviceSaveParam); + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index ffa188be..b2b36c76 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -1,5 +1,7 @@ package com.openhis.web.doctorstation.appservice.impl; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -13,16 +15,25 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.MessageUtils; +import com.openhis.administration.domain.ChargeItem; +import com.openhis.administration.service.IChargeItemService; import com.openhis.common.constant.CommonConstants; -import com.openhis.common.enums.ActivityType; -import com.openhis.common.enums.ConditionCode; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; +import com.openhis.medication.domain.MedicationRequest; +import com.openhis.medication.service.IMedicationRequestService; import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService; -import com.openhis.web.doctorstation.dto.AdviceBaseDto; -import com.openhis.web.doctorstation.dto.AdviceInventoryDto; -import com.openhis.web.doctorstation.dto.AdvicePriceDto; +import com.openhis.web.doctorstation.dto.*; import com.openhis.web.doctorstation.mapper.DoctorStationAdviceAppMapper; +import com.openhis.workflow.domain.DeviceRequest; +import com.openhis.workflow.domain.ServiceRequest; +import com.openhis.workflow.service.IDeviceRequestService; +import com.openhis.workflow.service.IServiceRequestService; /** * 医生站-医嘱/处方 应用实现类 @@ -30,9 +41,24 @@ import com.openhis.web.doctorstation.mapper.DoctorStationAdviceAppMapper; @Service public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAppService { + @Resource + AssignSeqUtil assignSeqUtil; + @Resource DoctorStationAdviceAppMapper doctorStationAdviceAppMapper; + @Resource + IMedicationRequestService iMedicationRequestService; + + @Resource + IDeviceRequestService iDeviceRequestService; + + @Resource + IServiceRequestService iServiceRequestService; + + @Resource + IChargeItemService iChargeItemService; + /** * 查询医嘱信息 * @@ -63,6 +89,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 医嘱库存集合 List adviceInventory = doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList, CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR); + // TODO: 预减库存待处理 + // 费用定价子表信息 List childCharge = doctorStationAdviceAppMapper .getChildCharge(ConditionCode.UNIT_PRODUCT_BATCH_NUM.getInfo(), chargeItemDefinitionIdList); @@ -132,4 +160,134 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp return adviceBaseInfo; } + /** + * 门诊保存医嘱 + * + * @param adviceSaveParam 医嘱表单信息 + * @return 结果 + */ + @Override + public R saveAdvice(AdviceSaveParam adviceSaveParam) { + // 医嘱分类信息 + List adviceSaveList = adviceSaveParam.getAdviceSaveList(); + // TODO: 保存医嘱时规则校验;待做 + // 药品 + List medicineList = adviceSaveList.stream() + .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + // 耗材 + List deviceList = adviceSaveList.stream() + .filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + // 诊疗活动 + List activityList = adviceSaveList.stream() + .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + // 生成处方号 , 只有开了药品才有处方号 + String prescriptionNo = ""; + if (medicineList.size() > 0) { + prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_NO.getPrefix(), 8); + } + // 保存药品请求 + List medicationRequestList = new ArrayList<>(); + MedicationRequest medicationRequest; + for (AdviceSaveDto adviceSaveDto : medicineList) { + medicationRequest = new MedicationRequest(); + medicationRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 8)); + medicationRequest.setPrescriptionNo(prescriptionNo); + medicationRequest.setQuantity(adviceSaveDto.getQuantity()); + medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum()); + medicationRequest.setUnitCode(adviceSaveDto.getUnitCode()); + medicationRequest.setLotNumber(adviceSaveDto.getLotNumber()); + medicationRequest.setStatusEnum(adviceSaveDto.getStatusEnum()); + medicationRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); + medicationRequest.setMedicationId(adviceSaveDto.getAdviceDefinitionId());// 医嘱定义id + medicationRequest.setPatientId(adviceSaveDto.getPatientId()); + medicationRequest.setPractitionerId(adviceSaveDto.getPractitionerId()); + medicationRequest.setOrgId(adviceSaveDto.getOrgId()); + medicationRequest.setLocationId(adviceSaveDto.getLocationId()); + medicationRequest.setEncounterId(adviceSaveDto.getEncounterId()); + medicationRequest.setTherapyEnum(adviceSaveDto.getTherapyEnum()); + medicationRequest.setMethodCode(adviceSaveDto.getMethodCode()); + medicationRequest.setRateCode(adviceSaveDto.getRateCode()); + medicationRequest.setDose(adviceSaveDto.getDose()); + medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); + // medicationRequest.setPackageId(adviceSaveDto.getPackageId()); + + medicationRequestList.add(medicationRequest); + } + iMedicationRequestService.saveBatch(medicationRequestList); + + // 保存耗材请求 + List deviceRequestList = new ArrayList<>(); + DeviceRequest deviceRequest; + for (AdviceSaveDto adviceSaveDto : deviceList) { + deviceRequest = new DeviceRequest(); + deviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 8)); + deviceRequest.setPrescriptionNo(prescriptionNo); + deviceRequest.setQuantity(adviceSaveDto.getQuantity()); + deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); + deviceRequest.setLotNumber(adviceSaveDto.getLotNumber()); + deviceRequest.setStatusEnum(adviceSaveDto.getStatusEnum()); + deviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); + deviceRequest.setDeviceDefId(adviceSaveDto.getAdviceDefinitionId());// 耗材定义id + deviceRequest.setPatientId(adviceSaveDto.getPatientId()); + deviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); + deviceRequest.setOrgId(adviceSaveDto.getOrgId()); + deviceRequest.setLocationId(adviceSaveDto.getLocationId()); + deviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); + // deviceRequest.setPackageId(adviceSaveDto.getPackageId()); + // deviceRequest.setActivityId(adviceSaveDto.getActivityId()); + + deviceRequestList.add(deviceRequest); + } + iDeviceRequestService.saveBatch(deviceRequestList); + + // 保存诊疗项目请求 + List serviceRequestList = new ArrayList<>(); + ServiceRequest serviceRequest; + for (AdviceSaveDto adviceSaveDto : activityList) { + serviceRequest = new ServiceRequest(); + serviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 8)); + serviceRequest.setPrescriptionNo(prescriptionNo); + serviceRequest.setBasedOnTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION); + serviceRequest.setBasedOnId(adviceSaveDto.getAdviceDefinitionId()); + serviceRequest.setQuantity(adviceSaveDto.getQuantity()); + serviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); + serviceRequest.setStatusEnum(adviceSaveDto.getStatusEnum()); + serviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); + serviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); + serviceRequest.setActivityId(adviceSaveDto.getAdviceDefinitionId());// 诊疗定义id + serviceRequest.setPatientId(adviceSaveDto.getPatientId()); + serviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); + serviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); + + serviceRequestList.add(serviceRequest); + } + iServiceRequestService.saveBatch(serviceRequestList); + + // 保存费用项管理 + List chargeItemList = new ArrayList<>(); + ChargeItem chargeItem; + for (AdviceSaveDto adviceSaveDto : adviceSaveList) { + chargeItem = new ChargeItem(); + chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue()); + chargeItem.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix(), 8)); + chargeItem.setPrescriptionNo(prescriptionNo); + chargeItem.setPatientId(adviceSaveDto.getPatientId()); + chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); + chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); + chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 + chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 + chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 + chargeItem + .setTotalPrice((new BigDecimal(adviceSaveDto.getQuantity()).multiply(adviceSaveDto.getUnitPrice())) + .setScale(4, RoundingMode.HALF_UP)); // 总价 + chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId()); + chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId()); + + chargeItemList.add(chargeItem); + } + iChargeItemService.saveBatch(chargeItemList); + + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊医嘱"})); + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java index 4817d37a..78d61f83 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java @@ -3,14 +3,12 @@ */ package com.openhis.web.doctorstation.controller; -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 org.springframework.web.bind.annotation.*; import com.core.common.core.domain.R; import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService; import com.openhis.web.doctorstation.dto.AdviceBaseDto; +import com.openhis.web.doctorstation.dto.AdviceSaveParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -39,11 +37,22 @@ public class DoctorStationAdviceController { @GetMapping(value = "/advice-base-info") public R getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, @RequestParam(value = "searchKey", defaultValue = "") String searchKey, - @RequestParam(value = "locationId",required = false) Long locationId, + @RequestParam(value = "locationId", required = false) Long locationId, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { return R.ok( iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, pageNo, pageSize)); } + /** + * 门诊保存医嘱 + * + * @param adviceSaveParam 医嘱表单信息 + * @return 结果 + */ + @PostMapping(value = "/save-advice") + public R saveAdvice(@RequestBody AdviceSaveParam adviceSaveParam) { + return iDoctorStationAdviceAppService.saveAdvice(adviceSaveParam); + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdvicePriceDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdvicePriceDto.java index 1e237789..02c3f0fb 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdvicePriceDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdvicePriceDto.java @@ -25,6 +25,10 @@ public class AdvicePriceDto { @JsonSerialize(using = ToStringSerializer.class) private Long definitionId; + /** 费用定价子表ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long definitionDetailId; + /** 命中条件 */ private String conditionCode; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java index e102b8ec..8258b038 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java @@ -1,9 +1,12 @@ package com.openhis.web.doctorstation.dto; +import java.math.BigDecimal; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.enums.EncounterClass; import com.openhis.common.enums.RequestStatus; +import com.openhis.common.enums.TherapyTimeType; import lombok.Data; import lombok.experimental.Accessors; @@ -16,7 +19,7 @@ import lombok.experimental.Accessors; public class AdviceSaveDto { /** 医嘱类型 */ - private String adviceType; // 1:药品 , 2: 耗材 , 3:项目 + private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目 /** 执行次数 */ private Integer executeNum; // 当医嘱类型为药品时,选填 @@ -30,6 +33,17 @@ public class AdviceSaveDto { /** 请求单位编码 */ private String unitCode; + /** 单价 */ + private BigDecimal unitPrice; + + /** 费用定价主表ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long definitionId; + + /** 费用定价子表ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long definitionDetailId; + /** 产品批号 */ private String lotNumber; @@ -65,6 +79,21 @@ public class AdviceSaveDto { @JsonSerialize(using = ToStringSerializer.class) private Long encounterId; + /** 治疗类型 */ + private Integer therapyEnum; + + /** 用法 */ + private String methodCode; + + /** 用药频次 */ + private String rateCode; + + /** 单次剂量 */ + private BigDecimal dose; + + /** 剂量单位 */ + private String doseUnitCode; + /** 组套id */ @JsonSerialize(using = ToStringSerializer.class) private Long packageId; // 该参数先预留出来 @@ -79,6 +108,9 @@ public class AdviceSaveDto { public AdviceSaveDto() { this.statusEnum = RequestStatus.DRAFT.getValue(); this.categoryEnum = EncounterClass.AMB.getValue(); + this.therapyEnum = TherapyTimeType.TEMPORARY.getValue(); + // TODO: 应该从当前登录账号获取参与者id,现在没有 + // this.practitionerId } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/assembler/InventoryManageAssembler.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/assembler/InventoryManageAssembler.java index 39773586..2ee16b50 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/assembler/InventoryManageAssembler.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/assembler/InventoryManageAssembler.java @@ -48,7 +48,7 @@ public class InventoryManageAssembler { // 收费项id:供应物品id .setProductId(supplyItemDetailDto.getItemId()) // 物品数量 - .setQuantityValue(supplyItemDetailDto.getItemQuantity().longValue()) + .setQuantityValue(supplyItemDetailDto.getItemQuantity().intValue()) // 物品单位 .setQuantityUnit(supplyItemDetailDto.getItemUnit()) // 原价 diff --git a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index 7c378de7..4b523c32 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -162,6 +162,7 @@ SELECT T2.id, - T2.bus_no AS supply_bus_no, + T2.supply_bus_no, T2.status_enum, T2.supplier_id, T2.approver_id, T2.approval_time, T2.applicant_id, - T2.create_time, + T2.occurrence_time, T2.practitioner_id, T2.tenant_id FROM (SELECT T1.id, - T1.bus_no, + T1.bus_no AS supply_bus_no, T1.status_enum, T1.supplier_id, T1.approver_id, T1.approval_time, T1.applicant_id, - T1.create_time, + T1.occurrence_time, T1.practitioner_id, T1.tenant_id FROM wor_supply_request AS T1 @@ -33,7 +33,7 @@ T1.approver_id, T1.approval_time, T1.applicant_id, - T1.create_time, + T1.occurrence_time, T1.practitioner_id, T1.tenant_id ORDER BY T1.bus_no desc diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ItemType.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ItemType.java index 9c7d0f8b..5374c5ba 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ItemType.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ItemType.java @@ -18,9 +18,9 @@ import lombok.Getter; public enum ItemType implements HisEnumInterface { /** - * 中药 + * 药品 */ - MEDICINE(1, "1", "中药"), + MEDICINE(1, "1", "药品"), /** * 耗材 From c23da71b9329b06bcb1e14decb19febbe985231e Mon Sep 17 00:00:00 2001 From: anxin Date: Wed, 19 Mar 2025 17:57:46 +0800 Subject: [PATCH 006/149] =?UTF-8?q?=E8=8D=AF=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MedicationManageAppServiceImpl.java | 4 +- .../DiagnosisTreatmentController.java | 2 +- .../dto/MedicationManageDto.java | 47 ++++++++++++++++++- .../MedicationManageSearchMapper.xml | 27 +++++++++-- 4 files changed, 73 insertions(+), 7 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java index 5d6a66a3..af080b35 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java @@ -117,9 +117,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi // 药品状态 e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum())); // 活动标记 - e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag())); +// e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag())); // 适用范围 - e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum())); +// e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum())); }); // 返回【药品录列表DTO】分页 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 7947c1b4..01578846 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -49,7 +49,7 @@ import lombok.extern.slf4j.Slf4j; * @date 2025-02-20 */ @RestController -@RequestMapping("/datadictionary/diagnosistreatment") +@RequestMapping("/data-dictionary/diagnosis-treatment") @Slf4j @AllArgsConstructor public class DiagnosisTreatmentController { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java index 039f653c..c85e7c0c 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java @@ -77,6 +77,15 @@ public class MedicationManageDto { /** 药品定义 */ private String definition; + /** 用量限定 */ + private BigDecimal usageLimit; + + /** DDD值 */ + private String dddCode; + + /** DDD单位 */ + private String dddUnitCode; + /** 药品编号 */ private String busNo; @@ -116,7 +125,7 @@ public class MedicationManageDto { private String unitCode; /** 最小单位 */ - private String minUnitCode; +// private String minUnitCode; /** 所含耗材 */ private String comprisedText; @@ -170,4 +179,40 @@ public class MedicationManageDto { /** 产品特性 */ private Integer characteristic; + /** 贯标国家编码 */ + private String nationalDrugCode; + + /** 拆分属性 */ + private String partAttribute; + + /** 抗生素分类 */ + private String antibioticCode; + + /** 权限限制 */ + private Integer restrictedEnum; + + /** 是否自制 */ + private Integer selfFlag; + + /** 是否抗生素 */ + private Integer antibioticFlag; + + /** 基药标识 */ + private Integer basicFlag; + + /** 生产厂家名称 */ + private String manufacturerName; + + /** 常规单位 */ + private String baseUnitCode; + + /** 当前库存数量(常规单位) */ + private String baseQuantity; + + /** 最小单位 */ + private String minUnitCode; + + /** 当前库存数量(最小单位数量) */ + private String minQuantity; + } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/MedicationManageSearchMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/MedicationManageSearchMapper.xml index c137eacc..0648bec3 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/MedicationManageSearchMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/MedicationManageSearchMapper.xml @@ -20,6 +20,9 @@ T2.dose_unit_code, T2.max_unit, T2.definition, + T2.usage_limit, + T2.ddd_code, + T2.ddd_unit_code, T1.bus_no, T1.name, T1.domain_enum, @@ -32,7 +35,6 @@ T1.merchandise_py_str, T1.merchandise_wb_str, T1.unit_code, - T1.min_unit_code, T1.comprised_text, T1.ingredient, T1.part_percent, @@ -48,9 +50,24 @@ T1.restricted_flag, T1.restricted_scope, T1.children_flag, - T1.characteristic + T1.characteristic, + T1.national_drug_code, + T1.part_attribute, + T1.antibiotic_code + T1.restricted_enum + T1.self_flag + T1.antibiotic_flag + T1.basic_flag + T1.remark, + T3.manufacturer_name, + T4.base_unit_code, + T4.base_quantity, + T4.min_unit_code, + T4.min_quantity FROM med_medication_definition T1 - LEFT JOIN med_medication T2 on T1.id = T2.medication_def_id + LEFT JOIN med_medication T2 ON T1.id = T2.medication_def_id + LEFT JOIN adm_supplier T3 ON T1.manufacturer_id = T3.id + LEFT JOIN wor_inventory_item T4 ON T1.id = T4.item_id T1.delete_flag = '0' @@ -79,6 +96,7 @@ ORDER BY T1.bus_no LIMIT #{pageSize} OFFSET #{offset} + + + + \ No newline at end of file From a445ad299c6038304b207c529319b4c0eed06027 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Wed, 19 Mar 2025 18:15:51 +0800 Subject: [PATCH 007/149] tb --- .../impl/DoctorStationAdviceAppServiceImpl.java | 8 +++++--- .../openhis/web/doctorstation/dto/AdviceSaveDto.java | 10 ++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index fe8501b8..144f239c 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -183,6 +183,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 生成处方号 , 只有开了药品才有处方号 String prescriptionNo = ""; if (medicineList.size() > 0) { + // TODO: 药品分方;待做 prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_NO.getPrefix(), 8); } // 保存药品请求 @@ -209,6 +210,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp medicationRequest.setRateCode(adviceSaveDto.getRateCode()); medicationRequest.setDose(adviceSaveDto.getDose()); medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); + medicationRequest.setGroupId(adviceSaveDto.getGroupId());// 分组id // medicationRequest.setPackageId(adviceSaveDto.getPackageId()); medicationRequestList.add(medicationRequest); @@ -221,7 +223,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp for (AdviceSaveDto adviceSaveDto : deviceList) { deviceRequest = new DeviceRequest(); deviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 8)); - deviceRequest.setPrescriptionNo(prescriptionNo); + // deviceRequest.setPrescriptionNo(prescriptionNo); // 耗材不需要处方号 deviceRequest.setQuantity(adviceSaveDto.getQuantity()); deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); deviceRequest.setLotNumber(adviceSaveDto.getLotNumber()); @@ -246,7 +248,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp for (AdviceSaveDto adviceSaveDto : activityList) { serviceRequest = new ServiceRequest(); serviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 8)); - serviceRequest.setPrescriptionNo(prescriptionNo); + // serviceRequest.setPrescriptionNo(prescriptionNo); // 诊疗不需要处方号 serviceRequest.setBasedOnTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION); serviceRequest.setBasedOnId(adviceSaveDto.getAdviceDefinitionId()); serviceRequest.setQuantity(adviceSaveDto.getQuantity()); @@ -286,7 +288,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp chargeItemList.add(chargeItem); } iChargeItemService.saveBatch(chargeItemList); - // TODO: 此处调用请求方法接口 + // TODO: 此处调用请求发放接口 return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊医嘱"})); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java index 8258b038..259959c7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java @@ -94,13 +94,19 @@ public class AdviceSaveDto { /** 剂量单位 */ private String doseUnitCode; + /** + * 分组id , 一组药品共用一个id,前端传过来 + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long groupId; + /** 组套id */ @JsonSerialize(using = ToStringSerializer.class) - private Long packageId; // 该参数先预留出来 + private Long packageId; /** 活动(项目)定义id */ @JsonSerialize(using = ToStringSerializer.class) - private Long activityId; // 该参数先预留出来 + private Long activityId; /** * 设置默认值 From 3d09f06d1d935cc0b9a210c04c4b22908a418059 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Wed, 19 Mar 2025 19:45:05 +0800 Subject: [PATCH 008/149] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E8=BE=93=E6=B6=B2=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientInfusionRecordService.java | 13 +- .../OutpatientInfusionRecordServiceImpl.java | 117 +++++-------- .../OutpatientInfusionRecordController.java | 34 ++-- .../dto/OutpatientInfusionPatientDto.java | 3 + .../dto/OutpatientInfusionSearchParam.java | 24 --- .../mapper/OutpatientManageMapper.java | 10 +- .../OutpatientManageMapper.xml | 158 +++++++++--------- .../common/constant/CommonConstants.java | 13 +- 8 files changed, 163 insertions(+), 209 deletions(-) delete mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java index f918a6ec..6203c6e4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java @@ -5,7 +5,8 @@ import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; -import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam; + +import javax.servlet.http.HttpServletRequest; /** * 门诊管理——输液实现类 @@ -18,13 +19,13 @@ public interface IOutpatientInfusionRecordService { /** * 获取门诊输液记录的患者列表 * - * @param outpatientInfusionSearchParam 门诊输液记录的患者列表查询参数 + * @param searchKey 模糊查询关键字 * @param pageNo 当前页 * @param pageSize 每页多少条 * @return 分页查询 */ IPage getOutpatientInfusionPatientList( - OutpatientInfusionSearchParam outpatientInfusionSearchParam, Integer pageNo, Integer pageSize); + String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request); /** * 点击患者,查询该患者的输液记录 @@ -33,7 +34,7 @@ public interface IOutpatientInfusionRecordService { * @return 当前患者门诊输液待执行列表 */ List - getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto); + getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto, HttpServletRequest request); /** * 执行患者门诊输液 @@ -54,11 +55,9 @@ public interface IOutpatientInfusionRecordService { /** * 门诊输液执行历史记录查询 * - * @param beginTime 开始时间 - * @param endTime 结束时间 * @param historyFlag 查询的是否为执行履历 * @return 门诊输液记录列表 */ - List getPatientInfusionPerformRecord(String beginTime, String endTime,boolean historyFlag); + List getPatientInfusionPerformRecord(HttpServletRequest request,boolean historyFlag); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java index af74229b..2de43133 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java @@ -1,16 +1,15 @@ package com.openhis.web.outpatientmanage.appservice.impl; -import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; 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.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -33,7 +32,6 @@ import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; -import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam; import com.openhis.web.outpatientmanage.mapper.OutpatientManageMapper; import com.openhis.workflow.domain.ServiceRequest; import com.openhis.workflow.mapper.ServiceRequestMapper; @@ -67,49 +65,20 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR /** * 获取门诊输液记录的患者列表 * - * @param outpatientInfusionSearchParam 门诊输液记录的患者列表查询参数 + * @param searchKey 模糊查询关键字 * @param pageNo 当前页 * @param pageSize 每页多少条 * @return 分页查询 */ @Override - public IPage getOutpatientInfusionPatientList( - OutpatientInfusionSearchParam outpatientInfusionSearchParam, Integer pageNo, Integer pageSize) { - - LocalDateTime beginTime; - LocalDateTime endTime; - String searchKey; - // 搜索key为空 - if (outpatientInfusionSearchParam == null) { - searchKey = null; - } else { - searchKey = outpatientInfusionSearchParam.getSearchKey(); - } - // 任意开始结束时间为空,默认查询当天日期记录 - if (outpatientInfusionSearchParam.getBeginTime() == null - || outpatientInfusionSearchParam.getEndTime() == null) { - beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true); - endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false); - } else {// 时间不空,删选时间 - beginTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getBeginTime(), true); - endTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getEndTime(), false); - } + public IPage getOutpatientInfusionPatientList(String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request) { // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientBusNo, CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.PatientName)), - null); - // based_on_id 是为空的 - queryWrapper.eq(CommonConstants.FieldName.basedOnId, null); - // 状态是未完成的 - queryWrapper.in(CommonConstants.FieldName.requestStatus, EventStatus.IN_PROGRESS.getValue(), - EventStatus.NOT_DONE.getValue()); - // 添加时间段查询条件 - if (beginTime != null && endTime != null) { - queryWrapper.ge(CommonConstants.FieldName.createTime, beginTime); - queryWrapper.le(CommonConstants.FieldName.createTime, endTime); - } + request); IPage outpatientInfusionPatientDto = outpatientManageMapper.getOutpatientInfusionPatient(new Page<>(pageNo, pageSize), queryWrapper); @@ -131,25 +100,29 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR * @return 当前患者门诊输液待执行列表 */ @Override - public List - getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto) { + public List getPatientInfusionRecord( + OutpatientInfusionPatientDto outpatientInfusionPatientDto, HttpServletRequest request) { if (outpatientInfusionPatientDto == null && outpatientInfusionPatientDto.getPatientId() != null) { return null; } - // 创建查询包装器 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(OutpatientInfusionRecordDto::getPatientId, outpatientInfusionPatientDto.getPatientId()); - // based_on_id 是为空的 - queryWrapper.eq(OutpatientInfusionRecordDto::getBasedOnId, null); - // 状态是未完成的 - queryWrapper.in(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.IN_PROGRESS.getValue(), - EventStatus.NOT_DONE.getValue()); - // 从数据库获取输液记录列表 - List infusionList = - outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); - return infusionList; + // 构建查询条件 + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(null, null, null, request); + + queryWrapper.eq(CommonConstants.FieldName.PatientId, outpatientInfusionPatientDto.getPatientId()); + // based_on_id 是为空的 + queryWrapper.eq(CommonConstants.FieldName.BasedOnId, null); + // 状态是未完成的 + queryWrapper.in(CommonConstants.FieldName.RequestStatus, EventStatus.IN_PROGRESS.getValue(), + EventStatus.NOT_DONE.getValue()); + + // 默认显示100条 + IPage OutpatientInfusionRecordPage = + outpatientManageMapper.getOutpatientInfusionRecord(new Page<>(1, 100), queryWrapper); + + return OutpatientInfusionRecordPage.getRecords(); } /** @@ -178,8 +151,9 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR List groupRecords = entry.getValue(); // 获取组内药品个数 - Long groupCount = outpatientManageMapper.countMedicationExecuteNum(groupRecords.get(0).getServiceId(), null, + Long groupCount = outpatientManageMapper.countExecuteNumOrGroupNum(groupRecords.get(0).getServiceId(), null, groupRecords.get(0).getGroupId(), false); + // 检查组内药品是否全部选中 if (groupCount != groupRecords.size()) { return false; @@ -191,7 +165,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR String prefixBusNo = record.getBusNo() + "." + record.getGroupId() + "." + record.getMedicationId(); // 获取执行次数 Long exeCount = - outpatientManageMapper.countMedicationExecuteNum(record.getServiceId(), prefixBusNo, null, true); + outpatientManageMapper.countExecuteNumOrGroupNum(record.getServiceId(), prefixBusNo, null, true); if (exeCount < record.getExecuteNum()) { ServiceRequest serviceRequest = new ServiceRequest(); @@ -216,7 +190,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR String prefixBusNo = record.getBusNo() + "." + record.getGroupId() + "." + record.getMedicationId(); // 获取执行次数 Long exeCount = - outpatientManageMapper.countMedicationExecuteNum(record.getServiceId(), prefixBusNo, null, true); + outpatientManageMapper.countExecuteNumOrGroupNum(record.getServiceId(), prefixBusNo, null, true); // 执行完毕后,更新执行服务请求表的状态 if (exeCount.equals(record.getExecuteNum())) { @@ -267,49 +241,36 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR /** * 显示门诊输液执行记录查询 * - * @param beginTime 开始时间 - * @param endTime 结束时间 * @param historyFlag 查询的是否为执行履历 * @return 门诊输液执行记录查询 */ @Override - public List getPatientInfusionPerformRecord(String beginTime, String endTime, + public List getPatientInfusionPerformRecord(HttpServletRequest request, boolean historyFlag) { - LocalDateTime beginDateTime; - LocalDateTime endDateTime; - // 筛选时间不传,默认当天记录 - if (beginTime == null || endTime == null) { - beginDateTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true); - endDateTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false); - } else { - beginDateTime = DateUtils.startDayOrEndDay(beginTime, true); - endDateTime = DateUtils.startDayOrEndDay(endTime, false); - } + // 构建查询条件 + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(null, null, null, request); - // 创建查询包装器 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); // 执行历史查询的条件 if (historyFlag) { // based_on_id 不为空,此条件筛选出执行履历 - queryWrapper.isNotNull(OutpatientInfusionRecordDto::getBasedOnId); + queryWrapper.isNotNull(CommonConstants.FieldName.BasedOnId); // 状态是已完成 - queryWrapper.eq(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.COMPLETED.getValue()); + queryWrapper.eq(CommonConstants.FieldName.RequestStatus, EventStatus.COMPLETED.getValue()); // 门诊输液待执行记录查询 } else { // based_on_id 为空,此条件筛选控制不显示执行履历 - queryWrapper.isNull(OutpatientInfusionRecordDto::getBasedOnId); + queryWrapper.isNull(CommonConstants.FieldName.BasedOnId); // 状态是进行中 - queryWrapper.eq(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.IN_PROGRESS.getValue()); + queryWrapper.eq(CommonConstants.FieldName.RequestStatus, EventStatus.IN_PROGRESS.getValue()); } - // 时间筛选 - queryWrapper.ge(OutpatientInfusionRecordDto::getCreateTime, beginDateTime); - queryWrapper.le(OutpatientInfusionRecordDto::getCreateTime, endDateTime); - // 从数据库获取输液记录列表 - List infusionPerformList = - outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); + // 默认显示100条 + IPage OutpatientInfusionRecordPage = + outpatientManageMapper.getOutpatientInfusionRecord(new Page<>(1, 100), queryWrapper); + List infusionPerformList = OutpatientInfusionRecordPage.getRecords(); // 遍历列表并处理每个记录 infusionPerformList.forEach(e -> { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java index 59ddd293..9f7f3e7d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java @@ -2,6 +2,8 @@ package com.openhis.web.outpatientmanage.controller; import java.util.List; +import javax.servlet.http.HttpServletRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -12,7 +14,6 @@ import com.openhis.common.constant.PromptMsgConstant; import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; -import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -35,16 +36,18 @@ public class OutpatientInfusionRecordController { /** * 查询门诊输液的患者列表 * - * @param outpatientInfusionSearchParam 查询参数 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 * @return 返回门诊输液的患者列表 */ @GetMapping(value = "/infusion-patient-list") - public R getOutpatientInfusionPatientList(OutpatientInfusionSearchParam outpatientInfusionSearchParam, + public R getOutpatientInfusionPatientList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - return R.ok(outpatientInfusionRecordService.getOutpatientInfusionPatientList(outpatientInfusionSearchParam, - pageNo, pageSize)); + return R + .ok(outpatientInfusionRecordService.getOutpatientInfusionPatientList(searchKey, pageNo, pageSize, request)); } /** @@ -54,9 +57,10 @@ public class OutpatientInfusionRecordController { * @return 当前患者门诊输液待执行列表 */ @GetMapping(value = "/patient-infusion-record") - public R getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto) { + public R getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto, + HttpServletRequest request) { - return R.ok(outpatientInfusionRecordService.getPatientInfusionRecord(outpatientInfusionPatientDto)); + return R.ok(outpatientInfusionRecordService.getPatientInfusionRecord(outpatientInfusionPatientDto, request)); } /** @@ -94,29 +98,23 @@ public class OutpatientInfusionRecordController { /** * 门诊输液待执行记录查询 * - * @param beginTime 开始时间 - * @param endTime 结束时间 * @return 门诊输液待执行记录列表 */ @GetMapping(value = "/infusion-wait-perform-record") - public R getPatientInfusionRecords(@RequestParam(required = false) String beginTime, - @RequestParam(required = false) String endTime) { + public R getPatientInfusionRecords(HttpServletRequest request) { - return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime, endTime, false)); + return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(request, false)); } /** * 门诊输液执行历史记录查询 * - * @param beginTime 开始时间 - * @param endTime 结束时间 * @return 门诊输液执行历史记录列表 */ @GetMapping(value = "/infusion-perform-record") - public R getPatientInfusionPerformRecord(@RequestParam(required = false) String beginTime, - @RequestParam(required = false) String endTime) { + public R getPatientInfusionPerformRecord(HttpServletRequest request) { - return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime, endTime, true)); + return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(request, true)); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java index 00a29224..30797d28 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java @@ -50,4 +50,7 @@ public class OutpatientInfusionPatientDto { /** 病人年龄 */ private String ageString; + /** 开单时间 */ + private Date createTime; + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java deleted file mode 100644 index a0869482..00000000 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.openhis.web.outpatientmanage.dto; - -import lombok.Data; - -/** - * 门诊输液记录查询体体条件类 - * - * @author liuhr - * @date 2025/3/12 - */ -@Data -public class OutpatientInfusionSearchParam { - - /** 病人ID/门诊号/病人姓名 */ - private String searchKey; - - /** 筛选开始时间 */ - private String beginTime; - - /** 筛选结束时间 */ - private String endTime; - -} - diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java index e5bd3d49..ba2d00c1 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java @@ -1,7 +1,9 @@ package com.openhis.web.outpatientmanage.mapper; +import java.util.Date; import java.util.List; +import com.openhis.workflow.domain.ServiceRequest; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -57,11 +59,13 @@ public interface OutpatientManageMapper { /** * 门诊输液记录查询 * + * @param page 分页参数,默认100条记录 * @param queryWrapper 查询条件 * @return 门诊输液记录列表 */ - List getOutpatientInfusionRecord( - @Param(Constants.WRAPPER) LambdaQueryWrapper queryWrapper); + IPage getOutpatientInfusionRecord( + @Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper); /** * 查询药品已执行数量/查询同组内药品数量 @@ -72,7 +76,7 @@ public interface OutpatientManageMapper { * @param flag 控制查询条件 * @return 查询个数 */ - long countMedicationExecuteNum(@Param("paramId") Long paramId, @Param("prefixBusNo") String prefixBusNo, + long countExecuteNumOrGroupNum(@Param("paramId") Long paramId, @Param("prefixBusNo") String prefixBusNo, @Param("groupId") Long groupId, @Param("flag") boolean flag); } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml index bff580d1..f4b66287 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml @@ -133,32 +133,34 @@ - SELECT COUNT(*) FROM @@ -281,7 +290,7 @@ - AND sr.base_on_id = #{paramId} + AND sr.based_on_id = #{paramId} AND sr.bus_no LIKE CONCAT(#{prefixBusNo}, '%') AND sr.status_enum = 6 --服务状态是已完成 @@ -292,7 +301,6 @@ AND mr.group_id = #{groupId} AND sr.status_enum = 2 --服务状态是进行中 - diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java index 8de702bb..820f93fa 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java @@ -113,11 +113,16 @@ public class CommonConstants { */ String PatientBusNo = "patient_bus_no"; + /** + * 患者ID + */ + String PatientId = "patient_id"; + + /** * 就诊号 */ String EncounterBusNo = "encounter_bus_no"; - /** * 身份证号 */ @@ -141,17 +146,17 @@ public class CommonConstants { /** * 请求状态 */ - String requestStatus = "request_status"; + String RequestStatus = "request_status"; /** * 创建时间 */ - String createTime = "create_time"; + String CreateTime = "create_time"; /** * 请求基于什么的ID */ - String basedOnId = "based_on_id"; + String BasedOnId = "based_on_id"; } /** From ef80116180f1b40721587db42b7ac27780c5a1bc Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Thu, 20 Mar 2025 09:27:49 +0800 Subject: [PATCH 009/149] up --- .../mapper/outpatientmanage/OutpatientManageMapper.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml index f4b66287..3191c05d 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml @@ -257,12 +257,6 @@ AND mr.infusion_flag = 1 AND md.infusion_flag = 1 - - - AND mr.create_time BETWEEN TO_TIMESTAMP(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS') - AND TO_TIMESTAMP(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') - - ORDER BY mr.create_time desc,e.bus_no,pt.bus_no From 1918c0924e5193fd7aa628d3227abc7d669db4e5 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Thu, 20 Mar 2025 10:03:02 +0800 Subject: [PATCH 010/149] tb --- .../com/openhis/web/chargemanage/dto/AccountFormData.java | 4 ++++ .../openhis/web/chargemanage/dto/ChargeItemFormData.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java index afae30a6..1dd8f619 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java @@ -10,6 +10,8 @@ import com.openhis.common.enums.AccountStatus; import lombok.Data; import lombok.experimental.Accessors; +import javax.validation.constraints.NotBlank; + /** * 就诊账号 表单数据 */ @@ -24,6 +26,7 @@ public class AccountFormData { private Long encounterId; /** 患者id */ + @NotBlank(message = "患者id不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long patientId; @@ -34,6 +37,7 @@ public class AccountFormData { private Integer billingStatusEnum; /** 账户类型编码 */ + @NotBlank(message = "账户类型不能为空") private String typeCode; // 1:个人现金账户, 2:医保账户 /** 名称 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java index 15e9ee34..64829cfb 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java @@ -13,6 +13,8 @@ import com.openhis.common.enums.EncounterClass; import lombok.Data; import lombok.experimental.Accessors; +import javax.validation.constraints.NotBlank; + /** * 费用项管理 表单数据 */ @@ -27,6 +29,7 @@ public class ChargeItemFormData { private Long encounterId; /** 患者id */ + @NotBlank(message = "患者id不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long patientId; @@ -47,6 +50,7 @@ public class ChargeItemFormData { private Long performerId; /** 费用定价ID */ + @NotBlank(message = "费用定价ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long definitionId; @@ -61,10 +65,12 @@ public class ChargeItemFormData { private String serviceTable; /** 医疗服务ID */ + @NotBlank(message = "医疗服务ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long serviceId; /** 总价 */ + @NotBlank(message = "总价不能为空") private BigDecimal totalPrice; /** 关联账户ID */ From 6dcedea99c0069155ca4dd57e002bbc026b13c22 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Thu, 20 Mar 2025 10:11:52 +0800 Subject: [PATCH 011/149] =?UTF-8?q?=E4=BC=A0=E5=8F=82=E9=9D=9E=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/chargemanage/dto/AccountFormData.java | 8 ++++---- .../web/chargemanage/dto/ChargeItemFormData.java | 12 ++++++------ .../web/chargemanage/dto/EncounterFormData.java | 12 ++++++------ .../chargemanage/dto/EncounterLocationFormData.java | 3 ++- .../dto/EncounterParticipantFormData.java | 3 ++- .../dto/OutpatientRegistrationAddParam.java | 7 +++++++ 6 files changed, 27 insertions(+), 18 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java index 1dd8f619..e5aad841 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java @@ -2,6 +2,8 @@ package com.openhis.web.chargemanage.dto; import java.math.BigDecimal; +import javax.validation.constraints.NotNull; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.enums.AccountBillingStatus; @@ -10,8 +12,6 @@ import com.openhis.common.enums.AccountStatus; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; - /** * 就诊账号 表单数据 */ @@ -26,7 +26,7 @@ public class AccountFormData { private Long encounterId; /** 患者id */ - @NotBlank(message = "患者id不能为空") + @NotNull(message = "患者id不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long patientId; @@ -37,7 +37,7 @@ public class AccountFormData { private Integer billingStatusEnum; /** 账户类型编码 */ - @NotBlank(message = "账户类型不能为空") + @NotNull(message = "账户类型不能为空") private String typeCode; // 1:个人现金账户, 2:医保账户 /** 名称 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java index 64829cfb..32f6a7c4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java @@ -3,6 +3,8 @@ package com.openhis.web.chargemanage.dto; import java.math.BigDecimal; import java.util.Date; +import javax.validation.constraints.NotNull; + import com.core.common.utils.SecurityUtils; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -13,8 +15,6 @@ import com.openhis.common.enums.EncounterClass; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; - /** * 费用项管理 表单数据 */ @@ -29,7 +29,7 @@ public class ChargeItemFormData { private Long encounterId; /** 患者id */ - @NotBlank(message = "患者id不能为空") + @NotNull(message = "患者id不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long patientId; @@ -50,7 +50,7 @@ public class ChargeItemFormData { private Long performerId; /** 费用定价ID */ - @NotBlank(message = "费用定价ID不能为空") + @NotNull(message = "费用定价ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long definitionId; @@ -65,12 +65,12 @@ public class ChargeItemFormData { private String serviceTable; /** 医疗服务ID */ - @NotBlank(message = "医疗服务ID不能为空") + @NotNull(message = "医疗服务ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long serviceId; /** 总价 */ - @NotBlank(message = "总价不能为空") + @NotNull(message = "总价不能为空") private BigDecimal totalPrice; /** 关联账户ID */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java index e9b36c3a..512e3600 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java @@ -1,5 +1,7 @@ package com.openhis.web.chargemanage.dto; +import javax.validation.constraints.NotNull; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.enums.*; @@ -7,8 +9,6 @@ import com.openhis.common.enums.*; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; - /** * 就诊 表单数据 */ @@ -19,7 +19,7 @@ public class EncounterFormData { /** * 患者ID */ - @NotBlank(message = "患者ID不能为空") + @NotNull(message = "患者ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long patientId; @@ -41,7 +41,7 @@ public class EncounterFormData { /** * 优先级编码 */ - @NotBlank(message = "优先级编码不能为空") + @NotNull(message = "优先级编码不能为空") private Integer priorityEnum; /** @@ -52,7 +52,7 @@ public class EncounterFormData { /** * 服务ID */ - @NotBlank(message = "服务ID不能为空") + @NotNull(message = "服务ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long serviceTypeId; @@ -64,7 +64,7 @@ public class EncounterFormData { /** * 机构ID */ - @NotBlank(message = "机构ID不能为空") + @NotNull(message = "机构ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long organizationId; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java index f06aec9d..d1d61a6b 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java @@ -9,6 +9,7 @@ import lombok.Data; import lombok.experimental.Accessors; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * 就诊位置 表单数据 @@ -26,7 +27,7 @@ public class EncounterLocationFormData { /** * 位置ID */ - @NotBlank(message = "位置ID不能为空") + @NotNull(message = "位置ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long locationId; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java index e8be696d..d86d844b 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java @@ -1,6 +1,7 @@ package com.openhis.web.chargemanage.dto; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -26,7 +27,7 @@ public class EncounterParticipantFormData { private String typeCode; /** 参与者ID */ - @NotBlank(message = "参与者ID不能为空") + @NotNull(message = "参与者ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long practitionerId; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java index c41ebfe6..aa9eb889 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java @@ -1,5 +1,7 @@ package com.openhis.web.chargemanage.dto; +import javax.validation.Valid; + import lombok.Data; import lombok.experimental.Accessors; @@ -13,6 +15,7 @@ public class OutpatientRegistrationAddParam { /** * 就诊管理-表单数据 */ + @Valid private EncounterFormData encounterFormData; // /** @@ -23,20 +26,24 @@ public class OutpatientRegistrationAddParam { /** * 就诊位置管理-表单数据 */ + @Valid private EncounterLocationFormData encounterLocationFormData; /** * 就诊参数者管理-表单数据 */ + @Valid private EncounterParticipantFormData encounterParticipantFormData; /** * 就诊账户管理-表单数据 */ + @Valid private AccountFormData accountFormData; /** * 费用项管理-表单数据 */ + @Valid private ChargeItemFormData chargeItemFormData; } From 98d104d8fa3312080244a173bb52205d31311b63 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Thu, 20 Mar 2025 10:26:58 +0800 Subject: [PATCH 012/149] =?UTF-8?q?=E6=8C=82=E5=8F=B7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OutpatientRegistrationAppServiceImpl.java | 12 +++++++----- .../dto/EncounterParticipantFormData.java | 2 -- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java index 7aec115b..f01c4d3f 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java @@ -211,11 +211,13 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra EncounterLocation encounterLocation = new EncounterLocation(); BeanUtils.copyProperties(encounterLocationFormData, encounterLocation); iEncounterLocationService.saveEncounterLocationByRegister(encounterLocation); - // 保存就诊参数者信息 - encounterParticipantFormData.setEncounterId(encounterId); - EncounterParticipant encounterParticipant = new EncounterParticipant(); - BeanUtils.copyProperties(encounterParticipantFormData, encounterParticipant); - iEncounterParticipantService.saveEncounterParticipantByRegister(encounterParticipant); + // 保存就诊参数者信息 , 选了参与这才保存 + if (encounterParticipantFormData.getPractitionerId() != null) { + encounterParticipantFormData.setEncounterId(encounterId); + EncounterParticipant encounterParticipant = new EncounterParticipant(); + BeanUtils.copyProperties(encounterParticipantFormData, encounterParticipant); + iEncounterParticipantService.saveEncounterParticipantByRegister(encounterParticipant); + } // 保存就诊账户信息 accountFormData.setEncounterId(encounterId); Account account = new Account(); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java index d86d844b..dbbf2fa8 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java @@ -1,6 +1,5 @@ package com.openhis.web.chargemanage.dto; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -27,7 +26,6 @@ public class EncounterParticipantFormData { private String typeCode; /** 参与者ID */ - @NotNull(message = "参与者ID不能为空") @JsonSerialize(using = ToStringSerializer.class) private Long practitionerId; From fe4cc16927ee2a8558d388ebf8e527fa3d98e4be Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Thu, 20 Mar 2025 10:33:20 +0800 Subject: [PATCH 013/149] tb --- .../controller/OutpatientRegistrationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java index 5b24cc7a..7b9fdacc 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java @@ -84,7 +84,7 @@ public class OutpatientRegistrationController { @GetMapping(value = "/location-tree") public R getLocationTree(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { - return R.ok(iLocationAppService.getLocationTree(LocationForm.ROOM.getValue(), pageNo, pageSize)); + return iLocationAppService.getLocationTree(LocationForm.ROOM.getValue(), pageNo, pageSize); } From 0ac2e84b9f5407b5a0f56b6e97cfe79952130ee2 Mon Sep 17 00:00:00 2001 From: duhe Date: Thu, 20 Mar 2025 10:43:17 +0800 Subject: [PATCH 014/149] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E6=8C=82=E5=8F=B7?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E7=94=BB=E9=9D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E7=94=A8=20up=20by=20dh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medicine/components/medicineDialog.vue | 16 +- .../src/views/catalog/medicine/index.vue | 13 +- .../components/outpatientregistration.js | 11 +- .../components/patientAddDialog.vue | 32 +- .../charge/outpatientregistration/index.vue | 61 +- .../components/inventoryReceiptDialog.vue | 708 ++++++++---------- .../components/purchaseinventory.js | 16 +- .../purchaseinventory/index.vue | 258 +++---- 8 files changed, 484 insertions(+), 631 deletions(-) diff --git a/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue b/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue index 6234cc01..f5fbf017 100644 --- a/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue +++ b/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue @@ -373,10 +373,10 @@ :disabled="form.id != undefined" > @@ -471,18 +471,17 @@ - + - + @@ -720,6 +718,7 @@ function show() { // getList(); reset(); statusFlagOptions.value = props.status; + domainEnumOptions.value = props.domainEnum; // currentData.value.activeFlag == 1 // ? (currentData.value.activeFlag = true) // : (currentData.value.activeFlag = false); //是否为活性 @@ -751,6 +750,7 @@ function edit() { reset(); form.value = props.item; statusFlagOptions.value = props.status; + domainEnumOptions.value = props.domainEnum; visible.value = true; } /** 重置操作表单 */ diff --git a/openhis-ui-vue3/src/views/catalog/medicine/index.vue b/openhis-ui-vue3/src/views/catalog/medicine/index.vue index 49768ed5..60d68de3 100644 --- a/openhis-ui-vue3/src/views/catalog/medicine/index.vue +++ b/openhis-ui-vue3/src/views/catalog/medicine/index.vue @@ -303,14 +303,22 @@ key="effectiveDate" prop="effectiveDate" :show-overflow-tooltip="true" - /> + > + + + > + + { - maritalstatusList.value = response.data; - }); - listoccupationtype().then((response) => { - occupationtypeList.value = response.data; - }); - lisadministrativegender().then((response) => { - administrativegenderList.value = response.data; - }); - listbloodtypeabo().then((response) => { - bloodtypeaboList.value = response.data; - }); - listbloodtypearh().then((response) => { - bloodtypearhList.value = response.data; - }); - listfamilyrelationshiptype().then((response) => { - familyrelationshiptypeList.value = response.data; + patientlLists().then((response) => { + console.log(response); + occupationtypeList.value = response.data.occupationType; + administrativegenderList.value = response.data.administrativeGender; + bloodtypeaboList.value = response.data.bloodTypeABO; + bloodtypearhList.value = response.data.bloodTypeRH; + familyrelationshiptypeList.value = response.data.familyRelationshipType; + maritalstatusList.value = response.data.maritalStatus; }); } diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue index 921ce142..de628fe0 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue @@ -9,7 +9,7 @@ @@ -151,7 +151,7 @@ @@ -678,10 +678,29 @@ const data = reactive({ // status: undefined, // 状态(包括 1:预置,2:启用,3:停用) }, rules: { - // name: [{ required: true, message: "名称不能为空", trigger: "blur" }], - // conditionCode: [ - // { required: true, message: "编码不能为空", trigger: "blur" }, + patientId: [{ required: true, message: "病人不能为空", trigger: "blur" }], + priorityEnum: [ + { required: true, message: "优先级不能为空", trigger: "blur" }, + ], + serviceTypeId: [ + { required: true, message: "挂号类型不能为空", trigger: "blur" }, + ], + organizationId: [ + { required: true, message: "优先级不能为空", trigger: "blur" }, + ], + locationId: [ + { required: true, message: "就诊科室不能为空", trigger: "blur" }, + ], + // practitionerId: [ + // { required: true, message: "医生不能为空", trigger: "blur" }, // ], + typeCode: [ + { required: true, message: "账户类型不能为空", trigger: "blur" }, + ], + definitionId: [ + { required: true, message: "费用定价不能为空", trigger: "blur" }, + ], + totalPrice: [{ required: true, message: "总价不能为空", trigger: "blur" }], }, }); @@ -797,13 +816,6 @@ function setInfo() { (doctor) => doctor.id === form.value.practitionerId ); form.value.doctorName = doctorData.length > 0 ? doctorData[0].name : ""; - console.log(doctorData, "datayisheng"); - const healthcareData = healthcareList.value.filter( - (healthcare) => healthcare.id === form.value.serviceTypeId - ); - form.value.locationId_dictText = - healthcareData.length > 0 ? healthcareData[0].name : ""; - form.value.price = healthcareData.length > 0 ? healthcareData[0].price : ""; } // 设定费用项管理表单 @@ -811,10 +823,9 @@ function setchargeItem() { const healthcareData = healthcareList.value.filter( (healthcare) => healthcare.id === form.value.serviceTypeId ); - form.value.definitionId = - healthcareData.length > 0 ? healthcareData[0].definitionId : ""; - form.value.totalPrice = - healthcareData.length > 0 ? healthcareData[0].price : ""; + form.value.locationId_dictText = + healthcareData.length > 0 ? healthcareData[0].name : ""; + form.value.price = healthcareData.length > 0 ? healthcareData[0].price : ""; } /** 查询患者信息 */ function getList() { @@ -944,10 +955,14 @@ function reset() { function handleAdd() { const transformedData = transformFormData(form.value); console.log(transformedData, "transformedData门诊挂号"); - addOutpatientRegistration(transformedData).then((response) => { - reset(); - proxy.$modal.msgSuccess("新增成功"); - getList(); + proxy.$refs["outpatientRegistrationRef"].validate((valid) => { + if (valid) { + addOutpatientRegistration(transformedData).then((response) => { + reset(); + proxy.$modal.msgSuccess("新增成功"); + getList(); + }); + } }); } @@ -979,7 +994,7 @@ function transformFormData(form) { patientId: form.patientId, definitionId: form.definitionId, serviceId: form.serviceTypeId, - totalPrice: form.totalPrice, // 默认值为 99.99 + totalPrice: form.price, // 默认值为 99.99 }, }; } diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue index bce286e0..e643f1dc 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue @@ -36,100 +36,85 @@ - - - - - - - - - + + + + + + + + + + + + - - - \ No newline at end of file From 1490056b25876c16684e93b6bbcef74ff77b0e68 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Thu, 20 Mar 2025 20:13:31 +0800 Subject: [PATCH 023/149] up --- .../IOutpatientInfusionRecordService.java | 11 +++++----- .../OutpatientInfusionRecordServiceImpl.java | 21 +++++++++---------- .../OutpatientInfusionRecordController.java | 6 ++---- .../dto/OutpatientInfusionPatientDto.java | 3 ++- .../dto/OutpatientInfusionRecordDto.java | 3 ++- .../OutpatientManageMapper.xml | 10 ++++----- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java index f36ccaf4..11f5850e 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java @@ -2,12 +2,12 @@ package com.openhis.web.outpatientmanage.appservice; import java.util.List; +import javax.servlet.http.HttpServletRequest; + import com.baomidou.mybatisplus.core.metadata.IPage; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; -import javax.servlet.http.HttpServletRequest; - /** * 门诊管理——输液实现类 * @@ -19,14 +19,13 @@ public interface IOutpatientInfusionRecordService { /** * 获取门诊输液记录的患者列表 * - * @param infusionPatientDto 输液患者实体 * @param searchKey 模糊查询关键字 * @param pageNo 当前页 * @param pageSize 每页多少条 * @return 分页查询 */ - IPage getOutpatientInfusionPatientList(OutpatientInfusionPatientDto infusionPatientDto, - String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request); + IPage getOutpatientInfusionPatientList(String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request); /** * 点击患者,查询该患者的输液记录 @@ -59,6 +58,6 @@ public interface IOutpatientInfusionRecordService { * @param historyFlag 查询的是否为执行履历 * @return 门诊输液记录列表 */ - List getPatientInfusionPerformRecord(HttpServletRequest request,boolean historyFlag); + List getPatientInfusionPerformRecord(HttpServletRequest request, boolean historyFlag); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java index 19022515..22aa6af8 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java @@ -64,22 +64,21 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR /** * 获取门诊输液记录的患者列表 * - * @param infusionPatientDto 输液患者实体 * @param searchKey 模糊查询关键字 * @param pageNo 当前页 * @param pageSize 每页多少条 * @return 分页查询 */ @Override - public IPage getOutpatientInfusionPatientList( - OutpatientInfusionPatientDto infusionPatientDto, String searchKey, Integer pageNo, Integer pageSize, - HttpServletRequest request) { + public IPage getOutpatientInfusionPatientList(String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request) { // 构建查询条件 - QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(infusionPatientDto, searchKey, - new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientBusNo, - CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.PatientName)), - request); + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(new OutpatientInfusionPatientDto(), searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientBusNo, + CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.PatientName)), + request); IPage outpatientInfusionPatientDto = outpatientManageMapper.getOutpatientInfusionPatient(new Page<>(pageNo, pageSize), queryWrapper); @@ -113,11 +112,11 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR // 构建查询条件 QueryWrapper queryWrapper = - HisQueryUtils.buildQueryWrapper(null, null, null, request); + HisQueryUtils.buildQueryWrapper(new OutpatientInfusionPatientDto(), null, null, request); queryWrapper.eq(CommonConstants.FieldName.PatientId, outpatientInfusionPatientDto.getPatientId()); // based_on_id 是为空的 - queryWrapper.eq(CommonConstants.FieldName.BasedOnId, null); + queryWrapper.isNull(CommonConstants.FieldName.BasedOnId); // 状态是未完成的 queryWrapper.eq(CommonConstants.FieldName.RequestStatus, EventStatus.IN_PROGRESS.getValue()); @@ -315,7 +314,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR // 构建查询条件 QueryWrapper queryWrapper = - HisQueryUtils.buildQueryWrapper(null, null, null, request); + HisQueryUtils.buildQueryWrapper(new OutpatientInfusionRecordDto(), null, null, request); // 执行历史查询的条件 if (historyFlag) { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java index c4d563fb..9f7f3e7d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java @@ -36,20 +36,18 @@ public class OutpatientInfusionRecordController { /** * 查询门诊输液的患者列表 * - * @param infusionPatientDto 患者实体 * @param searchKey 模糊查询关键字 * @param pageNo 当前页 * @param pageSize 每页多少条 * @return 返回门诊输液的患者列表 */ @GetMapping(value = "/infusion-patient-list") - public R getOutpatientInfusionPatientList(OutpatientInfusionPatientDto infusionPatientDto, - @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + public R getOutpatientInfusionPatientList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { return R - .ok(outpatientInfusionRecordService.getOutpatientInfusionPatientList(infusionPatientDto,searchKey, pageNo, pageSize, request)); + .ok(outpatientInfusionRecordService.getOutpatientInfusionPatientList(searchKey, pageNo, pageSize, request)); } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java index 752e2031..4fc0a2aa 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java @@ -1,5 +1,6 @@ package com.openhis.web.outpatientmanage.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -51,6 +52,6 @@ public class OutpatientInfusionPatientDto { private String ageString; /** 开单时间 */ - private Date createTime; + private String createTime; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java index e9228231..8c2d9496 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java @@ -3,6 +3,7 @@ package com.openhis.web.outpatientmanage.dto; import java.math.BigDecimal; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; @@ -119,6 +120,6 @@ public class OutpatientInfusionRecordDto { private String skinTestFlag_enumText; /** 开单时间 */ - private Date createTime; + private String createTime; } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml index 96afe984..87ce0209 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml @@ -157,8 +157,8 @@ pt.name AS patient_name, --病人姓名 pt.id_card AS id_card, --病人身份证号 sr.tenant_id, - pt.gender_enum AS gender_enum, --病人性别 - mr.create_time AS create_time --开单时间 + pt.gender_enum, --病人性别 + to_char(mr.create_time, 'YYYY-MM-DD HH24:MI:SS') AS create_time--开单时间 FROM wor_service_request sr LEFT JOIN adm_encounter e ON e.id = sr.encounter_id @@ -172,7 +172,7 @@ AND sr.based_on_id is null ORDER BY - mr.create_time,e.bus_no,pt.bus_no + create_time,e.bus_no,pt.bus_no ) AS T1 ${ew.customSqlSegment} @@ -241,7 +241,7 @@ sr.performer_id, --执行护士 to_char(sr.occurrence_start_time, 'YYYY-MM-DD HH24:MI:SS') AS occurrence_start_time, --预计执行时间 to_char(sr.occurrence_end_time, 'YYYY-MM-DD HH24:MI:SS') AS occurrence_end_time, --预计结束时间 - mr.create_time --开单时间 + to_char(mr.create_time, 'YYYY-MM-DD HH24:MI:SS') AS create_time--开单时间 FROM wor_service_request sr LEFT JOIN adm_encounter e ON e.id = sr.encounter_id @@ -257,7 +257,7 @@ ORDER BY - mr.create_time desc,e.bus_no,pt.bus_no + create_time desc,e.bus_no,pt.bus_no ) AS T1 ${ew.customSqlSegment} From 0bed4969a4e23a1dc51109bbcb71d9f8f3285c6d Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Thu, 20 Mar 2025 20:14:13 +0800 Subject: [PATCH 024/149] up --- .../appservice/impl/OutpatientInfusionRecordServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java index 22aa6af8..0683b42d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java @@ -306,7 +306,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR * 显示门诊输液执行记录查询 * * @param historyFlag 查询的是否为执行履历 - * @return 门诊输液执行记录查询 + * @return 返回门诊输液执行记录查询 */ @Override public List getPatientInfusionPerformRecord(HttpServletRequest request, From 0426da617633f7b8fb2f3e14eed0bdf58b615a1d Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Fri, 21 Mar 2025 11:51:46 +0800 Subject: [PATCH 025/149] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IDoctorStationDiagnosisAppService.java | 16 ++++++ .../DoctorStationAdviceAppServiceImpl.java | 1 + .../DoctorStationDiagnosisAppServiceImpl.java | 45 ++++++++++++++-- .../DoctorStationDiagnosisController.java | 23 ++++++++ .../web/doctorstation/dto/AdviceSaveDto.java | 5 ++ .../doctorstation/dto/DiagnosisQueryDto.java | 52 +++++++++++++++++++ .../dto/SaveDiagnosisChildParam.java | 1 + .../DoctorStationDiagnosisAppMapper.java | 9 ++++ .../DoctorStationDiagnosisAppMapper.xml | 16 ++++++ 9 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/DiagnosisQueryDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java index 745d5cee..42a021c0 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationDiagnosisAppService.java @@ -74,4 +74,20 @@ public interface IDoctorStationDiagnosisAppService { */ R getConditionDefinitionBusinessClass(Long patientId); + /** + * 查询就诊诊断信息 + * + * @param encounterId 就诊id + * @return 就诊诊断信息 + */ + R getEncounterDiagnosis(Long encounterId); + + /** + * 删除就诊诊断信息 + * + * @param conditionId 诊断ID + * @return 结果 + */ + R delEncounterDiagnosis(Long conditionId); + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index 144f239c..7a525566 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -210,6 +210,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp medicationRequest.setRateCode(adviceSaveDto.getRateCode()); medicationRequest.setDose(adviceSaveDto.getDose()); medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); + medicationRequest.setSkinTestFlag(adviceSaveDto.getSkinTestFlag()); // 皮试标记 medicationRequest.setGroupId(adviceSaveDto.getGroupId());// 分组id // medicationRequest.setPackageId(adviceSaveDto.getPackageId()); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java index 205b926c..fdd1d77a 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java @@ -26,10 +26,7 @@ import com.openhis.clinical.service.IConditionService; import com.openhis.clinical.service.IDiagnosisBelongBindingService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.enums.BindingType; -import com.openhis.common.enums.ConditionDefinitionSource; -import com.openhis.common.enums.PublicationStatus; -import com.openhis.common.enums.Whether; +import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisPageUtils; import com.openhis.common.utils.HisQueryUtils; @@ -240,6 +237,46 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn return R.ok(conditionDefinitionBusinessClass); } + /** + * 查询就诊诊断信息 + * + * @param encounterId 就诊id + * @return 就诊诊断信息 + */ + @Override + public R getEncounterDiagnosis(Long encounterId) { + List encounterDiagnosis = doctorStationDiagnosisAppMapper.getEncounterDiagnosis(encounterId); + for (DiagnosisQueryDto diagnosis : encounterDiagnosis) { + // 中医诊断/西医诊断 + if (ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue() + .equals(diagnosis.getSourceEnum()) + || ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue() + .equals(diagnosis.getSourceEnum())) { + diagnosis.setTypeName(CommonConstants.BusinessName.TCM_DIAGNOSIS); + } else { + diagnosis.setTypeName(CommonConstants.BusinessName.WESTERN_MEDICINE_DIAGNOSIS); + } + // 验证状态 + diagnosis.setVerificationStatusEnum_enumText( + EnumUtils.getInfoByValue(ConditionVerificationStatus.class, diagnosis.getVerificationStatusEnum())); + } + return R.ok(encounterDiagnosis); + } + + /** + * 删除就诊诊断信息 + * + * @param conditionId 诊断ID + * @return 结果 + */ + @Override + public R delEncounterDiagnosis(Long conditionId) { + iConditionService.removeById(conditionId); + iEncounterDiagnosisService + .remove(new LambdaQueryWrapper().eq(EncounterDiagnosis::getConditionId, conditionId)); + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"就诊诊断信息"})); + } + /** * 处理诊断定义元数据 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationDiagnosisController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationDiagnosisController.java index 51f935d6..4df2744d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationDiagnosisController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationDiagnosisController.java @@ -147,4 +147,27 @@ public class DoctorStationDiagnosisController { return iDoctorStationDiagnosisAppService.getConditionDefinitionBusinessClass(patientId); } + /** + * 查询就诊诊断信息 + * + * @param encounterId 就诊id + * @return 就诊诊断信息 + */ + @GetMapping(value = "/get-encounter-diagnosis") + public R getEncounterDiagnosis(@RequestParam Long encounterId) { + return iDoctorStationDiagnosisAppService.getEncounterDiagnosis(encounterId); + } + + /** + * 删除就诊诊断信息 + * + * @param conditionId 诊断ID + * @return 结果 + */ + @DeleteMapping(value = "/encounter-diagnosis") + public R delEncounterDiagnosis(@RequestParam Long conditionId) { + return iDoctorStationDiagnosisAppService.delEncounterDiagnosis(conditionId); + } + + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java index 259959c7..6d1fa76d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java @@ -94,6 +94,11 @@ public class AdviceSaveDto { /** 剂量单位 */ private String doseUnitCode; + /** + * 皮试标志 1:是 , 0:否 + */ + private Integer skinTestFlag; + /** * 分组id , 一组药品共用一个id,前端传过来 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/DiagnosisQueryDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/DiagnosisQueryDto.java new file mode 100644 index 00000000..8bf95bcb --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/DiagnosisQueryDto.java @@ -0,0 +1,52 @@ +package com.openhis.web.doctorstation.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 诊断查询 dto + * + * @author system + * @date 2025-02-20 + */ +@Data +@Accessors(chain = true) +public class DiagnosisQueryDto { + + /** + * 诊断ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long conditionId; + + /** + * 诊断定义id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long definitionId; + + /** 所属分类 */ + private Integer sourceEnum; + /** + * 诊断类型(中医诊断或西医诊断) + */ + private String typeName; + + /** 诊断名称 */ + private String name; + + /** + * 主诊断标记 (1:是,0:否) + */ + private Integer maindiseFlag; + + /** + * 验证状态 + */ + private Integer verificationStatusEnum; + private String verificationStatusEnum_enumText; + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/SaveDiagnosisChildParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/SaveDiagnosisChildParam.java index 2c030ee0..0e57bb4f 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/SaveDiagnosisChildParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/SaveDiagnosisChildParam.java @@ -40,6 +40,7 @@ public class SaveDiagnosisChildParam { /** * 诊断ID - 用于存储 adm_encounter_diagnosis表 */ + @JsonSerialize(using = ToStringSerializer.class) private Long conditionId; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationDiagnosisAppMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationDiagnosisAppMapper.java index 5a958e1c..e85a6781 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationDiagnosisAppMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationDiagnosisAppMapper.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.openhis.web.doctorstation.dto.ConditionDefinitionMetadata; import com.openhis.web.doctorstation.dto.DiagnosisBelongBindingDto; +import com.openhis.web.doctorstation.dto.DiagnosisQueryDto; /** * 医生站-诊断 应用Mapper @@ -73,4 +74,12 @@ public interface DoctorStationDiagnosisAppMapper { List getOrganizationList(@Param("statusEnum") Integer statusEnum, @Param("bindingEnum") Integer bindingEnum, @Param("currentUserOrganizationId") Long currentUserOrganizationId); + /** + * 查询就诊诊断信息 + * + * @param encounterId 就诊id + * @return 就诊诊断信息 + */ + List getEncounterDiagnosis(@Param("encounterId") Long encounterId); + } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationDiagnosisAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationDiagnosisAppMapper.xml index 568adb51..dc2318cf 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationDiagnosisAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationDiagnosisAppMapper.xml @@ -116,4 +116,20 @@ AND T1.status_enum = #{statusEnum} + + \ No newline at end of file From ede0dbc72d61f4bb189b2a611eed55a9e50dfec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E8=8F=B2?= <12704587+yvwen@user.noreply.gitee.com> Date: Fri, 21 Mar 2025 13:14:26 +0800 Subject: [PATCH 026/149] =?UTF-8?q?=E8=BE=93=E6=B6=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infusionrecord/component/api.js | 8 +++ .../clinicmanagement/infusionrecord/index.vue | 63 ++++++++++++------- 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/component/api.js b/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/component/api.js index f72a85c7..823bdb98 100644 --- a/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/component/api.js +++ b/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/component/api.js @@ -24,6 +24,14 @@ export function updateInfusionRecord(data) { data: data }) } + // 时间更改 +export function editPatientInfusionTime(data) { + return request({ + url: '/outpatient-manage/infusion/infusion-perform-time', + method: 'put', + data: data + }) +} // 点击患者,查询该患者的输液记录 export function listPatientInfusionRecord(query) { diff --git a/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue b/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue index eac6671d..d9b63aa7 100644 --- a/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue +++ b/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue @@ -40,7 +40,7 @@ 搜索 确认执行 - 取消执行 + 打印患者卡 打印瓶签 打印输液单 @@ -52,7 +52,7 @@ @selection-change="handleSelectionChange" ref="tableRef"> - + @@ -71,7 +71,10 @@

院注执行历史

- + + + @@ -82,6 +85,11 @@ + + +
@@ -96,8 +104,8 @@ \ No newline at end of file From 8307b86d9edba08ed172294532e20da6c48b96f7 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 25 Mar 2025 15:32:31 +0800 Subject: [PATCH 045/149] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/IItemDefinitionService.java | 22 ++++++ .../impl/ItemDefinitionServiceImpl.java | 76 +++++++++++++++++++ .../impl/MedicationManageAppServiceImpl.java | 52 ++++++++++++- .../DiagnosisTreatmentController.java | 14 +++- .../dto/DiagnosisTreatmentDto.java | 13 +++- .../dto/DiagnosisTreatmentInitDto.java | 1 + .../dto/MedicationManageDto.java | 12 ++- .../dto/MedicationManageInitDto.java | 37 +++++++++ .../dto/MedicationManageUpDto.java | 25 ++++++ .../common/constant/CommonConstants.java | 11 +++ .../domain/ChargeItemDefinition.java | 2 +- 11 files changed, 253 insertions(+), 12 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java new file mode 100644 index 00000000..41f69488 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java @@ -0,0 +1,22 @@ +package com.openhis.web.datadictionary.appservice; + +import com.openhis.medication.domain.MedicationDetail; +import com.openhis.web.datadictionary.dto.MedicationManageUpDto; + +/** + * 项目定价 + * + * @author liuhr + * @date 2025/3/25 + */ +public interface IItemDefinitionService { + + /** + * 添加项目定价 + * + * @param medicationManageUpDto 药品目录信息 + * @param medicationDetail 药品信息 + */ + boolean addItem(MedicationManageUpDto medicationManageUpDto, MedicationDetail medicationDetail); + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java new file mode 100644 index 00000000..c36fb9dc --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java @@ -0,0 +1,76 @@ +package com.openhis.web.datadictionary.appservice.impl; + +import com.openhis.administration.domain.ChargeItemDefDetail; +import com.openhis.administration.service.IChargeItemDefinitionService; +import com.openhis.workflow.domain.ServiceRequest; +import liquibase.pro.packaged.S; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.core.common.utils.DateUtils; +import com.openhis.administration.domain.ChargeItemDefinition; +import com.openhis.administration.service.IChargeItemDefDetailService; +import com.openhis.administration.service.IChargeItemService; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.enums.PublicationStatus; +import com.openhis.common.enums.Whether; +import com.openhis.medication.domain.MedicationDetail; +import com.openhis.web.datadictionary.appservice.IItemDefinitionService; +import com.openhis.web.datadictionary.dto.MedicationManageUpDto; + +import java.util.ArrayList; +import java.util.List; + +/** + * 项目定价 实现 + * + * @author liuhr + * @date 2025/3/25 + */ +@Service +public class ItemDefinitionServiceImpl implements IItemDefinitionService { + + @Autowired + IChargeItemDefinitionService chargeItemDefinitionService; + + @Autowired + IChargeItemDefDetailService chargeItemDefDetailService; + + /** + * 添加项目定价 + * + * @param medicationManageUpDto 药品目录信息 + * @param medicationDetail 药品信息 + */ + @Override + public boolean addItem(MedicationManageUpDto medicationManageUpDto, MedicationDetail medicationDetail) { + + ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition(); + chargeItemDefinition.setChargeName(medicationDetail.getName()) + .setStatusEnum(PublicationStatus.ACTIVE.getValue()) + .setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION) + .setInstanceId(medicationDetail.getMedicationDefId()).setEffectiveStart(DateUtils.getNowDate()) + // todo 机构ID后续修改 + .setOrgId(1L) + // 财务类别 + .setTypeCode(medicationManageUpDto.getMinimalFee()) + // 医保类别 + .setYbType(medicationManageUpDto.getYbType()).setConditionFlag(Whether.YES.getValue()) + .setPrice(medicationManageUpDto.getRetailPrice()); + boolean insertCIDSuccess = chargeItemDefinitionService.save(chargeItemDefinition); + + if (insertCIDSuccess) { + List shargeItemDefDetails = new ArrayList<>(); + ChargeItemDefDetail chargeItemDefDetail1 = new ChargeItemDefDetail(); + chargeItemDefDetail1.setDefinitionId(chargeItemDefinition.getId()) + // 单位+批次(unit,pici) 用,符号拼装 + .setConditionCode( + medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()); +// .setAmount(1) + shargeItemDefDetails.add(chargeItemDefDetail1); + } + // 添加子表信息 + return false; + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java index af080b35..3448bb16 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java @@ -11,6 +11,13 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.core.common.core.domain.entity.SysDictData; +import com.core.common.utils.ChineseConvertUtils; +import com.core.system.service.ISysDictTypeService; +import com.openhis.administration.domain.Supplier; +import com.openhis.administration.service.ISupplierService; +import com.openhis.common.constant.CommonConstants; +import com.openhis.web.datadictionary.appservice.IItemDefinitionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -25,7 +32,6 @@ import com.core.common.utils.SecurityUtils; import com.core.common.utils.bean.BeanUtils; import com.core.common.utils.poi.ExcelUtil; import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.enums.AccountStatus; import com.openhis.common.enums.ApplicableScope; import com.openhis.common.enums.PublicationStatus; import com.openhis.common.utils.EnumUtils; @@ -57,6 +63,14 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi @Autowired private MedicationManageSearchMapper medicationManageSearchMapper; + @Autowired + private ISupplierService supplierService; + + @Autowired + private ISysDictTypeService sysDictTypeService; + + @Autowired + private IItemDefinitionService itemDefinitionServic; /** * 药品目录初始化 @@ -75,9 +89,25 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi List domainEnumOptions = Stream.of(ApplicableScope.values()) .map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo())) .collect(Collectors.toList()); + // 查询供应商列表 + List supplierList = supplierService.getList(); + // 供应商信息 + List supplierListOptions = supplierList.stream() + .map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName())) + .collect(Collectors.toList()); + + // 获取药品分类 + List medicalList = + sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE); + // 获取药品分类List + List medicationListOptions = medicalList.stream() + .map(status -> new MedicationManageInitDto.dictCategoryCode(status.getDictValue(), status.getDictLabel())) + .collect(Collectors.toList()); medicationManageInitDto.setStatusFlagOptions(statusEnumOptions); medicationManageInitDto.setDomainFlagOptions(domainEnumOptions); + medicationManageInitDto.setSupplierListOptions(supplierListOptions); + medicationManageInitDto.setMedicationCategoryCodeOptions(medicationListOptions); return R.ok(medicationManageInitDto); } @@ -117,9 +147,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi // 药品状态 e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum())); // 活动标记 -// e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag())); + // e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag())); // 适用范围 -// e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum())); + // e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum())); }); // 返回【药品录列表DTO】分页 @@ -138,6 +168,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi Medication medication = new Medication(); BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息 BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息 + // 拼音码 + medicationDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getName())); + // 五笔码 + medicationDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getName())); // 更新子表药品信息 if (medicationService.updateById(medication)) { @@ -223,10 +257,20 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi MedicationDetail medicationDetail = new MedicationDetail(); BeanUtils.copyProperties(medicationManageUpDto, medicationDetail); + // 拼音码 + medicationDetail.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getName())); + // 五笔码 + medicationDetail.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getName())); + // 新增主表外来药品目录 if (medicationDefinitionService.addMedication(medicationDetail)) { + // 新增子表外来药品目录 - return medicationService.addMedication(medicationDetail) + boolean insertMedicationSuccess = medicationService.addMedication(medicationDetail); + // 添加药品成功后,添加相应的条件价格表信息 + boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(medicationManageUpDto,medicationDetail); + + return (insertMedicationSuccess || insertItemDefinitionSuccess) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"})) : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); } else { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 01578846..1b719c75 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -10,6 +10,7 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; +import com.openhis.common.enums.*; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,10 +25,6 @@ import com.core.system.service.ISysDictTypeService; import com.openhis.administration.domain.Organization; import com.openhis.administration.service.IOrganizationService; import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.enums.ActivityDefCategory; -import com.openhis.common.enums.OrganizationType; -import com.openhis.common.enums.PublicationStatus; -import com.openhis.common.enums.Whether; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisPageUtils; import com.openhis.common.utils.HisQueryUtils; @@ -113,6 +110,13 @@ public class DiagnosisTreatmentController { diseaseTreatmentCategories.add(diseaseTreatmentCategory2); diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); + + // 获取类型 + List typeEnumOptions = Stream.of(ActivityType.values()) + .map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions); + return R.ok(diagnosisTreatmentInitDto); } @@ -145,6 +149,8 @@ public class DiagnosisTreatmentController { e.setYbFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbFlag())); // 医保对码标记枚举类回显赋值 e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag())); + //类型举类回显赋值 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(ActivityType.class, e.getTypeEnum())); }); // 返回【诊疗目录列表DTO】分页 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index 79c4ed95..881a4132 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -8,6 +8,8 @@ import com.openhis.common.enums.PublicationStatus; import lombok.Data; import lombok.experimental.Accessors; +import javax.validation.constraints.NotNull; + /** * 诊疗目录分页检索 * @@ -37,7 +39,8 @@ public class DiagnosisTreatmentDto { private String wbStr; /** 类型 */ - private String typeCode; + private Integer typeEnum; + private String typeEnum_enumText; /** 使用单位 */ private String permittedUnitCode; @@ -67,4 +70,12 @@ public class DiagnosisTreatmentDto { /** 规则id */ private Integer ruleId; + + /** 归属科室 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long orgId; + + /** 所在位置 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long locationId; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java index 6cc44888..77408654 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java @@ -18,6 +18,7 @@ public class DiagnosisTreatmentInitDto { private List statusFlagOptions; private List diseaseTreatmentCategoryList; private List exeOrganizations; + private List typeEnumOptions; /** * 状态 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java index 0e47901c..0d258adc 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java @@ -110,8 +110,9 @@ public class MedicationManageDto { private String wbStr; /** 药品分类 */ - @Dict(dictCode = "medicine_category") + @Dict(dictCode = "med_category_code") private Integer categoryCode; + private String categoryCode_dictText; /** 商品名称 */ private String merchandiseName; @@ -144,7 +145,9 @@ public class MedicationManageDto { private String approvalNumber; /** 医保是否对码 */ + @Dict(dictCode = "sys_yes_no") private Integer ybMatchFlag; + private String ybMatchFlag_dictText; /** 医保编码 */ private String ybNo; @@ -155,10 +158,12 @@ public class MedicationManageDto { /** 是否皮试 */ @Dict(dictCode = "sys_yes_no") private Integer skinTestFlag; + private String skinTestFlag_dictText; /** 是否为注射药物 */ @Dict(dictCode = "sys_yes_no") private Integer injectFlag; + private String injectFlag_dictText; /** 生产厂家 */ @JsonSerialize(using = ToStringSerializer.class) @@ -171,6 +176,7 @@ public class MedicationManageDto { /** 是否限制使用 */ @Dict(dictCode = "sys_yes_no") private Integer restrictedFlag; + private String restrictedFlag_dictText; /** 限制使用范围 */ private String restrictedScope; @@ -178,6 +184,7 @@ public class MedicationManageDto { /** 儿童用药标志 */ @Dict(dictCode = "sys_yes_no") private Integer childrenFlag; + private String childrenFlag_dictText; /** 产品特性 */ private Integer characteristic; @@ -213,9 +220,10 @@ public class MedicationManageDto { private String baseQuantity; /** 最小单位 */ - private String minUnitCode; + private Integer minUnitCode; /** 当前库存数量(最小单位数量) */ private String minQuantity; + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java index 053b9afd..f01bb2f6 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java @@ -1,7 +1,9 @@ package com.openhis.web.datadictionary.dto; +import java.util.ArrayList; import java.util.List; +import com.openhis.web.inventorymanage.dto.PurchaseInventoryInitDto; import lombok.Data; import lombok.experimental.Accessors; @@ -16,6 +18,12 @@ import lombok.experimental.Accessors; public class MedicationManageInitDto { private List statusFlagOptions; private List domainFlagOptions; + //供应商 + private List supplierListOptions; + //药品类型 + private List medicationCategoryCodeOptions; + //单位编码 + private List unitCodeOptions; /** * 状态 @@ -44,4 +52,33 @@ public class MedicationManageInitDto { this.info = info; } } + + /** + * 供应商 + */ + @Data + public static class supplierListOption { + private Long value; + private String label; + + public supplierListOption(Long value, String label) { + this.value = value; + this.label = label; + } + } + + /** + * 药品类型 + */ + @Data + public static class dictCategoryCode { + private String value; + private String info; + + public dictCategoryCode(String value, String info) { + this.value = value; + this.info = info; + } + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java index f0c23309..8f90e405 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; @@ -31,8 +32,13 @@ public class MedicationManageUpDto { private Long medicationDefId; /** 所属科室 */ + @JsonSerialize(using = ToStringSerializer.class) private Long orgId; + /** 所在位置 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long locationId; + /** 剂型 */ private String doseFormCode; @@ -66,7 +72,9 @@ public class MedicationManageUpDto { private BigDecimal dose; /** 剂量单位 */ + @Dict(dictCode = "unit_code") private String doseUnitCode; + private String doseUnitCode_dictText; /** 单次最大剂量 */ private BigDecimal maxUnit; @@ -146,9 +154,11 @@ public class MedicationManageUpDto { private Integer injectFlag; /** 生产厂家 */ + @JsonSerialize(using = ToStringSerializer.class) private Long manufacturerId; /** 供应商 */ + @JsonSerialize(using = ToStringSerializer.class) private Long supplyId; /** 是否限制使用 */ @@ -163,4 +173,19 @@ public class MedicationManageUpDto { /** 产品特性 */ private Integer characteristic; + /** 购入价 */ + private BigDecimal purchasePrice; + + /** 零售价 */ + private BigDecimal retailPrice; + + /** 最高零售价 */ + private BigDecimal maximumRetailPrice; + + /** 医保类别 */ + private String ybType; + + /** 最小费用 */ + private String minimalFee; + } diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java index e6209cbb..bc9f0656 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java @@ -184,6 +184,17 @@ public class CommonConstants { String TCM_DIAGNOSIS = "中医诊断"; } + /** + * 字典字段名常量 + */ + public interface DictName { + /** + * 药品分类 + */ + String MED_CATEGORY_CODE = "med_category_code"; + + } + /** * sql条件常量 */ diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItemDefinition.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItemDefinition.java index fb63ec88..7bb64a9c 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItemDefinition.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/ChargeItemDefinition.java @@ -36,7 +36,7 @@ public class ChargeItemDefinition extends HisBaseEntity { private String title; /** 状态 */ - private PublicationStatus statusEnum; + private Integer statusEnum; /** 机构ID */ private Long orgId; From 67d717ae065f022f6240054e4ecd96d392bbae55 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 25 Mar 2025 15:39:41 +0800 Subject: [PATCH 046/149] up --- .../openhis/web/datadictionary/dto/MedicationManageDto.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java index 0d258adc..ab186335 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java @@ -127,7 +127,7 @@ public class MedicationManageDto { private String unitCode; /** 最小单位 */ -// private String minUnitCode; + private String minUnitCode; /** 所含耗材 */ private String comprisedText; @@ -219,9 +219,6 @@ public class MedicationManageDto { /** 当前库存数量(常规单位) */ private String baseQuantity; - /** 最小单位 */ - private Integer minUnitCode; - /** 当前库存数量(最小单位数量) */ private String minQuantity; From 5b0bff9211f9a8e512192cf67d0abf4918ac5969 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 25 Mar 2025 16:05:29 +0800 Subject: [PATCH 047/149] =?UTF-8?q?=E8=AF=8A=E7=96=97=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ItemDefinitionServiceImpl.java | 43 +++++++++++++------ .../DiagnosisTreatmentController.java | 4 ++ .../dto/DiagnosisTreatmentDto.java | 6 ++- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java index c36fb9dc..fde1002d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java @@ -1,16 +1,16 @@ package com.openhis.web.datadictionary.appservice.impl; -import com.openhis.administration.domain.ChargeItemDefDetail; -import com.openhis.administration.service.IChargeItemDefinitionService; -import com.openhis.workflow.domain.ServiceRequest; -import liquibase.pro.packaged.S; +import java.util.ArrayList; +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.core.common.utils.DateUtils; +import com.openhis.administration.domain.ChargeItemDefDetail; import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.service.IChargeItemDefDetailService; -import com.openhis.administration.service.IChargeItemService; +import com.openhis.administration.service.IChargeItemDefinitionService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.enums.PublicationStatus; import com.openhis.common.enums.Whether; @@ -18,9 +18,6 @@ import com.openhis.medication.domain.MedicationDetail; import com.openhis.web.datadictionary.appservice.IItemDefinitionService; import com.openhis.web.datadictionary.dto.MedicationManageUpDto; -import java.util.ArrayList; -import java.util.List; - /** * 项目定价 实现 * @@ -65,11 +62,33 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService { chargeItemDefDetail1.setDefinitionId(chargeItemDefinition.getId()) // 单位+批次(unit,pici) 用,符号拼装 .setConditionCode( - medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()); -// .setAmount(1) - shargeItemDefDetails.add(chargeItemDefDetail1); + medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()) + // 购入价 + .setAmount(medicationManageUpDto.getPurchasePrice()).setPriority(0); + + ChargeItemDefDetail chargeItemDefDetail2 = new ChargeItemDefDetail(); + chargeItemDefDetail1.setDefinitionId(chargeItemDefinition.getId()) + // 单位+批次(unit,pici) 用,符号拼装 + .setConditionCode( + medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()) + // 零售价 + .setAmount(medicationManageUpDto.getRetailPrice()).setPriority(1); + + shargeItemDefDetails.add(chargeItemDefDetail2); + + ChargeItemDefDetail chargeItemDefDetail3 = new ChargeItemDefDetail(); + chargeItemDefDetail1.setDefinitionId(chargeItemDefinition.getId()) + // 单位+批次(unit,pici) 用,符号拼装 + .setConditionCode( + medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()) + // 最高零售价 + .setAmount(medicationManageUpDto.getMaximumRetailPrice()).setPriority(2); + + shargeItemDefDetails.add(chargeItemDefDetail3); + + return chargeItemDefDetailService.saveBatch(shargeItemDefDetails); } - // 添加子表信息 + return false; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 1b719c75..2e79edad 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -151,6 +151,10 @@ public class DiagnosisTreatmentController { e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag())); //类型举类回显赋值 e.setTypeEnum_enumText(EnumUtils.getInfoByValue(ActivityType.class, e.getTypeEnum())); + //目录类别举类回显赋值 + e.setCategory_enumText(EnumUtils.getInfoByValue(ActivityDefCategory.class, e.getCategoryEnum())); + //状态举类回显赋值 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum())); }); // 返回【诊疗目录列表DTO】分页 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index 881a4132..154f3ad6 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -24,7 +24,8 @@ public class DiagnosisTreatmentDto { private Long id; /** 目录类别 */ - private ActivityDefCategory categoryEnum; + private Integer categoryEnum; + private String category_enumText; /** 编码 */ private String busNo; @@ -57,7 +58,8 @@ public class DiagnosisTreatmentDto { private String ybMatchFlag_enumText; /** 状态 */ - private PublicationStatus statusEnum; + private Integer statusEnum; + private String statusEnum_enumText; /** 身体部位 */ private String bodySiteCode; From 85a348b2faf3eccc706ef018037f1541f92e40ef Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Tue, 25 Mar 2025 16:10:04 +0800 Subject: [PATCH 048/149] =?UTF-8?q?=E5=8F=82=E4=B8=8E=E8=80=85=E9=87=8D?= =?UTF-8?q?=E5=86=99=20-=20=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/system/SysRoleMapper.xml | 28 ++++- .../appservice/IPractitionerAppService.java | 41 +------ .../impl/PractitionerAppServiceImpl.java | 109 +----------------- .../controller/PractitionerController.java | 65 +---------- .../mapper/PractitionerAppAppMapper.java | 11 ++ .../basedatamanage/PractitionerAppMapper.xml | 8 ++ .../common/enums/PractitionerRole.java | 3 +- .../administration/domain/BizUser.java | 72 ++++++++++++ .../administration/domain/BizUserRole.java | 27 +++++ .../administration/domain/Practitioner.java | 3 + .../administration/mapper/BizUserMapper.java | 17 +++ .../mapper/BizUserRoleMapper.java | 18 +++ .../service/IBizUserRoleService.java | 14 +++ .../service/IBizUserService.java | 14 +++ .../service/impl/BizUserRoleServiceImpl.java | 19 +++ .../service/impl/BizUserServiceImpl.java | 19 +++ .../mapper/administration/BizUserMapper.xml | 7 ++ .../administration/BizUserRoleMapper.xml | 7 ++ 18 files changed, 271 insertions(+), 211 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java create mode 100644 openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUser.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUserRole.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserMapper.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserRoleMapper.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserRoleService.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserService.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserRoleServiceImpl.java create mode 100644 openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserServiceImpl.java create mode 100644 openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserMapper.xml create mode 100644 openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserRoleMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysRoleMapper.xml b/openhis-server/core-system/src/main/resources/mapper/system/SysRoleMapper.xml index 0db98b29..55d07a54 100644 --- a/openhis-server/core-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/openhis-server/core-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -121,8 +121,18 @@ #{roleKey}, #{roleSort}, #{dataScope}, - #{menuCheckStrictly}, - #{deptCheckStrictly}, + + + 1, + 0, + + + + + 1, + 0, + + #{status}, #{remark}, #{createBy}, @@ -137,8 +147,18 @@ role_key = #{roleKey}, role_sort = #{roleSort}, data_scope = #{dataScope}, - menu_check_strictly = #{menuCheckStrictly}, - dept_check_strictly = #{deptCheckStrictly}, + + + 1, + 0, + + + + + 1, + 0, + + status = #{status}, remark = #{remark}, update_by = #{updateBy}, diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java index 9704f1d1..9c9e3304 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java @@ -1,47 +1,8 @@ package com.openhis.web.basedatamanage.appservice; -import javax.servlet.http.HttpServletRequest; - -import com.core.common.core.domain.R; -import com.openhis.web.basedatamanage.dto.PractSearchParam; -import com.openhis.web.basedatamanage.dto.PractitionerDto; - /** - * Practitioner 应该服务类 + * 参与者 应该服务类 */ public interface IPractitionerAppService { - /** - * 查询员工信息 - * - * @param pageNo 当前页码 - * @param pageSize 查询条数 - * @param request 请求数据 - * @return 员工分页列表 - */ - R getPractitionerPage(PractSearchParam practSearchParam, String searchKey, Integer pageNo, Integer pageSize, - HttpServletRequest request); - /** - * 员工信息详情 - * - * @param practitionerId 员工信息id - * @return 员工信息详情 - */ - R getPractitionerById(Long practitionerId); - - /** - * 添加/编辑员工信息 - * - * @param practitionerDto 员工信息 - * @return 操作结果 - */ - R addOrEditPractitioner(PractitionerDto practitionerDto); - - /** - * 员工信息 - * - * @param practitionerId 员工信息id - * @return 操作结果 - */ - R deletePractitioner(Long practitionerId); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java index fb2034da..32ae53a0 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java @@ -1,117 +1,16 @@ package com.openhis.web.basedatamanage.appservice.impl; -import java.util.Arrays; -import java.util.HashSet; +import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -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.extension.plugins.pagination.Page; -import com.core.common.core.domain.R; -import com.core.common.utils.MessageUtils; -import com.openhis.administration.domain.Practitioner; -import com.openhis.administration.domain.PractitionerRole; -import com.openhis.administration.mapper.PractitionerMapper; -import com.openhis.administration.service.IPractitionerRoleService; -import com.openhis.administration.service.IPractitionerService; -import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.utils.HisPageUtils; -import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.basedatamanage.appservice.IPractitionerAppService; -import com.openhis.web.basedatamanage.dto.PractSearchParam; -import com.openhis.web.basedatamanage.dto.PractitionerDto; +import com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper; @Service public class PractitionerAppServiceImpl implements IPractitionerAppService { - @Autowired - private IPractitionerService practitionerService; + @Resource + PractitionerAppAppMapper practitionerAppAppMapper; - @Autowired - private PractitionerMapper practitionerMapper; - - @Autowired - private IPractitionerRoleService practitionerRoleService; - - @Override - public R getPractitionerPage(PractSearchParam practSearchParam, String searchKey, Integer pageNo, - Integer pageSize, HttpServletRequest request) { - - // 构建查询条件 - QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(practSearchParam, searchKey, - new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), request); - - // 查询员工分页列表 - Page practitionerDtoPage = - HisPageUtils.selectPage(practitionerMapper, queryWrapper, pageNo, pageSize, PractitionerDto.class); - - return R.ok(practitionerDtoPage, - MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"})); - } - - /** - * 员工信息详情 - * - * @param practitionerId 员工信息id - * @return 员工信息详情 - */ - @Override - public R getPractitionerById(Long practitionerId) { - Practitioner practitioner = practitionerService.getById(practitionerId); - if (practitioner != null) { - return R.ok(practitioner, - MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"})); - } else { - return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息查询失败"})); - } - } - - /** - * 添加/编辑员工信息 - * - * @param practitionerDto 员工信息 - * @return 操作结果 - */ - @Override - public R addOrEditPractitioner(PractitionerDto practitionerDto) { - - Practitioner practitioner = new Practitioner(); - BeanUtils.copyProperties(practitionerDto, practitioner); - PractitionerRole practitionerRole = new PractitionerRole(); - - if (practitionerDto.getId() != null) { - // 更新员工信息 - practitionerService.updateById(practitioner); - } else { - // 新增员工信息 - practitionerService.save(practitioner); - - // 新增员工岗位信息 - practitionerRole.setPractitionerId(practitioner.getId()); - practitionerRole.setName(practitioner.getName()); - practitionerRoleService.save(practitionerRole); - } - // 返回员工id - return R.ok(practitioner.getId(), - MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"员工信息更新添加"})); - } - - /** - * 删除员工 - * - * @param practitionerId 员工信息id - * @return 操作结果 - */ - @Override - public R deletePractitioner(Long practitionerId) { - // 删除员工信息 - boolean deletepractitioner = practitionerService.removeById(practitionerId); - return deletepractitioner - ? R.ok(practitionerId, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"员工信息"})) - : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息"})); - } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java index 96173a77..2a3c59a2 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java @@ -3,25 +3,16 @@ */ package com.openhis.web.basedatamanage.controller; -import javax.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import com.core.common.core.domain.R; import com.openhis.web.basedatamanage.appservice.IPractitionerAppService; -import com.openhis.web.basedatamanage.dto.PractSearchParam; -import com.openhis.web.basedatamanage.dto.PractitionerDto; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; /** - * 员工管理Controller业务层处理 - * - * @author - * @date 2025-02-21 + * 参与者 Controller业务层处理 */ @RestController @RequestMapping("/base-data-manage/practitioner") @@ -29,54 +20,6 @@ import lombok.extern.slf4j.Slf4j; @AllArgsConstructor public class PractitionerController { - @Autowired - private IPractitionerAppService practitionerAppService; - - /** - * 员工分页列表 - * - * @param practSearchParam 查询条件 - * @param pageNo 当前页码 - * @param pageSize 查询条数 - * @param request 请求数据 - * @return 员工分页列表 - */ - @GetMapping(value = "/practitioner") - public R getPractitionerPage(PractSearchParam practSearchParam, - @RequestParam(value = "searchKey", defaultValue = "") String searchKey, - @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - return practitionerAppService.getPractitionerPage(practSearchParam, searchKey, pageNo, pageSize, request); - } - - /** - * 获取员工需要编辑的信息 - * - * @param practitionerId 员工信息 - */ - @GetMapping("/practitioner-getById") - public R getPractitionerById(@Validated @RequestParam Long practitionerId) { - return practitionerAppService.getPractitionerById(practitionerId); - } - - /** - * 编辑员工信息 - * - * @param practitionerDto 员工信息 - */ - @PutMapping("/practitioner") - public R addOrEditPractitioner(@Validated @RequestBody PractitionerDto practitionerDto) { - return practitionerAppService.addOrEditPractitioner(practitionerDto); - } - - /** - * 删除员工信息 - * - * @param practitionerId 主表id - */ - @DeleteMapping("/practitioner") - public R deletePractitioner(@RequestParam Long practitionerId) { - return practitionerAppService.deletePractitioner(practitionerId); - } + private final IPractitionerAppService practitionerAppService; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java new file mode 100644 index 00000000..9e50ba06 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java @@ -0,0 +1,11 @@ +package com.openhis.web.basedatamanage.mapper; + +import org.springframework.stereotype.Repository; + +/** + * 参与者 应用Mapper + */ +@Repository +public interface PractitionerAppAppMapper { + +} diff --git a/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml new file mode 100644 index 00000000..f5b8f393 --- /dev/null +++ b/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PractitionerRole.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PractitionerRole.java index b9312351..5ec25b1a 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PractitionerRole.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PractitionerRole.java @@ -6,11 +6,12 @@ import lombok.AllArgsConstructor; import lombok.Getter; /** - * 参与者角色 + * 参与者角色 : 对应 sys_role表的角色标识 ; 需要补充业务数据时在该枚举类添加 */ @Getter @AllArgsConstructor public enum PractitionerRole implements HisEnumInterface { + DOCTOR(1, "doctor", "医生"), NURSE(2, "nurse", "护士"), diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUser.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUser.java new file mode 100644 index 00000000..3c830920 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUser.java @@ -0,0 +1,72 @@ +package com.openhis.administration.domain; + +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; + +/** + * 用户管理Entity实体 + * + * @author system + * @date 2025-02-20 + */ +@Data +@TableName("sys_user") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class BizUser extends HisBaseEntity { + + /** 用户ID */ + @TableId(type = IdType.ASSIGN_ID) + private Long userId; + + /** 部门ID */ + private Long deptId; + + /** 用户账号 */ + private String userName; + + /** 用户昵称 */ + private String nickName; + + /** 用户类型 */ + private String userType; + + /** 用户邮箱 */ + private String email; + + /** 手机号码 */ + private String phonenumber; + + /** 用户性别 */ + private String sex; + + /** 用户头像 */ + private String avatar; + + /** 密码 */ + private String password; + + /** 帐号状态(0正常 1停用) */ + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登录IP */ + private String loginIp; + + /** 最后登录时间 */ + private Date loginDate; + + /** 备注 */ + private String remark; + +} diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUserRole.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUserRole.java new file mode 100644 index 00000000..6c9af566 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/BizUserRole.java @@ -0,0 +1,27 @@ +package com.openhis.administration.domain; + +import com.baomidou.mybatisplus.annotation.TableName; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 用户角色Entity实体 + * + * @author system + * @date 2025-02-20 + */ +@Data +@TableName("sys_user_role") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class BizUserRole { + + /** 用户ID */ + private Long userId; + + /** 角色ID */ + private Long roleId; + +} diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/Practitioner.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/Practitioner.java index a5c3c168..ee47e373 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/Practitioner.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/Practitioner.java @@ -80,6 +80,9 @@ public class Practitioner extends HisBaseEntity { /** 医保码 */ private String ybNo; + /** 机构id */ + private Long orgId; + /** 系统用户id */ private Long userId; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserMapper.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserMapper.java new file mode 100644 index 00000000..d31ae0ac --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserMapper.java @@ -0,0 +1,17 @@ +package com.openhis.administration.mapper; + +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.openhis.administration.domain.BizUser; + +/** + * 用户管理Mapper接口 + * + * @author system + * @date 2025-02-20 + */ +@Repository +public interface BizUserMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserRoleMapper.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserRoleMapper.java new file mode 100644 index 00000000..28773514 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/mapper/BizUserRoleMapper.java @@ -0,0 +1,18 @@ +package com.openhis.administration.mapper; + +import com.openhis.administration.domain.BizUserRole; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.openhis.administration.domain.BizUser; + +/** + * 用户角色Mapper接口 + * + * @author system + * @date 2025-02-20 + */ +@Repository +public interface BizUserRoleMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserRoleService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserRoleService.java new file mode 100644 index 00000000..a8f0e80f --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserRoleService.java @@ -0,0 +1,14 @@ +package com.openhis.administration.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.openhis.administration.domain.BizUserRole; + +/** + * 用户角色Service接口 + * + * @author system + * @date 2025-02-20 + */ +public interface IBizUserRoleService extends IService { + +} \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserService.java new file mode 100644 index 00000000..d1cd92d2 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IBizUserService.java @@ -0,0 +1,14 @@ +package com.openhis.administration.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.openhis.administration.domain.BizUser; + +/** + * 用户管理Service接口 + * + * @author system + * @date 2025-02-20 + */ +public interface IBizUserService extends IService { + +} \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserRoleServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserRoleServiceImpl.java new file mode 100644 index 00000000..63e75825 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserRoleServiceImpl.java @@ -0,0 +1,19 @@ +package com.openhis.administration.service.impl; + +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.openhis.administration.domain.BizUserRole; +import com.openhis.administration.mapper.BizUserRoleMapper; +import com.openhis.administration.service.IBizUserRoleService; + +/** + * 用户角色Service业务层处理 + * + * @author system + * @date 2025-02-20 + */ +@Service +public class BizUserRoleServiceImpl extends ServiceImpl implements IBizUserRoleService { + +} \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserServiceImpl.java new file mode 100644 index 00000000..fc108152 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/BizUserServiceImpl.java @@ -0,0 +1,19 @@ +package com.openhis.administration.service.impl; + +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.openhis.administration.domain.BizUser; +import com.openhis.administration.mapper.BizUserMapper; +import com.openhis.administration.service.IBizUserService; + +/** + * 用户管理Service业务层处理 + * + * @author system + * @date 2025-02-20 + */ +@Service +public class BizUserServiceImpl extends ServiceImpl implements IBizUserService { + +} \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserMapper.xml b/openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserMapper.xml new file mode 100644 index 00000000..f7fd379c --- /dev/null +++ b/openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserMapper.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserRoleMapper.xml b/openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserRoleMapper.xml new file mode 100644 index 00000000..73b709a8 --- /dev/null +++ b/openhis-server/openhis-domain/src/main/resources/mapper/administration/BizUserRoleMapper.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file From 7ca6b938479aa0e58a4b2fffe9fb25cee2b9d1df Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 25 Mar 2025 16:22:09 +0800 Subject: [PATCH 049/149] up --- .../impl/MedicationManageAppServiceImpl.java | 19 +++++++++++++++---- .../dto/MedicationManageInitDto.java | 7 +++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java index 3448bb16..ba18dc02 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java @@ -17,7 +17,10 @@ import com.core.system.service.ISysDictTypeService; import com.openhis.administration.domain.Supplier; import com.openhis.administration.service.ISupplierService; import com.openhis.common.constant.CommonConstants; +import com.openhis.common.enums.DeviceCategory; +import com.openhis.common.enums.Whether; import com.openhis.web.datadictionary.appservice.IItemDefinitionService; +import com.openhis.web.datadictionary.dto.DeviceManageInitDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -99,15 +102,23 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi // 获取药品分类 List medicalList = sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE); - // 获取药品分类List - List medicationListOptions = medicalList.stream() - .map(status -> new MedicationManageInitDto.dictCategoryCode(status.getDictValue(), status.getDictLabel())) + // 获取药品分类 + List medicationCategories = Stream.of(DeviceCategory.values()) + .map(category -> new MedicationManageInitDto.dictCategoryCode(category.getValue(), category.getInfo())) + .collect(Collectors.toList()); + + //获取是/否 列表 + // 获取状态 + List statusWeatherOption = Stream.of(Whether.values()) + .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo())) .collect(Collectors.toList()); medicationManageInitDto.setStatusFlagOptions(statusEnumOptions); medicationManageInitDto.setDomainFlagOptions(domainEnumOptions); medicationManageInitDto.setSupplierListOptions(supplierListOptions); - medicationManageInitDto.setMedicationCategoryCodeOptions(medicationListOptions); + medicationManageInitDto.setMedicationCategoryCodeOptions(medicationCategories); + medicationManageInitDto.setStatusWeatherOptions(statusWeatherOption); + return R.ok(medicationManageInitDto); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java index f01bb2f6..8017726a 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java @@ -25,6 +25,8 @@ public class MedicationManageInitDto { //单位编码 private List unitCodeOptions; + //是/否 状态 + private List statusWeatherOptions; /** * 状态 */ @@ -72,10 +74,11 @@ public class MedicationManageInitDto { */ @Data public static class dictCategoryCode { - private String value; + private Integer value; private String info; + List children = new ArrayList<>(); - public dictCategoryCode(String value, String info) { + public dictCategoryCode(Integer value, String info) { this.value = value; this.info = info; } From 9f3884b414a9b040907dbf98227cd060c8242aaa Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 25 Mar 2025 16:44:50 +0800 Subject: [PATCH 050/149] up --- .../impl/MedicationManageAppServiceImpl.java | 28 +++++++++---------- .../DiagnosisTreatmentController.java | 1 + .../dto/MedicationManageInitDto.java | 16 +++++------ 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java index ba18dc02..56582f40 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java @@ -11,16 +11,6 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.core.common.core.domain.entity.SysDictData; -import com.core.common.utils.ChineseConvertUtils; -import com.core.system.service.ISysDictTypeService; -import com.openhis.administration.domain.Supplier; -import com.openhis.administration.service.ISupplierService; -import com.openhis.common.constant.CommonConstants; -import com.openhis.common.enums.DeviceCategory; -import com.openhis.common.enums.Whether; -import com.openhis.web.datadictionary.appservice.IItemDefinitionService; -import com.openhis.web.datadictionary.dto.DeviceManageInitDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -30,19 +20,27 @@ import org.springframework.web.bind.annotation.RequestParam; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; +import com.core.common.core.domain.entity.SysDictData; +import com.core.common.utils.ChineseConvertUtils; import com.core.common.utils.MessageUtils; import com.core.common.utils.SecurityUtils; 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.Supplier; +import com.openhis.administration.service.ISupplierService; +import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.ApplicableScope; import com.openhis.common.enums.PublicationStatus; +import com.openhis.common.enums.Whether; import com.openhis.common.utils.EnumUtils; import com.openhis.medication.domain.Medication; import com.openhis.medication.domain.MedicationDefinition; import com.openhis.medication.domain.MedicationDetail; import com.openhis.medication.service.IMedicationDefinitionService; import com.openhis.medication.service.IMedicationService; +import com.openhis.web.datadictionary.appservice.IItemDefinitionService; import com.openhis.web.datadictionary.appservice.IMedicationManageAppService; import com.openhis.web.datadictionary.dto.MedicationManageDto; import com.openhis.web.datadictionary.dto.MedicationManageInitDto; @@ -103,11 +101,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi List medicalList = sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE); // 获取药品分类 - List medicationCategories = Stream.of(DeviceCategory.values()) - .map(category -> new MedicationManageInitDto.dictCategoryCode(category.getValue(), category.getInfo())) + List medicationCategories = medicalList.stream().map( + category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel())) .collect(Collectors.toList()); - //获取是/否 列表 + // 获取是/否 列表 // 获取状态 List statusWeatherOption = Stream.of(Whether.values()) .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo())) @@ -118,7 +116,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi medicationManageInitDto.setSupplierListOptions(supplierListOptions); medicationManageInitDto.setMedicationCategoryCodeOptions(medicationCategories); medicationManageInitDto.setStatusWeatherOptions(statusWeatherOption); - + return R.ok(medicationManageInitDto); } @@ -279,7 +277,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi // 新增子表外来药品目录 boolean insertMedicationSuccess = medicationService.addMedication(medicationDetail); // 添加药品成功后,添加相应的条件价格表信息 - boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(medicationManageUpDto,medicationDetail); + boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(medicationManageUpDto, medicationDetail); return (insertMedicationSuccess || insertItemDefinitionSuccess) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"})) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 2e79edad..62936fa3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -103,6 +103,7 @@ public class DiagnosisTreatmentController { .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), status.getDictLabel())) .collect(Collectors.toList()); + DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 = new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(), ActivityDefCategory.TREATMENT_SURGERY.getInfo()); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java index 8017726a..c432b5af 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java @@ -3,7 +3,6 @@ package com.openhis.web.datadictionary.dto; import java.util.ArrayList; import java.util.List; -import com.openhis.web.inventorymanage.dto.PurchaseInventoryInitDto; import lombok.Data; import lombok.experimental.Accessors; @@ -18,15 +17,16 @@ import lombok.experimental.Accessors; public class MedicationManageInitDto { private List statusFlagOptions; private List domainFlagOptions; - //供应商 + // 供应商 private List supplierListOptions; - //药品类型 + // 药品类型 private List medicationCategoryCodeOptions; - //单位编码 + // 单位编码 private List unitCodeOptions; - //是/否 状态 + // 是/否 状态 private List statusWeatherOptions; + /** * 状态 */ @@ -74,11 +74,11 @@ public class MedicationManageInitDto { */ @Data public static class dictCategoryCode { - private Integer value; + private String value; private String info; - List children = new ArrayList<>(); + private List children = new ArrayList<>(); - public dictCategoryCode(Integer value, String info) { + public dictCategoryCode(String value, String info) { this.value = value; this.info = info; } From facbd89b40e6a27831b40049386b10e183b7319d Mon Sep 17 00:00:00 2001 From: duhe Date: Tue, 25 Mar 2025 17:25:30 +0800 Subject: [PATCH 051/149] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E6=95=B4=20up=20by=20dh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ISupplierManagementAppService.java | 3 +- .../SupplierManagementAppServiceImpl.java | 26 +++-- .../SupplierManagementController.java | 4 +- .../web/datadictionary/dto/SupplierDto.java | 4 + .../openhis/common/enums/SupplierType.java | 2 +- .../supplier/components/supplier.js | 9 ++ .../src/views/basicmanage/supplier/index.vue | 80 +++++++++----- .../basicservices/registrationfee/index.vue | 6 +- .../src/views/catalog/disease/index.vue | 101 ++++++++++++++++-- .../medicine/components/medicineDialog.vue | 44 +++++--- .../src/views/catalog/medicine/index.vue | 66 +++--------- 11 files changed, 236 insertions(+), 109 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java index d243d9eb..2994c9ec 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java @@ -35,11 +35,12 @@ public interface ISupplierManagementAppService { * * @param supplierSearchParam 查询条件 * @param searchKey 查询条件-模糊查询 + * @param typeEnum 查询条件 * @param pageNo 查询条件 * @param pageSize 查询条件 * @return 厂商/产地查询结果 */ - R getSupplierList(SupplierSearchParam supplierSearchParam, String searchKey, Integer pageNo, Integer pageSize, + R getSupplierList(SupplierSearchParam supplierSearchParam, String searchKey,Integer typeEnum, Integer pageNo, Integer pageSize, HttpServletRequest request); /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java index b1491a05..a6d25ff3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java @@ -12,12 +12,16 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; +import com.alibaba.druid.sql.visitor.functions.Isnull; import com.core.common.utils.ChineseConvertUtils; +import com.core.common.utils.StringUtils; import com.openhis.administration.domain.Supplier; import com.openhis.administration.mapper.SupplierMapper; import com.openhis.administration.service.ISupplierService; import com.openhis.common.enums.AccountStatus; import com.openhis.common.enums.SupplierType; +import com.openhis.common.enums.SupplyStatus; +import com.openhis.common.enums.SupplyType; import com.openhis.common.utils.EnumUtils; import com.openhis.web.datadictionary.appservice.ISupplierManagementAppService; import com.openhis.web.datadictionary.dto.SupplierDto; @@ -73,27 +77,33 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS * * @param supplierSearchParam 查询条件 * @param searchKey 查询条件-模糊查询 + * @param typeEnum 查询条件 * @param pageNo 查询条件 * @param pageSize 查询条件 * @return 厂商/产地查询结果 */ @Override - public R getSupplierList(SupplierSearchParam supplierSearchParam, - @RequestParam(value = "searchKey", defaultValue = "") String searchKey, - @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + public R getSupplierList(SupplierSearchParam supplierSearchParam, String searchKey, + Integer typeEnum, Integer pageNo, Integer pageSize, HttpServletRequest request) { // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(supplierSearchParam, searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request); + if(StringUtils.isNotNull(typeEnum)){ + queryWrapper.eq("type_enum",typeEnum); + } + // 设置排序 queryWrapper.orderByAsc("bus_no"); // 分页查询 Page supplierPage = HisPageUtils.selectPage(supplierMapper, queryWrapper, pageNo, pageSize, SupplierDto.class); // 枚举类回显赋值 - supplierPage.getRecords() - .forEach(e -> e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()))); + supplierPage.getRecords().forEach(e -> { + e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag())); + // 厂商类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplierType.class, e.getTypeEnum())); + }); // 返回【病种目录列表DTO】分页 return R.ok(supplierPage); } @@ -104,7 +114,7 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS * @param supplierUpDto 供应商信息 */ @Override - public R addSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) { + public R addSupplyRequest(SupplierUpDto supplierUpDto) { Supplier supplierInfo = new Supplier(); BeanUtils.copyProperties(supplierUpDto, supplierInfo); @@ -123,7 +133,7 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS * @param supplierUpDto 供应商信息 */ @Override - public R editSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) { + public R editSupplyRequest(SupplierUpDto supplierUpDto) { Supplier supplier = new Supplier(); BeanUtils.copyProperties(supplierUpDto, supplier); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java index 5e75103a..20ccc5dd 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java @@ -46,6 +46,7 @@ public class SupplierManagementController { * * @param supplierSearchParam 查询条件 * @param searchKey 查询条件-模糊查询 + * @param typeEnum 查询条件 * @param pageNo 查询条件 * @param pageSize 查询条件 * @return 厂商/产地查询结果 @@ -53,11 +54,12 @@ public class SupplierManagementController { @GetMapping(value = "/get-supplier-list") public R getSupplierList(SupplierSearchParam supplierSearchParam, @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "typeEnum", defaultValue = "") Integer typeEnum, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { // 返回分页 - return supplierManagementAppService.getSupplierList(supplierSearchParam, searchKey, pageNo, pageSize, request); + return supplierManagementAppService.getSupplierList(supplierSearchParam, searchKey,typeEnum, pageNo, pageSize, request); } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java index c4f145c5..b2169fd5 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.IdType; 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 lombok.Data; import lombok.experimental.Accessors; @@ -35,6 +36,7 @@ public class SupplierDto { /** 类型 */ private Integer typeEnum; + private String typeEnum_enumText; /** 地址 */ private String address; @@ -57,5 +59,7 @@ public class SupplierDto { /** 机构编号 */ @JsonSerialize(using = ToStringSerializer.class) + @Dict(dictTable = "adm_organization",dictCode = "id",dictText = "name") private Long orgId; + private String orgId_dictText; } diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/SupplierType.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/SupplierType.java index b81be822..68bded60 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/SupplierType.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/SupplierType.java @@ -6,7 +6,7 @@ import lombok.Getter; @Getter @AllArgsConstructor -public enum SupplierType { +public enum SupplierType implements HisEnumInterface { DRAFT(1, "1", "生产商"), ACTIVE(2, "2", "供应商"); diff --git a/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js b/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js index 3282d902..98d535eb 100644 --- a/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js +++ b/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js @@ -70,3 +70,12 @@ export function getSupplierInit() { method: 'get' }) } + +// 查询部门树结构 +export function deptTreeSelect(queryParams) { + return request({ + url: '/base-data-manage/organization/organization', + method: 'get', + param: queryParams + }) +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/basicmanage/supplier/index.vue b/openhis-ui-vue3/src/views/basicmanage/supplier/index.vue index b418cda9..ab38a259 100644 --- a/openhis-ui-vue3/src/views/basicmanage/supplier/index.vue +++ b/openhis-ui-vue3/src/views/basicmanage/supplier/index.vue @@ -7,27 +7,18 @@ v-show="showSearch" label-width="90px" > - - - - + - + + + + @@ -260,12 +264,22 @@ - + - - + + + + + @@ -289,6 +303,7 @@ import { stopSupplier, startSupplier, getSupplierInit, + deptTreeSelect, } from "./components/supplier"; const router = useRouter(); @@ -308,6 +323,7 @@ const multiple = ref(true); const total = ref(0); const title = ref(""); const supplierTypeOptions = ref(undefined); +const deptOptions = ref(undefined); // 部门树选项 // 是否停用 const statusFlagOptions = ref(undefined); // const initPassword = ref(undefined); @@ -320,9 +336,9 @@ const data = reactive({ pageNo: 1, pageSize: 10, searchKey: undefined, // 供应商名称 - busNo: undefined, // 编码 - statusEnum: undefined, // 状态(包括 1:预置,2:启用,3:停用) - sourceEnum: undefined, // 来源(包括 1:厂商/产地目录分类,2:自定义) + // busNo: undefined, // 编码 + typeEnum: undefined, // 状态(包括 1:预置,2:启用,3:停用) + // sourceEnum: undefined, // 来源(包括 1:厂商/产地目录分类,2:自定义) }, rules: { busNo: [{ required: true, message: "编码不能为空", trigger: "blur" }], @@ -349,6 +365,16 @@ function getsupplierTypeList() { }); } +/** 查询部门下拉树结构 */ +function getDeptTree() { + console.log("查询部门下拉树结构"); + deptTreeSelect().then((response) => { + console.log(response, "response查询部门下拉树结构"); + deptOptions.value = response.data.records; + console.log(deptOptions.value, "部门下拉树结构"); + }); +} + /** 查询厂商/产地目录列表 */ function getList() { loading.value = true; @@ -356,7 +382,7 @@ function getList() { console.log(queryParams.value, "queryParams.value"); getSupplierList(queryParams.value).then((res) => { loading.value = false; - console.log(res, "res",res.data.records); + console.log(res, "res", res.data.records); supplierList.value = res.data.records; console.log(supplierList.value, "supplierList.value"); total.value = res.data.total; @@ -458,6 +484,8 @@ function handleUpdate(row) { reset(); console.log(row, "row"); form.value = JSON.parse(JSON.stringify(row)); + form.value.activeFlag == 1 ? (form.value.activeFlag = true) : (form.value.activeFlag = false); //是否为活性 + // console.log(form.value.ty, "form.value"); open.value = true; title.value = "厂商/产地编辑"; } @@ -465,6 +493,7 @@ function handleUpdate(row) { function submitForm() { proxy.$refs["supplierRef"].validate((valid) => { if (valid) { + form.activeFlag == true ? (form.activeFlag = 1) : (form.activeFlag = 0); //是否为活性 if (form.value.id != undefined) { console.log(form.value, "editSupplier", form.value.statusEnum); editSupplier(form.value).then((response) => { @@ -495,6 +524,7 @@ function handleView(row) { } getsupplierTypeList(); getList(); +getDeptTree(); \ No newline at end of file From dd8a8f00b173247d79215d4115498dbe1bf29a0f Mon Sep 17 00:00:00 2001 From: "Zhang.YC" Date: Tue, 25 Mar 2025 18:29:33 +0800 Subject: [PATCH 055/149] =?UTF-8?q?=E7=A7=91=E5=AE=A4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicmanage/organization/components/api.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openhis-ui-vue3/src/views/basicmanage/organization/components/api.js b/openhis-ui-vue3/src/views/basicmanage/organization/components/api.js index a6e6a017..5339c67c 100644 --- a/openhis-ui-vue3/src/views/basicmanage/organization/components/api.js +++ b/openhis-ui-vue3/src/views/basicmanage/organization/components/api.js @@ -2,7 +2,7 @@ import request from '@/utils/request' export function getList(queryParams) { return request({ - url: '/basedatamanage/organization/organization', + url: '/base-data-manage/organization/organization', method: 'get', param: queryParams }) @@ -10,7 +10,7 @@ export function getList(queryParams) { export function addOrganization(data) { return request({ - url: '/basedatamanage/organization/organization', + url: '/base-data-manage/organization/organization', method: 'post', data: data }) @@ -18,7 +18,7 @@ export function addOrganization(data) { export function updateOrganization(data) { return request({ - url: '/basedatamanage/organization/organization', + url: '/base-data-manage/organization/organization', method: 'put', data: data }) @@ -26,7 +26,7 @@ export function updateOrganization(data) { export function deleteOrganization(param) { return request({ - url: '/basedatamanage/organization/organization', + url: '/base-data-manage/organization/organization', method: 'delete', params: param }) @@ -34,28 +34,28 @@ export function deleteOrganization(param) { export function getOrgDetail(id) { return request({ - url: '/basedatamanage/organization/organization?orgId=' + id, + url: '/base-data-manage/organization/organization?orgId=' + id, method: 'get', }) } export function initOrgTypeOption() { return request({ - url: '/basedatamanage/organization/init', + url: '/base-data-manage/organization/init', method: 'get', }) } export function disableOrg(id) { return request({ - url: '/basedatamanage/organization/organization-inactive?orgId=' + id, + url: '/base-data-manage/organization/organization-inactive?orgId=' + id, method: 'put', }) } export function enableOrg(id) { return request({ - url: '/basedatamanage/organization/organization-active?orgId=' + id, + url: '/base-data-manage/organization/organization-active?orgId=' + id, method: 'put', }) } From 2a0b1c90929b1a0e268d5333a5058bdd198c0aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E8=8F=B2?= <12704587+yvwen@user.noreply.gitee.com> Date: Tue, 25 Mar 2025 18:39:52 +0800 Subject: [PATCH 056/149] =?UTF-8?q?=E8=BE=93=E6=B6=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clinicmanagement/infusionrecord/index.vue | 84 ++++++++----------- 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue b/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue index 9abb7ddb..6cce2ebb 100644 --- a/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue +++ b/openhis-ui-vue3/src/views/clinicmanagement/infusionrecord/index.vue @@ -49,7 +49,7 @@

院注医嘱

+ @selection-change="handleSelectionChange" ref="tableRef" > - + + \ No newline at end of file From 3a96873df46f857c405fe76176c72d369164c9d9 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Fri, 28 Mar 2025 17:28:15 +0800 Subject: [PATCH 118/149] =?UTF-8?q?=E5=99=A8=E6=9D=90=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E8=AF=8A=E7=96=97=E6=A0=BC=E5=BC=8F=E6=8F=90=E5=8F=96=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IDiagnosisTreatmentManageAppService.java | 86 ++++++ .../appservice/IItemDefinitionService.java | 9 - .../impl/DeviceManageAppServiceImpl.java | 2 +- ...iagnosisTreatmentManageAppServiceImpl.java | 279 ++++++++++++++++++ .../DiagnosisTreatmentController.java | 167 +---------- .../dto/DiagnosisTreatmentDto.java | 4 + .../dto/DiagnosisTreatmentUpDto.java | 12 + .../ActivityDefinitionManageMapper.java | 40 +++ .../ActivityDefinitionManageMapper.xml | 136 +++++++++ 9 files changed, 573 insertions(+), 162 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagnosisTreatmentManageAppService.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java create mode 100644 openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagnosisTreatmentManageAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagnosisTreatmentManageAppService.java new file mode 100644 index 00000000..e4aa4f26 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagnosisTreatmentManageAppService.java @@ -0,0 +1,86 @@ +package com.openhis.web.datadictionary.appservice; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import com.core.common.core.domain.R; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentUpDto; + +/** + * 诊疗目录 + * + * @author liuhr + * @date 2025/3/28 + */ +public interface IDiagnosisTreatmentManageAppService { + + /** + * 诊疗目录初期查询 + * + * @return + */ + R getDiseaseTreatmentInit(); + + /** + * 查询诊疗目录分页列表 + * + * @param DiagnosisTreatmentSelParam 查询条件 + * @param searchKey 查询条件-模糊查询 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return + */ + R getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request); + + /** + * 根据id查询诊疗详情 + * + * @param id 诊疗ID + * @return + */ + R getDiseaseTreatmentOne(Long id); + + /** + * 诊疗目录编辑 + * + * @param diagnosisTreatmentUpDto 诊疗目录列表 + * @return + */ + R editDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto); + + /** + * 诊疗目录停用 + * + * @param ids 诊疗目录ID列表 + * @return + */ + R editDiseaseTreatmentStop(List ids); + + /** + * 诊疗目录启用 + * + * @param ids 诊疗目录ID列表 + * @return + */ + R editDiseaseTreatmentStart(List ids); + + /** + * 新增外来诊疗目录 + * + * @param diagnosisTreatmentUpDto 诊疗目录 + * @return + */ + @PostMapping("/information") + R addDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto); + +} \ No newline at end of file diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java index 53980f83..15cce3a3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java @@ -22,15 +22,6 @@ public interface IItemDefinitionService { */ boolean addItem(ItemUpFromDirectoryDto itemUpFromDirectoryDto); - -// /** -// * 添加器材的项目定价 -// * -// * @param deviceManageUpDto 器材目录信息 -// * @param deviceDefinition 器材信息 -// */ -// boolean addItem(ItemUpFromDirectoryDto itemUpFromDirectoryDto, DeviceDefinition deviceDefinition); -// /** * 修改项目定价表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java index 072e7de6..64911631 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java @@ -199,7 +199,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService { // 更新器材信息 if (deviceDefinitionService.updateById(deviceDefinition)) { ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition(); - chargeItemDefinition.setYbType(deviceManageDto.getItemTypeCode()).setTypeCode(deviceManageDto.getTypeCode()) + chargeItemDefinition.setYbType(deviceManageDto.getYbType()).setTypeCode(deviceManageDto.getItemTypeCode()) .setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION) .setInstanceId(deviceDefinition.getId()); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java new file mode 100644 index 00000000..181bdee9 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java @@ -0,0 +1,279 @@ +package com.openhis.web.datadictionary.appservice.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +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; +import com.core.common.core.domain.R; +import com.core.common.core.domain.entity.SysDictData; +import com.core.common.utils.MessageUtils; +import com.core.common.utils.SecurityUtils; +import com.core.common.utils.bean.BeanUtils; +import com.core.system.service.ISysDictTypeService; +import com.openhis.administration.domain.Organization; +import com.openhis.administration.service.IOrganizationService; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.datadictionary.appservice.IDiagnosisTreatmentManageAppService; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentInitDto; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentUpDto; +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; + +/** + * 诊疗实现类 + * + * @author Wuser + * @date 2025/3/28 + */ +@Service +public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatmentManageAppService { + + @Autowired + private IActivityDefinitionService iActivityDefinitionService; + @Autowired + private ActivityDefinitionMapper activityDefinitionMapper; + @Autowired + private IOrganizationService iOrganizationService; + @Autowired + private ISysDictTypeService iSysDictTypeService; + @Resource + private ActivityDefinitionManageMapper activityDefinitionManageMapper; + + /** + * 诊疗目录初期查询 + * + * @return + */ + @Override + public R getDiseaseTreatmentInit() { + DiagnosisTreatmentInitDto diagnosisTreatmentInitDto = new DiagnosisTreatmentInitDto(); + // 获取状态 + List statusEnumOptions = Stream.of(PublicationStatus.values()) + .map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + diagnosisTreatmentInitDto.setStatusFlagOptions(statusEnumOptions); + // 获取执行科室 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(Organization::getTypeEnum, OrganizationType.HOSPITAL_DEPARTMENT); + List organizations = iOrganizationService.list(queryWrapper); + List exeOrganizations = organizations.stream() + .map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName())) + .collect(Collectors.toList()); + diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations); + + // 获取诊疗分类 + // 查询医疗服务项类型 + 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())) + .collect(Collectors.toList()); + List diseaseTreatmentCategories = new ArrayList<>(); + + DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory = + new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getValue(), + ActivityDefCategory.MEDICAL_SERVICE_ITEM.getInfo()); + diseaseTreatmentCategory.setChildren(diseaseTreatmentCategoryList); + diseaseTreatmentCategories.add(diseaseTreatmentCategory); + diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); + + // 查询手术与治疗类型 + List medical_service_items2 = + iSysDictTypeService.selectDictDataByType(ActivityDefCategory.TREATMENT_SURGERY.getCode()); + // 获取手术与治疗List + List diseaseTreatmentCategoryList2 = medical_service_items2 + .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), + status.getDictLabel())) + .collect(Collectors.toList()); + + DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 = + new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(), + ActivityDefCategory.TREATMENT_SURGERY.getInfo()); + diseaseTreatmentCategory2.setChildren(diseaseTreatmentCategoryList2); + diseaseTreatmentCategories.add(diseaseTreatmentCategory2); + + diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); + + // 获取类型 + List typeEnumOptions = Stream.of(ActivityType.values()) + .map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions); + + return R.ok(diagnosisTreatmentInitDto); + } + + /** + * 查询诊疗目录分页列表 + * + * @param DiagnosisTreatmentSelParam 查询条件 + * @param searchKey 查询条件-模糊查询 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return + */ + @Override + public R getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey, + Integer pageNo, Integer pageSize, HttpServletRequest request) { + // + // // 构建查询条件 + // QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam, + // searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request); + // // 设置排序 + // queryWrapper.orderByAsc("bus_no"); + // // 分页查询 + // Page diseaseTreatmentPage = HisPageUtils.selectPage(activityDefinitionMapper, + // queryWrapper, pageNo, pageSize, DiagnosisTreatmentDto.class); + + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam, + searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request); + + // 分页查询 + IPage diseaseTreatmentPage = + activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<>(pageNo, pageSize), queryWrapper); + + diseaseTreatmentPage.getRecords().forEach(e -> { + // 医保标记枚举类回显赋值 + e.setYbFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbFlag())); + // 医保对码标记枚举类回显赋值 + e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag())); + // 类型举类回显赋值 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(ActivityType.class, e.getTypeEnum())); + // 目录类别举类回显赋值 + e.setCategory_enumText(EnumUtils.getInfoByValue(ActivityDefCategory.class, e.getCategoryEnum())); + // 状态举类回显赋值 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum())); + }); + + // 返回【诊疗目录列表DTO】分页 + return R.ok(diseaseTreatmentPage); + } + + /** + * 根据id查询诊疗详情 + * + * @param id 诊疗ID + * @return + */ + @Override + public R getDiseaseTreatmentOne(Long id) { + + // 获取租户ID + Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); + // 根据ID查询【诊疗目录】 + return R.ok(activityDefinitionManageMapper.getDiseaseTreatmentOne(id, tenantId)); + + } + + /** + * 诊疗目录编辑 + * + * @param diagnosisTreatmentUpDto 诊疗目录列表 + * @return + */ + @Override + public R editDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) { + + ActivityDefinition ActivityDefinition = new ActivityDefinition(); + BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition); + + // 更新诊疗信息 + return iActivityDefinitionService.updateById(ActivityDefinition) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + + } + + /** + * 诊疗目录停用 + * + * @param ids 诊疗目录ID列表 + * @return + */ + @Override + public R editDiseaseTreatmentStop(List ids) { + + List ActivityDefinitionList = new CopyOnWriteArrayList<>(); + + // 取得更新值 + for (Long detail : ids) { + ActivityDefinition ActivityDefinition = new ActivityDefinition(); + ActivityDefinition.setId(detail); + ActivityDefinition.setStatusEnum(PublicationStatus.RETIRED.getValue()); + ActivityDefinitionList.add(ActivityDefinition); + } + // 更新诊疗信息 + return iActivityDefinitionService.updateBatchById(ActivityDefinitionList) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + + } + + /** + * 诊疗目录启用 + * + * @param ids 诊疗目录ID列表 + * @return + */ + @Override + public R editDiseaseTreatmentStart(List ids) { + + List ActivityDefinitionList = new CopyOnWriteArrayList<>(); + + // 取得更新值 + for (Long detail : ids) { + ActivityDefinition ActivityDefinition = new ActivityDefinition(); + ActivityDefinition.setId(detail); + ActivityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue()); + ActivityDefinitionList.add(ActivityDefinition); + } + // 更新诊疗信息 + return iActivityDefinitionService.updateBatchById(ActivityDefinitionList) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + + } + + /** + * 新增外来诊疗目录 + * + * @param diagnosisTreatmentUpDto 诊疗目录 + * @return + */ + @Override + public R addDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) { + + ActivityDefinition ActivityDefinition = new ActivityDefinition(); + BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition); + // 新增外来诊疗目录 + ActivityDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue()); + return iActivityDefinitionService.addDiagnosisTreatment(ActivityDefinition) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); + + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 62936fa3..89112892 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -1,40 +1,18 @@ package com.openhis.web.datadictionary.controller; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.stream.Collectors; -import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; -import com.openhis.common.enums.*; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -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.core.domain.R; -import com.core.common.core.domain.entity.SysDictData; -import com.core.common.utils.MessageUtils; -import com.core.common.utils.bean.BeanUtils; -import com.core.system.service.ISysDictTypeService; -import com.openhis.administration.domain.Organization; -import com.openhis.administration.service.IOrganizationService; -import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.utils.EnumUtils; -import com.openhis.common.utils.HisPageUtils; -import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.datadictionary.appservice.IDiagnosisTreatmentManageAppService; import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto; -import com.openhis.web.datadictionary.dto.DiagnosisTreatmentInitDto; import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam; import com.openhis.web.datadictionary.dto.DiagnosisTreatmentUpDto; -import com.openhis.workflow.domain.ActivityDefinition; -import com.openhis.workflow.mapper.ActivityDefinitionMapper; -import com.openhis.workflow.service.IActivityDefinitionService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -50,10 +28,9 @@ import lombok.extern.slf4j.Slf4j; @Slf4j @AllArgsConstructor public class DiagnosisTreatmentController { - private final IActivityDefinitionService iActivityDefinitionService; - private final ActivityDefinitionMapper activityDefinitionMapper; - private final IOrganizationService iOrganizationService; - private final ISysDictTypeService iSysDictTypeService; + + @Autowired + private IDiagnosisTreatmentManageAppService diagnosisTreatmentManageAppService; /** * 诊疗目录初期查询 @@ -62,63 +39,8 @@ public class DiagnosisTreatmentController { */ @GetMapping("/init") public R getDiseaseTreatmentInit() { - DiagnosisTreatmentInitDto diagnosisTreatmentInitDto = new DiagnosisTreatmentInitDto(); - // 获取状态 - List statusEnumOptions = Stream.of(PublicationStatus.values()) - .map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo())) - .collect(Collectors.toList()); - diagnosisTreatmentInitDto.setStatusFlagOptions(statusEnumOptions); - // 获取执行科室 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(Organization::getTypeEnum, OrganizationType.HOSPITAL_DEPARTMENT); - List organizations = iOrganizationService.list(queryWrapper); - List exeOrganizations = organizations.stream() - .map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName())) - .collect(Collectors.toList()); - diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations); - // 获取诊疗分类 - // 查询医疗服务项类型 - 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())) - .collect(Collectors.toList()); - List diseaseTreatmentCategories = new ArrayList<>(); - - DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory = - new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getValue(), - ActivityDefCategory.MEDICAL_SERVICE_ITEM.getInfo()); - diseaseTreatmentCategory.setChildren(diseaseTreatmentCategoryList); - diseaseTreatmentCategories.add(diseaseTreatmentCategory); - diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); - - // 查询手术与治疗类型 - List medical_service_items2 = - iSysDictTypeService.selectDictDataByType(ActivityDefCategory.TREATMENT_SURGERY.getCode()); - // 获取手术与治疗List - List diseaseTreatmentCategoryList2 = medical_service_items2 - .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), - status.getDictLabel())) - .collect(Collectors.toList()); - - DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 = - new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(), - ActivityDefCategory.TREATMENT_SURGERY.getInfo()); - diseaseTreatmentCategory2.setChildren(diseaseTreatmentCategoryList2); - diseaseTreatmentCategories.add(diseaseTreatmentCategory2); - - diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); - - // 获取类型 - List typeEnumOptions = Stream.of(ActivityType.values()) - .map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo())) - .collect(Collectors.toList()); - diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions); - - return R.ok(diagnosisTreatmentInitDto); + return diagnosisTreatmentManageAppService.getDiseaseTreatmentInit(); } /** @@ -136,30 +58,9 @@ public class DiagnosisTreatmentController { @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - // 构建查询条件 - QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam, - searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request); - // 设置排序 - queryWrapper.orderByAsc("bus_no"); - // 分页查询 - Page diseaseTreatmentPage = HisPageUtils.selectPage(activityDefinitionMapper, - queryWrapper, pageNo, pageSize, DiagnosisTreatmentDto.class); - - diseaseTreatmentPage.getRecords().forEach(e -> { - // 医保标记枚举类回显赋值 - e.setYbFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbFlag())); - // 医保对码标记枚举类回显赋值 - e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag())); - //类型举类回显赋值 - e.setTypeEnum_enumText(EnumUtils.getInfoByValue(ActivityType.class, e.getTypeEnum())); - //目录类别举类回显赋值 - e.setCategory_enumText(EnumUtils.getInfoByValue(ActivityDefCategory.class, e.getCategoryEnum())); - //状态举类回显赋值 - e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum())); - }); - // 返回【诊疗目录列表DTO】分页 - return R.ok(diseaseTreatmentPage); + return diagnosisTreatmentManageAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, + pageSize, request); } /** @@ -169,12 +70,9 @@ public class DiagnosisTreatmentController { * @return */ @GetMapping("/information-one") - public R getDiseaseTreatmentOne(@PathVariable("id") Long id) { - DiagnosisTreatmentDto diagnosisTreatmentDto = new DiagnosisTreatmentDto(); - // 根据ID查询【诊疗目录】 - ActivityDefinition activityDefinition = iActivityDefinitionService.getById(id); - BeanUtils.copyProperties(activityDefinition, diagnosisTreatmentDto); - return R.ok(diagnosisTreatmentDto); + public R getDiseaseTreatmentOne(@RequestParam Long id) { + + return diagnosisTreatmentManageAppService.getDiseaseTreatmentOne(id); } /** @@ -186,13 +84,7 @@ public class DiagnosisTreatmentController { @PutMapping("/information") public R editDiseaseTreatment(@RequestBody DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) { - ActivityDefinition ActivityDefinition = new ActivityDefinition(); - BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition); - - // 更新诊疗信息 - return iActivityDefinitionService.updateById(ActivityDefinition) - ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) - : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + return diagnosisTreatmentManageAppService.editDiseaseTreatment(diagnosisTreatmentUpDto); } /** @@ -203,19 +95,8 @@ public class DiagnosisTreatmentController { */ @PutMapping("/information-stop") public R editDiseaseTreatmentStop(@RequestBody List ids) { - List ActivityDefinitionList = new CopyOnWriteArrayList<>(); - // 取得更新值 - for (Long detail : ids) { - ActivityDefinition ActivityDefinition = new ActivityDefinition(); - ActivityDefinition.setId(detail); - ActivityDefinition.setStatusEnum(PublicationStatus.RETIRED.getValue()); - ActivityDefinitionList.add(ActivityDefinition); - } - // 更新诊疗信息 - return iActivityDefinitionService.updateBatchById(ActivityDefinitionList) - ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) - : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + return diagnosisTreatmentManageAppService.editDiseaseTreatmentStop(ids); } /** @@ -226,19 +107,7 @@ public class DiagnosisTreatmentController { */ @PutMapping("/information-start") public R editDiseaseTreatmentStart(@RequestBody List ids) { - List ActivityDefinitionList = new CopyOnWriteArrayList<>(); - - // 取得更新值 - for (Long detail : ids) { - ActivityDefinition ActivityDefinition = new ActivityDefinition(); - ActivityDefinition.setId(detail); - ActivityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue()); - ActivityDefinitionList.add(ActivityDefinition); - } - // 更新诊疗信息 - return iActivityDefinitionService.updateBatchById(ActivityDefinitionList) - ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) - : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + return diagnosisTreatmentManageAppService.editDiseaseTreatmentStart(ids); } /** @@ -249,13 +118,7 @@ public class DiagnosisTreatmentController { */ @PostMapping("/information") public R addDiseaseTreatment(@Validated @RequestBody DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) { - ActivityDefinition ActivityDefinition = new ActivityDefinition(); - BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition); - // 新增外来诊疗目录 - ActivityDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue()); - return iActivityDefinitionService.addDiagnosisTreatment(ActivityDefinition) - ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) - : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); + return diagnosisTreatmentManageAppService.addDiseaseTreatment(diagnosisTreatmentUpDto); } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index c6ab1373..d49976d2 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -66,10 +66,14 @@ public class DiagnosisTreatmentDto { private String statusEnum_enumText; /** 身体部位 */ + @Dict(dictCode = "body_site_code") private String bodySiteCode; + private String bodySiteCode_dictText; /** 所需标本 */ + @Dict(dictCode = "specimen_code") private String specimenCode; + private String specimenCode_dictText; /** 说明 */ private String descriptionText; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java index 6e70dfcf..e46683b7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java @@ -77,6 +77,18 @@ public class DiagnosisTreatmentUpDto { /** 规则id */ private Integer ruleId; + /** 所属科室 */ + @Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name") + @JsonSerialize(using = ToStringSerializer.class) + private Long orgId; + private String orgId_dictText; + + /** 所在位置 */ + @Dict(dictTable = "adm_location", dictCode = "id", dictText = "name") + @JsonSerialize(using = ToStringSerializer.class) + private Long locationId; + private String locationId_dictText; + /** 财务类别 */ @Dict(dictCode = "fin_type_code") private String itemTypeCode; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java new file mode 100644 index 00000000..5a4f0937 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java @@ -0,0 +1,40 @@ +package com.openhis.web.datadictionary.mapper; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto; + +/** + * 诊疗定义管理 + * + * @author liuhr + * @date 2025/3/28 + */ +@Repository +public interface ActivityDefinitionManageMapper { + + /** + * 诊疗目录分页查询 + * + * @param page 分页参数 + * @param queryWrapper 查询条件 + * @return 器材记录 + */ + IPage getDiseaseTreatmentPage(@Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 诊疗详情 + * + * @param id 诊疗ID + * @param tenantId 租户 + * @return + */ + DiagnosisTreatmentDto getDiseaseTreatmentOne(@Param("id") Long id, @Param("tenantId") Integer tenantId); + +} diff --git a/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml new file mode 100644 index 00000000..d0192249 --- /dev/null +++ b/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + \ No newline at end of file From 141a81b5cfe1b92a524f4922b6aedb3e5ffbe3c5 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Fri, 28 Mar 2025 17:29:04 +0800 Subject: [PATCH 119/149] =?UTF-8?q?=E8=AF=8A=E7=96=97=E7=9B=AE=E5=BD=95up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java | 1 + 1 file changed, 1 insertion(+) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index d49976d2..dec2ecb1 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -114,5 +114,6 @@ public class DiagnosisTreatmentDto { /** 最高零售价 */ private BigDecimal maximumRetailPrice; + } From 22e46a05459ea24441953885e8a7062d1a21edb0 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Fri, 28 Mar 2025 17:33:32 +0800 Subject: [PATCH 120/149] =?UTF-8?q?=E5=8F=82=E4=B8=8E=E8=80=85=E6=94=B9?= =?UTF-8?q?=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/PractitionerRolesDto.java | 6 +++ .../DoctorStationAdviceAppServiceImpl.java | 15 +++--- .../doctorstation/dto/AdviceInventoryDto.java | 20 +++---- .../basedatamanage/PractitionerAppMapper.xml | 1 + .../DoctorStationAdviceAppMapper.xml | 52 ++++++++++--------- .../openhis/common/enums/ConditionCode.java | 2 +- 6 files changed, 55 insertions(+), 41 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java index f8b19a3d..bb70bb01 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java @@ -18,6 +18,12 @@ public class PractitionerRolesDto { */ @JsonSerialize(using = ToStringSerializer.class) private Long roleId; + + /** + * 角色code + */ + private String roleCode; + /** * 角色名称 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index 7f082eb0..e567bb6c 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -83,7 +83,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp IPage adviceBaseInfo = doctorStationAdviceAppMapper.getAdviceBaseInfo(new Page<>(pageNo, pageSize), CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION, - CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, DeviceCategory.SINGLE_USE.getInfo(), queryWrapper); + CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, DeviceCategory.SINGLE_USE.getCode(), queryWrapper); List adviceBaseDtoList = adviceBaseInfo.getRecords(); // 医嘱定义ID集合 List adviceDefinitionIdList = @@ -123,16 +123,17 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp String finalUnitCode = unitCode; // 匹配包装单位 List advicePrice1 = childCharge.stream() - .filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId) && e.getConditionValue() - .equals(String.format(CommonConstants.Common.COMMA_FORMAT, finalUnitCode, - adviceInventoryDto.getLotNumber()))) + .filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId) + && e.getConditionValue().equals(adviceInventoryDto.getLotNumber())) .peek(e -> e.setUnitCode(finalUnitCode)) // 设置 unitCode .collect(Collectors.toList()); priceDtoList.addAll(advicePrice1); } + // 价格信息 + baseDto.setPriceList(priceDtoList); } // 诊疗活动 - else { + else if (CommonConstants.TableName.WOR_ACTIVITY_DEFINITION.equals(baseDto.getAdviceTableName())) { List priceList = mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId())) .collect(Collectors.toList()); @@ -144,6 +145,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp } } + return adviceBaseInfo; + // 下面的注释不要删除 2025.03.27 // // 药品和耗材 // List medicationAndDeviceList = adviceBaseDtoList.stream() @@ -206,7 +209,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // // 价格信息 // baseDto.setPriceList(priceList); // } - return adviceBaseInfo; + } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java index 7c6f5530..412a02e8 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java @@ -23,16 +23,16 @@ public class AdviceInventoryDto { @JsonSerialize(using = ToStringSerializer.class) private Long itemId; - /** 当前库存数量(包装单位) */ - private BigDecimal baseQuantity; - - /** 包装单位 */ - @Dict(dictCode = "unit_code") - private String baseUnitCode; - private String baseUnitCode_dictText; - - /** 当前库存数量(最小单位) */ - private BigDecimal minQuantity; +// /** 当前库存数量(包装单位) */ +// private BigDecimal baseQuantity; +// +// /** 包装单位 */ +// @Dict(dictCode = "unit_code") +// private String baseUnitCode; +// private String baseUnitCode_dictText; +// +// /** 当前库存数量(最小单位) */ +// private BigDecimal minQuantity; /** 最小单位 */ @Dict(dictCode = "unit_code") diff --git a/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml index eb75fe31..2a78d22d 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/basedatamanage/PractitionerAppMapper.xml @@ -48,6 +48,7 @@ SELECT encounter_id, - organization_id, department_name, - id_card, patient_name, gender_enum, - encounter_date - + encounter_date, + organization_id, + id_card, + start_time FROM ( SELECT - DISTINCT - T2.id AS encounter_id, - TO_CHAR(T2.start_time,'YYYY-MM-DD') AS encounter_date, - T2.organization_id, - T3.gender_enum, - T3.name AS patient_name, - T3.id_card, - T6.name AS department_name - - FROM med_medication_dispense AS T1 - - INNER JOIN adm_encounter AS T2 - ON T1.encounter_id = T2.id - - INNER JOIN adm_patient AS T3 - ON T1.patient_id = T3.id - - INNER JOIN med_medication AS T4 - ON T1.medication_id = T4.id - - INNER JOIN med_medication_definition AS T5 - ON T4.medication_def_id = T5.id - AND T5.category_code IN ('1','2') - - INNER JOIN adm_organization AS T6 - ON T2.organization_id = T6.id - - WHERE - T1.status_enum = 3 - + T1.id AS encounter_id, + T1.start_time, + TO_CHAR(T1.start_time,'YYYY-MM-DD') AS encounter_date, + T1.organization_id, + T2.gender_enum, + T2.name AS patient_name, + T2.id_card, + T3.name AS department_name + FROM adm_encounter AS T1 + INNER JOIN adm_patient AS T2 + ON T1.patient_id = T2.id + LEFT OUTER JOIN adm_organization AS T3 + ON T1.organization_id = T3.id + GROUP BY + T1.id, + T1.start_time, + T1.organization_id, + T2.gender_enum, + T2.name, + T2.id_card, + T3.name ORDER BY - T2.start_time desc, - T2.organization_id - ) + T1.start_time desc, + T1.organization_id, + T1.patient_id + ) ${ew.customSqlSegment} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java new file mode 100644 index 00000000..c5e047ec --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java @@ -0,0 +1,41 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum FinCategory implements HisEnumInterface { + + /** + * 自费 + */ + SELF_PAY(1, "1", "自费"), + + /** + * 省医保 + */ + PROVINCIAL_MEDICAL_INSURANCE(2, "2", "省医保"), + + /** + * 市医保 + */ + MUNICIPAL_MEDICAL_INSURANCE(4, "4", "市医保"); + + private Integer value; + private String code; + private String info; + + public static FinCategory getByValue(Integer value) { + if (value == null) { + return null; + } + for (FinCategory val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} From 3004d5053f66d5093ab3f7d3e5de7da5970d1426 Mon Sep 17 00:00:00 2001 From: wangyang <446708998@qq.com> Date: Sat, 29 Mar 2025 14:59:12 +0800 Subject: [PATCH 125/149] up --- .../src/main/java/com/openhis/common/enums/FinCategory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java index c5e047ec..b127e8e3 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/FinCategory.java @@ -21,7 +21,7 @@ public enum FinCategory implements HisEnumInterface { /** * 市医保 */ - MUNICIPAL_MEDICAL_INSURANCE(4, "4", "市医保"); + MUNICIPAL_MEDICAL_INSURANCE(3, "3", "市医保"); private Integer value; private String code; From 7747130227a03b7a89834afdcf40f2809ce4f727 Mon Sep 17 00:00:00 2001 From: sunjiaqi Date: Sat, 29 Mar 2025 16:09:36 +0800 Subject: [PATCH 126/149] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/IPaymentRecService.java | 50 ++++++ .../impl/PaymentRecServiceImpl.java | 167 +++++++++++++++++ .../PaymentReconciliationController.java | 80 +++++++++ .../web/payment/dto/PaymentDetailDto.java | 45 +++++ .../openhis/web/payment/dto/PaymentDto.java | 74 ++++++++ .../web/payment/mapper/PaymentMapper.java | 36 ++++ .../cliniccharge/ChargeItemBizMapper.xml | 20 +++ .../mapper/payment/PaymentMapper.xml | 95 ++++++++++ .../common/constant/CommonConstants.java | 15 ++ .../openhis/common/enums/AssignSeqEnum.java | 7 +- .../com/openhis/common/enums/Category.java | 51 ++++++ .../com/openhis/common/enums/Payment.java | 169 ++++++++++++++++++ .../com/openhis/common/enums/PaymentKind.java | 48 +++++ .../openhis/common/enums/PaymentResult.java | 46 +++++ .../com/openhis/common/enums/PaymentType.java | 44 +++++ 15 files changed, 946 insertions(+), 1 deletion(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/IPaymentRecService.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/impl/PaymentRecServiceImpl.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/payment/controller/PaymentReconciliationController.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDetailDto.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDto.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/payment/mapper/PaymentMapper.java create mode 100644 openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml create mode 100644 openhis-server/openhis-application/src/main/resources/mapper/payment/PaymentMapper.xml create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Category.java create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Payment.java create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentKind.java create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentResult.java create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentType.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/IPaymentRecService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/IPaymentRecService.java new file mode 100644 index 00000000..d1da6748 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/IPaymentRecService.java @@ -0,0 +1,50 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.payment.appservice; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.openhis.financial.domain.PaymentRecDetail; +import com.openhis.financial.domain.PaymentReconciliation; +import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto; +import com.openhis.web.payment.dto.PaymentDetailDto; +import com.openhis.web.payment.dto.PaymentDto; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * 付款应用层Service + * + * @author SunJQ + * @date 2025-03-29 + */ +public interface IPaymentRecService { + /** + * 付款 + * @param paymentDto + * @return + */ + R savePayment(PaymentDto paymentDto); + /** + * 取消付款 + * @param paymentDto + * @return + */ + R cancelPayment(PaymentDto paymentDto); + + /** + * 支付列表 + * @param searchKey + * @param pageNo + * @param pageSize + * @param request + * @return + */ + IPage getPage(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request); + + List getDetail(PaymentDto paymentDto); + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/impl/PaymentRecServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/impl/PaymentRecServiceImpl.java new file mode 100644 index 00000000..d805abf2 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/appservice/impl/PaymentRecServiceImpl.java @@ -0,0 +1,167 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.payment.appservice.impl; + +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; +import com.core.common.core.domain.R; +import com.core.common.utils.AgeCalculatorUtil; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.core.common.utils.bean.BeanUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.financial.domain.Contract; +import com.openhis.financial.domain.PaymentRecDetail; +import com.openhis.financial.domain.PaymentReconciliation; +import com.openhis.financial.service.IContractService; +import com.openhis.financial.service.IPaymentRecDetailService; +import com.openhis.financial.service.IPaymentReconciliationService; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; +import com.openhis.web.payment.appservice.IPaymentRecService; +import com.openhis.web.payment.dto.PaymentDetailDto; +import com.openhis.web.payment.dto.PaymentDto; +import com.openhis.web.payment.mapper.PaymentMapper; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; + +/** + * 付款应用层Service + * + * @author SunJQ + * @date 2025-03-29 + */ +@Component +public class PaymentRecServiceImpl implements IPaymentRecService { + @Resource + IPaymentReconciliationService paymentReconciliationService; + @Resource + IPaymentRecDetailService paymentRecDetailService; + @Resource + IContractService contractService; + @Resource + AssignSeqUtil assignSeqUtil; + @Resource + PaymentMapper paymentMapper; + + @Override + @Transactional + public R savePayment(PaymentDto paymentDto) { + Contract contract = contractService.getOne(new LambdaQueryWrapper().eq(Contract::getBusNo, paymentDto.getContractNo())); + if (contract == null) { + //todo:sjq 返回提示信息 + R.fail(); + } + Category categoryEnum = Category.getByValue(contract.getCategoryEnum()); + //todo:sjq 医保支付与普通门诊支付多2207操作 + switch (categoryEnum) { + case SELF: + case PUBLIC: + return normalCharge(paymentDto); + case PROVINCIAL_INSURANCE: + case MUNICIPAL_INSURANCE: + return insuranceCharge(paymentDto); + } + return null; + } + + /** + * 医保支付 + * @param paymentDto + * @return + */ + private R insuranceCharge(PaymentDto paymentDto) { + normalCharge(paymentDto); + //todo:sjq 调用2207 + + return R.ok(); + } + + /** + * 自费支付 + * @param paymentDto + * @return + */ + private R normalCharge(PaymentDto paymentDto) { + //获取参数 + List paymentDetails = paymentDto.getPaymentDetails(); + PaymentReconciliation paymentReconciliation = new PaymentReconciliation(); + BigDecimal sum = BigDecimal.ZERO; + //数额校验 + ArrayList paymentRecDetails = new ArrayList<>(); + for (PaymentDetailDto paymentDetail : paymentDetails) { + PaymentRecDetail paymentRecDetail = new PaymentRecDetail(); + BeanUtils.copyProperties(paymentDetail,paymentRecDetail); + paymentRecDetail.setPredecessorId(paymentReconciliation.getId()); + paymentRecDetail.setAccountId(paymentDetail.getAccountId()==null?0:paymentDetail.getAccountId()); + paymentRecDetail.setResultEnum(PaymentResult.PAID.getValue()); + paymentRecDetails.add(paymentRecDetail); + sum = sum.add(paymentRecDetail.getAmount()); + } + if(sum.compareTo(paymentReconciliation.getTenderedAmount()) != 0){ + //todo:sjq 返回文字提示:实收金额合计不等于应收金额 + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); + } + + BeanUtils.copyProperties(paymentDto, paymentReconciliation); + paymentReconciliation.setStatusEnum(PaymentStatus.SUCCESS.getValue()) + .setPaymentNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.PAYMENT_NO.getPrefix(), 20)) + .setPaymentEnum(PaymentType.PAY.getValue()); + + //保存付款 + paymentReconciliationService.save(paymentReconciliation); + + //保存付款详情 + paymentRecDetailService.saveBatch(paymentRecDetails); + return R.ok(); + } + + @Override + public R cancelPayment(PaymentDto paymentDto) { + //todo:sjq 退费方法 + return null; + } + + @Override + public IPage getPage(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) { + // 构建查询条件 + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(new PaymentDto(), searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.encouterId, + CommonConstants.FieldName.contractNo, CommonConstants.FieldName.paymentNo)), + request); + + IPage paymentDtoIPage = + paymentMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper); + + //todo:sjq 1.是否联表查询患者名字,收款员姓名等信息 2.赋值 +// paymentDtoIPage.getRecords().forEach(e -> { +// // 性别 +// e.setKindEnum_enumText(EnumUtils.getInfoByValue(PaymentKind.class, e.getKindEnum())); +// // 计算年龄 +// e.setAgeString(AgeCalculatorUtil.getAge(DateUtils.parseDate(e.getBirthDate()))); +// }); + + return paymentDtoIPage; + } + + @Override + public List getDetail(PaymentDto paymentDto) { + return paymentMapper.getPaymentDetailList(paymentDto.getId()); + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/controller/PaymentReconciliationController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/controller/PaymentReconciliationController.java new file mode 100644 index 00000000..16b5f9fe --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/controller/PaymentReconciliationController.java @@ -0,0 +1,80 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.payment.controller; + +import com.core.common.core.domain.R; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.web.payment.appservice.IPaymentRecService; +import com.openhis.web.payment.dto.PaymentDto; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; + +/** + * 付款管理 + * + * @author SunJQ + * @date 2025-03-29 + */ +@RestController +@RequestMapping("/payment/payment") +@Slf4j +@AllArgsConstructor +public class PaymentReconciliationController { + + @Autowired + private IPaymentRecService paymentReconciliationService; + + /** + * 付款 + * + * @param paymentDto 付款实体 + */ + @PostMapping("/charge") + public R savePayment(@Validated @RequestBody PaymentDto paymentDto) { + return paymentReconciliationService.savePayment(paymentDto); + } + + /** + * 取消付款 + * + * @param paymentDto 付款实体 + */ + @PostMapping("/uncharge") + public R cancelPayment(@RequestBody PaymentDto paymentDto) { + return paymentReconciliationService.cancelPayment(paymentDto); + } + + /** + * 支付列表 + * @param searchKey + * @param pageNo + * @param pageSize + * @param request + * @return + */ + @PostMapping("/page") + public R paymentPage(@RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request){ + return R + .ok(paymentReconciliationService.getPage(searchKey, pageNo, pageSize, request)); + } + + /** + * 支付详情 + * @param paymentDto + * @return + */ + @PostMapping("/detail") + public R paymentDetail(@RequestBody PaymentDto paymentDto){ + return R.ok(paymentReconciliationService.getDetail(paymentDto)); + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDetailDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDetailDto.java new file mode 100644 index 00000000..8d510a28 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDetailDto.java @@ -0,0 +1,45 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.payment.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * 支付详情 + * + * @author SunJQ + * @date 2025-03-29 + */ +@Data +@Accessors(chain = true) +public class PaymentDetailDto { + + /** 付款类型 */ + private Integer targetEnum; + + /** 账户 */ + private Long accountId; + + /** 账户类型 */ + private Integer accountEnum; + + /** 支付类型 */ + private Integer payEnum; + + /** 支付类型等级 */ + private Integer payLevelEnum; + + /** 金额 */ + private BigDecimal amount; + + /** 找零 */ + private BigDecimal returnAmount; + + /** 交款 */ + private BigDecimal chargeAmount; + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDto.java new file mode 100644 index 00000000..44027871 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/dto/PaymentDto.java @@ -0,0 +1,74 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.payment.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.util.List; + +/** + * 付款入参 + * + * @author SunJQ + * @date 2025-03-29 + */ +@Data +@Accessors(chain = true) +public class PaymentDto { + + /** + * id + */ + private Long id; + + /** 发起支付的工作流程类别 */ + @NotNull + private Integer kindEnum; + private String kindEnum_enumText; + + /** 付款类别 */ + @NotNull + private Integer paymentEnum; + private String paymentEnum_enumText; + + /** 收款员 */ + private Long entererId; + + /** 支付的患者ID */ + @NotNull + private Long patientId; + + /** 应收金额 */ + @NotNull + private BigDecimal tenderedAmount; + + /** 找零金额 */ + @NotNull + private BigDecimal returnedAmount; + + /** 付款总额 */ + @NotNull + private BigDecimal displayAmount; + + /** 合同编码 */ + @NotNull + private String contractNo; + + /** 就诊ID */ + @NotBlank + private Long encounterId; + + /** 收费项 */ + @NotBlank + private String chargeItemIds; + + /** 支付详细 */ + @NotEmpty + private List paymentDetails; +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/mapper/PaymentMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/mapper/PaymentMapper.java new file mode 100644 index 00000000..82906f1a --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/payment/mapper/PaymentMapper.java @@ -0,0 +1,36 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.payment.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.payment.dto.PaymentDetailDto; +import com.openhis.web.payment.dto.PaymentDto; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +/** + * 付款Dao + * + * @author SunJQ + * @date 2025-03-29 + */ +public interface PaymentMapper { + /** + * 付款列表 + * @param page + * @param queryWrapper + * @return + */ + IPage getPage(Page page, QueryWrapper queryWrapper); + + /** + * 付款详情 + * @param id + * @return + */ + List getPaymentDetailList(@Param("id") Long id); +} diff --git a/openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml new file mode 100644 index 00000000..f01adfec --- /dev/null +++ b/openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/openhis-server/openhis-application/src/main/resources/mapper/payment/PaymentMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/payment/PaymentMapper.xml new file mode 100644 index 00000000..629d3091 --- /dev/null +++ b/openhis-server/openhis-application/src/main/resources/mapper/payment/PaymentMapper.xml @@ -0,0 +1,95 @@ + + + + + + + \ No newline at end of file diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java index fecb2c50..af06969c 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java @@ -166,6 +166,21 @@ public class CommonConstants { * 药品id */ String MedicationId = "medication_id"; + + /** + * 就诊Id + */ + String encouterId = "encouter_id"; + + /** + * 合同编码 + */ + String contractNo = "contract_no"; + + /** + * 支付流水 + */ + String paymentNo = "payment_no"; } /** diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java index a3507485..a843b338 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java @@ -59,7 +59,12 @@ public enum AssignSeqEnum { /** * 器材项目编码 */ - DEVICE_NUM("10", "项目编码", "DD"); + DEVICE_NUM("10", "项目编码", "DD"), + + /** + * 支付编码 + */ + PAYMENT_NO("11", "支付编码", "SF"); private final String code; private final String info; diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Category.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Category.java new file mode 100644 index 00000000..0b5ed798 --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Category.java @@ -0,0 +1,51 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * Category 合同类别(结算类别) + * + * @author SunJQ + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum Category { + + /** + * MEMBER_FIRST + */ + SELF(0, "自费"), + /** + * MEMBER_SECOND + */ + PROVINCIAL_INSURANCE(1, "MEMBER_SECOND"), + /** + * MEMBER_SECOND + */ + MUNICIPAL_INSURANCE(1, "MEMBER_SECOND"), + /** + * MEMBER_SECOND + */ + PUBLIC(1, "MEMBER_SECOND"); + @EnumValue + private Integer value; + private String description; + + public static Category getByValue(Integer value) { + if (value==null) { + return null; + } + for (Category val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Payment.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Payment.java new file mode 100644 index 00000000..1ad2948c --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/Payment.java @@ -0,0 +1,169 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 支付类型 + * + * @author SunJQ + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum Payment { + + /** + * 现金支付 + */ + CASH(1, 1, "现金支付"), + + /** + * 微信支付 + */ + VX_PAY(2, 1, "微信支付"), + + /** + * 支付宝支付 + */ + ALI_PAY(3, 1, "支付宝支付"), + + /** + * 银联支付 + */ + UNION_PAY(4, 1, "银联支付"), + + /** + * 医保账户支付 + */ + YB_ZH_PAY(5, 1, "医保账户支付"), + + /** + * 医保统筹支付合计 + */ + YB_TC_SUM_PAY(6, 1, "医保统筹支付合计"), + + /** + * 医保统筹支付 + */ + YB_TC_PAY(7, 2, "医保统筹支付"), + + /** + * 医保公务员补助 + */ + YB_GWY_PAY(8, 2, "医保公务员补助"), + + /** + * 先行自付金额 + */ + XX_SELF_PAY(9, 2, "先行自付金额"), + + /** + * 全自费金额 + */ + ALL_SELF_PAY(10, 2, "先行自付金额"), + + /** + * 医疗工伤支付 + */ + YL_GS_PAY(11, 2, "医疗工伤支付"), + + /** + * 老红军支付 + */ + YB_HJ_PAY(12, 2, "老红军支付"), + + /** + * 离休人员医疗保障基金支付金额 + */ + YB_LTX_PAY(13, 2, "离休人员医疗保障基金支付金额"), + + /** + * 居民统筹 + */ + YB_JM_TC_PAY(14, 2, "居民统筹"), + /** + * 居民大病 + */ + YB_JM_DB_PAY(15, 2, "居民大病"), + /** + * 补充医疗补助基金支付金额 + */ + YB_BC_PAY(16, 2, "补充医疗补助基金支付金额"), + /** + * 其他扶贫报销金额 + */ + YB_OTHER_FP_PAY(17, 2, "其他扶贫报销金额"), + /** + * 健康扶贫医疗基金 + */ + YB_JK_FP_PAY(18, 2, "健康扶贫医疗基金"), + /** + * 精准脱贫保险金额 + */ + YB_JZ_TP_PAY(19, 2, "精准脱贫保险金额"), + /** + * 提交医保总额 + */ + YB_SUM_FEE(20, 2, "提交医保总额"), + /** + * 二乙医疗专项医疗基金支出 + */ + YB_EY_PAY(21, 2, "二乙医疗专项医疗基金支出"), + /** + * 慢特病支付 + */ + YB_TM_PAY(22, 2, "补充医疗补助基金支付金额"), + /** + * 定点医疗机构垫支 + */ + YB_ORG_PAY(23, 2, "定点医疗机构垫支"), + /** + * 起付线公务员返还 + */ + YB_RETURN_GWY_PAY(24, 2, "起付线公务员返还"), + /** + * 大额理赔金额 + */ + YB_DELP_PAY(25, 2, "大额理赔金额"), + /** + * 民政救助金额 + */ + YB_MZJZ_PAY(26, 2, "民政救助金额"), + /** + * 生育基金支付 + */ + BIRTH_TC_PAY_AMOUNT(27, 1, "生育基金支付"), + /** + * 生育账户支付 + */ + BIRTH_ZH_PAY_AMOUNT(28, 1, "生育账户支付"), + /** + * 符合范围金额 + */ + YB_FHFW_AMOUNT(29, 2, "符合范围金额"), + /** + * 财政兜底基金支出 + */ + YB_CZDD_AMOUNT(30, 2, "财政兜底基金支出"); + @EnumValue + private Integer value; + private Integer level; + private String info; + + public static Payment getByValue(Integer value) { + if (value == null) { + return null; + } + for (Payment val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentKind.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentKind.java new file mode 100644 index 00000000..0f2162a3 --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentKind.java @@ -0,0 +1,48 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * PaymentKind (0: MEMBER_FIRST; 1: MEMBER_SECOND;) + * + * @author SunJQ + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum PaymentKind { + + /** + * 住院存款 + */ + HOSPITAL_DEPOSIT(0, "住院存款"), + /** + * 门诊收费 + */ + OUTPATIENT_CLINIC(1, "门诊收费"), + /** + * 住院费用 + */ + INPATIENT_CLINIC(2, "住院费用"); + + @EnumValue + private Integer value; + private String description; + + public static PaymentKind getByValue(String value) { + if(value==null){ + return null; + } + for (PaymentKind val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentResult.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentResult.java new file mode 100644 index 00000000..1a570606 --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentResult.java @@ -0,0 +1,46 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * PaymentResult (0: MEMBER_FIRST; 1: MEMBER_SECOND;) + * + * @author SunJQ + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum PaymentResult { + + /** + * 未支付 + */ + UNPAID(0, "未支付"), + /** + * 已支付 + */ + PAID(1, "已支付"), + /** + * 已退费 + */ + refunded(-2, "已退费"); + + private Integer value; + private String description; + + public static PaymentResult getByValue(String value) { + if (value==null) { + return null; + } + for (PaymentResult val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentType.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentType.java new file mode 100644 index 00000000..bb73511f --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/PaymentType.java @@ -0,0 +1,44 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * PaymentType (0: MEMBER_FIRST; 1: MEMBER_SECOND;) + * + * @author SunJQ + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum PaymentType { + + /** + * 付费 + */ + PAY(0, "付费"), + /** + * 退费 + */ + UN_PAY(1, "退费"); + @EnumValue + private Integer value; + private String description; + + public static PaymentType getByValue(String value) { + if(value==null){ + return null; + } + for (PaymentType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} From e6e6c9b3e73d68703437e2a279b119222ecf9c64 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Sat, 29 Mar 2025 16:47:47 +0800 Subject: [PATCH 127/149] =?UTF-8?q?=E5=8C=BB=E5=98=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DoctorStationAdviceAppServiceImpl.java | 104 ++++++++++++------ .../impl/DoctorStationMainAppServiceImpl.java | 1 + .../web/doctorstation/dto/AdviceSaveDto.java | 17 +++ .../web/doctorstation/dto/PatientInfoDto.java | 6 + .../DoctorStationMainAppMapper.xml | 4 +- 5 files changed, 100 insertions(+), 32 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index ba52ad2f..e67d7c54 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -1,11 +1,6 @@ package com.openhis.web.doctorstation.appservice.impl; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; import javax.annotation.Resource; @@ -238,8 +233,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // TODO: 药品分方;待做 prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_NO.getPrefix(), 8); } + // 声明费用项 + ChargeItem chargeItem; // 保存药品请求 - List medicationRequestList = new ArrayList<>(); MedicationRequest medicationRequest; for (AdviceSaveDto adviceSaveDto : medicineList) { medicationRequest = new MedicationRequest(); @@ -270,16 +266,40 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp medicationRequest.setRateCode(adviceSaveDto.getRateCode()); // 用药频次 medicationRequest.setDose(adviceSaveDto.getDose()); // 单次剂量 medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); // 剂量单位 + medicationRequest.setDispensePerDuration(adviceSaveDto.getDispensePerDuration()); // 每次发药供应天数 medicationRequest.setSkinTestFlag(adviceSaveDto.getSkinTestFlag()); // 皮试标记 medicationRequest.setGroupId(adviceSaveDto.getGroupId());// 分组id // medicationRequest.setPackageId(adviceSaveDto.getPackageId()); - medicationRequestList.add(medicationRequest); + iMedicationRequestService.save(medicationRequest); + + // 保存药品费用项 + chargeItem = new ChargeItem(); + chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue()); // 默认-待收费 + chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); + chargeItem.setPrescriptionNo(prescriptionNo); // 处方号 + chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者 + chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型 + chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id + chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId()); // 费用定价ID + chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId()); // 定价子表主键 + chargeItem.setEntererId(adviceSaveDto.getPractitionerId());// 开立人ID + chargeItem.setEnteredDate(new Date()); // 开立时间 + chargeItem.setServiceTable("med_medication_request");// 医疗服务类型 + chargeItem.setServiceId(medicationRequest.getId()); // 医疗服务ID + chargeItem.setProductTable(adviceSaveDto.getAdviceTableName());// 产品所在表 + chargeItem.setProductId(adviceSaveDto.getAdviceDefinitionId());// 收费项id + chargeItem.setAccountId(adviceSaveDto.getAccountId());// 关联账户ID + + chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 + chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 + chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 + chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价 + + iChargeItemService.save(chargeItem); } - iMedicationRequestService.saveBatch(medicationRequestList); // 保存耗材请求 - List deviceRequestList = new ArrayList<>(); DeviceRequest deviceRequest; for (AdviceSaveDto adviceSaveDto : deviceList) { deviceRequest = new DeviceRequest(); @@ -306,12 +326,35 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // deviceRequest.setPackageId(adviceSaveDto.getPackageId()); // deviceRequest.setActivityId(adviceSaveDto.getActivityId()); - deviceRequestList.add(deviceRequest); + iDeviceRequestService.save(deviceRequest); + + // 保存耗材费用项 + chargeItem = new ChargeItem(); + chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue()); // 默认-待收费 + chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo())); + chargeItem.setPrescriptionNo(prescriptionNo); // 处方号 + chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者 + chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型 + chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id + chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId()); // 费用定价ID + chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId()); // 定价子表主键 + chargeItem.setEntererId(adviceSaveDto.getPractitionerId());// 开立人ID + chargeItem.setEnteredDate(new Date()); // 开立时间 + chargeItem.setServiceTable("wor_device_request");// 医疗服务类型 + chargeItem.setServiceId(deviceRequest.getId()); // 医疗服务ID + chargeItem.setProductTable(adviceSaveDto.getAdviceTableName());// 产品所在表 + chargeItem.setProductId(adviceSaveDto.getAdviceDefinitionId());// 收费项id + chargeItem.setAccountId(adviceSaveDto.getAccountId());// 关联账户ID + + chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 + chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 + chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 + chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价 + + iChargeItemService.save(chargeItem); } - iDeviceRequestService.saveBatch(deviceRequestList); // 保存诊疗项目请求 - List serviceRequestList = new ArrayList<>(); ServiceRequest serviceRequest; for (AdviceSaveDto adviceSaveDto : activityList) { serviceRequest = new ServiceRequest(); @@ -328,35 +371,34 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp serviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); // 开方医生 serviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id - serviceRequestList.add(serviceRequest); - } - iServiceRequestService.saveBatch(serviceRequestList); + iServiceRequestService.save(serviceRequest); - // 保存费用项管理 - List chargeItemList = new ArrayList<>(); - ChargeItem chargeItem; - for (AdviceSaveDto adviceSaveDto : adviceSaveList) { + // 保存诊疗费用项 chargeItem = new ChargeItem(); - chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue()); // 默认-代收费 - chargeItem.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix(), 10)); + chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue()); // 默认-待收费 + chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo())); chargeItem.setPrescriptionNo(prescriptionNo); // 处方号 chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者 chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型 - chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 诊疗定义id + chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id + chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId()); // 费用定价ID + chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId()); // 定价子表主键 + chargeItem.setEntererId(adviceSaveDto.getPractitionerId());// 开立人ID + chargeItem.setEnteredDate(new Date()); // 开立时间 + chargeItem.setServiceTable("wor_service_request");// 医疗服务类型 + chargeItem.setServiceId(serviceRequest.getId()); // 医疗服务ID + chargeItem.setProductTable(adviceSaveDto.getAdviceTableName());// 产品所在表 + chargeItem.setProductId(adviceSaveDto.getAdviceDefinitionId());// 收费项id + chargeItem.setAccountId(adviceSaveDto.getAccountId());// 关联账户ID chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 - chargeItem - .setTotalPrice((new BigDecimal(adviceSaveDto.getQuantity()).multiply(adviceSaveDto.getUnitPrice())) - .setScale(4, RoundingMode.HALF_UP)); // 总价 + chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价 - chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId()); // 费用定价ID - chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId()); // 定价子表主键 - - chargeItemList.add(chargeItem); + iChargeItemService.save(chargeItem); } - iChargeItemService.saveBatch(chargeItemList); + // TODO: 此处调用请求发放接口 return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊医嘱"})); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java index 90408bb5..b78f4427 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java @@ -53,6 +53,7 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer // TODO: userId(当前登录账号ID) 和 currentUserOrganizationId(当前登录账号所属的科室ID) 待补充 // 当前登录账号ID Long userId = SecurityUtils.getLoginUser().getUserId(); + Long currentUserOrganizationId = SecurityUtils.getLoginUser().getOrgId(); IPage patientInfo = doctorStationMainAppMapper.getPatientInfo(new Page<>(pageNo, pageSize), ParticipantType.ADMITTER.getCode(), ClinicalStatus.INACTIVE.getValue(), null, null, queryWrapper); patientInfo.getRecords().forEach(e -> { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java index 6b103f31..095278c8 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java @@ -42,12 +42,18 @@ public class AdviceSaveDto { /** 请求数量 */ private Integer quantity; + /** 每次发药供应天数 */ + private Integer dispensePerDuration; + /** 请求单位编码 */ private String unitCode; /** 单价 */ private BigDecimal unitPrice; + /** 总价 */ + private BigDecimal totalPrice; + /** 费用定价主表ID */ @JsonSerialize(using = ToStringSerializer.class) private Long definitionId; @@ -71,6 +77,11 @@ public class AdviceSaveDto { @JsonSerialize(using = ToStringSerializer.class) private Long adviceDefinitionId; + /** + * 医嘱对应表名 + */ + private String adviceTableName; + /** 患者 */ @JsonSerialize(using = ToStringSerializer.class) private Long patientId; @@ -95,6 +106,12 @@ public class AdviceSaveDto { @JsonSerialize(using = ToStringSerializer.class) private Long encounterId; + /** + * 账户id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long accountId; + /** * 诊断ID */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/PatientInfoDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/PatientInfoDto.java index 7b6bf160..e547ac23 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/PatientInfoDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/PatientInfoDto.java @@ -27,6 +27,12 @@ public class PatientInfoDto { @JsonSerialize(using = ToStringSerializer.class) private Long patientId; + /** + * 账户id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long accountId; + /** * 患者姓名 */ diff --git a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationMainAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationMainAppMapper.xml index 057d3474..029636f8 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationMainAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationMainAppMapper.xml @@ -14,7 +14,8 @@ T10.phone, T10.birth_date, T10.status_enum, - T10.allergy_history_flag + T10.allergy_history_flag, + T10.account_id from ( SELECT T1.tenant_id AS tenant_id, @@ -24,6 +25,7 @@ T3.NAME AS healthcare_name, T5.user_id AS practitioner_user_id, T5.NAME AS practitioner_name, + T6.id AS account_id, T7.contract_name AS contract_name, T8.ID AS patient_id, T8.NAME AS patient_name, From b32bd56da55a312308af0db98a29ea9b42fc6aab Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Sat, 29 Mar 2025 17:02:39 +0800 Subject: [PATCH 128/149] =?UTF-8?q?=E5=8C=BB=E5=98=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cliniccharge/ChargeItemBizMapper.xml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml diff --git a/openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml deleted file mode 100644 index f01adfec..00000000 --- a/openhis-server/openhis-application/src/main/resources/mapper/cliniccharge/ChargeItemBizMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file From 24c11b86ca58755bf7560a02179c215ae0db5cda Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Sun, 30 Mar 2025 11:10:53 +0800 Subject: [PATCH 129/149] =?UTF-8?q?=E8=AF=8A=E7=96=97=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/openhis/common/enums/AssignSeqEnum.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java index a843b338..2ff82bf6 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java @@ -64,7 +64,11 @@ public enum AssignSeqEnum { /** * 支付编码 */ - PAYMENT_NO("11", "支付编码", "SF"); + PAYMENT_NO("11", "支付编码", "SF"), + /** + * 诊疗项目编码 + */ + ACTIVITY_DEFINITION_NUM("11", "诊疗编码", "AD");; private final String code; private final String info; From 73f15d7ee9d88fbceeb2177ff1f991ee4fd0ebd9 Mon Sep 17 00:00:00 2001 From: "Zhang.WH" Date: Sun, 30 Mar 2025 12:41:26 +0800 Subject: [PATCH 130/149] =?UTF-8?q?=E9=80=80=E8=B4=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientRefundAppService.java | 20 ++- .../impl/OutpatientRefundAppServiceImpl.java | 118 ++++++++++++++++-- .../OutpatientRefundController.java | 26 +++- .../dto/EncounterPatientPageDto.java | 27 ++++ .../dto/EncounterPatientPageParam.java | 10 +- .../web/chargemanage/dto/RefundItemDto.java | 33 ++++- .../mapper/OutpatientRefundAppMapper.java | 18 +++ .../impl/ReceiptApprovalAppServiceImpl.java | 3 +- .../main/resources/i18n/messages.properties | 6 +- .../OutpatientChargeAppMapper.xml | 29 ++--- .../OutpatientRefundAppMapper.xml | 114 +++++++++++++++-- .../common/constant/PromptMsgConstant.java | 17 +++ .../openhis/common/enums/AssignSeqEnum.java | 2 +- .../common/enums/ChargeItemStatus.java | 17 ++- .../common/enums/ContractCategory.java | 50 ++++++++ .../openhis/common/enums/DispenseStatus.java | 2 +- .../common/enums/NotPerformedReason.java | 35 ++++++ .../openhis/common/enums/RequestStatus.java | 4 +- .../service/IChargeItemService.java | 7 ++ .../service/impl/ChargeItemServiceImpl.java | 16 ++- .../service/impl/OrganizationServiceImpl.java | 8 +- .../financial/domain/PaymentRecDetail.java | 6 +- .../domain/PaymentReconciliation.java | 5 +- .../service/IMedicationDispenseService.java | 8 ++ .../impl/MedicationDispenseServiceImpl.java | 14 +++ .../service/IDeviceDispenseService.java | 9 ++ .../service/IServiceRequestService.java | 12 +- .../impl/DeviceDispenseServiceImpl.java | 19 ++- .../impl/ServiceRequestServiceImpl.java | 24 ++-- .../impl/SupplyRequestServiceImpl.java | 27 ++-- 30 files changed, 600 insertions(+), 86 deletions(-) create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ContractCategory.java create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/NotPerformedReason.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java index 9386da1c..6d6216ac 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java @@ -3,10 +3,13 @@ */ package com.openhis.web.chargemanage.appservice; -import com.core.common.core.domain.R; - import java.util.List; +import javax.servlet.http.HttpServletRequest; + +import com.core.common.core.domain.R; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; + /** * 门诊退费 service * @@ -30,4 +33,17 @@ public interface IOutpatientRefundAppService { * @return 操作结果 */ R refundPayment(List paymentIdList); + + /** + * 查询结算过的就诊患者分页列表 + * + * @param encounterPatientPageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 就诊患者分页列表 + */ + R getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, + Integer pageNo, Integer pageSize, HttpServletRequest request); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java index fdc0baaf..21f1f6d7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java @@ -3,20 +3,37 @@ */ package com.openhis.web.chargemanage.appservice.impl; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; +import javax.servlet.http.HttpServletRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; +import com.core.common.utils.AgeCalculatorUtil; +import com.core.common.utils.MessageUtils; import com.openhis.administration.service.IChargeItemService; import com.openhis.common.constant.CommonConstants; -import com.openhis.common.enums.PaymentStatus; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; import com.openhis.financial.service.IPaymentReconciliationService; +import com.openhis.medication.service.IMedicationDispenseService; import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService; +import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto; import com.openhis.web.chargemanage.dto.RefundItemDto; import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper; +import com.openhis.workflow.service.IDeviceDispenseService; +import com.openhis.workflow.service.IServiceRequestService; /** * 门诊退费 impl @@ -33,6 +50,12 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi private IPaymentReconciliationService paymentReconciliationService; @Autowired private IChargeItemService chargeItemService; + @Autowired + private IMedicationDispenseService medicationDispenseService; + @Autowired + private IDeviceDispenseService deviceDispenseService; + @Autowired + private IServiceRequestService serviceRequestService; /** * 根据就诊id查询患者的账单 @@ -56,20 +79,97 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi */ @Override public R refundPayment(List paymentIdList) { - - // 医生同意退费 - // 查询所有的chargeid,对应生成一个负的chargeitem - // 根据每个 chargeitem判断对应的服务,药品,耗材是否已发放执行 - // 若已发放/执行需要对应的发药人/执行人审批(药品耗材需要先退药) - + // todo:医生同意退费(审批流) // 根据支付id获取对应收费项目的id列表 List chargeItemIdList = paymentReconciliationService.getChargeItemIdListByPayment(paymentIdList); - //根据收费项目id列表查询退费项 + // 根据收费项目id列表查询退费项 List refundItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE); - return null; + List medDisIdList = new ArrayList<>(); + List devDisIdList = new ArrayList<>(); + List serReqIdList = new ArrayList<>(); + + for (RefundItemDto refundItem : refundItemList) { + if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(refundItem.getServiceTable())) { + + // 药品需要先退药 + if (DispenseStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus()) + || DispenseStatus.PART_COMPLETED.getValue().equals(refundItem.getRefundStatus())) { + return R + .fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00001, new Object[] {"药品"})); + } else { + // todo:审批流药师同意退费 + medDisIdList.add(refundItem.getDispenseId()); + } + } else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(refundItem.getServiceTable())) { + // 诊疗项目需医技科室同意退费 + if (RequestStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00002, null)); + } else { + // todo:审批流医技师同意退费 + serReqIdList.add(refundItem.getServiceId()); + } + } else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(refundItem.getServiceTable())) { + // 耗材需要先退药 + if (DispenseStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus()) + || DispenseStatus.PART_COMPLETED.getValue().equals(refundItem.getRefundStatus())) { + return R + .fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00001, new Object[] {"耗材"})); + } else { + devDisIdList.add(refundItem.getDispenseId()); + } + } + } + // 更新收费状态:已退费 + chargeItemService.updateRefundChargeStatus(chargeItemIdList); + // 更新未发放药品状态:停止发放,停止原因:退费 + medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue()); + // 更新未发放耗材状态:停止发放,停止原因:退费 + deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue()); + // 更新执行诊疗状态:停止 + serviceRequestService.updateStopRequestStatus(serReqIdList); + // 返回退费成功信息 + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"处方退费"})); + } + + /** + * 查询结算过的就诊患者分页列表 + * + * @param encounterPatientPageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 就诊患者分页列表 + */ + @Override + public R getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, + Integer pageNo, Integer pageSize, HttpServletRequest request) { + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( + encounterPatientPageParam, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr, + CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo, + CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)), + request); + // 就诊患者分页列表 + Page encounterPatientPage = + outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, + ChargeItemStatus.BILLED.getValue(), AccountType.MEDICAL_INSURANCE.getValue()); + + encounterPatientPage.getRecords().forEach(e -> { + // 性别枚举 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + // 收费状态枚举 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum())); + // 计算年龄 + e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate())); + // 合同类型枚举 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(ContractCategory.class, e.getCategoryEnum())); + }); + return R.ok(encounterPatientPage); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java index 174d080b..4e195c6f 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java @@ -3,17 +3,20 @@ */ package com.openhis.web.chargemanage.controller; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.core.common.core.domain.R; import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import java.util.List; - /** * 门诊退费 controller * @@ -29,6 +32,25 @@ public class OutpatientRefundController { @Autowired private IOutpatientRefundAppService outpatientRefundAppService; + /** + * 查询结算过的就诊患者分页列表 + * + * @param encounterPatientPageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 就诊患者分页列表 + */ + @GetMapping(value = "/encounter-patient-page") + public R getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + return R.ok(outpatientRefundAppService.getBilledEncounterPatientPage(encounterPatientPageParam, searchKey, + pageNo, pageSize, request)); + } + /** * 根据就诊id查询患者的账单 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java index f38b4f45..a8231c02 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java @@ -8,6 +8,7 @@ import java.util.Date; 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; @@ -72,7 +73,9 @@ public class EncounterPatientPageDto { /** * 账户类型编码 */ + @Dict(dictCode = "account_code") private String typeCode; + private String typeCode_dictText; /** * 账户余额 @@ -92,4 +95,28 @@ public class EncounterPatientPageDto { /** 收费状态 */ private Integer statusEnum; private String statusEnum_enumText; + + /** + * 医保总额 + */ + private BigDecimal insurancePrice; + + /** + * 自费总额 + */ + private BigDecimal selfPrice; + + /** + * 付款总额 + */ + private BigDecimal totalAmount; + + /** 合同类型 */ + private Integer categoryEnum; + private String categoryEnum_enumText; + + /** + * 结算时间 + */ + private Date billDate; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java index db852eae..ff776799 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java @@ -53,13 +53,13 @@ public class EncounterPatientPageParam { */ private Date startTime; + /** + * 收费时间 + */ + private Date billTime; + /** * 收费状态 */ private Integer statusEnum; - - /** - * 退款标识 - */ - private Integer refundFlag; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java index c4ce3eb4..1b9212e3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java @@ -14,4 +14,35 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -public class RefundItemDto {} +public class RefundItemDto { + + /** 收费ID */ + private Long chargeId; + + /** 医疗服务所在表 */ + private String serviceTable; + + /** 医疗服务ID */ + private Long serviceId; + + /** 请求编码 */ + private String busNo; + + /** 请求数量 */ + private Integer quantity; + + /** 请求单位编码 */ + private String unitCode; + + /** 退款状态 */ + private Integer refundStatus; + + /** 项目id */ + private Long itemId; + + /** 发放id */ + private Long dispenseId; + + /** 项目名 */ + private Long itemName; +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java index a4e7132c..293d17b6 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java @@ -8,6 +8,11 @@ import java.util.List; 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.chargemanage.dto.EncounterPatientPageDto; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto; import com.openhis.web.chargemanage.dto.RefundItemDto; @@ -47,4 +52,17 @@ public interface OutpatientRefundAppMapper { @Param("medMedicationRequest") String medMedicationRequest, @Param("worServiceRequest") String worServiceRequest, @Param("worDeviceRequest") String worDeviceRequest, @Param("three") Integer three); + + /** + * 查询已结算就诊患者分页列表 + * + * @param page 分页 + * @param queryWrapper 查询条件 + * @param billed 收费状态:已结算 + * @param insurance 账户类型:医保 + * @return 已结算就诊患者分页列表 + */ + Page selectBilledEncounterPatientPage(@Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("billed") Integer billed, + @Param("insurance") Integer insurance); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java index 4cd470a5..c9a63fe7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ReceiptApprovalAppServiceImpl.java @@ -246,6 +246,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService List chargeDetailList) { List resultList = new ArrayList<>(); + // todo:同一批次不能改价 // 将各个项目的定价信息按项目id分组 Map> chargeDetailGroup = chargeDetailList.stream().collect(Collectors.groupingBy(ItemChargeDetailDto::getInstanceId)); @@ -307,7 +308,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService */ private ChargeItemDefDetail addChargeItemDefApp(String conditionValue, BigDecimal sellPrice, Long definitionId) { ChargeItemDefDetail chargeItemDefDetail = new ChargeItemDefDetail(); - // todo:命中条件或建成字典枚举,此处为批次号,单位 + // todo:命中条件或建成字典枚举,此处为批次号,单位,优先级加一 chargeItemDefDetail // 命中值 .setConditionValue(conditionValue) diff --git a/openhis-server/openhis-application/src/main/resources/i18n/messages.properties b/openhis-server/openhis-application/src/main/resources/i18n/messages.properties index 31c39ddf..653376ce 100644 --- a/openhis-server/openhis-application/src/main/resources/i18n/messages.properties +++ b/openhis-server/openhis-application/src/main/resources/i18n/messages.properties @@ -31,9 +31,6 @@ no.update.permission=您没有修改数据的权限,请联系管理员添加 no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] - - - apl.common.M00001={0}添加成功 apl.common.M00002={0}保存成功 apl.common.M00003={0}已经存在 @@ -43,4 +40,5 @@ apl.common.M00006=操作失败,该数据已被他人删除,请刷新后重试 apl.common.M00007=操作失败,该数据已被他人更改,请刷新后重试 apl.common.M00008=请勿重复提交 apl.common.M00009=查询成功 -apl.common.M00010=操作失败,请联系管理员 \ No newline at end of file +apl.common.M00010=操作失败,请联系管理员 +apl.chargeRefund.M00001=该收费单相关{0}已经发出,请先退药后再进行退费 \ No newline at end of file diff --git a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml index 8a322737..2e9074f6 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml @@ -4,22 +4,23 @@ diff --git a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml index 93fbf507..d37d7496 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml @@ -24,46 +24,144 @@ AND T1.delete_flag = '0' + \ No newline at end of file diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/PromptMsgConstant.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/PromptMsgConstant.java index a67d431d..3d550099 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/PromptMsgConstant.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/PromptMsgConstant.java @@ -70,4 +70,21 @@ public class PromptMsgConstant { String M00001 = "apl.inventory.M00001"; } + + /** + * 退费 + */ + public interface ChargeRefund { + + /** + * 该收费单相关{0}已经发出,请先退药后再进行退费 + */ + String M00001 = "apl.chargeRefund.M00001"; + + /** + * 该收费单相关诊疗项目已经执行,请等待医技科室审批完成后再进行退费 + */ + String M00002 = "apl.chargeRefund.M00002"; + + } } diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java index a843b338..a8469414 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java @@ -29,7 +29,7 @@ public enum AssignSeqEnum { /** * 处方号 */ - PRESCRIPTION_NO("4", "处方号", "P"), + PRESCRIPTION_NO("4", "处方号", "PR"), /** * 药品请求编码 diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java index 4d5b2d68..1200feea 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java @@ -37,10 +37,25 @@ public enum ChargeItemStatus implements HisEnumInterface { */ ERROR(6, "entered-in-error", "错误"), + /** + * 退费中 + */ + REFUNDING(7, "refunding", "退费中"), + + /** + * 全部退费 + */ + REFUNDED(8, "refunded", "全部退费"), + + /** + * 部分退费 + */ + PART_REFUND(9, "part-refund", "部分退费"), + /** * 未知 */ - UNKNOWN(7, "unknown", "未知"); + UNKNOWN(10, "unknown", "未知"); private final Integer value; private final String code; diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ContractCategory.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ContractCategory.java new file mode 100644 index 00000000..771e8c8d --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ContractCategory.java @@ -0,0 +1,50 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 合同类型 + * + * @author zwh + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum ContractCategory implements HisEnumInterface{ + + /** + * 自费 + */ + SELF_CHARGE(1, "1", "自费"), + + /** + * 公费 + */ + PUBLIC_CHARGE(2, "2", "公费"), + + /** + * 省医保 + */ + PROVINCIAL_INSURANCE(3, "3", "省医保"), + + /** + * 市医保 + */ + MUNICIPAL_INSURANCE(4, "4", "市医保"), + + /** + * 职工医保 + */ + WORKER_INSURANCE(5, "5", "职工医保"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; +} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/DispenseStatus.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/DispenseStatus.java index 5e949485..deb87a9b 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/DispenseStatus.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/DispenseStatus.java @@ -46,7 +46,7 @@ public enum DispenseStatus implements HisEnumInterface { /** * 拒绝发药 */ - DECLINED(7, "DE", "拒绝发药 已退药"), + DECLINED(7, "DE", "拒绝发药"), /** * 已汇总 diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/NotPerformedReason.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/NotPerformedReason.java new file mode 100644 index 00000000..7e941573 --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/NotPerformedReason.java @@ -0,0 +1,35 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 未执行原因 + * + * @author zwh + * @date 2025-03-29 + */ +@Getter +@AllArgsConstructor +public enum NotPerformedReason { + + /** + * 退费 + */ + REFUND(1, "1", "退费"), + + /** + * 异常 + */ + ERROR(9, "9", "异常"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; +} diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/RequestStatus.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/RequestStatus.java index 71abcc59..8364f7ff 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/RequestStatus.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/RequestStatus.java @@ -36,9 +36,9 @@ public enum RequestStatus implements HisEnumInterface { ON_HOLD(4, "on_hold", "暂停"), /** - * 撤回 + * 取消 */ - CANCELLED(5, "cancelled", "撤回"), + CANCELLED(5, "cancelled", "取消"), /** * 停止 diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java index 5b7b3600..a0bd9684 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java @@ -43,4 +43,11 @@ public interface IChargeItemService extends IService { * @return 收费信息 */ List getChargeItemInfo(List chargeItemIdList); + + /** + * 更新收费状态:已退费 + * + * @param chargeItemIdList 收费id列表 + */ + void updateRefundChargeStatus(List chargeItemIdList); } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java index d673a38f..4a92fc44 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.openhis.administration.domain.ChargeItem; import com.openhis.administration.mapper.ChargeItemMapper; import com.openhis.administration.service.IChargeItemService; +import com.openhis.common.enums.ChargeItemStatus; import lombok.AllArgsConstructor; @@ -56,8 +57,8 @@ public class ChargeItemServiceImpl extends ServiceImpl() - .eq(ChargeItem::getEncounterId, encounterId).set(ChargeItem::getAccountId, accountId)); + int update = baseMapper.update(new ChargeItem().setAccountId(accountId), + new LambdaUpdateWrapper().eq(ChargeItem::getEncounterId, encounterId)); return update > 0; } @@ -71,4 +72,15 @@ public class ChargeItemServiceImpl extends ServiceImpl getChargeItemInfo(List chargeItemIdList) { return baseMapper.selectBatchIds(chargeItemIdList); } + + /** + * 更新收费状态:已退费 + * + * @param chargeItemIdList 收费id列表 + */ + @Override + public void updateRefundChargeStatus(List chargeItemIdList) { + baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.REFUNDED.getValue()), + new LambdaUpdateWrapper().in(ChargeItem::getId, chargeItemIdList)); + } } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/OrganizationServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/OrganizationServiceImpl.java index 0c0288d3..3e4da9b4 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/OrganizationServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/OrganizationServiceImpl.java @@ -30,8 +30,8 @@ public class OrganizationServiceImpl extends ServiceImpl().eq(Organization::getId, orgId) - .set(Organization::getActiveFlag, AccountStatus.ACTIVE.getValue())); + int updateCount = baseMapper.update(new Organization().setActiveFlag(AccountStatus.ACTIVE.getValue()), + new LambdaUpdateWrapper().eq(Organization::getId, orgId)); return updateCount > 0; } @@ -43,8 +43,8 @@ public class OrganizationServiceImpl extends ServiceImpl().eq(Organization::getId, orgId) - .set(Organization::getActiveFlag, AccountStatus.INACTIVE.getValue())); + int updateCount = baseMapper.update(new Organization().setActiveFlag(AccountStatus.INACTIVE.getValue()), + new LambdaUpdateWrapper().eq(Organization::getId, orgId)); return updateCount > 0; } diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentRecDetail.java b/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentRecDetail.java index 14a4f64c..94e9967f 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentRecDetail.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentRecDetail.java @@ -6,8 +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 lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -31,6 +31,9 @@ public class PaymentRecDetail extends HisBaseEntity { /** 先前支付明细id */ private Long predecessorId; + /** 付款id */ + private Long reconciliationId; + /** 付款类型 */ private Integer targetEnum; @@ -73,5 +76,4 @@ public class PaymentRecDetail extends HisBaseEntity { /** 单笔交易结果 */ private Integer resultEnum; - } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentReconciliation.java b/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentReconciliation.java index a331f6c5..a9432cab 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentReconciliation.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/financial/domain/PaymentReconciliation.java @@ -6,8 +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 lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -88,5 +88,6 @@ public class PaymentReconciliation extends HisBaseEntity { /** 就诊ID */ private Long encounterId; - + /** 结算时间 */ + private Date billDate; } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java index c8d090b1..ff2bb39f 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/IMedicationDispenseService.java @@ -20,4 +20,12 @@ public interface IMedicationDispenseService extends IService * @param medicationRequestList 药品请求信息 */ void addMedicationDispense(List medicationRequestList); + + /** + * 更新未发放药品状态:停止发放 + * + * @param medDisIdList 发放id列表 + * @param refund 停止原因:退费 + */ + void updateStopDispenseStatus(List medDisIdList, Integer refund); } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java index a8da42f2..6cb6d3a5 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/service/impl/MedicationDispenseServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.core.common.utils.DateUtils; import com.openhis.common.enums.DispenseStatus; @@ -74,4 +75,17 @@ public class MedicationDispenseServiceImpl extends ServiceImpl medDisIdList, Integer refund) { + baseMapper.update( + new MedicationDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund), + new LambdaUpdateWrapper().in(MedicationDispense::getId, medDisIdList)); + } } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java index 2efbf78f..4071ddc4 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IDeviceDispenseService.java @@ -1,5 +1,7 @@ package com.openhis.workflow.service; +import java.util.List; + import com.baomidou.mybatisplus.extension.service.IService; import com.openhis.workflow.domain.DeviceDispense; @@ -11,4 +13,11 @@ import com.openhis.workflow.domain.DeviceDispense; */ public interface IDeviceDispenseService extends IService { + /** + * 更新未发放耗材状态:停止发放 + * + * @param devDisIdList 发放id列表 + * @param refund 停止原因:退费 + */ + void updateStopDispenseStatus(List devDisIdList, Integer refund); } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java index 2ed4a05d..f98df483 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java @@ -1,6 +1,7 @@ package com.openhis.workflow.service; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.util.List; + import com.baomidou.mybatisplus.extension.service.IService; import com.openhis.workflow.domain.ServiceRequest; @@ -12,13 +13,18 @@ import com.openhis.workflow.domain.ServiceRequest; */ public interface IServiceRequestService extends IService { - /** * 查询服务申请管理中basedOnId相同的个数 * * @param basedOnId 请求基于什么的ID * @return basedOnId相同的个数 */ - Long countServiceRequestByBasedOnId(Long basedOnId) ; + Long countServiceRequestByBasedOnId(Long basedOnId); + /** + * 更新执行诊疗状态:停止 + * + * @param serReqIdList 服务请求id列表 + */ + void updateStopRequestStatus(List serReqIdList); } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java index 0dc5c1e6..5e046696 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/DeviceDispenseServiceImpl.java @@ -1,8 +1,12 @@ package com.openhis.workflow.service.impl; +import java.util.List; + import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.openhis.common.enums.DispenseStatus; import com.openhis.workflow.domain.DeviceDispense; import com.openhis.workflow.mapper.DeviceDispenseMapper; import com.openhis.workflow.service.IDeviceDispenseService; @@ -14,6 +18,19 @@ import com.openhis.workflow.service.IDeviceDispenseService; * @date 2025-02-20 */ @Service -public class DeviceDispenseServiceImpl extends ServiceImpl implements IDeviceDispenseService { +public class DeviceDispenseServiceImpl extends ServiceImpl + implements IDeviceDispenseService { + /** + * 更新未发放耗材状态:停止发放 + * + * @param devDisIdList 发放id列表 + * @param refund 停止原因:退费 + */ + @Override + public void updateStopDispenseStatus(List devDisIdList, Integer refund) { + baseMapper.update( + new DeviceDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund), + new LambdaUpdateWrapper().in(DeviceDispense::getId, devDisIdList)); + } } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java index c40e3c9c..41deca8c 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java @@ -1,11 +1,13 @@ package com.openhis.workflow.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; + 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.openhis.common.enums.RequestStatus; import com.openhis.workflow.domain.ServiceRequest; import com.openhis.workflow.mapper.ServiceRequestMapper; import com.openhis.workflow.service.IServiceRequestService; @@ -20,9 +22,6 @@ import com.openhis.workflow.service.IServiceRequestService; public class ServiceRequestServiceImpl extends ServiceImpl implements IServiceRequestService { - @Autowired - private ServiceRequestMapper serviceRequestMapper; - /** * 查询服务申请管理中basedOnId相同的个数 * @@ -33,6 +32,17 @@ public class ServiceRequestServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ServiceRequest::getBasedOnId, basedOnId); - return serviceRequestMapper.selectCount(queryWrapper); + return baseMapper.selectCount(queryWrapper); + } + + /** + * 更新执行诊疗状态:停止 + * + * @param serReqIdList 服务请求id列表 + */ + @Override + public void updateStopRequestStatus(List serReqIdList) { + baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.STOPPED.getValue()), + new LambdaUpdateWrapper().in(ServiceRequest::getId, serReqIdList)); } } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java index 4f57c284..08bae25b 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/SupplyRequestServiceImpl.java @@ -53,10 +53,10 @@ public class SupplyRequestServiceImpl extends ServiceImpl agreeRequest(String busNo, LoginUser loginUser, Date now) { // 更新单据状态 - baseMapper.update(null, - new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo) - .set(SupplyRequest::getApprovalTime, now).set(SupplyRequest::getApproverId, loginUser.getUserId()) - .set(SupplyRequest::getStatusEnum, SupplyStatus.AGREE.getValue())); + baseMapper.update( + new SupplyRequest().setApprovalTime(now).setApproverId(loginUser.getPractitionerId()) + .setStatusEnum(SupplyStatus.AGREE.getValue()), + new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo)); // 返回单据详情 return this.getSupplyByBusNo(busNo); } @@ -69,10 +69,9 @@ public class SupplyRequestServiceImpl extends ServiceImpl().eq(SupplyRequest::getBusNo, busNo) - .set(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue()) - .set(SupplyRequest::getApplyTime, DateUtils.getNowDate())); + int updateCount = baseMapper.update( + new SupplyRequest().setApplyTime(DateUtils.getNowDate()).setStatusEnum(SupplyStatus.APPROVAL.getValue()), + new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo)); return updateCount > 0; } @@ -84,8 +83,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl() - .eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue())); + int updateCount = baseMapper.update(new SupplyRequest().setStatusEnum(SupplyStatus.WITHDRAW.getValue()), + new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo)); return updateCount > 0; } @@ -99,10 +98,10 @@ public class SupplyRequestServiceImpl extends ServiceImpl().eq(SupplyRequest::getBusNo, busNo) - .set(SupplyRequest::getApprovalTime, now).set(SupplyRequest::getApproverId, loginUser.getUserId()) - .set(SupplyRequest::getStatusEnum, SupplyStatus.REJECT.getValue())); + int updateCount = baseMapper.update( + new SupplyRequest().setApprovalTime(now).setApproverId(loginUser.getPractitionerId()) + .setStatusEnum(SupplyStatus.REJECT.getValue()), + new LambdaUpdateWrapper().eq(SupplyRequest::getBusNo, busNo)); return updateCount > 0; } From cedf3fb275c97e9e4eba14b3c37e167f4a3290e2 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Sun, 30 Mar 2025 12:59:32 +0800 Subject: [PATCH 131/149] =?UTF-8?q?=E8=AF=8A=E7=96=97=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...iagnosisTreatmentManageAppServiceImpl.java | 148 +++++++++++------- .../dto/DiagnosisTreatmentDto.java | 10 +- .../dto/DiagnosisTreatmentInitDto.java | 20 +++ .../dto/DiagnosisTreatmentSelParam.java | 2 +- .../dto/DiagnosisTreatmentUpDto.java | 3 +- .../dto/MedicationManageUpDto.java | 1 - .../ActivityDefinitionManageMapper.xml | 6 +- .../common/constant/CommonConstants.java | 4 + .../workflow/domain/ActivityDefinition.java | 2 +- 9 files changed, 130 insertions(+), 66 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java index 181bdee9..698656ce 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import com.openhis.administration.domain.Supplier; +import com.openhis.administration.service.ISupplierService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,21 +22,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.core.common.core.domain.entity.SysDictData; -import com.core.common.utils.MessageUtils; -import com.core.common.utils.SecurityUtils; +import com.core.common.utils.*; import com.core.common.utils.bean.BeanUtils; import com.core.system.service.ISysDictTypeService; +import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.domain.Organization; 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.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.datadictionary.appservice.IDiagnosisTreatmentManageAppService; -import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto; -import com.openhis.web.datadictionary.dto.DiagnosisTreatmentInitDto; -import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam; -import com.openhis.web.datadictionary.dto.DiagnosisTreatmentUpDto; +import com.openhis.web.datadictionary.appservice.IItemDefinitionService; +import com.openhis.web.datadictionary.dto.*; import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper; import com.openhis.workflow.domain.ActivityDefinition; import com.openhis.workflow.mapper.ActivityDefinitionMapper; @@ -59,6 +60,13 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme private ISysDictTypeService iSysDictTypeService; @Resource private ActivityDefinitionManageMapper activityDefinitionManageMapper; + @Autowired + private IItemDefinitionService itemDefinitionServic; + @Autowired + private ISysDictTypeService sysDictTypeService; + + @Autowired(required = false) + AssignSeqUtil assignSeqUtil; /** * 诊疗目录初期查询 @@ -82,7 +90,15 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme .collect(Collectors.toList()); diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations); - // 获取诊疗分类 + // 获取诊目录疗分类 + List diagnosisList = + sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE); + // 获取诊疗录疗分类 + List diagnosisCategories = diagnosisList.stream().map( + category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel())) + .collect(Collectors.toList()); + diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories); + // 查询医疗服务项类型 List medical_service_items = iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode()); @@ -92,30 +108,31 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme status.getDictLabel())) .collect(Collectors.toList()); List diseaseTreatmentCategories = new ArrayList<>(); - - DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory = - new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getValue(), - ActivityDefCategory.MEDICAL_SERVICE_ITEM.getInfo()); - diseaseTreatmentCategory.setChildren(diseaseTreatmentCategoryList); - diseaseTreatmentCategories.add(diseaseTreatmentCategory); - diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); - - // 查询手术与治疗类型 - List medical_service_items2 = - iSysDictTypeService.selectDictDataByType(ActivityDefCategory.TREATMENT_SURGERY.getCode()); - // 获取手术与治疗List - List diseaseTreatmentCategoryList2 = medical_service_items2 - .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), - status.getDictLabel())) - .collect(Collectors.toList()); - - DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 = - new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(), - ActivityDefCategory.TREATMENT_SURGERY.getInfo()); - diseaseTreatmentCategory2.setChildren(diseaseTreatmentCategoryList2); - diseaseTreatmentCategories.add(diseaseTreatmentCategory2); - - diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); +// +// //获取目录分类 +// DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory = +// new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getValue(), +// ActivityDefCategory.MEDICAL_SERVICE_ITEM.getInfo()); +// diseaseTreatmentCategory.setChildren(diseaseTreatmentCategoryList); +// diseaseTreatmentCategories.add(diseaseTreatmentCategory); +// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); +// +// // 查询手术与治疗类型 +// List medical_service_items2 = +// iSysDictTypeService.selectDictDataByType(ActivityDefCategory.TREATMENT_SURGERY.getCode()); +// // 获取手术与治疗List +// List diseaseTreatmentCategoryList2 = medical_service_items2 +// .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(), +// status.getDictLabel())) +// .collect(Collectors.toList()); +// +// DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 = +// new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(), +// ActivityDefCategory.TREATMENT_SURGERY.getInfo()); +// diseaseTreatmentCategory2.setChildren(diseaseTreatmentCategoryList2); +// diseaseTreatmentCategories.add(diseaseTreatmentCategory2); +// +// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories); // 获取类型 List typeEnumOptions = Stream.of(ActivityType.values()) @@ -138,15 +155,6 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme @Override public R getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) { - // - // // 构建查询条件 - // QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam, - // searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request); - // // 设置排序 - // queryWrapper.orderByAsc("bus_no"); - // // 分页查询 - // Page diseaseTreatmentPage = HisPageUtils.selectPage(activityDefinitionMapper, - // queryWrapper, pageNo, pageSize, DiagnosisTreatmentDto.class); // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam, @@ -163,8 +171,6 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag())); // 类型举类回显赋值 e.setTypeEnum_enumText(EnumUtils.getInfoByValue(ActivityType.class, e.getTypeEnum())); - // 目录类别举类回显赋值 - e.setCategory_enumText(EnumUtils.getInfoByValue(ActivityDefCategory.class, e.getCategoryEnum())); // 状态举类回显赋值 e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum())); }); @@ -198,14 +204,32 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme @Override public R editDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) { - ActivityDefinition ActivityDefinition = new ActivityDefinition(); - BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition); + ActivityDefinition activityDefinition = new ActivityDefinition(); + BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition); + + // 使用10位数基础采番 + String code = assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10); + activityDefinition.setBusNo(code); + // 拼音码 + activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName())); + // 五笔码 + activityDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(activityDefinition.getName())); // 更新诊疗信息 - return iActivityDefinitionService.updateById(ActivityDefinition) - ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) - : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + if (iActivityDefinitionService.updateById(activityDefinition)) { + ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition(); + chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType()) + .setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode()) + .setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION) + .setInstanceId(diagnosisTreatmentUpDto.getId()); + // 更新价格表 + return itemDefinitionServic.updateItem(chargeItemDefinition) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + + } + return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } /** @@ -267,13 +291,31 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme @Override public R addDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) { - ActivityDefinition ActivityDefinition = new ActivityDefinition(); - BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition); + ActivityDefinition activityDefinition = new ActivityDefinition(); + BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition); + // 拼音码 + activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName())); + // 五笔码 + activityDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(activityDefinition.getName())); + // 新增外来诊疗目录 - ActivityDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue()); - return iActivityDefinitionService.addDiagnosisTreatment(ActivityDefinition) - ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) - : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); + activityDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue()); + if (iActivityDefinitionService.addDiagnosisTreatment(activityDefinition)) { + + ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto(); + BeanUtils.copyProperties(diagnosisTreatmentUpDto, itemUpFromDirectoryDto); + itemUpFromDirectoryDto.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode()) + .setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION) + .setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue()) + .setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName()) + .setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice()); + + return itemDefinitionServic.addItem(itemUpFromDirectoryDto) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); + + } + return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index dec2ecb1..9b91cc16 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -26,8 +26,9 @@ public class DiagnosisTreatmentDto { private Long id; /** 目录类别 */ - private Integer categoryEnum; - private String category_enumText; + @Dict(dictCode = "activity_category_code") + private String categoryCode; + private String categoryCode_dictText; /** 编码 */ private String busNo; @@ -93,9 +94,6 @@ public class DiagnosisTreatmentDto { private Long locationId; private String locationId_dictText; - /** 售价 */ - private BigDecimal price; - /** 财务类别 */ @Dict(dictCode = "fin_type_code") private String typeCode; @@ -114,6 +112,6 @@ public class DiagnosisTreatmentDto { /** 最高零售价 */ private BigDecimal maximumRetailPrice; - + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java index 77408654..7ebbb51a 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java @@ -3,6 +3,8 @@ package com.openhis.web.datadictionary.dto; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; import lombok.experimental.Accessors; @@ -19,6 +21,8 @@ public class DiagnosisTreatmentInitDto { private List diseaseTreatmentCategoryList; private List exeOrganizations; private List typeEnumOptions; + //诊疗目录 + private List diagnosisCategoryOptions; /** * 状态 @@ -64,6 +68,21 @@ public class DiagnosisTreatmentInitDto { } } + /** + * 诊疗目录类型 + */ + @Data + public static class dictCategoryCode { + private String value; + private String info; + private List children = new ArrayList<>(); + + public dictCategoryCode(String value, String info) { + this.value = value; + this.info = info; + } + } + /** * 执行机构 */ @@ -77,4 +96,5 @@ public class DiagnosisTreatmentInitDto { this.label = label; } } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java index 48c42698..e5fd9eb5 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java @@ -16,7 +16,7 @@ import lombok.experimental.Accessors; public class DiagnosisTreatmentSelParam { /** 目录类别 */ - private Integer categoryEnum; + private Integer categoryCode; /** 类型 */ private Integer typeEnum; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java index e46683b7..5425e648 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java @@ -22,13 +22,14 @@ import java.math.BigDecimal; @Data @Accessors(chain = true) public class DiagnosisTreatmentUpDto { + /** ID */ @JsonSerialize(using = ToStringSerializer.class) private Long id; /** 目录类别 */ @NotNull(message = "目录类别不能为空") - private ActivityDefCategory categoryEnum; + private String categoryCode; /** 编码 */ @NotBlank(message = "项目编码不能为空") diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java index b809a736..aa77d98d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java @@ -53,7 +53,6 @@ public class MedicationManageUpDto { private Integer activeFlag; /** 批次号 */ - @NotBlank(message = "批次号不能为空") private String lotNumber; /** 生效日期 */ diff --git a/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml index d0192249..a615f28f 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml @@ -6,7 +6,7 @@ SELECT T3.id, - T3.category_enum, + T3.category_code, T3.bus_no, T3.name, T3.py_str, @@ -33,7 +33,7 @@ ( SELECT T1.id, - T1.category_enum, + T1.category_code, T1.bus_no, T1.name, T1.py_str, @@ -83,7 +83,7 @@ SELECT DISTINCT - T7.name AS department_name, - T8.name AS doctor_name, + T8.name AS department_name, + T9.name AS doctor_name, + '西药开药' AS item_type, + T7.name AS condition_name, T2.prescription_no, T4.name AS medicine_name, T3.total_volume, @@ -105,10 +107,13 @@ ON T1.med_req_id = T5.service_id INNER JOIN adm_encounter AS T6 ON T1.encounter_id = T6.id - LEFT OUTER JOIN adm_organization AS T7 - ON T6.organization_id = T7.id - LEFT OUTER JOIN adm_practitioner AS T8 - ON T1.practitioner_id = T8.id + INNER JOIN cli_condition_definition AS T7 + ON T2.condition_id = T7.id + LEFT OUTER JOIN adm_organization AS T8 + ON T6.organization_id = T8.id + LEFT OUTER JOIN adm_practitioner AS T9 + ON T1.practitioner_id = T9.id + WHERE T1.encounter_id = #{encounterId} AND T1.status_enum = 2 From 653f0fa553b9e9a6fa1d04c81d1f8503e8bbb8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E8=8F=B2?= <12704587+yvwen@user.noreply.gitee.com> Date: Sun, 30 Mar 2025 18:27:39 +0800 Subject: [PATCH 143/149] =?UTF-8?q?=E5=8F=91=E8=8D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../westernmedicine/index.vue | 610 ++++++++++-------- 1 file changed, 346 insertions(+), 264 deletions(-) diff --git a/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue b/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue index 3950cb57..dfcc3c92 100644 --- a/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue +++ b/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue @@ -1,92 +1,162 @@ \ No newline at end of file From 5283a3a927c21e4303a15b13824f072a230e557a Mon Sep 17 00:00:00 2001 From: "Zhang.YC" Date: Mon, 31 Mar 2025 09:12:27 +0800 Subject: [PATCH 144/149] =?UTF-8?q?=E6=8C=82=E5=8F=B7=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=82=A3=E8=80=85=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charge/outpatientregistration/index.vue | 61 +++++++++++++++-- .../doctorstation/components/patientlist.vue | 5 +- .../components/prescriptionlist.vue | 66 ++++++++++++++----- .../src/views/doctorstation/index.vue | 9 ++- 4 files changed, 115 insertions(+), 26 deletions(-) diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue index 5e3baf9f..e79f5630 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue @@ -15,10 +15,27 @@ - + + + + @@ -625,6 +642,7 @@ import { } from "./components/outpatientregistration"; import patientInfoDialog from "./components/patientInfoDialog"; import PatientAddDialog from "./components/patientAddDialog"; +import patientList from "./components/patientList"; import { nextTick } from "vue"; const router = useRouter(); @@ -646,6 +664,8 @@ const total = ref(0); const title = ref(""); const priorityLevelOptionOptions = ref(undefined); // 优先级 const jzyyList = ref([{ value: "1", label: "其他" }]); +const showPopover = ref(false); +const patientSearchKey = ref(); // 键盘事件用 const contractNameRef = ref(null); const jzyyRef = ref(null); @@ -967,6 +987,39 @@ function handleAdd() { }); } +/** + * 姓名表单获取焦点打开列表 + */ +function handleFocus() { + showPopover.value = true; +} +/** + * 姓名表单失去焦点关闭列表 + */ +function handleBlur() { + showPopover.value = false; +} + +/** + * 搜索患者 + */ +function handleSearchPatient(value) { + patientSearchKey.value = value; +} + +/** + * 点击患者列表给表单赋值 + */ +function selsectPatient(row) { + form.value.searchKey = row.name; + form.value.name = row.name; + form.value.idCard = row.idCard; + form.value.genderEnum_enumText = row.genderEnum_enumText; + form.value.phone = row.phone; + form.value.firstEnum_enumText = row.firstEnum_enumText; + form.value.age = row.age; +} + // 设置新增参数 function transformFormData(form) { return { diff --git a/openhis-ui-vue3/src/views/doctorstation/components/patientlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/patientlist.vue index 3cd2330d..5ac58209 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/patientlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/patientlist.vue @@ -31,6 +31,7 @@ - \ No newline at end of file From 73d928cba152aff099f50157b0223a11fdd5d86b Mon Sep 17 00:00:00 2001 From: "Zhang.YC" Date: Mon, 31 Mar 2025 09:39:05 +0800 Subject: [PATCH 145/149] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E6=94=B6=E8=B4=B9?= =?UTF-8?q?=E9=80=80=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charge/cliniccharge/components/api.js | 45 ++++++ .../src/views/charge/cliniccharge/index.vue | 145 ++++++++++++++++++ .../charge/clinicrefund/components/api.js | 33 ++++ .../src/views/charge/clinicrefund/index.vue | 102 ++++++++++++ .../components/patientList.vue | 60 ++++++++ 5 files changed, 385 insertions(+) create mode 100644 openhis-ui-vue3/src/views/charge/cliniccharge/components/api.js create mode 100644 openhis-ui-vue3/src/views/charge/cliniccharge/index.vue create mode 100644 openhis-ui-vue3/src/views/charge/clinicrefund/components/api.js create mode 100644 openhis-ui-vue3/src/views/charge/clinicrefund/index.vue create mode 100644 openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientList.vue diff --git a/openhis-ui-vue3/src/views/charge/cliniccharge/components/api.js b/openhis-ui-vue3/src/views/charge/cliniccharge/components/api.js new file mode 100644 index 00000000..74888860 --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/cliniccharge/components/api.js @@ -0,0 +1,45 @@ +import request from '@/utils/request' + +/** + * 收费患者列表 + */ +export function getList(queryParams) { + return request({ + url: '/charge-manage/charge/encounter-patient-page', + method: 'get', + params: queryParams + }) +} + +/** + * 患者处方列表 + */ +export function getChargeList(encounterId) { + return request({ + url: '/charge-manage/charge/patient-prescription?encounterId=' + encounterId, + method: 'get', + }) +} + + +/** + * 医保转自费 + */ +export function changeToSelfPay(encounterId) { + return request({ + url: '/charge-manage/charge/self-pay?encounterId=' + encounterId, + method: 'put', + }) +} + + +/** + * 自费转医保 + */ +export function changeToMedicalInsurance(encounterId) { + return request({ + url: '/charge-manage/charge/medical-insurance?encounterId=' + encounterId, + method: 'put', + }) +} + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/cliniccharge/index.vue b/openhis-ui-vue3/src/views/charge/cliniccharge/index.vue new file mode 100644 index 00000000..a354f92b --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/cliniccharge/index.vue @@ -0,0 +1,145 @@ + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/clinicrefund/components/api.js b/openhis-ui-vue3/src/views/charge/clinicrefund/components/api.js new file mode 100644 index 00000000..34fc61d2 --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/clinicrefund/components/api.js @@ -0,0 +1,33 @@ +import request from '@/utils/request' + +/** + * 收费患者列表 + */ +export function getList(queryParams) { + return request({ + url: '/charge-manage/refund/encounter-patient-page', + method: 'get', + params: queryParams + }) +} + +/** + * 患者退费账单 + */ +export function getRefundList(encounterId) { + return request({ + url: '/charge-manage/refund/patient-payment?encounterId=' + encounterId, + method: 'get', + }) +} + +/** + * 退费 + */ +export function refund(data) { + return request({ + url: '/charge-manage/refund/refund-payment', + method: 'post', + data: data + }) +} diff --git a/openhis-ui-vue3/src/views/charge/clinicrefund/index.vue b/openhis-ui-vue3/src/views/charge/clinicrefund/index.vue new file mode 100644 index 00000000..fa6b39d3 --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/clinicrefund/index.vue @@ -0,0 +1,102 @@ + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientList.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientList.vue new file mode 100644 index 00000000..cd4b5e2f --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientList.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file From 5e6bc6facccafa86ea915c0fb1c8729a3a0b90f6 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Mon, 31 Mar 2025 09:45:55 +0800 Subject: [PATCH 146/149] =?UTF-8?q?=E8=AF=8A=E7=96=97=E5=92=8C=E7=96=BE?= =?UTF-8?q?=E7=97=85up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DiagnosisTreatmentManageAppServiceImpl.java | 3 +++ .../appservice/impl/DiseaseManageAppServiceImpl.java | 8 ++++++++ .../main/java/com/openhis/common/enums/AssignSeqEnum.java | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java index 698656ce..23397452 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java @@ -293,6 +293,9 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme ActivityDefinition activityDefinition = new ActivityDefinition(); BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition); + // 使用10位数基础采番 + String code = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10); + activityDefinition.setBusNo(code); // 拼音码 activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName())); // 五笔码 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java index 36922f1f..0db963c1 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java @@ -9,7 +9,9 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; +import com.core.common.utils.AssignSeqUtil; import com.core.common.utils.ChineseConvertUtils; +import com.openhis.common.enums.AssignSeqEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +49,8 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService { private ConditionDefinitionMapper conditionDefinitionMapper; @Autowired private IConditionDefinitionService ConditionDefinitionService; + @Autowired(required = false) + AssignSeqUtil assignSeqUtil; /** * 病种目录初始化 @@ -191,6 +195,10 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService { public R addDisease(DiseaseManageUpDto diseaseManageUpDto) { ConditionDefinition conditionDefinition = new ConditionDefinition(); BeanUtils.copyProperties(diseaseManageUpDto, conditionDefinition); + // 使用10位数基础采番 + String code = assignSeqUtil.getSeq(AssignSeqEnum.CONDITION_DEFINITION_NUM.getPrefix(), 10); + conditionDefinition.setConditionCode(code); + // 新增外来病种目录 conditionDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue()); // 拼音码 diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java index 1a045d13..30bb37a0 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/AssignSeqEnum.java @@ -68,7 +68,12 @@ public enum AssignSeqEnum { /** * 诊疗项目编码 */ - ACTIVITY_DEFINITION_NUM("11", "诊疗编码", "AD");; + ACTIVITY_DEFINITION_NUM("11", "诊疗编码", "AD"), + + /** + * 诊断定义编码 + */ + CONDITION_DEFINITION_NUM("11", "诊断编码", "CD"); private final String code; private final String info; From d1e30ada97583efa989f34c25eafe42c78979970 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Mon, 31 Mar 2025 10:06:44 +0800 Subject: [PATCH 147/149] =?UTF-8?q?=E8=AF=8A=E7=96=97=E6=98=AF=E5=90=A6lis?= =?UTF-8?q?t=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DiagnosisTreatmentManageAppServiceImpl.java | 7 +++++++ .../web/datadictionary/dto/DiagnosisTreatmentInitDto.java | 2 ++ 2 files changed, 9 insertions(+) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java index 23397452..80a2ae18 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagnosisTreatmentManageAppServiceImpl.java @@ -140,6 +140,13 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme .collect(Collectors.toList()); diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions); + // 获取是/否 列表 + // 获取状态 + List statusWeatherOption = Stream.of(Whether.values()) + .map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + diagnosisTreatmentInitDto.setStatusWeatherOption(statusWeatherOption); + return R.ok(diagnosisTreatmentInitDto); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java index 7ebbb51a..57172737 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java @@ -23,6 +23,8 @@ public class DiagnosisTreatmentInitDto { private List typeEnumOptions; //诊疗目录 private List diagnosisCategoryOptions; + //是否list + private List statusWeatherOption; /** * 状态 From b5df8479daea0e8130fa93b4f7c2e4c6b3984420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E8=8F=B2?= <12704587+yvwen@user.noreply.gitee.com> Date: Mon, 31 Mar 2025 10:18:49 +0800 Subject: [PATCH 148/149] up --- .../impl/IWesternMedicineDispenseAppServiceImpl.java | 12 ++++++------ .../WesternMedicineDispenseController.java | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java index bfcda523..8bc6f538 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java @@ -208,21 +208,21 @@ public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineD // id inventoryItem.setId(dispenseInventoryDto.getInventoryId()); // 包装数量 - inventoryItem.setBaseQuantity(dispenseInventoryDto.getInventoryBaseQuantity(). - min(new BigDecimal(dispenseInventoryDto.getDispenseQuantity()))); + inventoryItem.setBaseQuantity(dispenseInventoryDto.getInventoryBaseQuantity().subtract( + new BigDecimal(dispenseInventoryDto.getDispenseQuantity()))); // 拆零数量(拆零比×包装数量) - inventoryItem.setMinQuantity(dispenseInventoryDto.getInventoryMinQuantity(). - min(dispenseInventoryDto.getPartPercent().multiply( + inventoryItem.setMinQuantity(dispenseInventoryDto.getInventoryMinQuantity().subtract( + dispenseInventoryDto.getPartPercent().multiply( new BigDecimal(dispenseInventoryDto.getDispenseQuantity())))); } else if (dispenseInventoryDto.getDispenseUnitCode().equals(dispenseInventoryDto. getInventoryMinUnitCode())) { // id inventoryItem.setId(dispenseInventoryDto.getInventoryId()); // 拆零数量 - inventoryItem.setMinQuantity(dispenseInventoryDto.getInventoryMinQuantity().min( + inventoryItem.setMinQuantity(dispenseInventoryDto.getInventoryMinQuantity().subtract( new BigDecimal(dispenseInventoryDto.getDispenseQuantity()))); // 包装数量(拆零数量÷拆零比) - inventoryItem.setBaseQuantity(dispenseInventoryDto.getInventoryBaseQuantity().min( + inventoryItem.setBaseQuantity(dispenseInventoryDto.getInventoryBaseQuantity().subtract( new BigDecimal(dispenseInventoryDto.getDispenseQuantity()). divide(dispenseInventoryDto.getPartPercent(),RoundingMode.HALF_UP))); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/WesternMedicineDispenseController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/WesternMedicineDispenseController.java index d49aa2e8..85576931 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/WesternMedicineDispenseController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/WesternMedicineDispenseController.java @@ -85,7 +85,6 @@ public class WesternMedicineDispenseController { @PutMapping("/medicine-cancel") public R medicineCancel(@RequestParam(value = "prescriptionNo") String prescriptionNo, @RequestParam(value = "notPerformedReasonEnum") Integer notPerformedReasonEnum) { - //return iWesternMedicineDispenseService.medicineCancel(prescriptionNo, notPerformedReasonEnum); - return R.ok(); + return iWesternMedicineDispenseService.medicineCancel(prescriptionNo, notPerformedReasonEnum); } } \ No newline at end of file From 7c296698aadabafbedc17f413bdcf1b93ae6ab3f Mon Sep 17 00:00:00 2001 From: "Zhang.WH" Date: Mon, 31 Mar 2025 10:20:16 +0800 Subject: [PATCH 149/149] =?UTF-8?q?=E6=94=B6=E9=80=80=E8=B4=B9=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientChargeAppService.java | 7 ++++ .../IOutpatientRefundAppService.java | 7 ++++ .../impl/OutpatientChargeAppServiceImpl.java | 22 ++++++++++++ .../impl/OutpatientRefundAppServiceImpl.java | 33 +++++++++++++---- .../OutpatientChargeController.java | 10 ++++++ .../OutpatientRefundController.java | 10 ++++++ .../chargemanage/dto/OutpatientInitDto.java | 36 +++++++++++++++++++ .../mapper/OutpatientRefundAppMapper.java | 6 +++- .../OutpatientRefundAppMapper.xml | 8 +++-- 9 files changed, 129 insertions(+), 10 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java index 9e76b7e8..7d493cd7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java @@ -52,4 +52,11 @@ public interface IOutpatientChargeAppService { * @return 操作结果 */ R changeToMedicalInsurance(Long encounterId); + + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + R outpatientChargeInit(); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java index 6d6216ac..a8cd1849 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java @@ -46,4 +46,11 @@ public interface IOutpatientRefundAppService { */ R getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request); + + /** + * 门诊退费页面初始化 + * + * @return 初始化信息 + */ + R outpatientRefundInit(); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java index 14afe3eb..a5ccca46 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java @@ -3,8 +3,10 @@ */ package com.openhis.web.chargemanage.appservice.impl; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; +import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -28,6 +30,7 @@ import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService; import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; +import com.openhis.web.chargemanage.dto.OutpatientInitDto; import com.openhis.web.chargemanage.mapper.OutpatientChargeAppMapper; /** @@ -46,6 +49,25 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi @Autowired private IAccountService accountService; + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + @Override + public R outpatientChargeInit() { + OutpatientInitDto initDto = new OutpatientInitDto(); + List chargeItemStatusOptions = new ArrayList<>(); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(), + ChargeItemStatus.PLANNED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(), + ChargeItemStatus.BILLABLE.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.BILLED.getInfo())); + initDto.setChargeItemStatusOptions(chargeItemStatusOptions); + return R.ok(initDto); + } + /** * 查询就诊患者分页列表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java index 21f1f6d7..90df039b 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java @@ -27,10 +27,7 @@ import com.openhis.common.utils.HisQueryUtils; import com.openhis.financial.service.IPaymentReconciliationService; import com.openhis.medication.service.IMedicationDispenseService; import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService; -import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; -import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; -import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto; -import com.openhis.web.chargemanage.dto.RefundItemDto; +import com.openhis.web.chargemanage.dto.*; import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper; import com.openhis.workflow.service.IDeviceDispenseService; import com.openhis.workflow.service.IServiceRequestService; @@ -57,6 +54,27 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi @Autowired private IServiceRequestService serviceRequestService; + /** + * 门诊退费页面初始化 + * + * @return 初始化信息 + */ + @Override + public R outpatientRefundInit() { + OutpatientInitDto initDto = new OutpatientInitDto(); + List chargeItemStatusOptions = new ArrayList<>(); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.BILLED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(), + ChargeItemStatus.REFUNDING.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(), + ChargeItemStatus.REFUNDED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption( + ChargeItemStatus.PART_REFUND.getValue(), ChargeItemStatus.PART_REFUND.getInfo())); + initDto.setChargeItemStatusOptions(chargeItemStatusOptions); + return R.ok(initDto); + } + /** * 根据就诊id查询患者的账单 * @@ -156,9 +174,10 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)), request); // 就诊患者分页列表 - Page encounterPatientPage = - outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, - ChargeItemStatus.BILLED.getValue(), AccountType.MEDICAL_INSURANCE.getValue()); + Page encounterPatientPage = outpatientRefundAppMapper.selectBilledEncounterPatientPage( + new Page<>(pageNo, pageSize), queryWrapper, ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(), + ChargeItemStatus.PART_REFUND.getValue(), AccountType.MEDICAL_INSURANCE.getValue()); encounterPatientPage.getRecords().forEach(e -> { // 性别枚举 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java index 2743406a..11efbed4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java @@ -30,6 +30,16 @@ public class OutpatientChargeController { @Autowired private IOutpatientChargeAppService outpatientChargeAppService; + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R outpatientChargeInit() { + return outpatientChargeAppService.outpatientChargeInit(); + } + /** * 查询就诊患者分页列表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java index 4e195c6f..7dffbffd 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java @@ -32,6 +32,16 @@ public class OutpatientRefundController { @Autowired private IOutpatientRefundAppService outpatientRefundAppService; + /** + * 门诊退费页面初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R outpatientRefundInit() { + return outpatientRefundAppService.outpatientRefundInit(); + } + /** * 查询结算过的就诊患者分页列表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java new file mode 100644 index 00000000..49392cc8 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java @@ -0,0 +1,36 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.chargemanage.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 门诊费用相关初始化 + * + * @author zwh + * @date 2025-03-30 + */ +@Data +@Accessors(chain = true) +public class OutpatientInitDto { + + private List chargeItemStatusOptions; + + /** + * 收费状态 + */ + @Data + public static class chargeItemStatusOption { + private Integer value; + private String label; + + public chargeItemStatusOption(Integer value, String label) { + this.value = value; + this.label = label; + } + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java index 293d17b6..b6090a51 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java @@ -59,10 +59,14 @@ public interface OutpatientRefundAppMapper { * @param page 分页 * @param queryWrapper 查询条件 * @param billed 收费状态:已结算 + * @param refunding 收费状态:退费中 + * @param refunded 收费状态:已退费 + * @param partRefund 收费状态:部分退费 * @param insurance 账户类型:医保 * @return 已结算就诊患者分页列表 */ Page selectBilledEncounterPatientPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("billed") Integer billed, - @Param("insurance") Integer insurance); + @Param("refunding") Integer refunding, @Param("refunded") Integer refunded, + @Param("partRefund") Integer partRefund, @Param("insurance") Integer insurance); } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml index d37d7496..ac8dfd6c 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml @@ -18,7 +18,8 @@ T2.account_id FROM fin_payment_reconciliation AS T1 LEFT JOIN adm_charge_item AS T2 - ON T2.id IN (T1.charge_item_ids) + -- 因为T2.id是long型,T1.charge_item_ids是例如 "1","2" 的string类型,所以需要先转类型再匹配 + ON T2.id::TEXT = ANY(string_to_array(T1.charge_item_ids, ',')) WHERE T1.encouter_id =#{encounterId} AND T1.status_enum IN (#{success},#{refundAll},#{refundPart}) AND T1.delete_flag = '0' @@ -98,6 +99,7 @@ resultType="com.openhis.web.chargemanage.dto.EncounterPatientPageDto"> SELECT T8.encounter_id, T8.encounter_bus_no, + T8.status_enum, T8.start_time, T8.patient_name, T8.patient_bus_no, @@ -116,6 +118,7 @@ T1.start_time, T1.delete_flag, T1.tenant_id, + T1.status_enum, T2."name" AS patient_name, T2.bus_no AS patient_bus_no, T2.gender_enum, @@ -142,13 +145,14 @@ ON T6.encouter_id = T1.id LEFT JOIN fin_payment_rec_detail AS T7 ON T7.reconciliation_id = T6.id - WHERE T3.status_enum = #{billed} + WHERE T3.status_enum IN (#{billed},#{refunding},#{refunded},#{partRefund}) AND T1.delete_flag = '0' GROUP BY T1.id, T1.bus_no, T1.start_time, T1.delete_flag, T1.tenant_id, + T1.status_enum, T2."name", T2.bus_no, T2.gender_enum,