版本更新
This commit is contained in:
@@ -152,4 +152,6 @@ public class ChargeItem extends HisBaseEntity {
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
/** 执行id */
|
||||
private Long procedureId;
|
||||
}
|
||||
|
||||
@@ -29,4 +29,14 @@ public interface EncounterDiagnosisMapper extends BaseMapper<EncounterDiagnosis>
|
||||
*/
|
||||
void deleteTcmByEncounterId(@Param("encounterId") Long encounterId);
|
||||
|
||||
/**
|
||||
* 根据就诊id定义id等查询就诊诊断
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param conditionDefId 定义id
|
||||
* @param tenantId 租户
|
||||
* @return 查询结果
|
||||
*/
|
||||
EncounterDiagnosis getEncounterDiagnosisByEncounterConDefId(@Param("encounterId") Long encounterId,
|
||||
@Param("conditionDefId") Long conditionDefId, @Param("tenantId") Integer tenantId);
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
@@ -17,8 +19,8 @@ public interface IChargeItemDefinitionService extends IService<ChargeItemDefinit
|
||||
* 获取定价分页列表
|
||||
*
|
||||
* @param chargeItemDefinition 定价查询条件
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页面大小
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页面大小
|
||||
* @return 定价分页列表
|
||||
*/
|
||||
Page<ChargeItemDefinition> getPage(ChargeItemDefinition chargeItemDefinition, Integer pageNo, Integer pageSize);
|
||||
@@ -42,11 +44,28 @@ public interface IChargeItemDefinitionService extends IService<ChargeItemDefinit
|
||||
/**
|
||||
* 通过服务管理新增费用定价
|
||||
*
|
||||
* @param healthcareService 服务管理
|
||||
* @param healthcareService 服务管理
|
||||
* @param chargeItemDefinition 费用定价
|
||||
* @return 新增结果
|
||||
*/
|
||||
boolean addChargeItemDefinitionByHealthcareService(HealthcareService healthcareService, ChargeItemDefinition chargeItemDefinition);
|
||||
|
||||
boolean addChargeItemDefinitionByHealthcareService(HealthcareService healthcareService,
|
||||
ChargeItemDefinition chargeItemDefinition);
|
||||
|
||||
/**
|
||||
* 创建费用定价和详情
|
||||
*
|
||||
* @param chargeName 名称
|
||||
* @param typeCode 财务类别
|
||||
* @param ybCode 医保类别
|
||||
* @param unitCode 包装单位
|
||||
* @param purchasePrice 购入价
|
||||
* @param retailPrice 零售价
|
||||
* @param maximumRetailPrice 最高零售价
|
||||
* @param orgId 机构ID
|
||||
* @param instanceTable 关联表
|
||||
* @param instanceId 关联ID
|
||||
*/
|
||||
void addChargeItemDefinitionAndDetail(String chargeName, String typeCode, String ybCode, String unitCode,
|
||||
BigDecimal purchasePrice, BigDecimal retailPrice, BigDecimal maximumRetailPrice, Long orgId,
|
||||
String instanceTable, Long instanceId);
|
||||
}
|
||||
@@ -101,4 +101,19 @@ public interface IChargeItemService extends IService<ChargeItem> {
|
||||
*/
|
||||
List<ChargeItemDefInfo> getChargeItemDefInfoByIds(List<Long> chargeItemIds);
|
||||
|
||||
/**
|
||||
* 根据执行id查询收费项目信息
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 收费项目信息
|
||||
*/
|
||||
List<ChargeItem> getChargeItemByProcedureId(List<Long> procedureIdList);
|
||||
|
||||
/**
|
||||
* 根据执行id列表更新账单状态为:待收费
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
*/
|
||||
void updatePlannedChargeStatus(List<Long> procedureIdList);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.EncounterDiagnosis;
|
||||
import com.openhis.common.enums.ybenums.YbIptDiseTypeCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 就诊诊断管理Service接口
|
||||
*
|
||||
@@ -68,4 +68,15 @@ public interface IEncounterDiagnosisService extends IService<EncounterDiagnosis>
|
||||
* @return 主诊断
|
||||
*/
|
||||
EncounterDiagnosis getMainDiagnosis(List<EncounterDiagnosis> list);
|
||||
|
||||
/**
|
||||
* 根据就诊id定义id等查询就诊诊断
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param conditionDefId 定义id
|
||||
* @param tenantId 租户
|
||||
* @return 查询结果
|
||||
*/
|
||||
EncounterDiagnosis getEncounterDiagnosisByEncounterConDefId(Long encounterId, Long conditionDefId,
|
||||
Integer tenantId);
|
||||
}
|
||||
@@ -1,16 +1,27 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.administration.domain.ChargeItemDefDetail;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.administration.mapper.ChargeItemDefinitionMapper;
|
||||
import com.openhis.administration.service.IChargeItemDefDetailService;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.ConditionCode;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
|
||||
/**
|
||||
* 费用定价管理Service业务层处理
|
||||
@@ -22,6 +33,9 @@ import com.openhis.common.enums.DelFlag;
|
||||
public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefinitionMapper, ChargeItemDefinition>
|
||||
implements IChargeItemDefinitionService {
|
||||
|
||||
@Autowired
|
||||
private IChargeItemDefDetailService chargeItemDefDetailService;
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
@@ -96,4 +110,48 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建费用定价和详情
|
||||
*
|
||||
* @param chargeName 名称
|
||||
* @param typeCode 财务类别
|
||||
* @param ybCode 医保类别
|
||||
* @param unitCode 包装单位
|
||||
* @param purchasePrice 购入价
|
||||
* @param retailPrice 零售价
|
||||
* @param maximumRetailPrice 最高零售价
|
||||
* @param orgId 机构ID
|
||||
* @param instanceTable 关联表
|
||||
* @param instanceId 关联ID
|
||||
*/
|
||||
@Override
|
||||
public void addChargeItemDefinitionAndDetail(String chargeName, String typeCode, String ybCode, String unitCode,
|
||||
BigDecimal purchasePrice, BigDecimal retailPrice, BigDecimal maximumRetailPrice, Long orgId,
|
||||
String instanceTable, Long instanceId) {
|
||||
// 费用定价主表
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition().setChargeName(chargeName)
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setOrgId(orgId).setInstanceTable(instanceTable)
|
||||
.setInstanceId(instanceId).setEffectiveStart(DateUtils.getNowDate()).setTypeCode(typeCode).setYbType(ybCode)
|
||||
.setConditionFlag(Whether.YES.getValue()).setPrice(retailPrice);
|
||||
this.save(chargeItemDefinition);
|
||||
List<ChargeItemDefDetail> chargeItemDefDetailList = new ArrayList<>();
|
||||
// 购入价子表(购入价不一定存在)
|
||||
if (purchasePrice != null) {
|
||||
ChargeItemDefDetail defDetailPurchase =
|
||||
new ChargeItemDefDetail().setDefinitionId(chargeItemDefinition.getId())
|
||||
.setConditionCode(ConditionCode.PURCHASE.getCode()).setAmount(purchasePrice);
|
||||
chargeItemDefDetailList.add(defDetailPurchase);
|
||||
}
|
||||
// 零售价子表
|
||||
ChargeItemDefDetail defDetailRetail = new ChargeItemDefDetail().setDefinitionId(chargeItemDefinition.getId())
|
||||
.setConditionCode(ConditionCode.UNIT.getCode()).setConditionValue(unitCode).setAmount(retailPrice);
|
||||
chargeItemDefDetailList.add(defDetailRetail);
|
||||
// 最高零售价子表
|
||||
ChargeItemDefDetail defDetailMaximumRetail =
|
||||
new ChargeItemDefDetail().setDefinitionId(chargeItemDefinition.getId())
|
||||
.setConditionCode(ConditionCode.LIMIT.getCode()).setAmount(maximumRetailPrice);
|
||||
chargeItemDefDetailList.add(defDetailMaximumRetail);
|
||||
chargeItemDefDetailService.saveBatch(chargeItemDefDetailList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -94,7 +94,8 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
@Override
|
||||
public void updateRefundChargeStatus(List<Long> chargeItemIdList) {
|
||||
baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.REFUNDING.getValue()),
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList));
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList).eq(ChargeItem::getDeleteFlag,
|
||||
DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +108,8 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
public void updatePaymentStatus(List<Long> chargeItemIdList, Integer value) {
|
||||
baseMapper.update(
|
||||
new ChargeItem().setStatusEnum(value).setPerformerId(SecurityUtils.getLoginUser().getPractitionerId()),
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList));
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList).eq(ChargeItem::getDeleteFlag,
|
||||
DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +151,8 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
*/
|
||||
@Override
|
||||
public List<ChargeItem> getChargeItemInfoByReqId(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ChargeItem>().in(ChargeItem::getServiceId, requestIdList));
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ChargeItem>().in(ChargeItem::getServiceId, requestIdList)
|
||||
.eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,4 +176,30 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
public List<ChargeItemDefInfo> getChargeItemDefInfoByIds(List<Long> chargeItemIds) {
|
||||
return baseMapper.getChargeItemDefInfoByIds(chargeItemIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据执行id查询收费项目信息
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 收费项目信息
|
||||
*/
|
||||
@Override
|
||||
public List<ChargeItem> getChargeItemByProcedureId(List<Long> procedureIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ChargeItem>()
|
||||
.in(ChargeItem::getProcedureId, procedureIdList).eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据执行id列表更新账单状态为:待收费
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
*/
|
||||
@Override
|
||||
public void updatePlannedChargeStatus(List<Long> procedureIdList) {
|
||||
for (Long procedureId : procedureIdList) {
|
||||
baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.PLANNED.getValue()),
|
||||
new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getProcedureId, procedureId)
|
||||
.eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.enums.ybenums.YbIptDiseTypeCode;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -16,6 +14,8 @@ import com.openhis.administration.domain.EncounterDiagnosis;
|
||||
import com.openhis.administration.mapper.EncounterDiagnosisMapper;
|
||||
import com.openhis.administration.service.IEncounterDiagnosisService;
|
||||
import com.openhis.clinical.mapper.ConditionMapper;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.enums.ybenums.YbIptDiseTypeCode;
|
||||
|
||||
/**
|
||||
* 就诊诊断管理Service业务层处理
|
||||
@@ -86,6 +86,7 @@ public class EncounterDiagnosisServiceImpl extends ServiceImpl<EncounterDiagnosi
|
||||
|
||||
/**
|
||||
* 查询 EncounterDiagnosis
|
||||
*
|
||||
* @param diaIdList 诊断主键id
|
||||
* @return 诊断集合
|
||||
*/
|
||||
@@ -104,25 +105,41 @@ public class EncounterDiagnosisServiceImpl extends ServiceImpl<EncounterDiagnosi
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterDiagnosis> getDiagnosisList(Long encounterId, YbIptDiseTypeCode ybIptDiseTypeCode) {
|
||||
LambdaQueryWrapper<EncounterDiagnosis> queryWrapper = new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getEncounterId, encounterId);
|
||||
if(ybIptDiseTypeCode!=null){
|
||||
queryWrapper.eq(EncounterDiagnosis::getIptDiseTypeCode,ybIptDiseTypeCode.getValue());
|
||||
LambdaQueryWrapper<EncounterDiagnosis> queryWrapper =
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getEncounterId, encounterId);
|
||||
if (ybIptDiseTypeCode != null) {
|
||||
queryWrapper.eq(EncounterDiagnosis::getIptDiseTypeCode, ybIptDiseTypeCode.getValue());
|
||||
}
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在诊断中筛选主诊断
|
||||
*
|
||||
* @param list 诊断集合
|
||||
* @return 主诊断
|
||||
*/
|
||||
@Override
|
||||
public EncounterDiagnosis getMainDiagnosis(List<EncounterDiagnosis> list) {
|
||||
for (EncounterDiagnosis encounterDiagnosis : list) {
|
||||
if(Whether.YES.getValue()==encounterDiagnosis.getMaindiseFlag()){
|
||||
if (Whether.YES.getValue() == encounterDiagnosis.getMaindiseFlag()) {
|
||||
return encounterDiagnosis;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id定义id等查询就诊诊断
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param conditionDefId 定义id
|
||||
* @param tenantId 租户
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public EncounterDiagnosis getEncounterDiagnosisByEncounterConDefId(Long encounterId, Long conditionDefId,
|
||||
Integer tenantId) {
|
||||
return baseMapper.getEncounterDiagnosisByEncounterConDefId(encounterId, conditionDefId, tenantId);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诊断定义管理Service接口
|
||||
*
|
||||
@@ -36,4 +38,21 @@ public interface IConditionDefinitionService extends IService<ConditionDefinitio
|
||||
* @return 诊断定义集合
|
||||
*/
|
||||
List<ConditionDefinition> getConditionDefinitionListByIds(List<Long> collect);
|
||||
|
||||
/**
|
||||
* 根据名称查询诊断定义
|
||||
*
|
||||
* @param searchKey 目标字符
|
||||
* @return 诊断定义集合
|
||||
*/
|
||||
List<ConditionDefinition> getConditionDefinitionListBySearchKey(String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 诊断定义查询
|
||||
*
|
||||
* @param conditionDefId 诊断定义id
|
||||
* @return 查询结果
|
||||
*/
|
||||
ConditionDefinition getConditionDefinitionListById(Long conditionDefId);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -35,12 +36,14 @@ public interface IProcedureService extends IService<Procedure> {
|
||||
* @param eventStatus 执行状态
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @param exeDate 执行时间
|
||||
* @param groupId 组号
|
||||
* @param refundId 取消执行id
|
||||
* @return 是否成功
|
||||
* @return 执行id
|
||||
*/
|
||||
boolean addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Long groupId, Long refundId);
|
||||
Long addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId,
|
||||
Long refundId);
|
||||
|
||||
/**
|
||||
* 添加药品执行记录
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.mapper.ConditionDefinitionMapper;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -72,4 +78,31 @@ public class ConditionDefinitionServiceImpl extends ServiceImpl<ConditionDefinit
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ConditionDefinition>()
|
||||
.in(ConditionDefinition::getId, collect).eq(ConditionDefinition::getDescription, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称查询诊断定义
|
||||
*
|
||||
* @param searchKey 目标字符
|
||||
* @return 诊断定义集合
|
||||
*/
|
||||
@Override
|
||||
public List<ConditionDefinition> getConditionDefinitionListBySearchKey(String searchKey,
|
||||
HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("condition_code", "name", "py_str", "wb_str")), request);
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 诊断定义查询
|
||||
*
|
||||
* @param conditionDefId 诊断定义id
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public ConditionDefinition getConditionDefinitionListById(Long conditionDefId) {
|
||||
return baseMapper
|
||||
.selectOne(new LambdaQueryWrapper<ConditionDefinition>().eq(ConditionDefinition::getId, conditionDefId));
|
||||
}
|
||||
}
|
||||
@@ -60,14 +60,15 @@ public class ProcedureServiceImpl extends ServiceImpl<ProcedureMapper, Procedure
|
||||
* @param eventStatus 执行状态
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @param exeDate 执行时间
|
||||
* @param groupId 组号
|
||||
* @param refundId 取消执行id
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Long groupId, Long refundId) {
|
||||
Date now = DateUtils.getNowDate();
|
||||
public Long addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId,
|
||||
Long refundId) {
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Procedure procedure = new Procedure();
|
||||
procedure
|
||||
@@ -82,7 +83,7 @@ public class ProcedureServiceImpl extends ServiceImpl<ProcedureMapper, Procedure
|
||||
// 患者id
|
||||
.setPatientId(patientId)
|
||||
// 执行时间
|
||||
.setOccurrenceTime(now)
|
||||
.setOccurrenceTime(exeDate)
|
||||
// 执行状态
|
||||
.setStatusEnum(eventStatus.getValue())
|
||||
// 执行种类
|
||||
@@ -101,10 +102,14 @@ public class ProcedureServiceImpl extends ServiceImpl<ProcedureMapper, Procedure
|
||||
int result = baseMapper.insert(procedure);
|
||||
if (result > 0) {
|
||||
// 添加执行人子表
|
||||
return procedurePerformerService.addPerformRecord(procedure.getId(), now);
|
||||
boolean performerResult = procedurePerformerService.addPerformRecord(procedure.getId(), exeDate);
|
||||
if (!performerResult) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
return procedure.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
package com.openhis.crosssystem.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
@@ -32,6 +22,7 @@ import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.web.util.TenantOptionUtil;
|
||||
import com.openhis.common.utils.CommonUtil;
|
||||
import com.openhis.crosssystem.dto.*;
|
||||
import com.openhis.crosssystem.enums.LisAgeUnit;
|
||||
import com.openhis.crosssystem.enums.PacsAgeUnit;
|
||||
@@ -119,7 +110,7 @@ public class CrossSystemSendApplyUtil {
|
||||
.setSocketTimeout(30000).build();
|
||||
// 创建无视SSL验证的HttpClient
|
||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig)
|
||||
.setSSLSocketFactory(createIgnoreSslSocketFactory()).build();
|
||||
.setSSLSocketFactory(CommonUtil.createIgnoreSslSocketFactory()).build();
|
||||
CloseableHttpResponse response = null;
|
||||
// 发起HTTP请求
|
||||
try {
|
||||
@@ -221,7 +212,7 @@ public class CrossSystemSendApplyUtil {
|
||||
.setSocketTimeout(30000).build();
|
||||
// 创建无视SSL验证的HttpClient
|
||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig)
|
||||
.setSSLSocketFactory(createIgnoreSslSocketFactory()).build();
|
||||
.setSSLSocketFactory(CommonUtil.createIgnoreSslSocketFactory()).build();
|
||||
CloseableHttpResponse response = null;
|
||||
// 发起HTTP请求
|
||||
try {
|
||||
@@ -255,35 +246,4 @@ public class CrossSystemSendApplyUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建无视SSL验证的SSLSocketFactory
|
||||
*/
|
||||
private static SSLConnectionSocketFactory createIgnoreSslSocketFactory() {
|
||||
try {
|
||||
// 创建信任所有证书的TrustManager
|
||||
X509TrustManager trustAllCert = new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) {}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) {}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化SSLContext
|
||||
SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
sslContext.init(null, new TrustManager[] {trustAllCert}, new SecureRandom());
|
||||
|
||||
// 创建不验证主机名的SocketFactory
|
||||
return new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE // 关键:禁用主机名验证
|
||||
);
|
||||
} catch (NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new RuntimeException("SSL配置失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,5 +45,10 @@ public class DocStatisticsDefinition extends HisBaseEntity {
|
||||
单位
|
||||
*/
|
||||
private String unit;
|
||||
/** 字典名称 */
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
private String dictType;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ import lombok.experimental.Accessors;
|
||||
@TableName("doc_statistics_definition_option")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
/**
|
||||
* 统计定义选项 已作废
|
||||
*/
|
||||
public class DocStatisticsDefinitionOption extends HisBaseEntity {
|
||||
private Long id;
|
||||
/*
|
||||
|
||||
@@ -123,4 +123,7 @@ public class MedicationDispense extends HisBaseEntity {
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 执行id */
|
||||
private Long procedureId;
|
||||
}
|
||||
|
||||
@@ -233,4 +233,10 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
* 签发编码
|
||||
*/
|
||||
private String signCode;
|
||||
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.openhis.medication.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 药品发放管理Service接口
|
||||
@@ -24,6 +24,14 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
*/
|
||||
void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 医嘱执行生成药品发放,状态为待配药
|
||||
*
|
||||
* @param medicationRequest 药品医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
*/
|
||||
void generateMedicationDispense(MedicationRequest medicationRequest,Long procedureId);
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
*
|
||||
@@ -68,6 +76,7 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> selectByRequestIdList(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* 通过id获取药品发放信息
|
||||
*
|
||||
@@ -82,4 +91,12 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> medDispenseId);
|
||||
|
||||
/**
|
||||
* 通过执行id获取药品发放信息
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> getMedDispenseByProcedureId(List<Long> procedureIdList);
|
||||
}
|
||||
@@ -105,6 +105,69 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行生成药品发放,状态为待配药
|
||||
*
|
||||
* @param medicationRequest 药品医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
*/
|
||||
@Override
|
||||
public void generateMedicationDispense(MedicationRequest medicationRequest, Long procedureId) {
|
||||
MedicationDispense medicationDispense = new MedicationDispense();
|
||||
// 执行id
|
||||
medicationDispense.setProcedureId(procedureId);
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatus.PREPARATION.getValue());
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药类型
|
||||
medicationDispense.setDispenseEnum(medicationRequest.getCategoryEnum());
|
||||
// 药品编码
|
||||
medicationDispense.setMedicationId(medicationRequest.getMedicationId());
|
||||
// 请求数量
|
||||
medicationDispense.setQuantity(medicationRequest.getQuantity());
|
||||
// 请求单位编码
|
||||
medicationDispense.setUnitCode(medicationRequest.getUnitCode());
|
||||
// 产品批号
|
||||
medicationDispense.setLotNumber(medicationRequest.getLotNumber());
|
||||
// 患者id
|
||||
medicationDispense.setPatientId(medicationRequest.getPatientId());
|
||||
// 就诊id
|
||||
medicationDispense.setEncounterId(medicationRequest.getEncounterId());
|
||||
// 支持用药信息
|
||||
medicationDispense.setSupportInfo(medicationRequest.getSupportInfo());
|
||||
// 发药人
|
||||
medicationDispense.setPractitionerId(medicationRequest.getPractitionerId());
|
||||
// 发放药房
|
||||
medicationDispense.setLocationId(medicationRequest.getPerformLocation());
|
||||
// 药品请求id
|
||||
medicationDispense.setMedReqId(medicationRequest.getId());
|
||||
// 已发药数量
|
||||
medicationDispense.setDispenseQuantity(BigDecimal.ZERO);
|
||||
// 用法
|
||||
medicationDispense.setMethodCode(medicationRequest.getMethodCode());
|
||||
// 用药频次
|
||||
medicationDispense.setFrequencyCode(medicationRequest.getRateCode());
|
||||
// 单次剂量
|
||||
medicationDispense.setDose(medicationRequest.getDose());
|
||||
// 剂量单位
|
||||
medicationDispense.setDoseUnitCode(medicationRequest.getDoseUnitCode());
|
||||
// 单次最大剂量
|
||||
medicationDispense.setMaxUnit(medicationRequest.getMaxDose());
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加12小时
|
||||
LocalDateTime newTime = now.plusHours(12);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
medicationDispense.setLimitTime(limitTime);
|
||||
|
||||
baseMapper.insert(medicationDispense);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
*
|
||||
@@ -209,4 +272,17 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getId, medDispenseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过执行id获取药品发放信息
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationDispense> getMedDispenseByProcedureId(List<Long> procedureIdList) {
|
||||
return baseMapper.selectList(
|
||||
new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getProcedureId, procedureIdList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,17 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 器材发放管理Entity实体
|
||||
*
|
||||
@@ -36,9 +37,10 @@ public class DeviceDispense extends HisBaseEntity {
|
||||
/** 器材发放状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
// 暂时不要用
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
// 暂时不要用
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
@@ -111,4 +113,6 @@ public class DeviceDispense extends HisBaseEntity {
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 执行id */
|
||||
private Long procedureId;
|
||||
}
|
||||
|
||||
@@ -165,4 +165,9 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,8 @@ import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -71,6 +70,12 @@ public class ElepMedicationRequest extends HisBaseEntity {
|
||||
/** 诊断id */
|
||||
private Long conditionId;
|
||||
|
||||
/** 诊断id */
|
||||
private Long conditionDefId;
|
||||
|
||||
/** 慢病字段 */
|
||||
private String opspDiseCode;
|
||||
|
||||
/** 有效天数 */
|
||||
private Integer validityDays;
|
||||
|
||||
@@ -100,7 +105,7 @@ public class ElepMedicationRequest extends HisBaseEntity {
|
||||
/** 调配药师 */
|
||||
private Long dispensingDrId;
|
||||
|
||||
/** 发药药师*/
|
||||
/** 发药药师 */
|
||||
private Long issuingDrId;
|
||||
|
||||
/** 延长原因 */
|
||||
|
||||
@@ -5,14 +5,9 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 器材发放管理Service接口
|
||||
@@ -48,9 +43,10 @@ public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
List<DeviceDispense> selectDeviceDispenseByBasedOnId(Long basedOnId);
|
||||
List<DeviceDispense> getDevDispenseByProcedureId(List<Long> procedureIdList);
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
@@ -111,12 +107,4 @@ public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
* @param devDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> devDispenseId);
|
||||
|
||||
/**
|
||||
* 通过id获取耗材发放信息
|
||||
*
|
||||
* @param idList 发放id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<DeviceDispense> selectByIdList(@Param("idList") List<Long> idList);
|
||||
}
|
||||
|
||||
@@ -8,10 +8,6 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -19,9 +15,9 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DbOpType;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
@@ -124,13 +120,14 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> selectDeviceDispenseByBasedOnId(Long basedOnId) {
|
||||
return (baseMapper
|
||||
.selectList(new LambdaQueryWrapper<DeviceDispense>().eq(DeviceDispense::getBasedOnId, basedOnId)
|
||||
.eq(DeviceDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue())));
|
||||
public List<DeviceDispense> getDevDispenseByProcedureId(List<Long> procedureIdList) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getProcedureId, procedureIdList)
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,10 +144,10 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
String step, BigDecimal quantity) {
|
||||
// 服务请求编码
|
||||
deviceDispense.setBusNo(deviceDispense.getBusNo() + "." + step);
|
||||
// 请求基于什么
|
||||
deviceDispense.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE);
|
||||
// 请求基于什么的ID
|
||||
deviceDispense.setBasedOnId(deviceDispense.getId());
|
||||
// // 请求基于什么
|
||||
// deviceDispense.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE);
|
||||
// // 请求基于什么的ID
|
||||
// deviceDispense.setBasedOnId(deviceDispense.getId());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(quantity);
|
||||
// 状态
|
||||
@@ -258,17 +255,4 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
.in(DeviceDispense::getId, devDispenseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取耗材发放信息
|
||||
*
|
||||
* @param idList 发放id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> selectByIdList(@Param("idList") List<Long> idList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getId, idList)
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,17 +3,15 @@ package com.openhis.workflow.service.impl;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
@@ -93,11 +91,10 @@ public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper,
|
||||
public boolean supplyDeliveryValidation(List<Long> supplyReqIdList) {
|
||||
|
||||
// 根据请求id查询发放状态
|
||||
List<SupplyDelivery> deliveryList = baseMapper
|
||||
.selectList(new LambdaQueryWrapper<SupplyDelivery>().in(SupplyDelivery::getRequestId, supplyReqIdList));
|
||||
List<SupplyDelivery> deliveryList = baseMapper.selectList(new LambdaQueryWrapper<SupplyDelivery>()
|
||||
.eq(SupplyDelivery::getDeleteFlag, DelFlag.NO.getCode()).in(SupplyDelivery::getRequestId, supplyReqIdList));
|
||||
if (!deliveryList.isEmpty()) {
|
||||
List<Integer> deliveryStatusList =
|
||||
deliveryList.stream().map(SupplyDelivery::getStatusEnum).collect(Collectors.toList());
|
||||
List<Integer> deliveryStatusList = deliveryList.stream().map(SupplyDelivery::getStatusEnum).toList();
|
||||
return deliveryStatusList.stream().anyMatch(x -> x.equals(DispenseStatus.COMPLETED.getValue()));
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -41,7 +40,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByBusNo(String busNo) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,9 +51,11 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
* @return 单据信息
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByOriginalBusNo(String originalBusNo){
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getOriginalBusNo, originalBusNo));
|
||||
public List<SupplyRequest> getSupplyByOriginalBusNo(String originalBusNo) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getOriginalBusNo, originalBusNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
@@ -81,14 +83,14 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> addOriginalBusNo(String busNo,String originalBusNo){
|
||||
public List<SupplyRequest> addOriginalBusNo(String busNo, String originalBusNo) {
|
||||
// 更新单据状态
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getOriginalBusNo, originalBusNo));
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getOriginalBusNo, originalBusNo));
|
||||
// 返回单据详情
|
||||
return this.getSupplyByBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将原始单据号信息的原始单据号删除
|
||||
*
|
||||
@@ -97,9 +99,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public boolean updateByBusNo(String busNo) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getOriginalBusNo, ""));
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getOriginalBusNo, ""));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -110,12 +111,13 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public boolean updateStatusEnumByBusNo(String busNo){
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
public boolean updateStatusEnumByBusNo(String busNo) {
|
||||
int updateCount =
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.EXPIRED_INVALIDATED.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
@@ -145,6 +147,7 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单据
|
||||
*
|
||||
@@ -152,12 +155,12 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean removeByBusNo(String busNo){
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getDeleteFlag,DelFlag.YES.getCode() ));
|
||||
public boolean removeByBusNo(String busNo) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getDeleteFlag, DelFlag.YES.getCode()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回申请
|
||||
*
|
||||
@@ -234,7 +237,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
@Override public boolean deleteRequest(String busNo) {
|
||||
@Override
|
||||
public boolean deleteRequest(String busNo) {
|
||||
// 更新单据状态
|
||||
int deleteCount = baseMapper.delete(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
|
||||
@@ -246,19 +250,22 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*
|
||||
* @param supplyRequestIdList 供应申请id列表
|
||||
*/
|
||||
@Override public void updateCompletedStatusBatch(List<Long> supplyRequestIdList) {
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> supplyRequestIdList) {
|
||||
baseMapper.update(new SupplyRequest().setStatusEnum(SupplyStatus.AGREE.getValue())
|
||||
.setApproverId(SecurityUtils.getLoginUser().getPractitionerId()).setApprovalTime(DateUtils.getNowDate()),
|
||||
.setApproverId(SecurityUtils.getLoginUser().getPractitionerId()).setApprovalTime(DateUtils.getNowDate()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().in(SupplyRequest::getId, supplyRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id,获取供应申请列表
|
||||
*
|
||||
* @param requestIdList id列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
@Override public List<SupplyRequest> selectByIdList(List<Long> requestIdList){
|
||||
return baseMapper.selectList( new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getId, requestIdList)
|
||||
@Override
|
||||
public List<SupplyRequest> selectByIdList(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getId, requestIdList)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,320 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.yb.dto;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【3511】返回结果
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Data
|
||||
public class MedicalInventory3511Output {
|
||||
/**
|
||||
* 有效期止
|
||||
* 类型:日期型,格式yyyy-MM-dd
|
||||
*/
|
||||
@JSONField(name = "expyEnd", format = "yyyy-MM-dd")
|
||||
private Date expyEnd;
|
||||
|
||||
/**
|
||||
* 药师证件类型
|
||||
* 类型:字符型,长度3,非空
|
||||
*/
|
||||
@JSONField(name = "pharCertType")
|
||||
private String pharCertType;
|
||||
|
||||
/**
|
||||
* 销售/退货经办人姓名
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "selRetnOpterName")
|
||||
private String selRetnOpterName;
|
||||
|
||||
/**
|
||||
* 医疗目录编码
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "medListCodg")
|
||||
private String medListCodg;
|
||||
|
||||
/**
|
||||
* 统筹区编号
|
||||
* 类型:字符型,长度6
|
||||
*/
|
||||
@JSONField(name = "poolareaNo")
|
||||
private String poolareaNo;
|
||||
|
||||
/**
|
||||
* 结算ID
|
||||
* 类型:字符型,长度30
|
||||
*/
|
||||
@JSONField(name = "setlId")
|
||||
private String setlId;
|
||||
|
||||
/**
|
||||
* 创建机构编号
|
||||
* 类型:字符型,长度20
|
||||
*/
|
||||
@JSONField(name = "crteOptinsNo")
|
||||
private String crteOptinsNo;
|
||||
|
||||
/**
|
||||
* 医药机构目录编码
|
||||
* 类型:字符型,长度150
|
||||
*/
|
||||
@JSONField(name = "medinsListCodg")
|
||||
private String medinsListCodg;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
* 类型:字符型,长度500
|
||||
*/
|
||||
@JSONField(name = "memo")
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 数据更新时间
|
||||
* 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "updtTime", format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updtTime;
|
||||
|
||||
/**
|
||||
* 医保费用结算类型
|
||||
* 类型:字符型,长度6,非空
|
||||
*/
|
||||
@JSONField(name = "hiFeesetlType")
|
||||
private String hiFeesetlType;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
* 类型:日期型,格式yyyy-MM-dd
|
||||
*/
|
||||
@JSONField(name = "manuDate", format = "yyyy-MM-dd")
|
||||
private Date manuDate;
|
||||
|
||||
/**
|
||||
* 经办人姓名
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "opterName")
|
||||
private String opterName;
|
||||
|
||||
/**
|
||||
* 人员编号
|
||||
* 类型:字符型,长度30
|
||||
*/
|
||||
@JSONField(name = "psnNo")
|
||||
private String psnNo;
|
||||
|
||||
/**
|
||||
* 数据唯一记录号
|
||||
* 类型:字符型,长度40
|
||||
*/
|
||||
@JSONField(name = "rid")
|
||||
private String rid;
|
||||
|
||||
/**
|
||||
* 数据创建时间
|
||||
* 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "crteTime", format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date crteTime;
|
||||
|
||||
/**
|
||||
* 药师证件号码
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "pharCertno")
|
||||
private String pharCertno;
|
||||
|
||||
/**
|
||||
* 有效标志
|
||||
* 类型:字符型,长度3,非空
|
||||
*/
|
||||
@JSONField(name = "valiFlag")
|
||||
private String valiFlag;
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
* 类型:字符型,长度600
|
||||
*/
|
||||
@JSONField(name = "certno")
|
||||
private String certno;
|
||||
|
||||
/**
|
||||
* 定点医药机构编号
|
||||
* 类型:字符型,长度30
|
||||
*/
|
||||
@JSONField(name = "fixmedinsCode")
|
||||
private String fixmedinsCode;
|
||||
|
||||
/**
|
||||
* 处方药标志
|
||||
* 类型:字符型,长度3,非空
|
||||
*/
|
||||
@JSONField(name = "rxFlag")
|
||||
private String rxFlag;
|
||||
|
||||
/**
|
||||
* 药师执业资格证号
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "pharPracCertNo")
|
||||
private String pharPracCertNo;
|
||||
|
||||
/**
|
||||
* 目录特项标志
|
||||
* 类型:字符型,长度3,非空
|
||||
*/
|
||||
@JSONField(name = "listSpItemFlag")
|
||||
private String listSpItemFlag;
|
||||
|
||||
/**
|
||||
* 定点医药机构批次流水号
|
||||
* 类型:字符型,长度30
|
||||
*/
|
||||
@JSONField(name = "fixmedinsBchno")
|
||||
private String fixmedinsBchno;
|
||||
|
||||
/**
|
||||
* 经办时间
|
||||
* 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "optTime", format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date optTime;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "psnName")
|
||||
private String psnName;
|
||||
|
||||
/**
|
||||
* 电子监管编码
|
||||
* 类型:字符型,长度20
|
||||
*/
|
||||
@JSONField(name = "elecSupnCodg")
|
||||
private String elecSupnCodg;
|
||||
|
||||
/**
|
||||
* 开单医师姓名
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "bilgDrName")
|
||||
private String bilgDrName;
|
||||
|
||||
/**
|
||||
* 经办人ID
|
||||
* 类型:字符型,长度20
|
||||
*/
|
||||
@JSONField(name = "opterId")
|
||||
private String opterId;
|
||||
|
||||
/**
|
||||
* 生产批号
|
||||
* 类型:字符型,长度30
|
||||
*/
|
||||
@JSONField(name = "manuLotnum")
|
||||
private String manuLotnum;
|
||||
|
||||
/**
|
||||
* 医药机构目录名称
|
||||
* 类型:字符型,长度100
|
||||
*/
|
||||
@JSONField(name = "medinsListName")
|
||||
private String medinsListName;
|
||||
|
||||
/**
|
||||
* 人员证件类型
|
||||
* 类型:字符型,长度6,非空
|
||||
*/
|
||||
@JSONField(name = "psnCertType")
|
||||
private String psnCertType;
|
||||
|
||||
/**
|
||||
* 销售/退货时间
|
||||
* 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "selRetnTime", format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date selRetnTime;
|
||||
|
||||
/**
|
||||
* 销售/退货数量
|
||||
* 类型:数值型,长度16,2(16位数字,其中2位小数)
|
||||
*/
|
||||
@JSONField(name = "selRetnCnt")
|
||||
private BigDecimal selRetnCnt;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "crterName")
|
||||
private String crterName;
|
||||
|
||||
/**
|
||||
* 药师姓名
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "pharName")
|
||||
private String pharName;
|
||||
|
||||
/**
|
||||
* 开单医师证件类型
|
||||
* 类型:字符型,长度3,非空
|
||||
*/
|
||||
@JSONField(name = "prscDrCertType")
|
||||
private String prscDrCertType;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
* 类型:字符型,长度20
|
||||
*/
|
||||
@JSONField(name = "crterId")
|
||||
private String crterId;
|
||||
|
||||
/**
|
||||
* 开单医师证件号码
|
||||
* 类型:字符型,长度50
|
||||
*/
|
||||
@JSONField(name = "prscDrCertno")
|
||||
private String prscDrCertno;
|
||||
|
||||
/**
|
||||
* 经办机构编号
|
||||
* 类型:字符型,长度20
|
||||
*/
|
||||
@JSONField(name = "optinsNo")
|
||||
private String optinsNo;
|
||||
|
||||
/**
|
||||
* 拆零标志
|
||||
* 类型:字符型,长度3,非空
|
||||
*/
|
||||
@JSONField(name = "trdnFlag")
|
||||
private String trdnFlag;
|
||||
|
||||
/**
|
||||
* 最终成交单价
|
||||
* 类型:数值型,长度16,6(16位数字,其中6位小数)
|
||||
*/
|
||||
@JSONField(name = "finlTrnsPric")
|
||||
private BigDecimal finlTrnsPric;
|
||||
|
||||
/**
|
||||
* 定点医药机构商品销售流水号
|
||||
* 类型:字符型,长度30
|
||||
*/
|
||||
@JSONField(name = "medinsProdSelNo")
|
||||
private String medinsProdSelNo;
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.yb.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 【3511】
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MedicalInventory3511Param {
|
||||
/**
|
||||
* 定点医药机构编号 类型:字符型,长度30,必填项
|
||||
*/
|
||||
@JSONField(name = "fixmedins_code")
|
||||
private String fixmedinsCode;
|
||||
|
||||
/**
|
||||
* 医药机构目录编码 类型:字符型,长度150,必填项(与定点医药机构批次流水号二选一)
|
||||
*/
|
||||
@JSONField(name = "medins_list_codg")
|
||||
private String medinsListCodg;
|
||||
|
||||
/**
|
||||
* 定点医药机构批次流水号 类型:字符型,长度30,必填项(与医药机构目录编码二选一)
|
||||
*/
|
||||
@JSONField(name = "fixmedins_bchno")
|
||||
private String fixmedinsBchno;
|
||||
|
||||
/**
|
||||
* 开始日期 类型:日期型,格式yyyy-MM-dd,必填项
|
||||
*/
|
||||
@JSONField(name = "begndate", format = "yyyy-MM-dd")
|
||||
private Date begndate;
|
||||
|
||||
/**
|
||||
* 结束日期 类型:日期型,格式yyyy-MM-dd,必填项
|
||||
*/
|
||||
@JSONField(name = "enddate", format = "yyyy-MM-dd")
|
||||
private Date enddate;
|
||||
|
||||
/**
|
||||
* 定点医药机构商品销售流水号 类型:字符型,长度30,非必填
|
||||
*/
|
||||
@JSONField(name = "medins_prod_sel_no")
|
||||
private String medinsProdSelNo;
|
||||
|
||||
/**
|
||||
* 医疗目录编码 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "med_list_codg")
|
||||
private String medListCodg;
|
||||
|
||||
/**
|
||||
* 医药机构目录名称 类型:字符型,长度100,非必填
|
||||
*/
|
||||
@JSONField(name = "medins_list_name")
|
||||
private String medinsListName;
|
||||
|
||||
/**
|
||||
* 开单医师证件类型 类型:字符型,长度3,非必填
|
||||
*/
|
||||
@JSONField(name = "prsc_dr_cert_type")
|
||||
private String prscDrCertType;
|
||||
|
||||
/**
|
||||
* 开单医师证件号码 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "prsc_dr_certno")
|
||||
private String prscDrCertno;
|
||||
|
||||
/**
|
||||
* 开单医师姓名 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "bilg_dr_name")
|
||||
private String bilgDrName;
|
||||
|
||||
/**
|
||||
* 药师证件类型 类型:字符型,长度3,非必填
|
||||
*/
|
||||
@JSONField(name = "phar_cert_type")
|
||||
private String pharCertType;
|
||||
|
||||
/**
|
||||
* 药师证件号码 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "phar_certno")
|
||||
private String pharCertno;
|
||||
|
||||
/**
|
||||
* 药师姓名 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "phar_name")
|
||||
private String pharName;
|
||||
|
||||
/**
|
||||
* 药师执业资格证号 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "phar_prac_cert_no")
|
||||
private String pharPracCertNo;
|
||||
|
||||
/**
|
||||
* 医保费用结算类型 类型:字符型,长度6,必填项
|
||||
*/
|
||||
@JSONField(name = "hi_feesetl_type")
|
||||
private String hiFeesetlType;
|
||||
|
||||
/**
|
||||
* 结算ID 类型:字符型,长度30,非必填
|
||||
*/
|
||||
@JSONField(name = "setl_id")
|
||||
private String setlId;
|
||||
|
||||
/**
|
||||
* 人员编号 类型:字符型,长度30,非必填
|
||||
*/
|
||||
@JSONField(name = "psn_no")
|
||||
private String psnNo;
|
||||
|
||||
/**
|
||||
* 人员证件类型 类型:字符型,长度6,必填项
|
||||
*/
|
||||
@JSONField(name = "psn_cert_type")
|
||||
private String psnCertType;
|
||||
|
||||
/**
|
||||
* 证件号码 类型:字符型,长度600,非必填
|
||||
*/
|
||||
@JSONField(name = "certno")
|
||||
private String certno;
|
||||
|
||||
/**
|
||||
* 人员姓名 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "psn_name")
|
||||
private String psnName;
|
||||
|
||||
/**
|
||||
* 生产批号 类型:字符型,长度30,非必填
|
||||
*/
|
||||
@JSONField(name = "manu_lotnum")
|
||||
private String manuLotnum;
|
||||
|
||||
/**
|
||||
* 生产日期 类型:日期型,格式yyyy-MM-dd,非必填
|
||||
*/
|
||||
@JSONField(name = "manu_date", format = "yyyy-MM-dd")
|
||||
private Date manuDate;
|
||||
|
||||
/**
|
||||
* 有效期止 类型:日期型,格式yyyy-MM-dd,非必填
|
||||
*/
|
||||
@JSONField(name = "expy_end", format = "yyyy-MM-dd")
|
||||
private Date expyEnd;
|
||||
|
||||
/**
|
||||
* 电子监管编码 类型:字符型,长度20,非必填
|
||||
*/
|
||||
@JSONField(name = "elec_supn_codg")
|
||||
private String elecSupnCodg;
|
||||
|
||||
/**
|
||||
* 处方药标志 类型:字符型,长度3,必填项
|
||||
*/
|
||||
@JSONField(name = "rx_flag")
|
||||
private String rxFlag;
|
||||
|
||||
/**
|
||||
* 目录特项标志 类型:字符型,长度3,必填项
|
||||
*/
|
||||
@JSONField(name = "list_sp_item_flag")
|
||||
private String listSpItemFlag;
|
||||
|
||||
/**
|
||||
* 拆零标志 类型:字符型,长度3,必填项
|
||||
*/
|
||||
@JSONField(name = "trdn_flag")
|
||||
private String trdnFlag;
|
||||
|
||||
/**
|
||||
* 销售/退货时间 类型:日期时间型,格式yyyy-MM-dd HH:mm:ss,非必填
|
||||
*/
|
||||
@JSONField(name = "sel_retn_time", format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date selRetnTime;
|
||||
|
||||
/**
|
||||
* 销售/退货经办人姓名 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "sel_retn_opter_name")
|
||||
private String selRetnOpterName;
|
||||
|
||||
/**
|
||||
* 备注 类型:字符型,长度500,非必填
|
||||
*/
|
||||
@JSONField(name = "memo")
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 有效标志 类型:字符型,长度3,必填项
|
||||
*/
|
||||
@JSONField(name = "vali_flag")
|
||||
private String valiFlag;
|
||||
|
||||
/**
|
||||
* 数据唯一记录号 类型:字符型,长度40,非必填
|
||||
*/
|
||||
@JSONField(name = "rid")
|
||||
private String rid;
|
||||
|
||||
/**
|
||||
* 创建人ID 类型:字符型,长度20,非必填
|
||||
*/
|
||||
@JSONField(name = "crter_id")
|
||||
private String crterId;
|
||||
|
||||
/**
|
||||
* 创建人姓名 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "crter_name")
|
||||
private String crterName;
|
||||
|
||||
/**
|
||||
* 创建机构编号 类型:字符型,长度20,非必填
|
||||
*/
|
||||
@JSONField(name = "crte_optins_no")
|
||||
private String crteOptinsNo;
|
||||
|
||||
/**
|
||||
* 经办人ID 类型:字符型,长度20,非必填
|
||||
*/
|
||||
@JSONField(name = "opter_id")
|
||||
private String opterId;
|
||||
|
||||
/**
|
||||
* 经办人姓名 类型:字符型,长度50,非必填
|
||||
*/
|
||||
@JSONField(name = "opter_name")
|
||||
private String opterName;
|
||||
|
||||
/**
|
||||
* 经办机构编号 类型:字符型,长度20,非必填
|
||||
*/
|
||||
@JSONField(name = "optins_no")
|
||||
private String optinsNo;
|
||||
|
||||
/**
|
||||
* 统筹区编号 类型:字符型,长度6,非必填
|
||||
*/
|
||||
@JSONField(name = "poolarea_no")
|
||||
private String poolareaNo;
|
||||
}
|
||||
@@ -22,4 +22,10 @@ public class PaymentDecDetailUniAccountDto extends PaymentRecDetail {
|
||||
|
||||
// 医疗费用总额
|
||||
private String medfeeSumamt;
|
||||
|
||||
// 医疗费用总额(有退费)
|
||||
private String returnMedfeeSumamt;
|
||||
|
||||
// 门诊还是住院
|
||||
private Integer kindEnum;
|
||||
}
|
||||
|
||||
@@ -1305,6 +1305,14 @@ public class YbDao {
|
||||
public List<Settlement3201DetailDto> reconcileGeneralLedgerDetail(Settlement3201WebParam settlement3201WebParam) {
|
||||
// 获取条件
|
||||
String clrType = settlement3201WebParam.getClrType();// 住院 or 门诊
|
||||
Integer kindEnum;
|
||||
if (clrType.equals(YbClrType.OUTPATIENT_CLINIC.getValue())) {
|
||||
kindEnum = PaymentKind.OUTPATIENT_CLINIC.getValue();
|
||||
} else if (clrType.equals(YbClrType.INPATIENT_CARE.getValue())) {
|
||||
kindEnum = PaymentKind.INPATIENT_CLINIC.getValue();
|
||||
} else {
|
||||
throw new ServiceException("请选择门诊或住院");
|
||||
}
|
||||
String contractNo = settlement3201WebParam.getContractNo();// 省市医保
|
||||
String insuType = settlement3201WebParam.getInsuType();// 职工 or 居民保险
|
||||
String stmtBegnDate = settlement3201WebParam.getStmtBegnDate();// 开始时间
|
||||
@@ -1400,16 +1408,16 @@ public class YbDao {
|
||||
continue;
|
||||
}
|
||||
// 分住院门诊
|
||||
Map<String, List<PaymentDecDetailUniAccountDto>> paymentDecDetailUniAccountDtoMapGroupByMedType =
|
||||
Map<Integer, List<PaymentDecDetailUniAccountDto>> paymentDecDetailUniAccountDtoMapGroupByMedType =
|
||||
stringListEntry.getValue().stream()
|
||||
.collect(Collectors.groupingBy(PaymentDecDetailUniAccountDto::getMedType));
|
||||
for (Map.Entry<String,
|
||||
.collect(Collectors.groupingBy(PaymentDecDetailUniAccountDto::getKindEnum));
|
||||
for (Map.Entry<Integer,
|
||||
List<PaymentDecDetailUniAccountDto>> listEntry : paymentDecDetailUniAccountDtoMapGroupByMedType
|
||||
.entrySet()) {
|
||||
if (listEntry.getValue().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (!StringUtils.isEmpty(clrType) && !listEntry.getKey().equals(clrType)) {
|
||||
if (!StringUtils.isEmpty(clrType) && !listEntry.getKey().equals(kindEnum)) {
|
||||
continue;
|
||||
}
|
||||
// 分职工居民
|
||||
@@ -1425,17 +1433,31 @@ public class YbDao {
|
||||
int count = 0;
|
||||
settlement3201Dto = new Settlement3201DetailDto();
|
||||
settlement3201Dto.setContractNo(stringListEntry.getKey())
|
||||
.setInsutype(Integer.parseInt(entry.getKey())).setClrType(listEntry.getKey());
|
||||
.setInsutype(Integer.parseInt(entry.getKey()));
|
||||
if (PaymentKind.OUTPATIENT_CLINIC.getValue() == listEntry.getKey()) {
|
||||
settlement3201Dto.setClrType(YbClrType.OUTPATIENT_CLINIC.getValue());
|
||||
} else if (PaymentKind.INPATIENT_CLINIC.getValue() == listEntry.getKey()) {
|
||||
settlement3201Dto.setClrType(YbClrType.INPATIENT_CARE.getValue());
|
||||
}
|
||||
for (PaymentDecDetailUniAccountDto paymentDecDetailUniAccountDto : entry.getValue()) {
|
||||
if (YbPayment.YB_FUND_PAY.getValue().equals(paymentDecDetailUniAccountDto.getPayEnum())) {
|
||||
// 基金支付
|
||||
settlement3201Dto.setFundPaySumAmt(
|
||||
paymentDecDetailUniAccountDto.getAmount().add(settlement3201Dto.getFundPaySumAmt()));
|
||||
// 合计医疗费用
|
||||
settlement3201Dto
|
||||
.setMedFeeSumAmt(new BigDecimal(paymentDecDetailUniAccountDto.getMedfeeSumamt() == null
|
||||
? "0.0" : paymentDecDetailUniAccountDto.getMedfeeSumamt())
|
||||
.add(settlement3201Dto.getMedFeeSumAmt()));
|
||||
if (BigDecimal.ZERO.compareTo(paymentDecDetailUniAccountDto.getAmount()) >= 0
|
||||
&& paymentDecDetailUniAccountDto.getReturnMedfeeSumamt() != null) {
|
||||
// 合计医疗费用
|
||||
settlement3201Dto.setMedFeeSumAmt(
|
||||
new BigDecimal(paymentDecDetailUniAccountDto.getReturnMedfeeSumamt() == null ? "0.0"
|
||||
: paymentDecDetailUniAccountDto.getReturnMedfeeSumamt())
|
||||
.add(settlement3201Dto.getMedFeeSumAmt()));
|
||||
} else {
|
||||
// 合计医疗费用
|
||||
settlement3201Dto.setMedFeeSumAmt(
|
||||
new BigDecimal(paymentDecDetailUniAccountDto.getMedfeeSumamt() == null ? "0.0"
|
||||
: paymentDecDetailUniAccountDto.getMedfeeSumamt())
|
||||
.add(settlement3201Dto.getMedFeeSumAmt()));
|
||||
}
|
||||
count++;
|
||||
}
|
||||
if (YbPayment.SELF_YB_ZH_PAY.getValue().equals(paymentDecDetailUniAccountDto.getPayEnum())) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.openhis.financial.service.impl.ContractServiceImpl;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
@@ -69,6 +70,8 @@ public class YbHttpUtils {
|
||||
IContractService iContractService;
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(YbHttpUtils.class);
|
||||
@Autowired
|
||||
private ContractServiceImpl contractServiceImpl;
|
||||
|
||||
public Info1101Output getPerInfo(Info1101ReadcardParam readcard) {
|
||||
// 声明参数
|
||||
@@ -397,17 +400,13 @@ public class YbHttpUtils {
|
||||
public Result reconcileGeneralLedger(Financial3201Param financial3201Param) {
|
||||
|
||||
// 此处先查询到合同并回填给入参对象
|
||||
List<Contract> redisContractList = iContractService.getContractListByYb();
|
||||
Contract contract;
|
||||
Optional<Contract> max = redisContractList.stream().max(Comparator.comparingInt(Contract::getSort));
|
||||
if (max.isPresent()) {
|
||||
contract = max.get();
|
||||
} else {
|
||||
throw new ServiceException("没有对合同进行优先级排序");
|
||||
Contract contract=iContractService.getContract(financial3201Param.getSetlOptins());
|
||||
if(contract==null){
|
||||
throw new ServiceException("未查询到合同信息");
|
||||
}
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/reconcile",
|
||||
financial3201Param, contract);
|
||||
financial3201Param,contract);
|
||||
|
||||
// 赋值(上述回填的两个参数医保不要,为了避免麻烦,在发送http后进行回填)
|
||||
financial3201Param.setFixmedinsCode(contract.getFixmedinsCode());
|
||||
@@ -474,7 +473,7 @@ public class YbHttpUtils {
|
||||
public String applyFinancialClearing(Financial3203AParam financial3203AParam) {
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/apply-clearing",
|
||||
financial3203AParam, null);
|
||||
financial3203AParam, iContractService.getContract(financial3203AParam.getClrOptins()));
|
||||
if (StringUtils.isEmpty(s)) {
|
||||
throw new ServiceException("未接收到医保返回参数");
|
||||
}
|
||||
@@ -644,6 +643,35 @@ public class YbHttpUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
public MedicalInventory3511Output querySalesInfo(MedicalInventory3511Param medicalInventory3511Param) {
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/query-3511-info",
|
||||
medicalInventory3511Param, null);
|
||||
if (StringUtils.isEmpty(s)) {
|
||||
throw new ServiceException("未接收到医保返回参数");
|
||||
}
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
try {
|
||||
result = mapper.readValue(s, Result.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 转业务参数
|
||||
MedicalInventory3511Output medicalInventory3511Output = null;
|
||||
if (result == null) {
|
||||
throw new ServiceException("未接收到医保返回参数");
|
||||
} else if (result.getCode() == 200) {
|
||||
System.out.println(JSON.toJSONString(result.getResult()));
|
||||
medicalInventory3511Output =
|
||||
parseObject(JSON.toJSONString(result.getResult()), MedicalInventory3511Output.class);
|
||||
} else {
|
||||
throw new ServiceException(result.getMessage());
|
||||
}
|
||||
return medicalInventory3511Output;
|
||||
}
|
||||
|
||||
public Result getClrOptins(Clearing3206AParam clearing3206AParam) {
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("ybUrl") + "/getclroptins",
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.openhis.ybcatalog.mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialDisease;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease;
|
||||
|
||||
/**
|
||||
* 特慢病目录 Mapper接口
|
||||
@@ -12,6 +12,6 @@ import com.openhis.ybcatalog.domain.CatalogSpecialDisease;
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
@Repository
|
||||
public interface CatalogSpecialDiseaseMapper extends BaseMapper<CatalogSpecialDisease> {
|
||||
public interface CatalogSpecialDiseaseMapper extends BaseMapper<CatalogSpecialInsuranceDisease> {
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.ybcatalog.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialDisease;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease;
|
||||
|
||||
/**
|
||||
* 特慢病目录 Service接口
|
||||
@@ -9,6 +9,6 @@ import com.openhis.ybcatalog.domain.CatalogSpecialDisease;
|
||||
* @author system
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
public interface ICatalogSpecialDiseaseService extends IService<CatalogSpecialDisease> {
|
||||
public interface ICatalogSpecialDiseaseService extends IService<CatalogSpecialInsuranceDisease> {
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.openhis.ybcatalog.service.impl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialDisease;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease;
|
||||
import com.openhis.ybcatalog.mapper.CatalogSpecialDiseaseMapper;
|
||||
import com.openhis.ybcatalog.service.ICatalogSpecialDiseaseService;
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.openhis.ybcatalog.service.ICatalogSpecialDiseaseService;
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
@Service
|
||||
public class CatalogSpecialDiseaseServiceImpl extends ServiceImpl<CatalogSpecialDiseaseMapper, CatalogSpecialDisease>
|
||||
implements ICatalogSpecialDiseaseService {
|
||||
public class CatalogSpecialDiseaseServiceImpl extends
|
||||
ServiceImpl<CatalogSpecialDiseaseMapper, CatalogSpecialInsuranceDisease> implements ICatalogSpecialDiseaseService {
|
||||
|
||||
}
|
||||
@@ -17,5 +17,16 @@
|
||||
WHERE encounter_id = #{encounterId}
|
||||
AND tcm_flag = 0
|
||||
</delete>
|
||||
<select id="getEncounterDiagnosisByEncounterConDefId"
|
||||
resultType="com.openhis.administration.domain.EncounterDiagnosis">
|
||||
SELECT *
|
||||
FROM adm_encounter_diagnosis T1
|
||||
INNER JOIN cli_condition T2 ON T1.condition_id = T2.id
|
||||
WHERE T1.encounter_id = #{encounterId}
|
||||
AND T2.definition_id = #{conditionDefId}
|
||||
AND T1.delete_flag = '0'
|
||||
AND T2.delete_flag = '0'
|
||||
AND T1.tenant_id = #{tenantId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -16,6 +16,7 @@
|
||||
AND payment.delete_flag = '0'
|
||||
AND payment.status_enum IN (#{success}, #{returnAll})
|
||||
AND payment.kind_enum = #{clinic}
|
||||
AND account.contract_no IS NOT NULL
|
||||
<if test="entererId != null">
|
||||
AND payment.enterer_id = #{entererId}
|
||||
</if>
|
||||
|
||||
@@ -123,7 +123,9 @@
|
||||
t2.contract_no,
|
||||
t5.insutype,
|
||||
t5.med_type,
|
||||
t7.medfee_sumamt
|
||||
t6.kind_enum,
|
||||
t7.medfee_sumamt,
|
||||
t8.medfee_sumamt as return_medfee_sumamt
|
||||
FROM
|
||||
fin_payment_rec_detail t1
|
||||
LEFT JOIN adm_account t2 on t1.account_id = t2.id
|
||||
@@ -132,11 +134,13 @@
|
||||
LEFT JOIN yb_clinc_reg t5 on t4.bus_no = t5.ipt_otp_no AND t4.delete_flag = '0'
|
||||
LEFT JOIN fin_payment_reconciliation t6 on t6.id = t1.reconciliation_id AND t6.delete_flag = '0'
|
||||
LEFT JOIN yb_clinc_settle t7 on t1.pay_trans_text = t7.setl_id
|
||||
LEFT JOIN yb_clinc_un_settle t8 on t6.yb_settle_ids = t8.settle_id
|
||||
WHERE
|
||||
1=1
|
||||
AND t6.bill_date > #{startTime}
|
||||
AND t6.bill_date < #{endTime}
|
||||
AND t6.status_enum != #{draft}
|
||||
AND t5.med_type IS NOT NULL
|
||||
AND t1.account_id IS NOT NULL
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
AND t1.reconciliation_id IN
|
||||
@@ -144,6 +148,5 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user