版本更新
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.BodyStructureDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
/**
|
||||
* BodyStructure 应该服务类
|
||||
*/
|
||||
public interface IBodyStructureAppService {
|
||||
/**
|
||||
* 查询身体部位树
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 身体部位树分页列表
|
||||
*/
|
||||
Page<BodyStructureDto> getBodyStructureTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 身体部位信息详情
|
||||
*
|
||||
* @param id 身体部位信息id
|
||||
* @return 身体部位详情
|
||||
*/
|
||||
R<?> getBodyStructureInfo(Long id);
|
||||
|
||||
/**
|
||||
* 添加/编辑体身体部位信息
|
||||
*
|
||||
* @param bodyStructureDto 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditBodyStructure(BodyStructureDto bodyStructureDto);
|
||||
|
||||
/**
|
||||
* 身体部位信息
|
||||
*
|
||||
* @param ids 身体部位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteBodyStructure(String ids);
|
||||
|
||||
/**
|
||||
* 身体部位启用
|
||||
*
|
||||
* @param id 身体部位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> activeBodyStructure(Long id);
|
||||
|
||||
/**
|
||||
* 身体部位停用
|
||||
*
|
||||
* @param id 身体部位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> inactiveBodyStructure(Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.LocationAddOrEditDto;
|
||||
import com.openhis.web.basedatamanage.dto.LocationPageParam;
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Location 应该服务类
|
||||
*/
|
||||
public interface ILocationAppService {
|
||||
/**
|
||||
* 位置信息
|
||||
*
|
||||
* @param formList 类型
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param isInHospital 是否为住院
|
||||
* @return 位置信息分页列表
|
||||
*/
|
||||
R<?> getLocationTree(List<Integer> formList, Integer pageNo, Integer pageSize, String isInHospital);
|
||||
|
||||
/**
|
||||
* 位置信息详情
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 位置信息详情
|
||||
*/
|
||||
R<?> getLocationById(Long locationId);
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteLocation(String busNo);
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
R<?> getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto);
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto);
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> locationInit();
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> enableLocation(List<Long> locationIdList);
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deactivateLocation(List<Long> locationIdList);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
/**
|
||||
* Organization 应该服务类
|
||||
*/
|
||||
public interface IOrganizationAppService {
|
||||
/**
|
||||
* 查询机构树
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构树分页列表
|
||||
*/
|
||||
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
R<?> getOrgInfo(Long orgId);
|
||||
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditOrganization(OrganizationDto organizationDto);
|
||||
|
||||
/**
|
||||
* 机构信息
|
||||
*
|
||||
* @param orgIds 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteOrganization(String orgIds);
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> activeOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> inactiveOrg(Long orgId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
/**
|
||||
* Organization 应该服务类
|
||||
*/
|
||||
public interface IOrganizationLocationAppService {
|
||||
|
||||
/**
|
||||
* 查询机构位置
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置分页列表
|
||||
*/
|
||||
R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 添加/编辑机构位置信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto);
|
||||
|
||||
/**
|
||||
* 机构位置信息
|
||||
*
|
||||
* @param orgLocId 机构位置信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteOrgLoc(Long orgLocId);
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> organizationLocationInit();
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
R<?> getLocationListByForm(Integer locationForm);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参与者 应该服务类
|
||||
*/
|
||||
public interface IPractitionerAppService {
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> saveUserPractitioner(UserAndPractitionerDto userAndPractitionerDto);
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
IPage<UserAndPractitionerDto> getUserPractitionerPage(UserAndPractitionerDto userAndPractitionerDto,
|
||||
String searchKey, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 修改用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> editUserPractitioner(UserAndPractitionerDto userAndPractitionerDto);
|
||||
|
||||
/**
|
||||
* 删除用户及参与者 ; admin不允许删除
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> delUserPractitioner(Long userId);
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
List<SelectableOrgDto> getSelectableOrgList();
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> switchOrg(Long orgId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.PractRoleSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRoleDto;
|
||||
|
||||
/**
|
||||
* PractitionerRole 应该服务类
|
||||
*/
|
||||
public interface IPractitionerRoleAppService {
|
||||
/**
|
||||
* 查询岗位
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 岗位分页列表
|
||||
*/
|
||||
R<?> getPractitionerPage(PractRoleSearchParam practRoleSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 岗位信息详情
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 岗位信息详情
|
||||
*/
|
||||
R<?> getPractitionerRoleById(Long practitionerRoleId);
|
||||
|
||||
/**
|
||||
* 添加/编辑岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditPractitionerRole(PractitionerRoleDto practitionerRoleDto);
|
||||
|
||||
/**
|
||||
* 岗位信息
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deletePractitionerRole(Long practitionerRoleId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.BodyStructure;
|
||||
import com.openhis.administration.service.IBodyStructureService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IBodyStructureAppService;
|
||||
import com.openhis.web.basedatamanage.dto.BodyStructureDto;
|
||||
|
||||
@Service
|
||||
public class BodyStructureAppServiceImpl implements IBodyStructureAppService {
|
||||
|
||||
@Resource
|
||||
private IBodyStructureService bodyStructureService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Override
|
||||
public Page<BodyStructureDto> getBodyStructureTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 查询身体部位列表
|
||||
Page<BodyStructure> page = bodyStructureService.page(new Page<>(pageNo, pageSize));
|
||||
List<BodyStructure> bodyStructureList = page.getRecords();
|
||||
// 将身体部位列表转为树结构
|
||||
List<BodyStructureDto> orgTree = buildTree(bodyStructureList);
|
||||
Page<BodyStructureDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将身体部位列表转换为树结构
|
||||
*
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<BodyStructureDto> buildTree(List<BodyStructure> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<BodyStructure> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, BodyStructureDto> nodeMap = new HashMap<>();
|
||||
List<BodyStructureDto> tree = new ArrayList<>();
|
||||
|
||||
for (BodyStructure record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
BodyStructureDto node = new BodyStructureDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
node.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, node.getStatusEnum()));
|
||||
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
if (parts.length == 1) {
|
||||
// 根节点
|
||||
tree.add(node);
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
BodyStructureDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位信息详情
|
||||
*
|
||||
* @param id 身体部位id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getBodyStructureInfo(Long id) {
|
||||
BodyStructure bodyStructure = bodyStructureService.getById(id);
|
||||
return R.ok(bodyStructure,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑部位
|
||||
*
|
||||
* @param bodyStructureDto 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditBodyStructure(BodyStructureDto bodyStructureDto) {
|
||||
|
||||
// 新增身体部位信息
|
||||
BodyStructure bodyStructure = new BodyStructure();
|
||||
BeanUtils.copyProperties(bodyStructureDto, bodyStructure);
|
||||
|
||||
// 拼音码
|
||||
bodyStructure.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(bodyStructureDto.getName()));
|
||||
// 五笔码
|
||||
bodyStructure.setWbStr(ChineseConvertUtils.toWBFirstLetter(bodyStructureDto.getName()));
|
||||
|
||||
if (bodyStructureDto.getId() != null) {
|
||||
// 更新身体部位信息
|
||||
bodyStructureService.updateById(bodyStructure);
|
||||
} else {
|
||||
bodyStructure.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.BODY_STRUCTURE_NO.getPrefix(), 3);
|
||||
// 如果传了上级部位 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(bodyStructure.getBusNo())) {
|
||||
bodyStructure.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, bodyStructure.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
bodyStructure.setBusNo(code);
|
||||
}
|
||||
// 生成待发送的机构信息
|
||||
bodyStructureService.save(bodyStructure);
|
||||
}
|
||||
// 返回身体部位id
|
||||
return R.ok(bodyStructure.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除身体部位
|
||||
*
|
||||
* @param id 身体部位id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteBodyStructure(String id) {
|
||||
|
||||
List<Long> orgIdList = new ArrayList<>();
|
||||
if (id != null) {
|
||||
orgIdList = Arrays.stream(id.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 删除身体部位信息
|
||||
boolean deleteOrgSuccess = bodyStructureService.removeByIds(orgIdList);
|
||||
return deleteOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"身体部位信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位列表启用
|
||||
*
|
||||
* @param id 身体部位列表信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> activeBodyStructure(Long id) {
|
||||
// 机构启用
|
||||
boolean result = bodyStructureService.activeBodyStructure(id);
|
||||
return result
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息启用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息启用"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位列表停用
|
||||
*
|
||||
* @param id 身体部位列表信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> inactiveBodyStructure(Long id) {
|
||||
// 机构停用
|
||||
boolean result = bodyStructureService.inactiveBodyStructure(id);
|
||||
return result
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息停用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息停用"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.mapper.LocationMapper;
|
||||
import com.openhis.administration.service.IEncounterLocationService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
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.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.*;
|
||||
import com.openhis.web.common.appservice.ICommonService;
|
||||
|
||||
@Service
|
||||
public class LocationAppServiceImpl implements ILocationAppService {
|
||||
|
||||
@Resource
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private ICommonService commonService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private LocationMapper locationMapper;
|
||||
|
||||
@Resource
|
||||
private IPractitionerRoleService practitionerRoleService;
|
||||
|
||||
@Resource
|
||||
private IEncounterLocationService encounterLocationService;
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> locationInit() {
|
||||
LocationInitDto initDto = new LocationInitDto();
|
||||
// 位置状态
|
||||
List<LocationInitDto.locationStatusOption> locationStatusOptions = new ArrayList<>();
|
||||
locationStatusOptions.add(new LocationInitDto.locationStatusOption(LocationStatus.ACTIVE.getValue(),
|
||||
LocationStatus.ACTIVE.getInfo()));
|
||||
locationStatusOptions.add(new LocationInitDto.locationStatusOption(LocationStatus.INACTIVE.getValue(),
|
||||
LocationStatus.INACTIVE.getInfo()));
|
||||
initDto.setLocationStatusOptions(locationStatusOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> enableLocation(List<Long> locationIdList) {
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||
for (Location location : locationList) {
|
||||
if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())
|
||||
|| LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
// 获取父节点的busNo(病区)
|
||||
String parentBusNo =
|
||||
location.getBusNo().substring(0, location.getBusNo().indexOf(CommonConstants.Common.POINT));
|
||||
// 查询所有父集位置
|
||||
List<Location> fatherLocations =
|
||||
locationService.list(new LambdaQueryWrapper<Location>().like(Location::getBusNo, parentBusNo)
|
||||
.in(Location::getFormEnum, LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue()));
|
||||
// 启用所有对应的父节点
|
||||
for (Location fatherLocation : fatherLocations) {
|
||||
fatherLocation.setStatusEnum(LocationStatus.ACTIVE.getValue());
|
||||
locationService.updateLocation(fatherLocation);
|
||||
}
|
||||
// 病床单独设置状态为空闲
|
||||
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
location.setStatusEnum(LocationStatus.IDLE.getValue());
|
||||
locationService.updateLocation(location);
|
||||
}
|
||||
} else {
|
||||
location.setStatusEnum(LocationStatus.ACTIVE.getValue());
|
||||
locationService.updateLocation(location);
|
||||
}
|
||||
}
|
||||
return R.ok("启用成功");
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deactivateLocation(List<Long> locationIdList) {
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||
for (Location location : locationList) {
|
||||
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
List<EncounterLocation> encounterLocationList =
|
||||
encounterLocationService.getEncounterLocationInfo(null, location.getId());
|
||||
if (encounterLocationList != null && !encounterLocationList.isEmpty()) {
|
||||
return R.fail("有被占用的床位,不可停用");
|
||||
}
|
||||
} else if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())) {
|
||||
// 检查病房下是否有启用的病床
|
||||
List<com.openhis.web.common.dto.LocationDto> activeBeds =
|
||||
commonService.getChildLocation(location.getId(), LocationForm.BED.getValue());
|
||||
if ((activeBeds != null && !activeBeds.isEmpty())) {
|
||||
return R.fail("病房下有启用或被占用的床位,不可停用");
|
||||
}
|
||||
} else if (LocationForm.WARD.getValue().equals(location.getFormEnum())) {
|
||||
// 检查病区下是否有启用的病房
|
||||
List<com.openhis.web.common.dto.LocationDto> activeHouses =
|
||||
commonService.getChildLocation(location.getId(), LocationForm.HOUSE.getValue());
|
||||
if ((activeHouses != null && !activeHouses.isEmpty())) {
|
||||
return R.fail("病区下有启用或被占用的病房,不可停用");
|
||||
}
|
||||
}
|
||||
location.setStatusEnum(LocationStatus.INACTIVE.getValue());
|
||||
locationService.updateLocation(location);
|
||||
}
|
||||
return R.ok("停用成功");
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置信息详情
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 位置信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationById(Long locationId) {
|
||||
LocationInfoDto locationInfoDto = new LocationInfoDto();
|
||||
BeanUtils.copyProperties(locationService.getById(locationId), locationInfoDto);
|
||||
// 位置类型
|
||||
locationInfoDto
|
||||
.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, locationInfoDto.getFormEnum()));
|
||||
// 使用状态
|
||||
locationInfoDto.setOperationalEnum_enumText(
|
||||
EnumUtils.getInfoByValue(LocationOperational.class, locationInfoDto.getOperationalEnum()));
|
||||
// 启用停用
|
||||
locationInfoDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, locationInfoDto.getStatusEnum()));
|
||||
return R.ok(locationInfoDto,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteLocation(String busNo) {
|
||||
// 删除位置信息(连同子集)
|
||||
boolean result =
|
||||
locationService.remove(new LambdaQueryWrapper<Location>().likeRight(Location::getBusNo, busNo));
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"位置信息删除"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"位置信息删除"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 数据初始化,不使用eq条件拼接
|
||||
List<Integer> formList = locationPageParam.getLocationFormList();
|
||||
locationPageParam.setLocationFormList(null);
|
||||
String busNo = locationPageParam.getBusNo();
|
||||
locationPageParam.setBusNo(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<Location> queryWrapper = HisQueryUtils.buildQueryWrapper(locationPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
request);
|
||||
// 根据不同的位置类型查询不同的位置分页信息(前端必传默认值)
|
||||
if (formList != null && !formList.isEmpty()) {
|
||||
queryWrapper.lambda().in(Location::getFormEnum, formList);
|
||||
}
|
||||
// 根据父节点编码查询子项
|
||||
queryWrapper.lambda().likeRight(StringUtils.isNotNull(busNo), Location::getBusNo, busNo);
|
||||
if (locationPageParam.getFormEnum() != null) {
|
||||
queryWrapper.lambda().eq(Location::getFormEnum, locationPageParam.getFormEnum());
|
||||
}
|
||||
|
||||
// 查询位置分页列表
|
||||
Page<LocationInfoDto> locationPage =
|
||||
HisPageUtils.selectPage(locationMapper, queryWrapper, pageNo, pageSize, LocationInfoDto.class);
|
||||
locationPage.getRecords().forEach(e -> {
|
||||
// 位置类型
|
||||
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
||||
// 使用状态
|
||||
e.setOperationalEnum_enumText(EnumUtils.getInfoByValue(LocationOperational.class, e.getOperationalEnum()));
|
||||
// 启用停用
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return R.ok(locationPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum()));
|
||||
// 新增病床设置状态为空闲
|
||||
if (LocationForm.BED.getValue().equals(Integer.valueOf(locationAddOrEditDto.getFormEnum()))) {
|
||||
location.setStatusEnum(LocationStatus.IDLE.getValue());
|
||||
}
|
||||
// 拼音码
|
||||
location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 五笔码
|
||||
location.setWbStr(ChineseConvertUtils.toWBFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.LOCATION_BUS_NO.getPrefix(), 3);
|
||||
// 如果传了上级 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(location.getBusNo())) {
|
||||
location.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, location.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
location.setBusNo(code);
|
||||
}
|
||||
boolean result = locationService.addLocation(location);
|
||||
if (result) {
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"库房"}));
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
// 拼音码
|
||||
location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 五笔码
|
||||
location.setWbStr(ChineseConvertUtils.toWBFirstLetter(locationAddOrEditDto.getName()));
|
||||
boolean result = locationService.updateLocation(location);
|
||||
if (result) {
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"库房"}));
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表-树型
|
||||
*
|
||||
* @param formList 类型
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param isInHospital 是否住院
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationTree(List<Integer> formList, Integer pageNo, Integer pageSize, String isInHospital) {
|
||||
|
||||
LambdaQueryWrapper<Location> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (formList != null && !formList.isEmpty()) {
|
||||
queryWrapper.in(Location::getFormEnum, formList);
|
||||
}
|
||||
if (Whether.YES.getCode().equals(isInHospital)) {
|
||||
// 当前登录者的id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
queryWrapper.in(Location::getId, locationIds);
|
||||
}
|
||||
// 查询位置列表
|
||||
Page<Location> page = locationService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
List<Location> locationList = page.getRecords();
|
||||
// 将位置列表转为树结构
|
||||
List<LocationDto> locationTree = buildTree(locationList);
|
||||
Page<LocationDto> locationQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
locationQueryDtoPage.setRecords(locationTree);
|
||||
|
||||
locationQueryDtoPage.getRecords().forEach(e -> {
|
||||
// 物理形式枚举回显赋值
|
||||
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
||||
// 状态编码回显赋值
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||
// 操作状态回显赋值
|
||||
e.setOperationalEnum_enumText(EnumUtils.getInfoByValue(LocationBedStatus.class, e.getOperationalEnum()));
|
||||
// 模式编码回显赋值
|
||||
e.setModeEnum_enumText(EnumUtils.getInfoByValue(LocationMode.class, e.getModeEnum()));
|
||||
});
|
||||
|
||||
return R.ok(locationQueryDtoPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将位置列表转换为树结构
|
||||
*
|
||||
* @param records 位置列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<LocationDto> buildTree(List<Location> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Location> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, LocationDto> nodeMap = new HashMap<>();
|
||||
List<LocationDto> tree = new ArrayList<>();
|
||||
|
||||
for (Location record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
LocationDto node = new LocationDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
if (parts.length == 1) {
|
||||
// 根节点
|
||||
tree.add(node);
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
LocationDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
tree.add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.core.common.utils.StringUtils;
|
||||
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.AccountStatus;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
@Service
|
||||
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
@Resource
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Override
|
||||
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 查询机构列表
|
||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
||||
List<Organization> organizationList = page.getRecords();
|
||||
// 将机构列表转为树结构
|
||||
List<OrganizationDto> orgTree = buildTree(organizationList);
|
||||
Page<OrganizationDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将机构列表转换为树结构
|
||||
*
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<OrganizationDto> buildTree(List<Organization> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Organization> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, OrganizationDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationDto> tree = new ArrayList<>();
|
||||
|
||||
for (Organization record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
OrganizationDto node = new OrganizationDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
node.setTypeEnum_dictText(EnumUtils.getInfoByValue(OrganizationType.class, node.getTypeEnum()));
|
||||
node.setClassEnum_dictText(EnumUtils.getInfoByValue(OrganizationClass.class, node.getClassEnum()));
|
||||
node.setActiveFlag_dictText(EnumUtils.getInfoByValue(AccountStatus.class, node.getActiveFlag()));
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
if (parts.length == 1) {
|
||||
// 根节点
|
||||
tree.add(node);
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
OrganizationDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgInfo(Long orgId) {
|
||||
Organization organization = organizationService.getById(orgId);
|
||||
return R.ok(organization, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑机构
|
||||
*
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditOrganization(OrganizationDto organizationDto) {
|
||||
|
||||
// 新增organization信息
|
||||
Organization organization = new Organization();
|
||||
BeanUtils.copyProperties(organizationDto, organization);
|
||||
|
||||
if (organizationDto.getId() != null) {
|
||||
// 更新机构信息
|
||||
organizationService.updateById(organization);
|
||||
} else {
|
||||
// 活动标识:有效
|
||||
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ORGANIZATION_BUS_NO.getPrefix(), 3);
|
||||
// 如果传了上级科室 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(organization.getBusNo())) {
|
||||
organization.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, organization.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
organization.setBusNo(code);
|
||||
}
|
||||
// 生成待发送的机构信息
|
||||
organizationService.save(organization);
|
||||
}
|
||||
// 返回机构id
|
||||
return R.ok(organization.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构
|
||||
*
|
||||
* @param orgIds 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteOrganization(String orgIds) {
|
||||
|
||||
List<Long> orgIdList = new ArrayList<>();
|
||||
if (orgIds != null) {
|
||||
orgIdList = Arrays.stream(orgIds.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 删除机构信息
|
||||
boolean deleteOrgSuccess = organizationService.removeByIds(orgIdList);
|
||||
return deleteOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"机构信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> activeOrg(Long orgId) {
|
||||
// 机构启用
|
||||
boolean result = organizationService.activeOrg(orgId);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息启用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息启用"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> inactiveOrg(Long orgId) {
|
||||
// 机构停用
|
||||
boolean result = organizationService.inactiveOrg(orgId);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息停用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息停用"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
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.Location;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.domain.OrganizationLocation;
|
||||
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationLocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationLocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocInitDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
@Service
|
||||
public class OrganizationLocationAppServiceImpl implements IOrganizationLocationAppService {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
|
||||
@Autowired
|
||||
private OrganizationLocationMapper organizationLocationMapper;
|
||||
|
||||
@Autowired
|
||||
private IOrganizationLocationService organizationLocationService;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> organizationLocationInit() {
|
||||
OrgLocInitDto initDto = new OrgLocInitDto();
|
||||
// 位置类型
|
||||
List<OrgLocInitDto.locationFormOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions
|
||||
.add(new OrgLocInitDto.locationFormOption(LocationForm.CABINET.getValue(), LocationForm.CABINET.getInfo()));
|
||||
chargeItemStatusOptions.add(
|
||||
new OrgLocInitDto.locationFormOption(LocationForm.PHARMACY.getValue(), LocationForm.PHARMACY.getInfo()));
|
||||
|
||||
// 获取科室下拉选列表
|
||||
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
||||
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationListByForm(Integer locationForm) {
|
||||
|
||||
OrgLocInitDto orgLocInitDto = new OrgLocInitDto();
|
||||
List<Location> locationList = new ArrayList<>();
|
||||
if (LocationForm.CABINET.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getCabinetList();
|
||||
} else if (LocationForm.PHARMACY.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getPharmacyList();
|
||||
}
|
||||
List<OrgLocInitDto.locationOption> locationOptions = locationList.stream()
|
||||
.map(location -> new OrgLocInitDto.locationOption(location.getId(), location.getName()))
|
||||
.collect(Collectors.toList());
|
||||
orgLocInitDto.setLocationOptions(locationOptions);
|
||||
return R.ok(orgLocInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置关系分页列表
|
||||
*
|
||||
* @param orgLocQueryParam 查询字段
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<OrganizationLocation> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(orgLocQueryParam, null, null, request);
|
||||
// 查询机构位置分页列表
|
||||
Page<OrgLocQueryDto> orgLocQueryDtoPage =
|
||||
HisPageUtils.selectPage(organizationLocationMapper, queryWrapper, pageNo, pageSize, OrgLocQueryDto.class);
|
||||
return R.ok(orgLocQueryDtoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑机构位置信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto) {
|
||||
|
||||
OrganizationLocation orgLoc = new OrganizationLocation();
|
||||
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
||||
|
||||
if (orgLocQueryDto.getId() != null) {
|
||||
// 更新机构位置信息
|
||||
organizationLocationService.updateById(orgLoc);
|
||||
} else {
|
||||
// 新增机构位置信息
|
||||
organizationLocationService.save(orgLoc);
|
||||
}
|
||||
// 返回机构位置id
|
||||
return R.ok(orgLoc.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构位置信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构位置
|
||||
*
|
||||
* @param orgLocId 机构位置信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteOrgLoc(Long orgLocId) {
|
||||
// 删除机构位置信息
|
||||
boolean deleteOrgLocSuccess = organizationLocationService.removeById(orgLocId);
|
||||
return deleteOrgLocSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"机构位置信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构位置信息"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,435 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.system.service.ISysTenantService;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.service.IBizUserRoleService;
|
||||
import com.openhis.administration.service.IBizUserService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.PractitionerRoles;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerOrgAndLocationDto;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRolesDto;
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
import com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper;
|
||||
|
||||
@Service
|
||||
public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
|
||||
@Resource
|
||||
PractitionerAppAppMapper practitionerAppAppMapper;
|
||||
|
||||
@Resource
|
||||
IBizUserService iBizUserService;
|
||||
|
||||
@Resource
|
||||
IBizUserRoleService iBizUserRoleService;
|
||||
|
||||
@Resource
|
||||
IPractitionerService iPractitionerService;
|
||||
|
||||
@Resource
|
||||
IPractitionerRoleService iPractitionerRoleService;
|
||||
|
||||
@Resource
|
||||
ISysTenantService sysTenantService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveUserPractitioner(UserAndPractitionerDto userAndPractitionerDto) {
|
||||
String userName = userAndPractitionerDto.getUserName();
|
||||
String nickName = userAndPractitionerDto.getNickName();
|
||||
String phonenumber = userAndPractitionerDto.getPhonenumber();
|
||||
String pharPracCertNo = userAndPractitionerDto.getPharPracCertNo(); // 职业证件编号
|
||||
String sex = userAndPractitionerDto.getSex();
|
||||
// 账号唯一性
|
||||
long count = iBizUserService.count(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName));
|
||||
if (count > 0L) {
|
||||
return R.fail(null, "账号已存在");
|
||||
}
|
||||
// 新增 sys_user
|
||||
BizUser bizUser = new BizUser();
|
||||
bizUser.setUserName(userName); // 账号
|
||||
bizUser.setNickName(nickName); // 昵称
|
||||
bizUser.setEmail(userAndPractitionerDto.getEmail());// 邮箱
|
||||
bizUser.setPhonenumber(phonenumber); // 电话
|
||||
bizUser.setSex(sex); // 性别
|
||||
bizUser.setPassword(SecurityUtils.encryptPassword(userAndPractitionerDto.getPassword())); // 密码
|
||||
bizUser.setStatus(userAndPractitionerDto.getStatus()); // 状态
|
||||
bizUser.setRemark(userAndPractitionerDto.getRemark()); // 备注
|
||||
iBizUserService.save(bizUser);
|
||||
Long userId =
|
||||
iBizUserService.getOne(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName)).getUserId(); // 用户id
|
||||
|
||||
// 初始化租户绑定
|
||||
sysTenantService.initTenantBind(userId);
|
||||
|
||||
// 新增 sys_user_role
|
||||
List<PractitionerRolesDto> practitionerRoleDtoList = userAndPractitionerDto.getPractitionerRolesDtoList();
|
||||
BizUserRole bizUserRole;
|
||||
for (PractitionerRolesDto practitionerRolesDto : practitionerRoleDtoList) {
|
||||
bizUserRole = new BizUserRole();
|
||||
bizUserRole.setUserId(userId);
|
||||
bizUserRole.setRoleId(practitionerRolesDto.getRoleId());
|
||||
iBizUserRoleService.save(bizUserRole);
|
||||
}
|
||||
// 新增 adm_practitioner
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setActiveFlag(AccountStatus.ACTIVE.getValue()); // 活动标记
|
||||
practitioner.setName(nickName); // 姓名
|
||||
practitioner.setGenderEnum(Integer.parseInt(sex)); // 性别
|
||||
practitioner.setBirthDate(userAndPractitionerDto.getBirthDate()); // 出生日期
|
||||
practitioner.setPhone(phonenumber); // 电话
|
||||
practitioner.setAddress(userAndPractitionerDto.getAddress()); // 地址
|
||||
practitioner.setYbNo(userAndPractitionerDto.getYbNo()); // 医保码
|
||||
practitioner.setUserId(userId); // 系统用户id
|
||||
// 责任科室
|
||||
List<PractitionerOrgAndLocationDto> responsibilityOrgDtoList =
|
||||
userAndPractitionerDto.getResponsibilityOrgDtoList();
|
||||
practitioner.setOrgId(responsibilityOrgDtoList.get(0).getOrgId()); // 机构id
|
||||
practitioner.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(nickName)); // 拼音码
|
||||
practitioner.setWbStr(ChineseConvertUtils.toWBFirstLetter(nickName)); // 五笔码
|
||||
practitioner.setPharPracCertNo(pharPracCertNo); // 职业证件编号
|
||||
iPractitionerService.save(practitioner);
|
||||
Long practitionerId = practitioner.getId();// 参与者id
|
||||
// 新增 adm_practitioner_role
|
||||
PractitionerRole practitionerRole;
|
||||
// 1.责任科室
|
||||
for (PractitionerOrgAndLocationDto responsibilityOrgDto : responsibilityOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setOrgId(responsibilityOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 2.医生出诊科室
|
||||
List<PractitionerOrgAndLocationDto> doctorVisitOrgDtoList = userAndPractitionerDto.getDoctorVisitOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto doctorVisitOrgDto : doctorVisitOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.DOCTOR.getCode());// 角色code
|
||||
practitionerRole.setOrgId(doctorVisitOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 3.管理库房
|
||||
List<PractitionerOrgAndLocationDto> manageLocationDtoList = userAndPractitionerDto.getManageLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageLocationDto : manageLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.LOCATION_ADMIN.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 4.管理药房
|
||||
List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList =
|
||||
userAndPractitionerDto.getManageMedicationLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto practitionerOrgAndLocationDto : manageMedicationLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.PHARMACIST.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(practitionerOrgAndLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理科室集合
|
||||
List<PractitionerOrgAndLocationDto> manageOrgDtoList = userAndPractitionerDto.getManageOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageOrgDto : manageOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode());// 角色code
|
||||
practitionerRole.setOrgId(manageOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理病区集合
|
||||
List<PractitionerOrgAndLocationDto> manageWardLocationDtoList =
|
||||
userAndPractitionerDto.getManageWardLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageWardLocationDto : manageWardLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageWardLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
@Override
|
||||
public IPage<UserAndPractitionerDto> getUserPractitionerPage(UserAndPractitionerDto userAndPractitionerDto,
|
||||
String searchKey, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<UserAndPractitionerDto> queryWrapper = HisQueryUtils.buildQueryWrapper(userAndPractitionerDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("user_name", "nick_name", "py_str", "wb_str")), null);
|
||||
queryWrapper.orderByDesc("user_id");
|
||||
IPage<UserAndPractitionerDto> userPractitionerPage =
|
||||
practitionerAppAppMapper.getUserPractitionerPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
List<UserAndPractitionerDto> records = userPractitionerPage.getRecords();
|
||||
// 参与者id集合
|
||||
List<Long> practitionerIdList =
|
||||
records.stream().map(UserAndPractitionerDto::getPractitionerId).collect(Collectors.toList());
|
||||
// 角色集合
|
||||
List<PractitionerRolesDto> practitionerRolesDtoList =
|
||||
practitionerAppAppMapper.getPractitionerRolesDtoList(practitionerIdList);
|
||||
// 科室和位置
|
||||
List<PractitionerOrgAndLocationDto> orgAndLocationDtoList =
|
||||
practitionerAppAppMapper.getOrgAndLocationDtoList(practitionerIdList);
|
||||
for (UserAndPractitionerDto record : records) {
|
||||
// 匹配角色
|
||||
List<PractitionerRolesDto> list1 = practitionerRolesDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())).collect(Collectors.toList());
|
||||
record.setPractitionerRolesDtoList(list1);
|
||||
// 匹配责任科室
|
||||
List<PractitionerOrgAndLocationDto> list2 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId()) && "".equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setResponsibilityOrgDtoList(list2);
|
||||
// 匹配医生出诊科室
|
||||
List<PractitionerOrgAndLocationDto> list3 =
|
||||
orgAndLocationDtoList.stream().filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.DOCTOR.getCode().equals(e.getRoleCode())).collect(Collectors.toList());
|
||||
record.setDoctorVisitOrgDtoList(list3);
|
||||
// 匹配管理库房
|
||||
List<PractitionerOrgAndLocationDto> list4 =
|
||||
orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.LOCATION_ADMIN.getCode().equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setManageLocationDtoList(list4);
|
||||
// 匹配管理药房
|
||||
List<
|
||||
PractitionerOrgAndLocationDto> list5 =
|
||||
orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.PHARMACIST.getCode().equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setManageMedicationLocationDtoList(list5);
|
||||
// 匹配护士-管理科室
|
||||
List<PractitionerOrgAndLocationDto> list6 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.NURSE.getCode().equals(e.getRoleCode()) && e.getOrgId() != null)
|
||||
.collect(Collectors.toList());
|
||||
record.setManageOrgDtoList(list6);
|
||||
// 匹配护士-管理病区
|
||||
List<PractitionerOrgAndLocationDto> list7 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.NURSE.getCode().equals(e.getRoleCode()) && e.getLocationId() != null)
|
||||
.collect(Collectors.toList());
|
||||
record.setManageWardLocationDtoList(list7);
|
||||
}
|
||||
return userPractitionerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户及参与者 : 登录账号和密码不允许编辑
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> editUserPractitioner(UserAndPractitionerDto userAndPractitionerDto) {
|
||||
Long userId = userAndPractitionerDto.getUserId(); // 系统用户id
|
||||
Long practitionerId = userAndPractitionerDto.getPractitionerId(); // 参与者id
|
||||
|
||||
String nickName = userAndPractitionerDto.getNickName();
|
||||
String phonenumber = userAndPractitionerDto.getPhonenumber();
|
||||
String sex = userAndPractitionerDto.getSex();
|
||||
String pharPracCertNo = userAndPractitionerDto.getPharPracCertNo(); // 职业证件编号
|
||||
// 编辑 sys_user
|
||||
BizUser bizUser = new BizUser();
|
||||
bizUser.setNickName(nickName); // 昵称
|
||||
bizUser.setEmail(userAndPractitionerDto.getEmail());// 邮箱
|
||||
bizUser.setPhonenumber(phonenumber); // 电话
|
||||
bizUser.setSex(sex); // 性别
|
||||
bizUser.setStatus(userAndPractitionerDto.getStatus()); // 状态
|
||||
bizUser.setRemark(userAndPractitionerDto.getRemark()); // 备注
|
||||
iBizUserService.update(bizUser, new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||
// 先删除,再新增 sys_user_role
|
||||
practitionerAppAppMapper.delUserRole(userId);
|
||||
List<PractitionerRolesDto> practitionerRoleDtoList = userAndPractitionerDto.getPractitionerRolesDtoList();
|
||||
BizUserRole bizUserRole;
|
||||
for (PractitionerRolesDto practitionerRolesDto : practitionerRoleDtoList) {
|
||||
bizUserRole = new BizUserRole();
|
||||
bizUserRole.setUserId(userId);
|
||||
bizUserRole.setRoleId(practitionerRolesDto.getRoleId());
|
||||
iBizUserRoleService.save(bizUserRole);
|
||||
}
|
||||
// 编辑 adm_practitioner
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setId(practitionerId);
|
||||
practitioner.setName(nickName); // 姓名
|
||||
practitioner.setGenderEnum(Integer.parseInt(sex)); // 性别
|
||||
practitioner.setBirthDate(userAndPractitionerDto.getBirthDate()); // 出生日期
|
||||
practitioner.setPhone(phonenumber); // 电话
|
||||
practitioner.setAddress(userAndPractitionerDto.getAddress()); // 地址
|
||||
practitioner.setYbNo(userAndPractitionerDto.getYbNo()); // 医保码
|
||||
practitioner.setUserId(userId); // 系统用户id
|
||||
// 责任科室
|
||||
List<PractitionerOrgAndLocationDto> responsibilityOrgDtoList =
|
||||
userAndPractitionerDto.getResponsibilityOrgDtoList();
|
||||
practitioner.setOrgId(responsibilityOrgDtoList.get(0).getOrgId()); // 机构id
|
||||
practitioner.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(nickName)); // 拼音码
|
||||
practitioner.setWbStr(ChineseConvertUtils.toWBFirstLetter(nickName)); // 五笔码
|
||||
practitioner.setPharPracCertNo(pharPracCertNo);// 职业证件编号
|
||||
iPractitionerService.updateById(practitioner);
|
||||
// 先删除,再新增 adm_practitioner_role
|
||||
practitionerAppAppMapper.delPractitionerRole(practitionerId);
|
||||
PractitionerRole practitionerRole;
|
||||
// 1.责任科室
|
||||
for (PractitionerOrgAndLocationDto responsibilityOrgDto : responsibilityOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setOrgId(responsibilityOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 2.医生出诊科室
|
||||
List<PractitionerOrgAndLocationDto> doctorVisitOrgDtoList = userAndPractitionerDto.getDoctorVisitOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto doctorVisitOrgDto : doctorVisitOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.DOCTOR.getCode());// 角色code
|
||||
practitionerRole.setOrgId(doctorVisitOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 3.管理库房
|
||||
List<PractitionerOrgAndLocationDto> manageLocationDtoList = userAndPractitionerDto.getManageLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageLocationDto : manageLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.LOCATION_ADMIN.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 4.管理药房
|
||||
List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList =
|
||||
userAndPractitionerDto.getManageMedicationLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto practitionerOrgAndLocationDto : manageMedicationLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.PHARMACIST.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(practitionerOrgAndLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理科室集合
|
||||
List<PractitionerOrgAndLocationDto> manageOrgDtoList = userAndPractitionerDto.getManageOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageOrgDto : manageOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode());// 角色code
|
||||
practitionerRole.setOrgId(manageOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理病区集合
|
||||
List<PractitionerOrgAndLocationDto> manageWardLocationDtoList =
|
||||
userAndPractitionerDto.getManageWardLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageWardLocationDto : manageWardLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageWardLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户及参与者 ; admin不允许删除
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> delUserPractitioner(Long userId) {
|
||||
if (1L == userId) {
|
||||
return R.fail(null, "admin不允许删除");
|
||||
}
|
||||
iBizUserService.remove(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||
practitionerAppAppMapper.delUserRole(userId);
|
||||
Practitioner one =
|
||||
iPractitionerService.getOne(new LambdaQueryWrapper<Practitioner>().eq(Practitioner::getUserId, userId));
|
||||
Long practitionerId = one.getId();// 参与者id
|
||||
iPractitionerService.removeById(practitionerId);
|
||||
iPractitionerRoleService
|
||||
.remove(new LambdaQueryWrapper<PractitionerRole>().eq(PractitionerRole::getPractitionerId, practitionerId));
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
@Override
|
||||
public List<SelectableOrgDto> getSelectableOrgList() {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
return practitionerAppAppMapper.getSelectableOrgList(practitionerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> switchOrg(Long orgId) {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setId(practitionerId);
|
||||
practitioner.setOrgId(orgId);
|
||||
iPractitionerService.updateById(practitioner);
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"切换科室"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
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.PractitionerRole;
|
||||
import com.openhis.administration.mapper.PractitionerRoleMapper;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerRoleAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractRoleSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRoleDto;
|
||||
|
||||
@Service
|
||||
public class PractitionerRoleAppServiceImpl implements IPractitionerRoleAppService {
|
||||
|
||||
@Autowired
|
||||
private IPractitionerRoleService practitionerRoleService;
|
||||
@Autowired
|
||||
private PractitionerRoleMapper practitionerRoleMapper;
|
||||
|
||||
@Override
|
||||
public R<?> getPractitionerPage(PractRoleSearchParam practRoleSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<PractitionerRole> queryWrapper = HisQueryUtils.buildQueryWrapper(practRoleSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("name")), request);
|
||||
|
||||
// 查询岗位分页列表
|
||||
Page<PractitionerRoleDto> practitionerRoleDtoPage =
|
||||
HisPageUtils.selectPage(practitionerRoleMapper, queryWrapper, pageNo, pageSize, PractitionerRoleDto.class);
|
||||
|
||||
return R.ok(practitionerRoleDtoPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位信息详情
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 岗位信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPractitionerRoleById(Long practitionerRoleId) {
|
||||
PractitionerRole practitionerRole = practitionerRoleService.getById(practitionerRoleId);
|
||||
if (practitionerRole != null) {
|
||||
return R.ok(practitionerRole,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"岗位信息查询失败"}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditPractitionerRole(PractitionerRoleDto practitionerRoleDto) {
|
||||
|
||||
PractitionerRole practitionerRole = new PractitionerRole();
|
||||
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||
// if (practitionerRole.getRoleCode() == null) {
|
||||
// return R.fail(PromptMsgConstant.Common.M00007, "角色编码不能为空");
|
||||
// }
|
||||
// if (practitionerRole.getOrgId() == null) {
|
||||
// return R.fail(PromptMsgConstant.Common.M00007, "科室不能为空");
|
||||
// }
|
||||
// if (practitionerRole.getLocationId() == null) {
|
||||
// return R.fail(PromptMsgConstant.Common.M00007, "位置不能为空");
|
||||
// }
|
||||
|
||||
if (practitionerRoleDto.getId() != null) {
|
||||
// 更新岗位信息
|
||||
practitionerRoleService.updateById(practitionerRole);
|
||||
} else {
|
||||
// 新增岗位信息
|
||||
// practitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
// 返回岗位id
|
||||
return R.ok(practitionerRole.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"岗位信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deletePractitionerRole(Long practitionerRoleId) {
|
||||
// 删除岗位信息
|
||||
boolean deletePractitionerRole = practitionerRoleService.removeById(practitionerRoleId);
|
||||
return deletePractitionerRole
|
||||
? R.ok(practitionerRoleId,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"岗位信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"岗位信息"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IBodyStructureAppService;
|
||||
import com.openhis.web.basedatamanage.dto.BodyStructureDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 身体部位管理controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/body-structure")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class BodyStructureController {
|
||||
|
||||
private final IBodyStructureAppService bodyStructureService;
|
||||
|
||||
/**
|
||||
* 身体部位分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 身体部位分页列表
|
||||
*/
|
||||
@GetMapping(value = "/body")
|
||||
public R<?> getBodyStructurePage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
||||
Page<BodyStructureDto> bodyStructureTree = bodyStructureService.getBodyStructureTree(pageNo, pageSize, request);
|
||||
return R.ok(bodyStructureTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"身体部位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身体部位需要编辑的信息
|
||||
*
|
||||
* @param id 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping("/body-getById")
|
||||
public R<?> getOrgInfo(@Validated @RequestParam Long id) {
|
||||
return bodyStructureService.getBodyStructureInfo(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑身体部位
|
||||
*
|
||||
* @param bodyStructureDto 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/body")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody BodyStructureDto bodyStructureDto) {
|
||||
return bodyStructureService.addOrEditBodyStructure(bodyStructureDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除身体部位
|
||||
*
|
||||
* @param ids 需要删除的Id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/body")
|
||||
public R<?> deleteBodyStructure(@RequestParam String ids) {
|
||||
return bodyStructureService.deleteBodyStructure(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位启用
|
||||
*
|
||||
* @param id 启用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/body-active")
|
||||
public R<?> activeBodyStructure(@RequestParam Long id) {
|
||||
return bodyStructureService.activeBodyStructure(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位停用
|
||||
*
|
||||
* @param id 停用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/body-inactive")
|
||||
public R<?> inactiveBodyStructure(@RequestParam Long id) {
|
||||
return bodyStructureService.inactiveBodyStructure(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.Frequency;
|
||||
import com.openhis.administration.service.IFrequencyService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.FrequencyDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationInitDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 频次信息管理controller
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/personalization/frequency")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class FrequencyController {
|
||||
|
||||
private final IFrequencyService frequencyService;
|
||||
|
||||
/**
|
||||
* 频次详情分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 机构分页列表
|
||||
*/
|
||||
@GetMapping(value = "/getPageList")
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, String code,HttpServletRequest request) {
|
||||
Page<Frequency> pageList= frequencyService.getPageList(pageNo, pageSize, code,request) ;
|
||||
return R.ok(pageList,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"频次详情信息"}));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/save")
|
||||
public R<?> addOrEditFrequency(@Validated @RequestBody FrequencyDto frequencyDto) {
|
||||
// 创建 Frequency 对象
|
||||
Frequency frequency = new Frequency();
|
||||
// 使用 BeanUtils 拷贝属性
|
||||
BeanUtils.copyProperties(frequencyDto, frequency);
|
||||
// 获取并转换 dayTimes 字段
|
||||
List<String> dayTimesList = frequencyDto.getDayTimes();
|
||||
if (dayTimesList != null && !dayTimesList.isEmpty()) {
|
||||
Collections.sort(dayTimesList);
|
||||
String dayTimesStr = String.join(",", dayTimesList); // 转换为逗号分隔的字符串
|
||||
frequency.setDayTimes(dayTimesStr); // 将转换后的字符串设置到 Frequency 对象
|
||||
}
|
||||
|
||||
return R.ok(frequencyService.saveOrUpdate(frequency, new LambdaQueryWrapper<Frequency>().eq(Frequency::getRateCode, frequency.getRateCode())),MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"保存频次详情"}));
|
||||
}
|
||||
|
||||
@DeleteMapping("{id}")
|
||||
public R<?> deleteFrequency(@PathVariable Long id) {
|
||||
return R.ok(frequencyService.removeById(id),MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"删除频次详情"}));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
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.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.LocationAddOrEditDto;
|
||||
import com.openhis.web.basedatamanage.dto.LocationPageParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 位置管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/location")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class LocationController {
|
||||
|
||||
@Resource
|
||||
private ILocationAppService locationAppService;
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
return locationAppService.locationInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表-树型
|
||||
*
|
||||
* @param formList 类型
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param isInHospital 是否住院
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@GetMapping(value = "/location-page-tree")
|
||||
public R<?> getLocationPage(@RequestParam List<Integer> formList,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "1000") Integer pageSize,
|
||||
@RequestParam(value = "isInHospital", defaultValue = "0") String isInHospital) {
|
||||
return locationAppService.getLocationTree(formList, pageNo, pageSize, isInHospital);
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@GetMapping(value = "/location-page")
|
||||
public R<?> getLocationPage(LocationPageParam locationPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return locationAppService.getLocationPage(locationPageParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取位置信息详情
|
||||
*
|
||||
* @param locationId 位置Id
|
||||
* @return 位置信息
|
||||
*/
|
||||
@GetMapping("/location")
|
||||
public R<?> getLocationById(@RequestParam Long locationId) {
|
||||
return locationAppService.getLocationById(locationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/location")
|
||||
public R<?> addLocation(@Validated @RequestBody LocationAddOrEditDto locationAddOrEditDto) {
|
||||
return locationAppService.addLocation(locationAddOrEditDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/location")
|
||||
public R<?> editLocation(@Validated @RequestBody LocationAddOrEditDto locationAddOrEditDto) {
|
||||
return locationAppService.editLocation(locationAddOrEditDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/location")
|
||||
public R<?> deleteLocation(@RequestParam String busNo) {
|
||||
return locationAppService.deleteLocation(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/enable")
|
||||
public R<?> enableLocation(@RequestBody List<Long> locationIdList) {
|
||||
return locationAppService.enableLocation(locationIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/deactivate")
|
||||
public R<?> deactivateLocation(@RequestBody List<Long> locationIdList) {
|
||||
return locationAppService.deactivateLocation(locationIdList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationInitDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 机构管理controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/organization")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OrganizationController {
|
||||
|
||||
private final IOrganizationAppService iOrganizationAppService;
|
||||
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
return R.ok(new OrganizationInitDto());
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 机构分页列表
|
||||
*/
|
||||
@GetMapping(value = "/organization")
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
||||
Page<OrganizationDto> organizationTree = iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
||||
return R.ok(organizationTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构需要编辑的信息
|
||||
*
|
||||
* @param orgId 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping("/organization-getById")
|
||||
public R<?> getOrgInfo(@Validated @RequestParam Long orgId) {
|
||||
return iOrganizationAppService.getOrgInfo(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/organization")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody OrganizationDto organizationDto) {
|
||||
return iOrganizationAppService.addOrEditOrganization(organizationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构信息
|
||||
*
|
||||
* @param orgIds 需要删除的Id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/organization")
|
||||
public R<?> deleteOrganization(@RequestParam String orgIds) {
|
||||
return iOrganizationAppService.deleteOrganization(orgIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 启用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/organization-active")
|
||||
public R<?> activeOrganization(@RequestParam Long orgId) {
|
||||
return iOrganizationAppService.activeOrg(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 停用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/organization-inactive")
|
||||
public R<?> inactiveOrganization(@RequestParam Long orgId) {
|
||||
return iOrganizationAppService.inactiveOrg(orgId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
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.IOrganizationLocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 机构位置关系controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/org-loc")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OrganizationLocationController {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationLocationAppService organizationLocationAppService;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
return organizationLocationAppService.organizationLocationInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置关系分页列表
|
||||
*
|
||||
* @param orgLocQueryParam 查询字段
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@GetMapping(value = "/org-loc")
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return organizationLocationAppService.getOrgLocPage(orgLocQueryParam, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@GetMapping(value = "/loc-list")
|
||||
public R<?> getLocationListByForm(@RequestParam Integer locationForm) {
|
||||
return organizationLocationAppService.getLocationListByForm(locationForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑机构位置关系信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置关系信息
|
||||
*/
|
||||
@PostMapping("/org-loc")
|
||||
public R<?> addOrEditOrgLoc(@Validated @RequestBody OrgLocQueryDto orgLocQueryDto) {
|
||||
return organizationLocationAppService.addOrEditOrgLoc(orgLocQueryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构位置关系信息
|
||||
*
|
||||
* @param orgLocId 主表id
|
||||
*/
|
||||
@DeleteMapping("/org-loc")
|
||||
public R<?> delOrgLoc(@RequestParam Long orgLocId) {
|
||||
return organizationLocationAppService.deleteOrgLoc(orgLocId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 参与者 Controller业务层处理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/practitioner")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PractitionerController {
|
||||
|
||||
private final IPractitionerAppService practitionerAppService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/user-practitioner")
|
||||
public R<?> saveUserPractitioner(@RequestBody UserAndPractitionerDto userAndPractitionerDto) {
|
||||
return practitionerAppService.saveUserPractitioner(userAndPractitionerDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
@GetMapping(value = "/user-practitioner-page")
|
||||
public R<?> getUserPractitionerPage(UserAndPractitionerDto userAndPractitionerDto,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R
|
||||
.ok(practitionerAppService.getUserPractitionerPage(userAndPractitionerDto, searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户及参与者详情
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 用户及参与者详情
|
||||
*/
|
||||
@GetMapping(value = "/user-practitioner-detail")
|
||||
public R<?> getUserPractitionerPage(@RequestParam Long userId) {
|
||||
UserAndPractitionerDto userAndPractitionerDto = new UserAndPractitionerDto();
|
||||
userAndPractitionerDto.setUserId(userId);
|
||||
IPage<UserAndPractitionerDto> userPractitionerPage =
|
||||
practitionerAppService.getUserPractitionerPage(userAndPractitionerDto, "", 1, 1);
|
||||
return R.ok(userPractitionerPage.getRecords().get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/user-practitioner")
|
||||
public R<?> editUserPractitioner(@RequestBody UserAndPractitionerDto userAndPractitionerDto) {
|
||||
return practitionerAppService.editUserPractitioner(userAndPractitionerDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户及参与者 ; admin不允许删除
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 结果
|
||||
*/
|
||||
@DeleteMapping(value = "/user-practitioner")
|
||||
public R<?> delUserPractitioner(@RequestParam Long userId) {
|
||||
return practitionerAppService.delUserPractitioner(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
@GetMapping(value = "/get-selectable-org-list")
|
||||
public R<?> getSelectableOrgList() {
|
||||
return R.ok(practitionerAppService.getSelectableOrgList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/switch-org")
|
||||
public R<?> switchOrg(@RequestParam Long orgId) {
|
||||
return practitionerAppService.switchOrg(orgId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
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.IPractitionerRoleAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractRoleSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRoleDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 岗位管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/practitioner-role")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PractitionerRoleController {
|
||||
|
||||
@Autowired
|
||||
private IPractitionerRoleAppService practitionerRoleAppService;
|
||||
|
||||
/**
|
||||
* 岗位分页列表
|
||||
*
|
||||
* @param practRoleSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 岗位分页列表
|
||||
*/
|
||||
@GetMapping(value = "/practitioner-role")
|
||||
public R<?> getPractitionerRolePage(PractRoleSearchParam practRoleSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return practitionerRoleAppService.getPractitionerPage(practRoleSearchParam, searchKey, pageNo, pageSize,
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位需要编辑的信息
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息
|
||||
*/
|
||||
@GetMapping("/practitioner-role-getById")
|
||||
public R<?> getPractitionerRoleById(@Validated @RequestParam Long practitionerRoleId) {
|
||||
return practitionerRoleAppService.getPractitionerRoleById(practitionerRoleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
*/
|
||||
@PutMapping("/practitioner-role")
|
||||
public R<?> editPractitionerRole(@Validated @RequestBody PractitionerRoleDto practitionerRoleDto) {
|
||||
return practitionerRoleAppService.addOrEditPractitionerRole(practitionerRoleDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位信息
|
||||
*
|
||||
* @param practitionerRoleId 主表id
|
||||
*/
|
||||
@DeleteMapping("/practitioner-role")
|
||||
public R<?> deletePractitionerRole(@RequestParam Long practitionerRoleId) {
|
||||
return practitionerRoleAppService.deletePractitionerRole(practitionerRoleId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.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;
|
||||
|
||||
/**
|
||||
* @author liuhr
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BodyStructureDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态枚举 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 子集合 */
|
||||
private List<BodyStructureDto> children = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/8/25
|
||||
*/
|
||||
@Data
|
||||
public class FrequencyDto {
|
||||
/**
|
||||
* 频次代码,唯一标识与字典表对应
|
||||
*/
|
||||
private String rateCode;
|
||||
|
||||
/**
|
||||
* 频次名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 每天执行的次数
|
||||
*/
|
||||
private Integer dayCount;
|
||||
|
||||
/**
|
||||
* 每次执行之间的间隔(天数)
|
||||
*/
|
||||
private Integer dayInterval;
|
||||
|
||||
/**
|
||||
* 每天的具体执行时间点,逗号分隔
|
||||
*/
|
||||
private List<String> dayTimes;
|
||||
|
||||
/**
|
||||
* 是否周期性每周执行,0 为否,1 为是
|
||||
*/
|
||||
private Integer weekCycleFlag;
|
||||
|
||||
/**
|
||||
* 每周执行的间隔,单位为周
|
||||
*/
|
||||
private Integer weekInterval;
|
||||
|
||||
/**
|
||||
* 每周执行的次数
|
||||
*/
|
||||
private Integer weekTimes;
|
||||
|
||||
/**
|
||||
* 是否为连续执行,0 为否,1 为是
|
||||
*/
|
||||
private Integer continueFlag;
|
||||
|
||||
/**
|
||||
* 执行总次数,记录任务累计执行次数
|
||||
*/
|
||||
private Integer totalExecutionCount;
|
||||
|
||||
/**
|
||||
* 任务执行周期长度
|
||||
*/
|
||||
private Integer executionPeriod;
|
||||
|
||||
/**
|
||||
* 任务执行周期的单位,如 day、week、month
|
||||
*/
|
||||
private String executionPeriodUnit;
|
||||
|
||||
/**
|
||||
* 第三方代码,外部系统使用
|
||||
*/
|
||||
private String thirdCode;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 并发戳,用于版本控制和并发冲突检测
|
||||
*/
|
||||
private Integer concurrencyStamp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 位置信息新增编辑dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationAddOrEditDto {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
@NotNull
|
||||
private String formEnum;
|
||||
|
||||
/** 机构编码 */
|
||||
private Long organizationId;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationDto {
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
@NotBlank(message = "位置编码不能为空")
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
@NotBlank(message = "位置名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 状态编码 */
|
||||
@NotNull(message = "状态编码不能为空")
|
||||
// private LocationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 操作状态 */
|
||||
@NotNull(message = "操作状态不能为空")
|
||||
// private LocationBedStatus operationalEnum;
|
||||
private Integer operationalEnum;
|
||||
private String operationalEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
@NotNull(message = "模式编码不能为空")
|
||||
// private LocationMode modeEnum;
|
||||
private Integer modeEnum;
|
||||
private String modeEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 功能编码 */
|
||||
@NotBlank(message = "功能编码不能为空")
|
||||
private String typeJson;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
@NotNull(message = "物理形式枚举不能为空")
|
||||
// private LocationForm formEnum;
|
||||
private Integer formEnum;
|
||||
private String formEnum_enumText;
|
||||
|
||||
/** 机构编码 */
|
||||
@NotNull(message = "机构编码不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 子集合 */
|
||||
private List<LocationDto> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 位置信息
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationInfoDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 操作状态 */
|
||||
private Integer operationalEnum;
|
||||
private String operationalEnum_enumText;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
private Integer formEnum;
|
||||
private String formEnum_enumText;
|
||||
|
||||
/** 机构编码 */
|
||||
@Dict(dictCode = "id",dictText = "name",dictTable = "adm_organization")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 位置信息初始化dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationInitDto {
|
||||
|
||||
private List<LocationInitDto.locationStatusOption> locationStatusOptions;
|
||||
|
||||
/**
|
||||
* 位置状态
|
||||
*/
|
||||
@Data
|
||||
public static class locationStatusOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public locationStatusOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 位置信息分页查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationPageParam {
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 位置类型 */
|
||||
private Integer formEnum;
|
||||
|
||||
/**
|
||||
* 位置分页默认初始类型(前端传)
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<Integer> locationFormList;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 科室位置关系初始化 dto
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocInitDto {
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private List<OrgLocInitDto.locationFormOption> locationFormOptions;
|
||||
|
||||
/** 科室列表 */
|
||||
private List<OrgLocInitDto.departmentOption> departmentOptions;
|
||||
|
||||
/** 科室列表 */
|
||||
private List<OrgLocInitDto.locationOption> locationOptions;
|
||||
|
||||
/** 位置列表 */
|
||||
@Data
|
||||
public static class locationOption {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public locationOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/** 科室列表 */
|
||||
@Data
|
||||
public static class departmentOption {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public departmentOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
@Data
|
||||
public static class locationFormOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public locationFormOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.sql.Time;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocQueryDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 机构编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/** 默认药房 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long defLocationId;
|
||||
|
||||
/** 发放类别 */
|
||||
private String distributionCategoryCode;
|
||||
|
||||
/**
|
||||
* 诊疗定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "wor_activity_definition")
|
||||
private Long activityDefinitionId;
|
||||
private String activityDefinitionId_dictText;
|
||||
|
||||
/**
|
||||
* 诊疗类型
|
||||
*/
|
||||
@Dict(dictCode = "activity_category_code")
|
||||
private String activityCategoryCode;
|
||||
private String activityCategoryCode_dictText;
|
||||
|
||||
/** 开始时间 */
|
||||
// @JsonFormat(pattern = "HH:mm:ss")
|
||||
private Time startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
// @JsonFormat(pattern = "HH:mm:ss")
|
||||
private Time endTime;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 科室分页查询条件
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocQueryParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 科室id
|
||||
*/
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 药房id
|
||||
*/
|
||||
private Long defLocationId;
|
||||
|
||||
/** 发放类别 */
|
||||
private String distributionCategoryCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.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 com.openhis.common.enums.OrganizationClass;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrganizationDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 活动标识 */
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_dictText;
|
||||
|
||||
/** 机构类型枚举 */
|
||||
private Integer typeEnum;
|
||||
private String typeEnum_dictText;
|
||||
|
||||
/** 机构分类枚举 */
|
||||
private Integer classEnum;
|
||||
private String classEnum_dictText;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 医保码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 医保名称 */
|
||||
private String ybName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 子集合 */
|
||||
private List<OrganizationDto> children = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 科室初始化 dto
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrganizationInitDto {
|
||||
|
||||
private List<OrganizationTypeOption> organizationTypeOptions;
|
||||
|
||||
private List<OrganizationClassOption> organizationClassOptions;
|
||||
|
||||
@Data
|
||||
public static class OrganizationTypeOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public OrganizationTypeOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class OrganizationClassOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public OrganizationClassOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
public OrganizationInitDto() {
|
||||
List<OrganizationTypeOption> organizationTypeOptionList = List.of(
|
||||
new OrganizationTypeOption(OrganizationType.HOSPITAL.getValue(), OrganizationType.HOSPITAL.getInfo()),
|
||||
new OrganizationTypeOption(OrganizationType.DEPARTMENT.getValue(), OrganizationType.DEPARTMENT.getInfo()));
|
||||
|
||||
List<OrganizationClassOption> organizationClassOptionList = List.of(
|
||||
new OrganizationClassOption(OrganizationClass.CLINIC.getValue(), OrganizationClass.CLINIC.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.INPATIENT.getValue(), OrganizationClass.INPATIENT.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.PHARMACY.getValue(), OrganizationClass.PHARMACY.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.STORAGE.getValue(), OrganizationClass.STORAGE.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.FIN.getValue(), OrganizationClass.FIN.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.NS.getValue(), OrganizationClass.NS.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.MANAGER.getValue(), OrganizationClass.MANAGER.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.SUPPORT.getValue(), OrganizationClass.SUPPORT.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.OTHER.getValue(), OrganizationClass.OTHER.getInfo()));
|
||||
|
||||
this.organizationTypeOptions = organizationTypeOptionList;
|
||||
this.organizationClassOptions = organizationClassOptionList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 岗位分页查询条件
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractRoleSearchParam implements Serializable {
|
||||
|
||||
/** 专业编码枚举 */
|
||||
private Integer specialtyEnum;
|
||||
|
||||
/** 机构 */
|
||||
private Long orgId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 员工分页查询条件
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractSearchParam implements Serializable {
|
||||
|
||||
/** 活动标记 */
|
||||
private Integer activeFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 姓名 */
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/** 其他名称 */
|
||||
private String nameJson;
|
||||
|
||||
/** 性别编码 */
|
||||
// @NotBlank(message = "性别不能为空")
|
||||
// private AdministrativeGender genderEnum;
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
|
||||
/** 死亡时间 */
|
||||
private Date deceasedDate;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 地址省 */
|
||||
private String addressProvince;
|
||||
|
||||
/** 地址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 地址区 */
|
||||
private String addressDistrict;
|
||||
|
||||
/** 地址街道 */
|
||||
private String addressStreet;
|
||||
|
||||
/** 患者其他地址 */
|
||||
private String addressJson;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String busNo;
|
||||
|
||||
/** 医保码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 系统用户id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 参与者机构和位置 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerOrgAndLocationDto {
|
||||
|
||||
/**
|
||||
* 位置id
|
||||
*/
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/**
|
||||
* 角色code
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.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;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerRoleDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 角色编码 */
|
||||
@NotBlank(message = "角色编码不能为空")
|
||||
private String role_code;
|
||||
|
||||
/** 活动标识 */
|
||||
@NotNull(message = "活动标识不能为空")
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 参与者Id */
|
||||
@NotNull(message = "参与者Id不能为空")
|
||||
private Long practitionerId;
|
||||
|
||||
/** 机构 */
|
||||
@NotNull(message = "机构不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 位置ID */
|
||||
@NotNull(message = "位置ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 服务id */
|
||||
@NotNull(message = "服务id不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long healthcareServiceId;
|
||||
|
||||
/** 专业编码枚举 */
|
||||
@NotNull(message = "专业编码不能为空")
|
||||
private Integer specialtyEnum;
|
||||
|
||||
/** 岗位类型 */
|
||||
@NotBlank(message = "岗位类型不能为空")
|
||||
private String typeCode;
|
||||
|
||||
/** 有效时间 */
|
||||
@NotBlank(message = "有效时间不能为空")
|
||||
private String availabilityJson;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 参与者角色 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerRolesDto {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色code
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 可选择切换科室 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SelectableOrgDto {
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户 及 参与者 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserAndPractitionerDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Dict(dictCode = "sys_user_sex")
|
||||
private String sex;
|
||||
private String sex_dictText;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@Dict(dictCode = "sys_normal_disable")
|
||||
private String status;
|
||||
private String status_dictText;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 医保码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/**
|
||||
* 职业证件编号
|
||||
*/
|
||||
private String pharPracCertNo;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/**
|
||||
* 责任科室
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> responsibilityOrgDtoList;
|
||||
|
||||
/**
|
||||
* 参与者角色集合
|
||||
*/
|
||||
private List<PractitionerRolesDto> practitionerRolesDtoList;
|
||||
|
||||
/**
|
||||
* 医生出诊科室集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> doctorVisitOrgDtoList;
|
||||
|
||||
/**
|
||||
* 管理库房集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageLocationDtoList;
|
||||
|
||||
/**
|
||||
* 管理药房集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList;
|
||||
|
||||
/**
|
||||
* 护士-管理科室集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageOrgDtoList;
|
||||
|
||||
/**
|
||||
* 护士-管理病区集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageWardLocationDtoList;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.web.basedatamanage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
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.basedatamanage.dto.PractitionerOrgAndLocationDto;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRolesDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
/**
|
||||
* 参与者 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface PractitionerAppAppMapper {
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
IPage<UserAndPractitionerDto> getUserPractitionerPage(@Param("page") Page<UserAndPractitionerDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<UserAndPractitionerDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询参与者的角色信息
|
||||
*
|
||||
* @param practitionerIdList 参与者id集合
|
||||
* @return 参与者的角色信息
|
||||
*/
|
||||
List<PractitionerRolesDto> getPractitionerRolesDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
||||
|
||||
/**
|
||||
* 查询科室和位置集合
|
||||
*
|
||||
* @param practitionerIdList 参与者id集合
|
||||
* @return 科室和位置集合
|
||||
*/
|
||||
List<PractitionerOrgAndLocationDto>
|
||||
getOrgAndLocationDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
||||
|
||||
/**
|
||||
* 物理删除系统用户与角色的关系
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
*/
|
||||
void delUserRole(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除参与者与业务角色的关系
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
*/
|
||||
void delPractitionerRole(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
List<SelectableOrgDto> getSelectableOrgList(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basicservice.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.yb.service.YbManager;
|
||||
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.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.IHealthcareServiceService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basicservice.dto.*;
|
||||
import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 服务管理 controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basic-service/healthcare")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class HealthcareServiceController {
|
||||
|
||||
private final IHealthcareServiceService iHealthcareServiceService;
|
||||
private final IChargeItemDefinitionService iChargeItemDefinitionService;
|
||||
|
||||
private final HealthcareServiceBizMapper healthcareServiceBizMapper;
|
||||
|
||||
private final YbManager ybService;
|
||||
|
||||
/**
|
||||
* 服务管理基础数据初始化
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
HealthcareServiceInitDto healthcareServiceInitDto = new HealthcareServiceInitDto();
|
||||
// 活动标记
|
||||
List<HealthcareServiceInitDto.activeFlagOption> activeFlagOptions = Stream.of(AccountStatus.values())
|
||||
.map(status -> new HealthcareServiceInitDto.activeFlagOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
healthcareServiceInitDto.setActiveFlagOptions(activeFlagOptions);
|
||||
// 是否需要预约
|
||||
List<HealthcareServiceInitDto.appointmentRequiredFlagOption> appointmentRequiredFlagOptions =
|
||||
Stream.of(Whether.values())
|
||||
.map(wh -> new HealthcareServiceInitDto.appointmentRequiredFlagOption(wh.getValue(), wh.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
healthcareServiceInitDto.setAppointmentRequiredFlagOptions(appointmentRequiredFlagOptions);
|
||||
return R.ok(healthcareServiceInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 新增
|
||||
*/
|
||||
@PostMapping(value = "/healthcare-service")
|
||||
public R<?> add(@Validated @RequestBody HealthcareServiceAddOrUpdateParam healthcareServiceAddOrUpdateParam) {
|
||||
// 服务管理-表单数据
|
||||
HealthcareServiceFormData healthcareServiceFormData =
|
||||
healthcareServiceAddOrUpdateParam.getHealthcareServiceFormData();
|
||||
// 费用定价-表单数据
|
||||
ChargeItemDefinitionFormData chargeItemDefinitionFormData =
|
||||
healthcareServiceAddOrUpdateParam.getChargeItemDefinitionFormData();
|
||||
// 服务管理-新增
|
||||
HealthcareService healthcareService = new HealthcareService();
|
||||
BeanUtils.copyProperties(healthcareServiceFormData, healthcareService);
|
||||
HealthcareService healthcareServiceAfterAdd = iHealthcareServiceService.addHealthcareService(healthcareService);
|
||||
// 同时保存费用定价
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinitionFormData.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
BeanUtils.copyProperties(chargeItemDefinitionFormData, chargeItemDefinition);
|
||||
boolean res = iChargeItemDefinitionService.addChargeItemDefinitionByHealthcareService(healthcareServiceAfterAdd,
|
||||
chargeItemDefinition);
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
// 医保开关打开并且,页面传了医保编码
|
||||
String ybNo = healthcareServiceFormData.getYbNo();
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(ybNo)) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE,
|
||||
healthcareServiceAfterAdd.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"服务管理"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 分页查询
|
||||
*
|
||||
* @param healthcareServiceDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 列表信息
|
||||
*/
|
||||
@GetMapping(value = "/healthcare-service-page")
|
||||
public R<?> getHealthcareServicePage(HealthcareServiceDto healthcareServiceDto,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<HealthcareServiceDto> queryWrapper = HisQueryUtils.buildQueryWrapper(healthcareServiceDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "charge_name")), request);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper.getHealthcareServicePage(
|
||||
new Page<>(pageNo, pageSize), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, queryWrapper);
|
||||
healthcareServicePage.getRecords().forEach(e -> {
|
||||
// 活动标记-枚举类回显赋值
|
||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
// 预约要求-枚举类回显赋值
|
||||
e.setAppointmentRequiredFlag_enumText(
|
||||
EnumUtils.getInfoByValue(Whether.class, e.getAppointmentRequiredFlag()));
|
||||
});
|
||||
return R.ok(healthcareServicePage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 详情
|
||||
*/
|
||||
@GetMapping(value = "/healthcare-service-detail")
|
||||
public R<?> getHealthcareServiceDetail(@RequestParam Long id) {
|
||||
HealthcareServiceDto healthcareServiceDto = new HealthcareServiceDto();
|
||||
healthcareServiceDto.setId(id);
|
||||
// 构建查询条件
|
||||
QueryWrapper<HealthcareServiceDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(healthcareServiceDto, null, null, null);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper.getHealthcareServicePage(
|
||||
new Page<>(1, 1), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, queryWrapper);
|
||||
HealthcareServiceDto healthcareServiceDtoDetail = healthcareServicePage.getRecords().get(0);
|
||||
// 枚举赋值
|
||||
healthcareServiceDtoDetail
|
||||
.setActiveFlag_enumText(
|
||||
EnumUtils.getInfoByValue(AccountStatus.class, healthcareServiceDtoDetail.getActiveFlag()))
|
||||
.setAppointmentRequiredFlag_enumText(
|
||||
EnumUtils.getInfoByValue(Whether.class, healthcareServiceDtoDetail.getAppointmentRequiredFlag()));
|
||||
return R.ok(healthcareServiceDtoDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 编辑
|
||||
*
|
||||
* @param healthcareServiceAddOrUpdateParam 表单数据
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping(value = "/healthcare-service")
|
||||
public R<?> edit(@Validated @RequestBody HealthcareServiceAddOrUpdateParam healthcareServiceAddOrUpdateParam) {
|
||||
// 服务管理-表单数据
|
||||
HealthcareServiceFormData healthcareServiceFormData =
|
||||
healthcareServiceAddOrUpdateParam.getHealthcareServiceFormData();
|
||||
HealthcareService healthcareService = new HealthcareService();
|
||||
BeanUtils.copyProperties(healthcareServiceFormData, healthcareService);
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
// 医保开关打开并且,页面传了医保编码
|
||||
String ybNo = healthcareServiceFormData.getYbNo();
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(ybNo)) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, healthcareService.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
boolean res = iHealthcareServiceService.updateHealthcareService(healthcareService);
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"服务管理"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 删除
|
||||
*
|
||||
* @param ids ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping(value = "/healthcare-service")
|
||||
public R<?> delete(@RequestParam String ids) {
|
||||
List<Long> idsList = new ArrayList<>();
|
||||
if (ids != null) {
|
||||
idsList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
boolean res = iHealthcareServiceService.removeByIds(idsList);
|
||||
// 同时删除非同定价
|
||||
for (Long id : idsList) {
|
||||
LambdaQueryWrapper<ChargeItemDefinition> QueryWrapper = new LambdaQueryWrapper<>();
|
||||
QueryWrapper.eq(ChargeItemDefinition::getInstanceId, id).eq(ChargeItemDefinition::getInstanceTable,
|
||||
CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
||||
iChargeItemDefinitionService.remove(QueryWrapper);
|
||||
}
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"服务管理"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 费用定价管理表单数据
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class ChargeItemDefinitionFormData {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String chargeName;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 机构ID
|
||||
*/
|
||||
@NotBlank(message = "机构ID不能为空")
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotBlank(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private String instanceTable;
|
||||
|
||||
/**
|
||||
* 关联项目
|
||||
*/
|
||||
private Long instanceId;
|
||||
|
||||
/**
|
||||
* 有效时间开始
|
||||
*/
|
||||
private Date effectiveStart;
|
||||
|
||||
/**
|
||||
* 有效时间结束
|
||||
*/
|
||||
private Date effectiveEnd;
|
||||
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@NotBlank(message = "财务类别不能为空")
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
@NotBlank(message = "医保类别不能为空")
|
||||
private String ybType;
|
||||
|
||||
/**
|
||||
* 是否使用详细价格规则
|
||||
*/
|
||||
@NotBlank(message = "是否使用详细价格规则不能为空")
|
||||
private Integer conditionFlag;
|
||||
|
||||
/**
|
||||
* 基础价格
|
||||
*/
|
||||
@NotBlank(message = "基础价格不能为空")
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务项目管理 新增修改参数类
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class HealthcareServiceAddOrUpdateParam {
|
||||
/**
|
||||
* 服务管理
|
||||
*/
|
||||
private HealthcareServiceFormData healthcareServiceFormData;
|
||||
|
||||
/**
|
||||
* 费用定价
|
||||
*/
|
||||
private ChargeItemDefinitionFormData chargeItemDefinitionFormData;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 服务管理 Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HealthcareServiceDto {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动标记
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_enumText;
|
||||
|
||||
/**
|
||||
* 提供部门ID
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long offeredOrgId;
|
||||
private String offeredOrgId_dictText;
|
||||
|
||||
/**
|
||||
* 服务分类
|
||||
*/
|
||||
@Dict(dictCode = "category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
@Dict(dictCode = "service_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/**
|
||||
* 服务专业
|
||||
*/
|
||||
@Dict(dictCode = "specialty_code")
|
||||
private String specialtyCode;
|
||||
private String specialtyCode_dictText;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 额外细节
|
||||
*/
|
||||
private String extraDetails;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 预约要求
|
||||
*/
|
||||
private Integer appointmentRequiredFlag;
|
||||
private String appointmentRequiredFlag_enumText;
|
||||
|
||||
/**
|
||||
* 费用定价ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String chargeName;
|
||||
|
||||
/**
|
||||
* 基础价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 诊疗费
|
||||
*/
|
||||
private BigDecimal activityPrice;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务项目管理表单数据
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class HealthcareServiceFormData {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动标记
|
||||
*/
|
||||
@NotBlank(message = "活动标记不能为空")
|
||||
private Integer activeFlag;
|
||||
|
||||
/**
|
||||
* 提供部门ID
|
||||
*/
|
||||
@NotBlank(message = "提供部门ID不能为空")
|
||||
private Long offeredOrgId;
|
||||
|
||||
/**
|
||||
* 服务分类
|
||||
*/
|
||||
@NotBlank(message = "服务分类不能为空")
|
||||
private String categoryCode;
|
||||
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
@NotBlank(message = "服务类型不能为空")
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 服务专业
|
||||
*/
|
||||
@NotBlank(message = "服务专业不能为空")
|
||||
private String specialtyCode;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
// @NotBlank(message = "地点不能为空")
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
@NotBlank(message = "服务名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 额外细节
|
||||
*/
|
||||
private String extraDetails;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@NotBlank(message = "联系方式不能为空")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 预约要求
|
||||
*/
|
||||
@NotBlank(message = "预约要求不能为空")
|
||||
private Integer appointmentRequiredFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务管理 init基础数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HealthcareServiceInitDto {
|
||||
|
||||
|
||||
private List<activeFlagOption> activeFlagOptions;
|
||||
private List<appointmentRequiredFlagOption> appointmentRequiredFlagOptions;
|
||||
|
||||
|
||||
/**
|
||||
* 活动标记
|
||||
*/
|
||||
@Data
|
||||
public static class activeFlagOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public activeFlagOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要预约
|
||||
*/
|
||||
@Data
|
||||
public static class appointmentRequiredFlagOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public appointmentRequiredFlagOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.openhis.web.basicservice.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.basicservice.dto.HealthcareServiceDto;
|
||||
|
||||
/**
|
||||
* 服务管理 自定义Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface HealthcareServiceBizMapper {
|
||||
|
||||
/**
|
||||
* 服务管理 分页查询
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param tableName 定价表名
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 列表信息
|
||||
*/
|
||||
IPage<HealthcareServiceDto> getHealthcareServicePage(@Param("page") Page<HealthcareServiceDto> page,
|
||||
@Param("tableName") String tableName, @Param("activityTableName") String activityTableName,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<HealthcareServiceDto> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.catalogmanage.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.ybcatalog.domain.CatalogZySyndrome;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 医保目录服务层
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
|
||||
public interface ICatalogService {
|
||||
R<?> getPage(Integer catalogType, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.catalogmanage.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import com.openhis.common.enums.CatalogType;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.catalogmanage.appservice.ICatalogService;
|
||||
import com.openhis.web.catalogmanage.mapper.CatalogMapper;
|
||||
import com.openhis.ybcatalog.domain.*;
|
||||
import com.openhis.ybcatalog.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* 医保目录服务层
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
@Service
|
||||
public class CatalogServiceImpl implements ICatalogService {
|
||||
|
||||
@Autowired
|
||||
CatalogMapper catalogMapper;
|
||||
@Autowired
|
||||
ICatalogDrugInfoService iCatalogDrugInfoService;
|
||||
@Autowired
|
||||
ICatalogMedicalServiceService iCatalogMedicalServiceService;
|
||||
@Autowired
|
||||
ICatalogMedicalConsumablesService iCatalogMedicalConsumablesService;
|
||||
@Autowired
|
||||
ICatalogSurgeryStandardDirectoryService iCatalogSurgeryStandardDirectoryService;
|
||||
@Autowired
|
||||
ICatalogZyDiseaseDiagnosisService iCatalogZyDiseaseDiagnosisService;
|
||||
@Autowired
|
||||
ICatalogWesternDiseaseService iCatalogWesternDiseaseService;
|
||||
@Autowired
|
||||
ICatalogZySyndromeService iCatalogZySyndromeService;
|
||||
@Autowired
|
||||
ICatalogMedicalHerbInfoService iCatalogMedicalHerbInfoService;
|
||||
|
||||
@Override
|
||||
public R<?> getPage(Integer catalogType, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 分类
|
||||
CatalogType catalog = CatalogType.getByValue(catalogType);
|
||||
if (catalog == null) {
|
||||
return R.fail(
|
||||
MessageUtils.createMessage(PromptMsgConstant.Yb.M00001, new String[] {String.valueOf(catalogType)}));
|
||||
}
|
||||
// 查询对应的目录
|
||||
switch (catalog) {
|
||||
case CATALOG_TYPE_1301:
|
||||
return get1301Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1302:
|
||||
return get1302Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1305:
|
||||
return get1305Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1306:
|
||||
return get1306Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1307:
|
||||
return get1307Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1308:
|
||||
return get1308Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1314:
|
||||
return get1314Page(searchKey, pageNo, pageSize, request);
|
||||
case CATALOG_TYPE_1315:
|
||||
return get1315Page(searchKey, pageNo, pageSize, request);
|
||||
default:
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Yb.M00001,
|
||||
new String[] {String.valueOf(catalogType)}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 中医证候目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1315Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
// QueryWrapper<CatalogZySyndrome> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
// null, searchKey, new HashSet<>(Arrays.asList(YBCommonConstants.FieldName.SyndromeTypeCode,
|
||||
// YBCommonConstants.FieldName.SyndromeTypeName, YBCommonConstants.FieldName.UniqueRecordId)),
|
||||
// request);
|
||||
//
|
||||
// return R.ok(catalogMapper.get1315Page(new Page(pageNo, pageSize), queryWrapper));
|
||||
QueryWrapper<CatalogZySyndrome> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(YbCommonConstants.FieldName.SyndromeTypeCode, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.SyndromeTypeName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.UniqueRecordId, searchKey);
|
||||
return R.ok(iCatalogZySyndromeService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 中医疾病目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1314Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
// QueryWrapper<CatalogZyDiseaseDiagnosis> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
// null, searchKey, new HashSet<>(Arrays.asList(YBCommonConstants.FieldName.DiseaseCategoryName,
|
||||
// YBCommonConstants.FieldName.DiseaseCategoryCode, YBCommonConstants.FieldName.UniqueRecordId)),
|
||||
// request);
|
||||
//
|
||||
// return R.ok(catalogMapper.get1314Page(new Page(pageNo, pageSize), queryWrapper));
|
||||
QueryWrapper<CatalogZyDiseaseDiagnosis> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(YbCommonConstants.FieldName.DiseaseCategoryName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.DiseaseCategoryCode, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.UniqueRecordId, searchKey);
|
||||
return R.ok(iCatalogZyDiseaseDiagnosisService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手术标准目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1308Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
// QueryWrapper<CatalogSurgeryStandardDirectory> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
// null, searchKey, new HashSet<>(Arrays.asList(YBCommonConstants.FieldName.CategoryName,
|
||||
// YBCommonConstants.FieldName.SubcategoryName, YBCommonConstants.FieldName.ItemName,
|
||||
// YBCommonConstants.FieldName.ItemName, YBCommonConstants.FieldName.OperationName,
|
||||
// YBCommonConstants.FieldName.OperationCode)),
|
||||
// request);
|
||||
//
|
||||
// return R.ok(catalogMapper.get1308Page(new Page(pageNo, pageSize), queryWrapper));
|
||||
QueryWrapper<CatalogSurgeryStandardDirectory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(YbCommonConstants.FieldName.CategoryName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.SubcategoryName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.ItemName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.OperationName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.OperationCode, searchKey);
|
||||
return R.ok(iCatalogSurgeryStandardDirectoryService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 疾病与诊断目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1307Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
// QueryWrapper<CatalogWesternDisease> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
// null, searchKey, new HashSet<>(Arrays.asList(YBCommonConstants.FieldName.CategoryName,
|
||||
// YBCommonConstants.FieldName.SubcategoryName, YBCommonConstants.FieldName.ItemName,
|
||||
// YBCommonConstants.FieldName.ItemName, YBCommonConstants.FieldName.OperationName,
|
||||
// YBCommonConstants.FieldName.OperationCode)),
|
||||
// request);
|
||||
//
|
||||
// return R.ok(catalogMapper.get1307Page(new Page(pageNo, pageSize), queryWrapper));
|
||||
QueryWrapper<CatalogWesternDisease> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(YbCommonConstants.FieldName.CategoryName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.SubcategoryName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.ChapterName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.SectionName, searchKey);
|
||||
return R.ok(iCatalogWesternDiseaseService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 医用耗材目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1306Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
// QueryWrapper<CatalogMedicalConsumables> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
// null, searchKey, new HashSet<>(Arrays.asList(YBCommonConstants.FieldName.MedicalCatalogCode,
|
||||
// YBCommonConstants.FieldName.ConsumableCategory, YBCommonConstants.FieldName.MaterialType,
|
||||
// YBCommonConstants.FieldName.Specification)),
|
||||
// request);
|
||||
//
|
||||
// return R.ok(catalogMapper.get1306Page(new Page(pageNo, pageSize), queryWrapper));
|
||||
QueryWrapper<CatalogMedicalConsumables> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(YbCommonConstants.FieldName.MedicalCatalogCode, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.ConsumableName, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.ConsumableCategory, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.MaterialType, searchKey).or()
|
||||
.like(YbCommonConstants.FieldName.Specification, searchKey);
|
||||
return R.ok(iCatalogMedicalConsumablesService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 医疗服务目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1305Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<CatalogMedicalService> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList(YbCommonConstants.FieldName.MedicalCatalogCode,
|
||||
YbCommonConstants.FieldName.MedicalServiceName, YbCommonConstants.FieldName.UniqueRecordId)),
|
||||
request);
|
||||
// 只保留每组中 version_number 最大的记录
|
||||
queryWrapper.eq(YbCommonConstants.FieldName.RowNumMax, 1);
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
return R.ok(catalogMapper.get1305Page(new Page(pageNo, pageSize), queryWrapper, tenantId));
|
||||
|
||||
// QueryWrapper<CatalogMedicalService> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.like(YbCommonConstants.FieldName.MedicalServiceName, searchKey).or()
|
||||
// .like(YbCommonConstants.FieldName.UniqueRecordId, searchKey);
|
||||
// return R.ok(iCatalogMedicalServiceService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 中药饮片目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1302Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
// QueryWrapper<CatalogMedicalHerbInfo> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
// null, searchKey, new HashSet<>(Arrays.asList(YBCommonConstants.FieldName.MedicalServiceName,
|
||||
// YBCommonConstants.FieldName.UniqueRecordId)),
|
||||
// request);
|
||||
//
|
||||
// return R.ok(catalogMapper.get1302Page(new Page(pageNo, pageSize), queryWrapper));
|
||||
QueryWrapper<CatalogMedicalHerbInfo> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.like(YBCommonConstants.FieldName.MedicalServiceName, searchKey).or()
|
||||
// .like(YBCommonConstants.FieldName.UniqueRecordId, searchKey);
|
||||
return R.ok(iCatalogMedicalHerbInfoService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 西药中成药目录
|
||||
*
|
||||
* @param searchKey 模糊条件
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @param request 请求参数
|
||||
* @return 分页内容
|
||||
*/
|
||||
private R<?> get1301Page(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<CatalogDrugInfo> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList(YbCommonConstants.FieldName.MedicalCatalogCode,
|
||||
YbCommonConstants.FieldName.RegisteredName, YbCommonConstants.FieldName.ApprovalNo,
|
||||
YbCommonConstants.FieldName.UniqueRecordId)),
|
||||
request);
|
||||
|
||||
// 只保留每组中 version_number 最大的记录
|
||||
queryWrapper.eq(YbCommonConstants.FieldName.RowNumMax, 1);
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
return R.ok(catalogMapper.get1301Page(new Page(pageNo, pageSize), queryWrapper, tenantId));
|
||||
|
||||
// QueryWrapper<CatalogDrugInfo> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.like(YbCommonConstants.FieldName.MedicalCatalogCode, searchKey).or()
|
||||
// .like(YbCommonConstants.FieldName.RegisteredName, searchKey).or()
|
||||
// .like(YbCommonConstants.FieldName.ApprovalNo, searchKey).or()
|
||||
// .like(YbCommonConstants.FieldName.UniqueRecordId, searchKey);
|
||||
// return R.ok(iCatalogDrugInfoService.page(new Page<>(pageNo, pageSize), queryWrapper));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.catalogmanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.annotation.Anonymous;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.catalogmanage.appservice.ICatalogService;
|
||||
import com.openhis.web.ybmanage.config.YbServiceConfig;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 医保目录
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/catalog")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CatalogController {
|
||||
|
||||
@Autowired
|
||||
ICatalogService iCatalogService;
|
||||
@Autowired
|
||||
YbServiceConfig ybServiceConfig;
|
||||
|
||||
/**
|
||||
* 分页查询医保目录信息,可选条件
|
||||
*
|
||||
* @param catalogType 查询参数
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("/page")
|
||||
public R<?> getPage(Integer catalogType, @RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
System.out.println(ybServiceConfig.getUrl());
|
||||
return R.ok(iCatalogService.getPage(catalogType, searchKey, pageNo, pageSize, request));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.catalogmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.ybcatalog.domain.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 医保目录Mapper
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
@Repository
|
||||
public interface CatalogMapper {
|
||||
|
||||
IPage<CatalogZySyndrome> get1315Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogZySyndrome> queryWrapper);
|
||||
|
||||
IPage<CatalogZyDiseaseDiagnosis> get1314Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogZyDiseaseDiagnosis> queryWrapper);
|
||||
|
||||
IPage<CatalogSurgeryStandardDirectory> get1308Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogSurgeryStandardDirectory> queryWrapper);
|
||||
|
||||
IPage<CatalogWesternDisease> get1307Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogWesternDisease> queryWrapper);
|
||||
|
||||
IPage<CatalogMedicalConsumables> get1306Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogMedicalConsumables> queryWrapper);
|
||||
|
||||
IPage<CatalogMedicalService> get1305Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogMedicalService> queryWrapper,@Param("tenantId") Integer tenantId);
|
||||
|
||||
IPage<CatalogMedicalHerbInfo> get1302Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogMedicalHerbInfo> queryWrapper);
|
||||
|
||||
IPage<CatalogDrugInfo> get1301Page(@Param("page")Page page, @Param(Constants.WRAPPER)QueryWrapper<CatalogDrugInfo> queryWrapper,@Param("tenantId") Integer tenantId);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||
|
||||
/**
|
||||
* 门诊收费 service
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IInpatientChargeAppService {
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
|
||||
String endTime);
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> changeToSelfPay(Long encounterId);
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> changeToMedicalInsurance(Long encounterId);
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> outpatientChargeInit();
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊收费 service
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOutpatientChargeAppService {
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> changeToSelfPay(Long encounterId);
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> changeToMedicalInsurance(Long encounterId);
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> outpatientChargeInit();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.PatientInfoDto;
|
||||
|
||||
/**
|
||||
* 门诊划价 service
|
||||
*
|
||||
* @author yangmo
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface IOutpatientPricingAppService {
|
||||
|
||||
/**
|
||||
* 查询就诊患者信息
|
||||
*
|
||||
* @param patientInfoDto 查询条件 (前端可传 statusEnum 区分就诊状态tab)
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 就诊患者信息
|
||||
*/
|
||||
IPage<PatientInfoDto> getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询医嘱信息
|
||||
*
|
||||
* @param adviceBaseDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param locationId 药房id
|
||||
* @param organizationId 患者挂号对应的科室id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
Long organizationId, Integer pageNo, Integer pageSize);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.RefundItemParam;
|
||||
|
||||
/**
|
||||
* 门诊退费 service
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-15
|
||||
*/
|
||||
public interface IOutpatientRefundAppService {
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者账单列表
|
||||
*/
|
||||
R<?> getEncounterPatientPayment(Long encounterId);
|
||||
|
||||
/**
|
||||
* 根据账单退费
|
||||
*
|
||||
* @param refundItemList 退费项目id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> refundPayment(List<RefundItemParam> refundItemList);
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 门诊退费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> outpatientRefundInit();
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的退费账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param billDateSTime 收费时间开始
|
||||
* @param billDateETime 收费时间结束
|
||||
* @return 退费账单列表
|
||||
*/
|
||||
R<?> getEncounterPatientRefund(Long encounterId, String billDateSTime, String billDateETime);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者因退费重新生成的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 重新生成的账单列表
|
||||
*/
|
||||
R<?> getRegenerateCharge(Long encounterId);
|
||||
|
||||
/**
|
||||
* 校验是否可以退费(耗材/药品是否已退,诊疗是否取消执行)
|
||||
*
|
||||
* @param chargeItemIdList 收费项目id列表
|
||||
* @return 是否可退
|
||||
*/
|
||||
R<?> verifyRefundable(List<Long> chargeItemIdList);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.web.basicservice.dto.HealthcareServiceDto;
|
||||
import com.openhis.web.chargemanage.dto.*;
|
||||
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 门诊挂号 应用Service
|
||||
*/
|
||||
public interface IOutpatientRegistrationAppService {
|
||||
|
||||
/**
|
||||
* 查询患者信息
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 患者信息
|
||||
*/
|
||||
Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询门诊科室数据
|
||||
*
|
||||
* @return 门诊科室
|
||||
*/
|
||||
List<OrgMetadata> getOrgMetadata();
|
||||
|
||||
/**
|
||||
* 根据科室id筛选医生
|
||||
*
|
||||
* @param orgId 科室ID
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 筛选医生
|
||||
*/
|
||||
IPage<PractitionerMetadata> getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo,
|
||||
Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*
|
||||
* @param organizationId 机构id
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 服务项目
|
||||
*/
|
||||
IPage<HealthcareServiceDto> getHealthcareMetadataByOrganizationId(Long organizationId, String searchKey,
|
||||
Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 退号
|
||||
*
|
||||
* @param cancelRegPaymentDto 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> returnRegister(CancelRegPaymentDto cancelRegPaymentDto);
|
||||
|
||||
/**
|
||||
* 查询当日就诊数据
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 当日就诊数据
|
||||
*/
|
||||
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 取消挂号
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> cancelRegister(Long encounterId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
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.IAccountService;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.ChargeItemContext;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||
import com.openhis.web.chargemanage.dto.OutpatientInitDto;
|
||||
import com.openhis.web.chargemanage.mapper.InpatientChargeAppMapper;
|
||||
|
||||
/**
|
||||
* 门诊收费 impl
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@Service
|
||||
public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService {
|
||||
|
||||
@Autowired
|
||||
private InpatientChargeAppMapper inpatientChargeAppMapper;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IAccountService accountService;
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> outpatientChargeInit() {
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterPatientPageParam> 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<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper
|
||||
.selectEncounterPatientPage(EncounterClass.IMP.getValue(), new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
encounterPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
});
|
||||
return R.ok(encounterPatientPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
|
||||
String endTime) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
|
||||
startTime = startTime + "000000";
|
||||
|
||||
endTime = endTime + "235959";
|
||||
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
try {
|
||||
startDate = sdf.parse(startTime);
|
||||
endDate = sdf.parse(endTime);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
||||
inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), startDate, endDate);
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return prescriptionDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToSelfPay(Long encounterId) {
|
||||
// 获取就诊患者的自费账户id
|
||||
Long accountId = accountService.getSelfPayAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"}));
|
||||
}
|
||||
// 医保转自费
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToMedicalInsurance(Long encounterId) {
|
||||
// 获取就诊患者的医保账户id
|
||||
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
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.IAccountService;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.ChargeItemContext;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
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.EncounterPatientPrescriptionDto;
|
||||
import com.openhis.web.chargemanage.dto.OutpatientInitDto;
|
||||
import com.openhis.web.chargemanage.mapper.OutpatientChargeAppMapper;
|
||||
|
||||
/**
|
||||
* 门诊收费 impl
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@Service
|
||||
public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppService {
|
||||
|
||||
@Autowired
|
||||
private OutpatientChargeAppMapper outpatientChargeAppMapper;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IAccountService accountService;
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> outpatientChargeInit() {
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterPatientPageParam> 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<EncounterPatientPageDto> encounterPatientPage = outpatientChargeAppMapper
|
||||
.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.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(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
});
|
||||
return R.ok(encounterPatientPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId) {
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
||||
outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return prescriptionDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToSelfPay(Long encounterId) {
|
||||
// 获取就诊患者的自费账户id
|
||||
Long accountId = accountService.getSelfPayAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"}));
|
||||
}
|
||||
// 医保转自费
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToMedicalInsurance(Long encounterId) {
|
||||
// 获取就诊患者的医保账户id
|
||||
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientPricingAppService;
|
||||
import com.openhis.web.chargemanage.mapper.OutpatientPricingAppMapper;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService;
|
||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.PatientInfoDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊划价 impl
|
||||
*
|
||||
* @author yangmo
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@Service
|
||||
public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppService {
|
||||
|
||||
@Resource
|
||||
OutpatientPricingAppMapper outpatientPricingAppMapper;
|
||||
|
||||
@Resource
|
||||
IDoctorStationMainAppService iDoctorStationMainAppService;
|
||||
|
||||
@Resource
|
||||
IDoctorStationAdviceAppService iDoctorStationAdviceAppService;
|
||||
|
||||
/**
|
||||
* 查询就诊患者信息
|
||||
*
|
||||
* @param patientInfoDto 查询条件 (前端传 statusEnum 区分就诊状态tab)
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 就诊患者信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<PatientInfoDto> getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
return iDoctorStationMainAppService.getPatientInfo(patientInfoDto, searchKey, pageNo, pageSize, request,
|
||||
Whether.YES.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医嘱信息
|
||||
*
|
||||
* @param adviceBaseDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param locationId 药房id
|
||||
* @param organizationId 患者挂号对应的科室id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
Long organizationId, Integer pageNo, Integer pageSize) {
|
||||
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
|
||||
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,482 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
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.service.IPaymentReconciliationService;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService;
|
||||
import com.openhis.web.chargemanage.dto.*;
|
||||
import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IDeviceRequestService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
* 门诊退费 impl
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-15
|
||||
*/
|
||||
@Service
|
||||
public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppService {
|
||||
|
||||
@Autowired
|
||||
private OutpatientRefundAppMapper outpatientRefundAppMapper;
|
||||
@Autowired
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
@Autowired
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
@Autowired
|
||||
private IServiceRequestService serviceRequestService;
|
||||
@Autowired
|
||||
private IMedicationRequestService medicationRequestService;
|
||||
@Autowired
|
||||
private IDeviceRequestService deviceRequestService;
|
||||
@Autowired
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 门诊退费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> outpatientRefundInit() {
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> 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查询患者的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者账单列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientPayment(Long encounterId) {
|
||||
|
||||
// 患者账单信息列表
|
||||
List<EncounterPatientPaymentDto> encounterPatientPaymentList =
|
||||
outpatientRefundAppMapper.selectEncounterPatientPayment(encounterId, PaymentStatus.SUCCESS.getValue(),
|
||||
PaymentStatus.REFUND_PART.getValue(), PaymentStatus.REFUND_ALL.getValue());
|
||||
|
||||
// 获取付款id集合
|
||||
List<Long> paymentIdList =
|
||||
encounterPatientPaymentList.stream().map(EncounterPatientPaymentDto::getId).collect(Collectors.toList());
|
||||
if (paymentIdList.isEmpty()) {
|
||||
return R.ok(null);
|
||||
}
|
||||
// 根据付款id获取对应收费项目的id列表(费用项id)
|
||||
List<Long> chargeItemIdList = paymentReconciliationService.getChargeItemIdListByPayment(paymentIdList);
|
||||
|
||||
// 根据收费项目id列表查询费用项
|
||||
List<RefundItemDto> refundItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
refundItemList.forEach(e -> {
|
||||
// 退费状态
|
||||
e.setRefundStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getRefundStatus()));
|
||||
// 发放状态
|
||||
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
|
||||
// 执行状态
|
||||
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
|
||||
|
||||
});
|
||||
|
||||
return R.ok(refundItemList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单退费
|
||||
*
|
||||
* @param refundItemList 退费项目id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> refundPayment(List<RefundItemParam> refundItemList) {
|
||||
|
||||
// 未退费用项,生成新的请求发放费用项
|
||||
List<RefundItemParam> creatList = new ArrayList<>();
|
||||
for (RefundItemParam param : refundItemList) {
|
||||
if (!param.getRefundFlg()) {
|
||||
// 未退费费用项list
|
||||
creatList.add(param);
|
||||
}
|
||||
}
|
||||
|
||||
if (!creatList.isEmpty()) {
|
||||
// 未退费费用项id集合
|
||||
List<Long> creatChargeItemIdList =
|
||||
creatList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
|
||||
// 根据费用项id查询费用项请求发放信息
|
||||
List<RefundItemDto> creatChargeItemList = outpatientRefundAppMapper.selectRefundItem(creatChargeItemIdList,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
for (RefundItemDto creatdDto : creatChargeItemList) {
|
||||
|
||||
// 未退费用项,生成新的请求,发放,费用项
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
// 药品请求查询
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(creatdDto.getRequestId());
|
||||
// 生成新的药品请求
|
||||
medicationRequest.setId(null); // 药品请求id
|
||||
medicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
|
||||
medicationRequestService.save(medicationRequest);
|
||||
|
||||
// 药品发放查询
|
||||
MedicationDispense medicationDispense =
|
||||
medicationDispenseService.getById(creatdDto.getDispenseId());
|
||||
// 生成新的药品发放
|
||||
medicationDispense.setId(null); // 药品发放id
|
||||
medicationDispense
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4)); // 药品发放编码
|
||||
medicationDispense.setMedReqId(medicationRequest.getId()); // 药品请求id
|
||||
medicationDispenseService.save(medicationDispense);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); // 编码
|
||||
chargeItem.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
|
||||
chargeItem.setServiceId(medicationRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
// 服务请求查询
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(creatdDto.getRequestId());
|
||||
// 生成新的服务请求
|
||||
serviceRequest.setId(null); // 服务请求id
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
||||
serviceRequestService.save(serviceRequest);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo())); // 编码
|
||||
chargeItem.setServiceId(serviceRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
// 耗材请求查询
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(creatdDto.getRequestId());
|
||||
// 生成新的耗材请求
|
||||
deviceRequest.setId(null); // 耗材请求id
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
|
||||
deviceRequestService.save(deviceRequest);
|
||||
|
||||
// 耗材发放查询
|
||||
DeviceDispense deviceDispense = deviceDispenseService.getById(creatdDto.getDispenseId());
|
||||
// 生成新的耗材发放
|
||||
deviceDispense.setId(null); // 耗材id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4)); // 器材发放id
|
||||
deviceDispense.setDeviceReqId(deviceRequest.getId()); // 器材请求id
|
||||
deviceDispenseService.save(deviceDispense);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo())); // 编码
|
||||
chargeItem.setServiceId(deviceRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 全部退费
|
||||
// 退费费用项id集合
|
||||
List<Long> chargeItemIdList =
|
||||
refundItemList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
|
||||
|
||||
// 根据费用项id查询费用项请求发放信息
|
||||
List<RefundItemDto> chargeItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
List<Long> medDisIdList = new ArrayList<>();
|
||||
List<Long> devDisIdList = new ArrayList<>();
|
||||
List<Long> serReqIdList = new ArrayList<>();
|
||||
|
||||
for (RefundItemDto dto : chargeItemList) {
|
||||
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(dto.getServiceTable())) {
|
||||
// 药品需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
|
||||
// 药品请求查询
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(dto.getRequestId());
|
||||
if (medicationRequest.getRefundMedicineId() != null) {
|
||||
throw new ServiceException("已申请退药,请勿重复申请");
|
||||
}
|
||||
// 生成药品请求(退药)
|
||||
medicationRequest.setId(null); // 药品请求id
|
||||
medicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
|
||||
medicationRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量
|
||||
medicationRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
||||
medicationRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||
medicationRequest.setRefundMedicineId(dto.getRequestId()); // 退药id
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("T" + dto.getPrescriptionNo()));
|
||||
medicationRequestService.save(medicationRequest);
|
||||
|
||||
} else {
|
||||
if (DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())
|
||||
&& NotPerformedReason.REFUND.getValue().equals(dto.getNotPerformedReason())) {
|
||||
throw new ServiceException("已申请退药,请勿重复申请");
|
||||
}
|
||||
medDisIdList.add(dto.getDispenseId());
|
||||
}
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(dto.getServiceTable())) {
|
||||
// 诊疗项目需医技科室同意退费
|
||||
if (RequestStatus.COMPLETED.getValue().equals(dto.getServiceStatus())) {
|
||||
// 服务请求查询
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(dto.getRequestId());
|
||||
if (serviceRequest.getRefundServiceId() != null) {
|
||||
throw new ServiceException("已申请退费,请勿重复申请");
|
||||
}
|
||||
// 生成服务请求(取消服务)
|
||||
serviceRequest.setId(null); // 服务请求id
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
||||
serviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量
|
||||
serviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
||||
serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||
serviceRequest.setRefundServiceId(dto.getRequestId()); // 退药id
|
||||
serviceRequestService.save(serviceRequest);
|
||||
|
||||
} else {
|
||||
if (RequestStatus.STOPPED.getValue().equals(dto.getServiceStatus())) {
|
||||
throw new ServiceException("已申请退费,请勿重复申请");
|
||||
}
|
||||
serReqIdList.add(dto.getServiceId());
|
||||
}
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(dto.getServiceTable())) {
|
||||
// 耗材需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
|
||||
// 耗材请求查询
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(dto.getRequestId());
|
||||
if (deviceRequest.getRefundDeviceId() == null) {
|
||||
// 生成耗材请求(退耗材)
|
||||
deviceRequest.setId(null); // 耗材请求id
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
|
||||
deviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量
|
||||
deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
||||
deviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||
deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id
|
||||
deviceRequestService.save(deviceRequest);
|
||||
}
|
||||
} else if (!DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())) {
|
||||
devDisIdList.add(dto.getDispenseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新收费状态:退费中
|
||||
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
|
||||
|
||||
if (!medDisIdList.isEmpty()) {
|
||||
// 更新未发放药品状态:停止发放,停止原因:退费
|
||||
medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
}
|
||||
if (!devDisIdList.isEmpty()) {
|
||||
// 更新未发放耗材状态:停止发放,停止原因:退费
|
||||
deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
}
|
||||
if (!serReqIdList.isEmpty()) {
|
||||
// 更新未执行诊疗状态:停止
|
||||
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<EncounterPatientPageParam> 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<EncounterPatientPageDto> encounterPatientPage =
|
||||
outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(),
|
||||
AccountType.MEDICAL_ELECTRONIC_CERTIFICATE.getCode(), EncounterClass.AMB.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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的退费账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param billDateSTime 收费时间开始
|
||||
* @param billDateETime 收费时间结束
|
||||
* @return 退费账单列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientRefund(Long encounterId, String billDateSTime, String billDateETime) {
|
||||
List<EncounterPatientRefundDto> refundDtoList =
|
||||
outpatientRefundAppMapper.selectEncounterPatientRefund(encounterId, ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(),
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, billDateSTime, billDateETime);
|
||||
refundDtoList.forEach(e -> {
|
||||
// 收费状态枚举
|
||||
e.setChargeStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getChargeStatus()));
|
||||
// 支付状态枚举
|
||||
e.setPaymentStatus_enumText(EnumUtils.getInfoByValue(PaymentStatus.class, e.getPaymentStatus()));
|
||||
// 发药状态
|
||||
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
|
||||
// 诊疗执行枚举
|
||||
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
|
||||
});
|
||||
return R.ok(refundDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者因退费重新生成的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 重新生成的账单列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getRegenerateCharge(Long encounterId) {
|
||||
return R.ok(chargeItemService.getRegenerateCharge(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否可以退费(耗材/药品是否已退,诊疗是否取消执行)
|
||||
*
|
||||
* @param chargeItemIdList 收费项目id列表
|
||||
* @return 是否可退
|
||||
*/
|
||||
@Override
|
||||
public R<?> verifyRefundable(List<Long> chargeItemIdList) {
|
||||
// 查询收费项目信息
|
||||
List<ChargeItem> chargeItemList = chargeItemService.listByIds(chargeItemIdList);
|
||||
|
||||
// 分别获取各个请求id列表
|
||||
List<Long> medReqIdList = new ArrayList<>();
|
||||
List<Long> devReqIdList = new ArrayList<>();
|
||||
chargeItemList.forEach(item -> {
|
||||
switch (item.getServiceTable()) {
|
||||
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
|
||||
}
|
||||
});
|
||||
|
||||
if (!medReqIdList.isEmpty()) {
|
||||
List<MedicationRequest> medicationRequestList = medicationRequestService.list(
|
||||
new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getRefundMedicineId, medReqIdList));
|
||||
if (!medicationRequestList.isEmpty()) {
|
||||
if (medicationRequestList.stream().map(MedicationRequest::getStatusEnum)
|
||||
.anyMatch(x -> x.equals(RequestStatus.CANCELLED.getValue()))) {
|
||||
throw new ServiceException("请先退药后再退费");
|
||||
}
|
||||
}
|
||||
}
|
||||
String fixmedinsCode =
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE);
|
||||
if (!HospitalCodeEnum.CCU.getCode().equals(fixmedinsCode)) {
|
||||
if (!devReqIdList.isEmpty()) {
|
||||
List<DeviceRequest> deviceRequestList = deviceRequestService
|
||||
.list(new LambdaQueryWrapper<DeviceRequest>().in(DeviceRequest::getRefundDeviceId, devReqIdList));
|
||||
if (!deviceRequestList.isEmpty()) {
|
||||
if (deviceRequestList.stream().map(DeviceRequest::getStatusEnum)
|
||||
.anyMatch(x -> x.equals(RequestStatus.CANCELLED.getValue()))) {
|
||||
throw new ServiceException("请先退耗材后再退费");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
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.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.*;
|
||||
import com.openhis.administration.mapper.PatientMapper;
|
||||
import com.openhis.administration.service.*;
|
||||
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.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
|
||||
import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
|
||||
import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto;
|
||||
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
||||
import com.openhis.web.chargemanage.dto.PatientMetadata;
|
||||
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
|
||||
import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper;
|
||||
import com.openhis.web.paymentmanage.appservice.IPaymentRecService;
|
||||
import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
|
||||
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
||||
import com.openhis.yb.model.CancelRegPaymentModel;
|
||||
import com.openhis.yb.service.YbManager;
|
||||
|
||||
/**
|
||||
* 门诊挂号 应用实现类
|
||||
*/
|
||||
@Service
|
||||
public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistrationAppService {
|
||||
|
||||
@Resource
|
||||
PatientMapper patientMapper;
|
||||
|
||||
@Resource
|
||||
OutpatientRegistrationAppMapper outpatientRegistrationAppMapper;
|
||||
|
||||
@Resource
|
||||
HealthcareServiceBizMapper healthcareServiceBizMapper;
|
||||
|
||||
@Resource
|
||||
IEncounterService iEncounterService;
|
||||
|
||||
@Resource
|
||||
IAccountService iAccountService;
|
||||
|
||||
@Resource
|
||||
IChargeItemService iChargeItemService;
|
||||
|
||||
@Resource
|
||||
IOrganizationService iOrganizationService;
|
||||
|
||||
@Resource
|
||||
YbManager ybManager;
|
||||
|
||||
@Resource
|
||||
IPaymentRecService iPaymentRecService;
|
||||
|
||||
@Resource
|
||||
IPatientIdentifierService patientIdentifierService;
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 查询患者信息
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 患者信息
|
||||
*/
|
||||
@Override
|
||||
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 通过证件号匹配 patient
|
||||
if (StringUtils.isNotEmpty(searchKey)) {
|
||||
PatientIdentifier patientIdentifier = patientIdentifierService
|
||||
.getOne(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getIdentifierNo, searchKey));
|
||||
if (patientIdentifier != null) {
|
||||
queryWrapper.or(q -> q.eq("id", patientIdentifier.getPatientId()));
|
||||
}
|
||||
}
|
||||
// 患者信息
|
||||
Page<PatientMetadata> patientMetadataPage =
|
||||
HisPageUtils.selectPage(patientMapper, queryWrapper, pageNo, pageSize, PatientMetadata.class);
|
||||
// 现有就诊过的患者id集合
|
||||
List<Long> patientIdList =
|
||||
iEncounterService.list().stream().map(e -> e.getPatientId()).collect(Collectors.toList());
|
||||
|
||||
patientMetadataPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
// 初复诊
|
||||
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
||||
: EncounterType.INITIAL.getInfo());
|
||||
|
||||
});
|
||||
return patientMetadataPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门诊科室数据
|
||||
*
|
||||
* @return 门诊科室
|
||||
*/
|
||||
@Override
|
||||
public List<OrgMetadata> getOrgMetadata() {
|
||||
List<Organization> list =
|
||||
iOrganizationService.getList(OrganizationType.DEPARTMENT.getValue(), OrganizationClass.CLINIC.getValue());
|
||||
List<OrgMetadata> orgMetadataList = new ArrayList<>();
|
||||
OrgMetadata orgMetadata;
|
||||
for (Organization organization : list) {
|
||||
orgMetadata = new OrgMetadata();
|
||||
BeanUtils.copyProperties(organization, orgMetadata);
|
||||
orgMetadataList.add(orgMetadata);
|
||||
}
|
||||
return orgMetadataList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室id筛选医生
|
||||
*
|
||||
* @param orgId 科室ID
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 筛选医生
|
||||
*/
|
||||
@Override
|
||||
public IPage<PractitionerMetadata> getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<PractitionerMetadata> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
IPage<PractitionerMetadata> practitionerMetadataPage =
|
||||
outpatientRegistrationAppMapper.getPractitionerMetadataPage(new Page<>(pageNo, pageSize), orgId,
|
||||
PractitionerRoles.DOCTOR.getCode(), queryWrapper);
|
||||
practitionerMetadataPage.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
});
|
||||
return practitionerMetadataPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*
|
||||
* @param organizationId 机构id
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 服务项目
|
||||
*/
|
||||
@Override
|
||||
public IPage<HealthcareServiceDto> getHealthcareMetadataByOrganizationId(Long organizationId, String searchKey,
|
||||
Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
HealthcareServiceDto healthcareServiceDto = new HealthcareServiceDto();
|
||||
healthcareServiceDto.setOfferedOrgId(organizationId);
|
||||
QueryWrapper<HealthcareServiceDto> queryWrapper = HisQueryUtils.buildQueryWrapper(healthcareServiceDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "charge_name")), null);
|
||||
return healthcareServiceBizMapper.getHealthcareServicePage(new Page<>(pageNo, pageSize),
|
||||
CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退号
|
||||
*
|
||||
* @param cancelRegPaymentDto 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> returnRegister(CancelRegPaymentDto cancelRegPaymentDto) {
|
||||
Encounter byId = iEncounterService.getById(cancelRegPaymentDto.getEncounterId());
|
||||
if (EncounterStatus.CANCELLED.getValue().equals(byId.getStatusEnum())) {
|
||||
return R.fail(null, "该患者已经退号,请勿重复退号");
|
||||
}
|
||||
iEncounterService.returnRegister(cancelRegPaymentDto.getEncounterId());
|
||||
// 查询账户信息
|
||||
Account account = iAccountService
|
||||
.getOne(new LambdaQueryWrapper<Account>().eq(Account::getEncounterId, cancelRegPaymentDto.getEncounterId())
|
||||
.ne(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode())
|
||||
.eq(Account::getEncounterFlag, Whether.YES.getValue()));
|
||||
|
||||
CancelPaymentDto cancelPaymentDto = new CancelPaymentDto();
|
||||
BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto);
|
||||
|
||||
// 开通医保的处理
|
||||
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
|
||||
&& account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) {
|
||||
CancelRegPaymentModel model = new CancelRegPaymentModel();
|
||||
BeanUtils.copyProperties(cancelRegPaymentDto, model);
|
||||
model.setContractNo(account.getContractNo());
|
||||
ybManager.cancelReg(model);
|
||||
cancelPaymentDto.setSetlId(model.getSetlId());
|
||||
// return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医保退号"}));
|
||||
}
|
||||
|
||||
R<?> result = iPaymentRecService.cancelRegPayment(cancelPaymentDto);
|
||||
|
||||
PaymentReconciliation paymentRecon = null;
|
||||
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
|
||||
paymentRecon = (PaymentReconciliation)result.getData();
|
||||
}
|
||||
if (paymentRecon != null) {
|
||||
String[] strings = paymentRecon.getChargeItemIds().split(",");
|
||||
List<Long> chargeItemIds = new ArrayList<>();
|
||||
for (String string : strings) {
|
||||
chargeItemIds.add(Long.parseLong(string));
|
||||
}
|
||||
// 更新收费状态:已退费
|
||||
if (!chargeItemIds.isEmpty()) {
|
||||
iChargeItemService.updatePaymentStatus(chargeItemIds, ChargeItemStatus.REFUNDED.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// 2025/05/05 该处保存费用项后,会通过统一收费处理进行收费
|
||||
return R.ok(paymentRecon, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"退号"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当日就诊数据
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 当日就诊数据
|
||||
*/
|
||||
@Override
|
||||
public IPage<CurrentDayEncounterDto> getCurrentDayEncounter(String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<CurrentDayEncounterDto> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
|
||||
request);
|
||||
|
||||
IPage<CurrentDayEncounterDto> currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter(
|
||||
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), ParticipantType.ADMITTER.getCode(),
|
||||
queryWrapper, ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue());
|
||||
currentDayEncounter.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 就诊状态
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterStatus.class, e.getStatusEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
});
|
||||
return currentDayEncounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消挂号
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> cancelRegister(Long encounterId) {
|
||||
iEncounterService.removeById(encounterId);
|
||||
return R.ok("已取消挂号");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
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.IInpatientChargeAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊收费 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge-manage/inpa-charge")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InpatientChargeController {
|
||||
|
||||
@Autowired
|
||||
private IInpatientChargeAppService inpatientChargeAppService;
|
||||
|
||||
/**
|
||||
* 收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> outpatientChargeInit() {
|
||||
return inpatientChargeAppService.outpatientChargeInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/encounter-patient-page")
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
||||
pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-prescription")
|
||||
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId, @RequestParam String startTime,
|
||||
@RequestParam String endTime) {
|
||||
return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId, startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/self-pay")
|
||||
public R<?> changeToSelfPay(@RequestParam Long encounterId) {
|
||||
return inpatientChargeAppService.changeToSelfPay(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/medical-insurance")
|
||||
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
|
||||
return inpatientChargeAppService.changeToMedicalInsurance(encounterId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
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.IOutpatientChargeAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊收费 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge-manage/charge")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientChargeController {
|
||||
|
||||
@Autowired
|
||||
private IOutpatientChargeAppService outpatientChargeAppService;
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> outpatientChargeInit() {
|
||||
return outpatientChargeAppService.outpatientChargeInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/encounter-patient-page")
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(outpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
||||
pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-prescription")
|
||||
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId) {
|
||||
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/self-pay")
|
||||
public R<?> changeToSelfPay(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToSelfPay(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/medical-insurance")
|
||||
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToMedicalInsurance(encounterId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientPricingAppService;
|
||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.PatientInfoDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊划价 controller
|
||||
*
|
||||
* @author yangmo
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge-manage/pricing")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientPricingController {
|
||||
|
||||
private final IOutpatientPricingAppService iOutpatientPricingAppService;
|
||||
|
||||
/**
|
||||
* 查询就诊患者信息
|
||||
*
|
||||
* @param patientInfoDto 查询条件 (前端可传 statusEnum 区分就诊状态tab)
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 就诊患者信息
|
||||
*/
|
||||
@GetMapping(value = "/patient-info")
|
||||
public R<?> getPatientInfo(PatientInfoDto patientInfoDto,
|
||||
@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(iOutpatientPricingAppService.getPatientInfo(patientInfoDto, searchKey, pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医嘱信息
|
||||
*
|
||||
* @param adviceBaseDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param locationId 药房id
|
||||
* @param organizationId 患者挂号对应的科室id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
@GetMapping(value = "/advice-base-info")
|
||||
public R<?> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "locationId", required = false) Long locationId,
|
||||
@RequestParam(value = "organizationId") Long organizationId,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R.ok(iOutpatientPricingAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, organizationId,
|
||||
pageNo, pageSize));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
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 com.openhis.web.chargemanage.dto.RefundItemParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊退费 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge-manage/refund")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientRefundController {
|
||||
|
||||
@Autowired
|
||||
private IOutpatientRefundAppService outpatientRefundAppService;
|
||||
|
||||
/**
|
||||
* 门诊退费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> outpatientRefundInit() {
|
||||
return outpatientRefundAppService.outpatientRefundInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @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 outpatientRefundAppService.getBilledEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
||||
pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的账单(申请退费列表)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者账单列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-payment")
|
||||
public R<?> getEncounterPatientPayment(@RequestParam Long encounterId) {
|
||||
return outpatientRefundAppService.getEncounterPatientPayment(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单申请退费
|
||||
*
|
||||
* @param refundItemList 退费项目id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/refund-payment")
|
||||
public R<?> refundPayment(@RequestBody List<RefundItemParam> refundItemList) {
|
||||
return outpatientRefundAppService.refundPayment(refundItemList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的退费账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param billDateSTime 收费时间开始
|
||||
* @param billDateETime 收费时间结束
|
||||
* @return 退费账单列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-refund")
|
||||
public R<?> getEncounterPatientRefund(@RequestParam Long encounterId, @RequestParam String billDateSTime,
|
||||
@RequestParam String billDateETime) {
|
||||
return outpatientRefundAppService.getEncounterPatientRefund(encounterId, billDateSTime, billDateETime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者因退费重新生成的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 重新生成的账单列表
|
||||
*/
|
||||
@GetMapping(value = "/regenerate_charge")
|
||||
public R<?> getRegenerateCharge(@RequestParam Long encounterId) {
|
||||
return outpatientRefundAppService.getRegenerateCharge(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否可以退费(耗材/药品是否已退,诊疗是否取消执行)
|
||||
*
|
||||
* @param chargeItemIdList 收费项目id列表
|
||||
* @return 是否可退
|
||||
*/
|
||||
@GetMapping(value = "/verify_refund")
|
||||
public R<?> verifyRefundable(@RequestParam List<Long> chargeItemIdList) {
|
||||
return outpatientRefundAppService.verifyRefundable(chargeItemIdList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.PriorityLevel;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
|
||||
import com.openhis.web.chargemanage.dto.OutpatientRegistrationInitDto;
|
||||
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
|
||||
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊挂号 controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge-manage/register")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientRegistrationController {
|
||||
|
||||
private final IOutpatientRegistrationAppService iOutpatientRegistrationAppService;
|
||||
|
||||
@Autowired
|
||||
private IEleInvoiceService eleInvoiceService;
|
||||
|
||||
/**
|
||||
* 基础数据初始化
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
OutpatientRegistrationInitDto outpatientRegistrationInitDto = new OutpatientRegistrationInitDto();
|
||||
// 优先级
|
||||
List<OutpatientRegistrationInitDto.priorityLevelOption> priorityLevelOptionOptions =
|
||||
Stream.of(PriorityLevel.values())
|
||||
.map(e -> new OutpatientRegistrationInitDto.priorityLevelOption(e.getValue(), e.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
outpatientRegistrationInitDto.setPriorityLevelOptionOptions(priorityLevelOptionOptions);
|
||||
return R.ok(outpatientRegistrationInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者信息
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 患者信息
|
||||
*/
|
||||
@GetMapping(value = "/patient-metadata")
|
||||
public R<?> getPatientMetadata(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R.ok(iOutpatientRegistrationAppService.getPatientMetadataBySearchKey(searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊科室
|
||||
*
|
||||
* @return 就诊科室集合
|
||||
*/
|
||||
@GetMapping(value = "/org-list")
|
||||
public R<?> getLocationTree() {
|
||||
return R.ok(iOutpatientRegistrationAppService.getOrgMetadata());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室id筛选医生
|
||||
*/
|
||||
@GetMapping(value = "/practitioner-metadata")
|
||||
public R<?> getPractitionerMetadata(@RequestParam(value = "orgId") Long orgId,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R.ok(
|
||||
iOutpatientRegistrationAppService.getPractitionerMetadataByLocationId(orgId, searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*/
|
||||
@GetMapping(value = "/healthcare-metadata")
|
||||
public R<?> getHealthcareMetadata(@RequestParam(value = "organizationId") Long organizationId,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R.ok(iOutpatientRegistrationAppService.getHealthcareMetadataByOrganizationId(organizationId, searchKey,
|
||||
pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 退号
|
||||
*
|
||||
* @param cancelRegPaymentDto 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "return")
|
||||
public R<?> returnRegister(@RequestBody CancelRegPaymentDto cancelRegPaymentDto) {
|
||||
|
||||
R<?> result = iOutpatientRegistrationAppService.returnRegister(cancelRegPaymentDto);
|
||||
// 取消付款成功后,开具发票
|
||||
if (result.getCode() == 200) {
|
||||
PaymentReconciliation paymentRecon = null;
|
||||
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
|
||||
paymentRecon = (PaymentReconciliation)result.getData();
|
||||
}
|
||||
R<?> eleResult =
|
||||
eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelRegPaymentDto.getReason());
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消挂号
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "cancel")
|
||||
public R<?> cancelRegister(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
return iOutpatientRegistrationAppService.cancelRegister(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当日就诊数据
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 当日就诊数据
|
||||
*/
|
||||
@GetMapping(value = "/current-day-encounter")
|
||||
public R<?> getCurrentDayEncounter(@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(iOutpatientRegistrationAppService.getCurrentDayEncounter(searchKey, pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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.constant.CommonConstants;
|
||||
import com.openhis.common.enums.AccountBillingStatus;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 就诊账号 表单数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AccountFormData {
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
@NotNull(message = "患者id不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 状态枚举 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 结账状态枚举 */
|
||||
private Integer billingStatusEnum;
|
||||
|
||||
/** 账户类型编码 */
|
||||
private String typeCode; // 【01医保电子凭证 | 02 居民身份证 | 03 社会保障卡 | 04 个人现金账户】
|
||||
|
||||
/** 名称 */
|
||||
private String name; // 刷医保卡时应该会带出该信息
|
||||
|
||||
/** 账户余额 */
|
||||
private BigDecimal balanceAmount; // 刷医保卡时应该会带出该信息
|
||||
|
||||
/** 医保区域编码 */
|
||||
private String ybAreaNo; // 刷医保卡时应该会带出该信息
|
||||
|
||||
/** 合同编码 */
|
||||
private String contractNo; // 从选择的费用性质里选择合同编码
|
||||
|
||||
/** 欠费限制额度 */
|
||||
private BigDecimal limitAccount; // 刷医保卡时应该会带出该信息
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public AccountFormData() {
|
||||
this.contractNo = CommonConstants.BusinessName.DEFAULT_CONTRACT_NO;
|
||||
this.statusEnum = AccountStatus.ACTIVE.getValue();
|
||||
this.billingStatusEnum = AccountBillingStatus.OPEN.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
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;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.ChargeItemContext;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 费用项管理 表单数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ChargeItemFormData {
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
@NotNull(message = "患者id不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 层级 */
|
||||
private String busNo;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 类别 */
|
||||
private Integer contextEnum;
|
||||
|
||||
/** 发生时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 执行人Id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long performerId;
|
||||
|
||||
/** 费用定价ID */
|
||||
@NotNull(message = "费用定价ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionId;
|
||||
|
||||
/** 开立人ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long entererId;
|
||||
|
||||
/** 开立时间 */
|
||||
private Date enteredDate;
|
||||
|
||||
/** 医疗服务类型 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
@NotNull(message = "医疗服务ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 总价 */
|
||||
@NotNull(message = "总价不能为空")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 关联账户ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public ChargeItemFormData() {
|
||||
this.statusEnum = ChargeItemStatus.PLANNED.getValue();
|
||||
this.contextEnum = ChargeItemContext.REGISTER.getValue();
|
||||
this.occurrenceTime = new Date();
|
||||
this.performerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
this.entererId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
this.enteredDate = new Date();
|
||||
this.serviceTable = CommonConstants.TableName.ADM_HEALTHCARE_SERVICE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 费用性质 元数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ContractMetadata {
|
||||
/** 合同名称 */
|
||||
private String contractName;
|
||||
/** 合同编码 */
|
||||
private String busNo;
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 当天就诊信息
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CurrentDayEncounterDto {
|
||||
|
||||
/** 租户ID */
|
||||
private Integer tenantId;
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 科室ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String organizationName;
|
||||
|
||||
/**
|
||||
* 挂号类型
|
||||
*/
|
||||
private String healthcareName;
|
||||
|
||||
/**
|
||||
* 专家账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerUserId;
|
||||
|
||||
/**
|
||||
* 专家
|
||||
*/
|
||||
private String practitionerName;
|
||||
|
||||
/**
|
||||
* 费用性质
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 患者性别
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 证件号
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 就诊状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 挂号日期/时间
|
||||
*/
|
||||
private Date registerTime;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 挂号人
|
||||
*/
|
||||
private String entererName;
|
||||
|
||||
/**
|
||||
* 收费项目ids
|
||||
*/
|
||||
private String chargeItemIds;
|
||||
|
||||
/**
|
||||
* 付款id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
/**
|
||||
* 发票url地址
|
||||
*/
|
||||
private String pictureUrl;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 就诊诊断 表单数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterDiagnosisFormData {
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
@NotBlank(message = "诊断ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
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.*;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 就诊 表单数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterFormData {
|
||||
|
||||
/**
|
||||
* 患者ID
|
||||
*/
|
||||
@NotNull(message = "患者ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 状态编码
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 类别编码
|
||||
*/
|
||||
private Integer classEnum;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/**
|
||||
* 类别医保文本
|
||||
*/
|
||||
private String ybClassText; // 医保接口获取
|
||||
|
||||
/**
|
||||
* 优先级编码
|
||||
*/
|
||||
@NotNull(message = "优先级编码不能为空")
|
||||
private Integer priorityEnum;
|
||||
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
private Integer typeEnum;
|
||||
|
||||
/**
|
||||
* 服务ID
|
||||
*/
|
||||
@NotNull(message = "服务ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceTypeId;
|
||||
|
||||
/**
|
||||
* 就诊对象状态
|
||||
*/
|
||||
private Integer subjectStatusEnum;
|
||||
|
||||
/**
|
||||
* 机构ID
|
||||
*/
|
||||
@NotNull(message = "机构ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public EncounterFormData() {
|
||||
this.statusEnum = EncounterStatus.PLANNED.getValue();
|
||||
this.classEnum = EncounterClass.AMB.getValue();
|
||||
this.ybClassEnum = EncounterYbClass.ORDINARY_OUTPATIENT.getValue();
|
||||
this.typeEnum = OutpatientClass.GENERAL_OUTPATIENT_SERVICE.getValue();
|
||||
this.subjectStatusEnum = EncounterSubjectStatus.TRIAGED.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.enums.EncounterLocationStatus;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 就诊位置 表单数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterLocationFormData {
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 位置ID
|
||||
*/
|
||||
private Long locationId;
|
||||
|
||||
/** 状态枚举 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
private Integer formEnum;
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public EncounterLocationFormData() {
|
||||
this.statusEnum = EncounterLocationStatus.PLANNED.getValue();
|
||||
this.formEnum = LocationForm.ROOM.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.enums.ParticipantType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 就诊参数者 表单数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterParticipantFormData {
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 参与者类型 */
|
||||
private String typeCode;
|
||||
|
||||
/** 参与者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public EncounterParticipantFormData() {
|
||||
this.typeCode = ParticipantType.REGISTRATION_DOCTOR.getCode();// 挂号医生
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 就诊患者分页dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientPageDto {
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 患者院内编码/病历号
|
||||
*/
|
||||
private String patientBusNo;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 拼音码
|
||||
*/
|
||||
private String patientPyStr;
|
||||
|
||||
/**
|
||||
* 五笔码
|
||||
*/
|
||||
private String patientWbStr;
|
||||
|
||||
/**
|
||||
* 就诊编码
|
||||
*/
|
||||
private String encounterBusNo;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 账户类型编码
|
||||
*/
|
||||
@Dict(dictCode = "account_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/**
|
||||
* 账户余额
|
||||
*/
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/**
|
||||
* 接诊时间
|
||||
*/
|
||||
private Date receptionTime;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/** 收费状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 医保总额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* 自费总额
|
||||
*/
|
||||
private BigDecimal selfAmount;
|
||||
|
||||
/**
|
||||
* 付款总额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 合同类型 */
|
||||
private Integer categoryEnum;
|
||||
private String categoryEnum_enumText;
|
||||
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date maxBillDate;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 就诊患者分页查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientPageParam {
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 患者院内编码/病历号
|
||||
*/
|
||||
private String patientBusNo;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 拼音码
|
||||
*/
|
||||
private String patientPyStr;
|
||||
|
||||
/**
|
||||
* 五笔码
|
||||
*/
|
||||
private String patientWbStr;
|
||||
|
||||
/**
|
||||
* 就诊编码
|
||||
*/
|
||||
private String encounterBusNo;
|
||||
|
||||
/**
|
||||
* 接诊时间
|
||||
*/
|
||||
private Date receptionTime;
|
||||
|
||||
/**
|
||||
* 住院开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 收费时间
|
||||
*/
|
||||
private Date billTime;
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 就诊患者账单 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-17
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientPaymentDto {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 关联账户ID */
|
||||
private Long accountId;
|
||||
|
||||
/** 支付状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 关联ID */
|
||||
private Long relationId;
|
||||
|
||||
/** 支付的业务标识符 */
|
||||
private String paymentNo;
|
||||
|
||||
/** 付款类别 */
|
||||
private Integer paymentEnum;
|
||||
|
||||
/** 支付位置 */
|
||||
@Dict(dictTable = "adm_location", dictText = "name", dictCode = "id")
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/** 到期时间 */
|
||||
private Date expirationDate;
|
||||
|
||||
/** 应收金额 */
|
||||
private BigDecimal tenderedAmount;
|
||||
|
||||
/** 找零金额 */
|
||||
private BigDecimal returnedAmount;
|
||||
|
||||
/** 付款总额 */
|
||||
private BigDecimal displayAmount;
|
||||
|
||||
/** 合同编码 */
|
||||
private String contractNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 就诊患者处方 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientPrescriptionDto {
|
||||
|
||||
/** 收费项目类型 */
|
||||
private Integer contextEnum;
|
||||
private String contextEnum_enumText;
|
||||
|
||||
/** 收费状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 开立科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestingOrgId;
|
||||
|
||||
/** 数量 */
|
||||
private Long quantityValue;
|
||||
|
||||
/** 单位 */
|
||||
private String quantityUnit;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 业务编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 收款人ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name")
|
||||
private Long entererId;
|
||||
private String entererId_dictText;
|
||||
|
||||
/** 开立时间 */
|
||||
private Date enteredDate;
|
||||
|
||||
/** 收费时间 */
|
||||
private Date billDate;
|
||||
|
||||
/** 关联账户ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 物品编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/** 物品名称 */
|
||||
private String itemName;
|
||||
|
||||
/** 特病标识 */
|
||||
@Dict(dictCode = "med_type")
|
||||
private String medTypeCode;
|
||||
private String medTypeCode_dictText;
|
||||
|
||||
/** 合同编码 */
|
||||
private String contractNo;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 合同名称 */
|
||||
private String contractName;
|
||||
|
||||
/** 服务所在表 */
|
||||
private String serviceTable;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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 com.openhis.yb.dto.PaymentDetailDto;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 患者退款信息列表
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-05-05
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientRefundDto {
|
||||
|
||||
/** 支付ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
/** 收款人ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long entererId;
|
||||
|
||||
/** 就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 支付的患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 请求ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 发放ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dispenseId;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 收费项目编号 */
|
||||
private String busNo;
|
||||
|
||||
/** 合同编号 */
|
||||
private String contractNo;
|
||||
|
||||
/** 项目名 */
|
||||
private String itemName;
|
||||
|
||||
/** 项目名 */
|
||||
private String orgName;
|
||||
|
||||
/** 收费项目ids */
|
||||
private String chargeItemIds;
|
||||
|
||||
/** 收款人 */
|
||||
private String entererName;
|
||||
|
||||
/** 服务表名 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 收费状态 */
|
||||
private Integer chargeStatus;
|
||||
private String chargeStatus_enumText;
|
||||
|
||||
/** 支付状态 */
|
||||
private Integer paymentStatus;
|
||||
private String paymentStatus_enumText;
|
||||
|
||||
/** 发放状态 */
|
||||
private Integer dispenseStatus;
|
||||
private String dispenseStatus_enumText;
|
||||
|
||||
/** 执行状态 */
|
||||
private Integer serviceStatus;
|
||||
private String serviceStatus_enumText;
|
||||
|
||||
/** 数量 */
|
||||
private Integer quantityValue;
|
||||
|
||||
/** 已发药数量 */
|
||||
private Integer dispenseQuantity;
|
||||
|
||||
/** 单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String quantityUnit;
|
||||
private String quantityUnit_dictText;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 结算时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date billDate;
|
||||
|
||||
/**
|
||||
* 支付明细列表
|
||||
*/
|
||||
private List<PaymentDetailDto> paymentDetailList;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊科室信息 元数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgMetadata {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
@@ -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<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions;
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
@Data
|
||||
public static class chargeItemStatusOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public chargeItemStatusOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊划价库存 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientPricingInventoryDto {
|
||||
|
||||
/** 物理表名 */
|
||||
private String itemTable;
|
||||
|
||||
/** 实例id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/** 当前库存数量 ,对应小单位*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 单位 , 对应小单位*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 库位 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationStoreId;
|
||||
|
||||
/** 库房id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 库房名称
|
||||
*/
|
||||
private String locationName;
|
||||
|
||||
/** 采购单价(进价) */
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊划价价格 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientPricingPriceDto {
|
||||
|
||||
/**
|
||||
* 费用定价名称
|
||||
*/
|
||||
private String chargeName;
|
||||
|
||||
/** 费用定价主表ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionId;
|
||||
|
||||
/** 费用定价子表ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionDetailId;
|
||||
|
||||
/** 命中条件 */
|
||||
private String conditionCode;
|
||||
|
||||
/** 命中值 */
|
||||
private String conditionValue;
|
||||
|
||||
/** 价格 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.openhis.yb.dto.Info5301SpecialConditionResult;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊挂号 新增参数
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientRegistrationAddParam {
|
||||
|
||||
/**
|
||||
* 就诊管理-表单数据
|
||||
*/
|
||||
@Valid
|
||||
private EncounterFormData encounterFormData;
|
||||
|
||||
// /**
|
||||
// * 就诊诊断管理-表单数据
|
||||
// */
|
||||
// private EncounterDiagnosisFormData encounterDiagnosisFormData;
|
||||
|
||||
/**
|
||||
* 就诊位置管理-表单数据
|
||||
*/
|
||||
@Valid
|
||||
private EncounterLocationFormData encounterLocationFormData;
|
||||
|
||||
/**
|
||||
* 就诊参数者管理-表单数据
|
||||
*/
|
||||
@Valid
|
||||
private EncounterParticipantFormData encounterParticipantFormData;
|
||||
|
||||
/**
|
||||
* 就诊账户管理-表单数据
|
||||
*/
|
||||
@Valid
|
||||
private AccountFormData accountFormData;
|
||||
/**
|
||||
* 费用项管理-表单数据 //todo:挂号费会绑定诊查费,该字段会变成List,挂号前先把这个收费项开个前台,后台没有保存
|
||||
*/
|
||||
@Valid
|
||||
private ChargeItemFormData chargeItemFormData;
|
||||
|
||||
/**
|
||||
* 密钥 医保挂号时使用
|
||||
*/
|
||||
private String busiCardInfo;// 2025/05/16 前后端一致,前端大写,后端保持大写
|
||||
|
||||
/**
|
||||
* 类型 医保挂号时使用
|
||||
*/
|
||||
private String ybMdtrtCertType;
|
||||
/**
|
||||
* 医保个人结算方式 参照枚举 按项目结算 01 按定额结算 02
|
||||
*/
|
||||
private String YbPsnSetlWay;
|
||||
/**
|
||||
* 特慢病列表
|
||||
*/
|
||||
private List<Info5301SpecialConditionResult> feedetail;
|
||||
|
||||
public OutpatientRegistrationAddParam() {
|
||||
this.YbPsnSetlWay = "01";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊挂号 init基础数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientRegistrationInitDto {
|
||||
|
||||
private List<priorityLevelOption> priorityLevelOptionOptions;
|
||||
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
@Data
|
||||
public static class priorityLevelOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public priorityLevelOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.yb.dto.PaymentDetailDto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientRegistrationSettleParam {
|
||||
|
||||
OutpatientRegistrationAddParam outpatientRegistrationAddParam;
|
||||
|
||||
String chrgBchno;// 收费批次号 付款时必传
|
||||
|
||||
String busNo;// 挂号no
|
||||
|
||||
List<PaymentDetailDto> paymentDetails;// 支付渠道 付款时必传
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 患者信息 元数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientMetadata {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/**
|
||||
* 初复诊
|
||||
*/
|
||||
private String firstEnum_enumText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 参与者 元数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerMetadata {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 划价项目 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-04-10
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PricingProjectDto {
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱详细分类
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeNum; // 当医嘱类型为药品时,选填
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 费用定价主表ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionId;
|
||||
|
||||
/** 费用定价子表ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionDetailId;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/**
|
||||
* 请求状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 耗材ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 医嘱对应表名
|
||||
*/
|
||||
private String adviceTableName;
|
||||
|
||||
/** 患者 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 开方医生 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
/** 请求发起的位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 发放位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long performLocation;
|
||||
|
||||
/** 所属科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 就诊id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionId;
|
||||
|
||||
/** 治疗类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 用法 */
|
||||
private String methodCode;
|
||||
|
||||
/** 用药频次 */
|
||||
private String rateCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
private String doseUnitCode;
|
||||
|
||||
/** 组套id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long packageId;
|
||||
|
||||
/** 活动(项目)定义id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityId;
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public PricingProjectDto() {
|
||||
this.statusEnum = RequestStatus.ACTIVE.getValue();
|
||||
this.categoryEnum = EncounterClass.AMB.getValue();
|
||||
this.therapyEnum = TherapyTimeType.TEMPORARY.getValue();
|
||||
this.practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
this.orgId = SecurityUtils.getLoginUser().getOrgId(); // 开方人科室
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 退款项目 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RefundItemDto {
|
||||
|
||||
/** 收费ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long chargeItemId;
|
||||
|
||||
/** 收费ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
/** 医疗服务所在表 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
private Long serviceId;
|
||||
|
||||
/** 请求编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 退款状态 */
|
||||
private Integer refundStatus;
|
||||
private String refundStatus_enumText;
|
||||
|
||||
/** 发放状态 */
|
||||
private Integer dispenseStatus;
|
||||
private String dispenseStatus_enumText;
|
||||
|
||||
/** 执行状态 */
|
||||
private Integer serviceStatus;
|
||||
private String serviceStatus_enumText;
|
||||
|
||||
/** 未发药原因 */
|
||||
private Integer notPerformedReason;
|
||||
|
||||
/** 项目id */
|
||||
private Long itemId;
|
||||
|
||||
/** 发放id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 请求id */
|
||||
private Long requestId;
|
||||
|
||||
/** 项目名 */
|
||||
private String itemName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 退费项目id列表 dto
|
||||
*
|
||||
* @author yangmo
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RefundItemParam {
|
||||
|
||||
/** 付款ID */
|
||||
private Long paymentId;
|
||||
|
||||
/** 收费项ID */
|
||||
private Long chargeItemId;
|
||||
|
||||
/** 退费标志 */
|
||||
private Boolean refundFlg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
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.EncounterPatientPrescriptionDto;
|
||||
|
||||
/**
|
||||
* 门诊收费 appMapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-13
|
||||
*/
|
||||
@Repository
|
||||
public interface InpatientChargeAppMapper {
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("classEnum") Integer classEnum,
|
||||
@Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param activity 项目
|
||||
* @param medication 药品
|
||||
* @param device 耗材
|
||||
* @param register 挂号费
|
||||
* @param planned 收费状态:待收费
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunding 收费状态:退费中
|
||||
* @param refunded 收费状态:全部退费
|
||||
* @param partRefund 收费状态:部分退费
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescription(@Param("encounterId") Long encounterId,
|
||||
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
|
||||
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.mapper;
|
||||
|
||||
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.EncounterPatientPrescriptionDto;
|
||||
|
||||
/**
|
||||
* 门诊收费 appMapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-13
|
||||
*/
|
||||
@Repository
|
||||
public interface OutpatientChargeAppMapper {
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param amb 就诊类型:门诊
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("amb") Integer amb);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param activity 项目
|
||||
* @param medication 药品
|
||||
* @param device 耗材
|
||||
* @param register 挂号费
|
||||
* @param planned 收费状态:待收费
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunding 收费状态:退费中
|
||||
* @param refunded 收费状态:全部退费
|
||||
* @param partRefund 收费状态:部分退费
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescription(@Param("encounterId") Long encounterId,
|
||||
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
|
||||
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 门诊划价 appMapper
|
||||
*
|
||||
* @author yangmo
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@Repository
|
||||
public interface OutpatientPricingAppMapper {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.chargemanage.mapper;
|
||||
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 门诊退费 appMapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-15
|
||||
*/
|
||||
@Repository
|
||||
public interface OutpatientRefundAppMapper {
|
||||
|
||||
/**
|
||||
* 获取就诊患者账单列表
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param success 支付状态:成功
|
||||
* @param refundPart 支付状态:部分退款
|
||||
* @param refundAll 支付状态:全部退款
|
||||
* @return 就诊患者账单列表
|
||||
*/
|
||||
List<EncounterPatientPaymentDto> selectEncounterPatientPayment(@Param("encounterId") Long encounterId,
|
||||
@Param("success") Integer success, @Param("refundPart") Integer refundPart,
|
||||
@Param("refundAll") Integer refundAll);
|
||||
|
||||
/**
|
||||
* 查询退费项目
|
||||
*
|
||||
* @param chargeItemIdList 收费项列表
|
||||
* @param medMedicationRequest 药品请求表
|
||||
* @param worServiceRequest 服务请求表
|
||||
* @param worDeviceRequest 耗材请求表
|
||||
* @param three 用于字符截位
|
||||
* @return 退费项目列表
|
||||
*/
|
||||
List<RefundItemDto> selectRefundItem(@Param("chargeItemIdList") List<Long> chargeItemIdList,
|
||||
@Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("worServiceRequest") String worServiceRequest, @Param("worDeviceRequest") String worDeviceRequest,
|
||||
@Param("three") Integer three);
|
||||
|
||||
/**
|
||||
* 查询已结算就诊患者分页列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunding 收费状态:退费中
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param partRefund 收费状态:部分退费
|
||||
* @param insurance 账户类型:医保
|
||||
* @param amb 就诊类型:门诊
|
||||
* @return 已结算就诊患者分页列表
|
||||
*/
|
||||
Page<EncounterPatientPageDto> selectBilledEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("billed") Integer billed,
|
||||
@Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund, @Param("insurance") String insurance, @Param("amb") Integer amb);
|
||||
|
||||
/**
|
||||
* 查询患者退费项目
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param refunding 收费状态:退费中
|
||||
* @param refunded 收费状态:已退款
|
||||
* @param partRefund 收费状态:部分退款
|
||||
* @param worServiceRequest 服务请求表
|
||||
* @param worDeviceRequest 设备请求表
|
||||
* @param medMedicationRequest 药品请求表
|
||||
* @param billDateSTime 收费时间开始
|
||||
* @param billDateETime 收费时间结束
|
||||
* @return 查询患者退费项目
|
||||
*/
|
||||
List<EncounterPatientRefundDto> selectEncounterPatientRefund(@Param("encounterId") Long encounterId,
|
||||
@Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund, @Param("worServiceRequest") String worServiceRequest,
|
||||
@Param("worDeviceRequest") String worDeviceRequest, @Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("billDateSTime") String billDateSTime, @Param("billDateETime") String billDateETime);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.openhis.web.chargemanage.mapper;
|
||||
|
||||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto;
|
||||
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
|
||||
import com.openhis.web.personalization.dto.ActivityDeviceDto;
|
||||
|
||||
/**
|
||||
* 门诊挂号 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface OutpatientRegistrationAppMapper {
|
||||
/**
|
||||
* 查询医生
|
||||
*/
|
||||
IPage<PractitionerMetadata> getPractitionerMetadataPage(@Param("page") Page<PractitionerMetadata> page,
|
||||
@Param("orgId") Long orgId, @Param("RoleCode") String RoleCode,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
|
||||
|
||||
/**
|
||||
* 根据病人id和科室id查询当日挂号次数
|
||||
*/
|
||||
Integer getNumByPatientIdAndOrganizationId(@Param("patientId") Long patientId,
|
||||
@Param("serviceTypeId") Long serviceTypeId, @Param("cancelled") Integer cancelled);
|
||||
|
||||
/**
|
||||
* 查询当日就诊数据
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param classEnum 就诊类型
|
||||
* @param participantType 参与者类型
|
||||
* @param queryWrapper 查询条件
|
||||
* @param register 收费项目类型:挂号
|
||||
* @param paymentStatus 支付状态:成功
|
||||
* @return 当日就诊数据
|
||||
*/
|
||||
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(@Param("page") Page<CurrentDayEncounterDto> page,
|
||||
@Param("classEnum") Integer classEnum, @Param("participantType") String participantType,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<CurrentDayEncounterDto> queryWrapper,
|
||||
@Param("register") Integer register, @Param("paymentStatus") Integer paymentStatus);
|
||||
|
||||
/**
|
||||
* 查询item绑定的信息(耗材或诊疗)
|
||||
*
|
||||
* @param itemId itemId
|
||||
* @param devActable 绑定的表名(耗材或诊疗)
|
||||
* @return item绑定的信息
|
||||
*/
|
||||
List<ActivityDeviceDto> getTmpActivityList(@Param("itemId") String itemId, @Param("devActable") String devActable);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.common.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.web.common.dto.InventoryItemParam;
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
import com.openhis.web.common.dto.SearchTraceNoParam;
|
||||
|
||||
/**
|
||||
* app常用接口
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
public interface ICommonService {
|
||||
|
||||
/**
|
||||
* 药房列表
|
||||
*
|
||||
* @return 药房列表
|
||||
*/
|
||||
List<LocationDto> getPharmacyList();
|
||||
|
||||
/**
|
||||
* 药房列表(库房用)
|
||||
*
|
||||
* @return 药房列表
|
||||
*/
|
||||
List<LocationDto> getInventoryPharmacyList();
|
||||
|
||||
/**
|
||||
* 药库列表
|
||||
*
|
||||
* @return 药库列表
|
||||
*/
|
||||
List<LocationDto> getCabinetList();
|
||||
|
||||
/**
|
||||
* 仓库列表
|
||||
*
|
||||
* @return 仓库列表
|
||||
*/
|
||||
List<LocationDto> getWarehouseList();
|
||||
|
||||
/**
|
||||
* 药库列表(库房用)
|
||||
*
|
||||
* @return 药库列表
|
||||
*/
|
||||
List<LocationDto> getInventoryCabinetList();
|
||||
|
||||
/**
|
||||
* 药房药库列表
|
||||
*
|
||||
* @return 药房药库列表
|
||||
*/
|
||||
List<LocationDto> getPharmacyCabinetList();
|
||||
|
||||
/**
|
||||
* 获取病区列表
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 病区列表
|
||||
*/
|
||||
List<LocationDto> getWardList(Long orgId);
|
||||
|
||||
/**
|
||||
* 库存项目下拉列表(药库业务使用)
|
||||
*
|
||||
* @param inventoryItemParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
R<?> getInventoryItemList(InventoryItemParam inventoryItemParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据项目相关信息查询项目库存相关信息
|
||||
*
|
||||
* @param inventoryItemParam 项目id
|
||||
* @return 项目库存相关信息
|
||||
*/
|
||||
R<?> getInventoryItemInfo(InventoryItemParam inventoryItemParam);
|
||||
|
||||
/**
|
||||
* 科室列表
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
R<?> getDepartmentList();
|
||||
|
||||
/**
|
||||
* 科室列表
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
List<Organization> departmentList();
|
||||
|
||||
/**
|
||||
* 根据追溯码获取药品/耗材信息
|
||||
*
|
||||
* @param traceNoList 追溯码列表
|
||||
* @return 项目信息
|
||||
*/
|
||||
R<?> getItemInfoByTraceNo(List<String> traceNoList);
|
||||
|
||||
/**
|
||||
* 追溯码查询
|
||||
*
|
||||
* @param searchTraceNoParam 查询条件
|
||||
* @return 项目信息
|
||||
*/
|
||||
R<?> searchTraceNo(SearchTraceNoParam searchTraceNoParam);
|
||||
|
||||
/**
|
||||
* 查询费用性质
|
||||
*
|
||||
* @return 费用性质
|
||||
*/
|
||||
R<?> getContractMetadata();
|
||||
|
||||
/**
|
||||
* 根据科室查询护士
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 护士列表
|
||||
*/
|
||||
R<?> getNurseListByOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 根据父级位置id查询他所有的子集
|
||||
*
|
||||
* @param locationId 位置id
|
||||
* @param locationForm 位置类型
|
||||
* @return 位置列表
|
||||
*/
|
||||
List<LocationDto> getChildLocation(Long locationId, Integer locationForm);
|
||||
|
||||
/**
|
||||
* 查询登录者管理的病区
|
||||
*
|
||||
* @return 病区列表
|
||||
*/
|
||||
List<LocationDto> getPractitionerWard();
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.common.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.TraceNoManage;
|
||||
import com.openhis.administration.mapper.TraceNoManageMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.financial.mapper.ContractMapper;
|
||||
import com.openhis.web.chargemanage.dto.ContractMetadata;
|
||||
import com.openhis.web.common.appservice.ICommonService;
|
||||
import com.openhis.web.common.dto.*;
|
||||
import com.openhis.web.common.mapper.CommonAppMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
|
||||
/**
|
||||
* app常用接口
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@Service
|
||||
public class CommonServiceImpl implements ICommonService {
|
||||
|
||||
@Resource
|
||||
private TraceNoManageMapper traceNoManageMapper;
|
||||
|
||||
@Resource
|
||||
private CommonAppMapper commonAppMapper;
|
||||
|
||||
@Resource
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private IPractitionerRoleService practitionerRoleService;
|
||||
|
||||
@Resource
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Resource
|
||||
private IInventoryItemService iInventoryItemService;
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
/**
|
||||
* 获取药房列表
|
||||
*
|
||||
* @return 药房列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getPharmacyList() {
|
||||
|
||||
List<Location> pharmacyList = locationService.getPharmacyList();
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyList) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药房列表(库房用)
|
||||
*
|
||||
* @return 药房列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getInventoryPharmacyList() {
|
||||
|
||||
// 用户id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 根据用户id获得管理库房信息
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
|
||||
List<Location> pharmacyList = locationService.getPharmacyList();
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyList) {
|
||||
for (Long locationId : locationIds) {
|
||||
if (location.getId().equals(locationId)) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药库列表
|
||||
*
|
||||
* @return 药库列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getCabinetList() {
|
||||
List<Location> pharmacyList = locationService.getCabinetList();
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyList) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仓库列表
|
||||
*
|
||||
* @return 仓库列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getWarehouseList() {
|
||||
List<Location> pharmacyList = locationService.getWarehouseList();
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyList) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药库列表(库房用)
|
||||
*
|
||||
* @return 药库列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getInventoryCabinetList() {
|
||||
// 用户id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 根据用户id获得管理库房信息
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
|
||||
List<Location> pharmacyList = locationService.getCabinetList();
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyList) {
|
||||
for (Long locationId : locationIds) {
|
||||
if (location.getId().equals(locationId)) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 药房药库列表
|
||||
*
|
||||
* @return 药房药库列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getPharmacyCabinetList() {
|
||||
List<Location> pharmacyCabinetList = locationService.getPharmacyCabinetList();
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyCabinetList) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取病区列表
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 病区列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getWardList(Long orgId) {
|
||||
List<Location> getWardList = new ArrayList<>();
|
||||
if (orgId != null) {
|
||||
getWardList = locationService.getWardList(orgId);
|
||||
} else {
|
||||
getWardList = locationService.getWardList(null);
|
||||
}
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : getWardList) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存项目下拉列表(药库业务使用)
|
||||
*
|
||||
* @param inventoryItemParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInventoryItemList(InventoryItemParam inventoryItemParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
Integer purchaseFlag = inventoryItemParam.getPurchaseFlag();
|
||||
inventoryItemParam.setPurchaseFlag(null);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InventoryItemParam> queryWrapper = HisQueryUtils.buildQueryWrapper(inventoryItemParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
null);
|
||||
// 查询库存项目信息
|
||||
IPage<InventoryItemDto> inventoryItems = commonAppMapper.selectInventoryItemList(new Page<>(pageNo, pageSize),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), purchaseFlag, ConditionCode.PURCHASE.getCode(),
|
||||
PublicationStatus.RETIRED.getValue(), queryWrapper);
|
||||
List<InventoryItemDto> inventoryItemDtoList = inventoryItems.getRecords();
|
||||
inventoryItemDtoList.forEach(e -> {
|
||||
// 项目类型
|
||||
e.setItemType_enumText(EnumUtils.getInfoByValue(ItemType.class, e.getItemType()));
|
||||
});
|
||||
for (InventoryItemDto inventoryItem : inventoryItemDtoList) {
|
||||
List<UnitDto> unitList = new ArrayList<>();
|
||||
UnitDto unitDto = new UnitDto();
|
||||
// 单位列表
|
||||
unitDto.setUnitCode(inventoryItem.getUnitCode()).setMinUnitCode(inventoryItem.getMinUnitCode());
|
||||
unitList.add(unitDto);
|
||||
inventoryItem.setUnitList(unitList);
|
||||
}
|
||||
return R.ok(inventoryItemDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目相关信息查询项目库存相关信息
|
||||
*
|
||||
* @param inventoryItemParam 项目id
|
||||
* @return 项目库存相关信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInventoryItemInfo(InventoryItemParam inventoryItemParam) {
|
||||
// 查询项目库存相关信息
|
||||
List<LocationInventoryDto> locationInventoryDtoList = commonAppMapper.selectInventoryItemInfo(
|
||||
inventoryItemParam.getOrgLocationId(), CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, inventoryItemParam.getObjLocationId(),
|
||||
inventoryItemParam.getLotNumber(), inventoryItemParam.getItemId(), ConditionCode.PURCHASE.getCode());
|
||||
|
||||
// 医保编码和生产厂家校验
|
||||
for (LocationInventoryDto dto : locationInventoryDtoList) {
|
||||
if (StringUtils.isNotEmpty(dto.getYbNo()) && StringUtils.isEmpty(dto.getManufacturer())) {
|
||||
return R.fail("生产厂家不能为空,请到药品目录维护");
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(locationInventoryDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室列表
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDepartmentList() {
|
||||
return R.ok(organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室列表
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
@Override
|
||||
public List<Organization> departmentList(){
|
||||
return organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据追溯码获取药品/耗材信息
|
||||
*
|
||||
* @param traceNoList 追溯码列表
|
||||
* @return 项目信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getItemInfoByTraceNo(List<String> traceNoList) {
|
||||
Map<String, String> traceNoMap = new HashMap<>();
|
||||
for (String traceNo : traceNoList) {
|
||||
if (traceNo != null && !StringUtils.isEmpty(traceNo)) {
|
||||
// 数据源更改
|
||||
InventoryItem inventoryItem = iInventoryItemService.getOne(
|
||||
new LambdaQueryWrapper<InventoryItem>().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1"));
|
||||
if (inventoryItem != null) {
|
||||
String itemId = inventoryItem.getItemId().toString();
|
||||
// TraceNoManage traceNoManage = commonAppMapper.getInfoByTraceNo("%" + traceNo + "%");
|
||||
// if (traceNoManage != null) {
|
||||
// String itemId = traceNoManage.getItemId().toString();
|
||||
// 如果map中已经存在该itemId,拼接traceNo,否则直接添加
|
||||
if (traceNoMap.containsKey(itemId)) {
|
||||
String existingTraceNos = traceNoMap.get(itemId);
|
||||
traceNoMap.put(itemId, existingTraceNos + CommonConstants.Common.COMMA + traceNo);
|
||||
} else {
|
||||
traceNoMap.put(itemId, traceNo);
|
||||
}
|
||||
} else {
|
||||
return R.ok(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(traceNoMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 追溯码查询
|
||||
*
|
||||
* @param searchTraceNoParam 查询条件
|
||||
* @return 项目信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> searchTraceNo(SearchTraceNoParam searchTraceNoParam) {
|
||||
List<TraceNoManage> traceNoManageList = new ArrayList<>();
|
||||
Map<String, String> traceNoMap = new HashMap<>();
|
||||
// 判断传入的是药品还是耗材,查询追溯码状态只有进的数据
|
||||
if (searchTraceNoParam.getItemType().equals(ItemType.MEDICINE.getValue())) {
|
||||
traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, searchTraceNoParam.getItemId(),
|
||||
searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
} else if (searchTraceNoParam.getItemType().equals(ItemType.DEVICE.getValue())) {
|
||||
traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
searchTraceNoParam.getItemId(), searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
}
|
||||
if (traceNoManageList != null) {
|
||||
for (TraceNoManage traceNoItem : traceNoManageList) {
|
||||
traceNoMap.put(traceNoItem.getItemId().toString(), traceNoItem.getTraceNo());
|
||||
}
|
||||
}
|
||||
return R.ok(traceNoMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询费用性质
|
||||
*
|
||||
* @return 费用性质
|
||||
*/
|
||||
@Override
|
||||
public R<?> getContractMetadata() {
|
||||
// TODO: Contract表的基础数据维护还没做,具体不知道状态字段的取值是什么,先查询默认值为0的数据
|
||||
List<Contract> ContractList =
|
||||
contractMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getStatusEnum, 0));
|
||||
// 复制同名字段并 return
|
||||
return R.ok(ContractList.stream().map(contract -> {
|
||||
ContractMetadata metadata = new ContractMetadata();
|
||||
try {
|
||||
BeanUtils.copyProperties(contract, metadata);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return metadata;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室查询护士
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 护士列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getNurseListByOrg(Long orgId) {
|
||||
return R.ok(practitionerRoleService.getNurseList(orgId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父级位置id查询他所有的子集
|
||||
*
|
||||
* @param locationId 位置id
|
||||
* @param locationForm 位置类型
|
||||
* @return 位置列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getChildLocation(Long locationId, Integer locationForm) {
|
||||
// 获取当前位置信息
|
||||
Location location = locationService.getById(locationId);
|
||||
// 查询所有子集位置
|
||||
List<Location> childLocations = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.likeRight(Location::getBusNo, location.getBusNo()).eq(Location::getFormEnum, locationForm)
|
||||
.ne(Location::getStatusEnum, LocationStatus.INACTIVE.getValue()));
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location childLocation : childLocations) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(childLocation, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
// 8. 返回成功响应
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询登录者管理的病区
|
||||
*
|
||||
* @return 病区列表
|
||||
*/
|
||||
@Override
|
||||
public List<LocationDto> getPractitionerWard() {
|
||||
// 查询当前登录者管理的病区
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
List<Location> locationList = locationService.getLocationList(locationIds);
|
||||
List<Location> wardList = new ArrayList<>();
|
||||
for (Location ward : locationList) {
|
||||
if (LocationForm.WARD.getValue().equals(ward.getFormEnum())) {
|
||||
wardList.add(ward);
|
||||
}
|
||||
}
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location ward : wardList) {
|
||||
locationDto = new LocationDto();
|
||||
BeanUtils.copyProperties(ward, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
return locationDtoList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.common.appservice.ICommonService;
|
||||
import com.openhis.web.common.dto.InventoryItemParam;
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
import com.openhis.web.common.dto.SearchTraceNoParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* app常用接口
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app-common")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CommonAppController {
|
||||
|
||||
@Resource
|
||||
private ICommonService commonService;
|
||||
|
||||
/**
|
||||
* 药房列表
|
||||
*
|
||||
* @return 药房列表
|
||||
*/
|
||||
@GetMapping(value = "/pharmacy-list")
|
||||
public R<?> getPharmacyList() {
|
||||
return R.ok(commonService.getPharmacyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 药房列表(库房用)
|
||||
*
|
||||
* @return 药房列表
|
||||
*/
|
||||
@GetMapping(value = "/inventory-pharmacy-list")
|
||||
public R<?> getInventoryPharmacyList() {
|
||||
return R.ok(commonService.getInventoryPharmacyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 药库列表
|
||||
*
|
||||
* @return 药库列表
|
||||
*/
|
||||
@GetMapping(value = "/cabinet-list")
|
||||
public R<?> getCabinetList() {
|
||||
return R.ok(commonService.getCabinetList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 药库列表(库房用)
|
||||
*
|
||||
* @return 药库列表
|
||||
*/
|
||||
@GetMapping(value = "/inventory-cabinet-list")
|
||||
public R<?> getInventoryCabinetList() {
|
||||
return R.ok(commonService.getInventoryCabinetList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 药房药库列表
|
||||
*
|
||||
* @return 药房药库列表
|
||||
*/
|
||||
@GetMapping(value = "/pharmacy-cabinet-list")
|
||||
public R<?> getPharmacyCabinetList() {
|
||||
return R.ok(commonService.getPharmacyCabinetList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 病区列表
|
||||
*
|
||||
* @return 病区列表
|
||||
*/
|
||||
@GetMapping(value = "/ward-list")
|
||||
public R<?> getWardList(@RequestParam(value = "orgId", required = false) Long orgId) {
|
||||
return R.ok(commonService.getWardList(orgId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室列表
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
@GetMapping(value = "/department-list")
|
||||
public R<?> getDepartmentList() {
|
||||
return commonService.getDepartmentList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存项目下拉列表(药库业务使用)
|
||||
*
|
||||
* @param inventoryItemParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
@GetMapping(value = "/inventory-item")
|
||||
public R<?> getInventoryItemList(InventoryItemParam inventoryItemParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "50") Integer pageSize) {
|
||||
return commonService.getInventoryItemList(inventoryItemParam, searchKey, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目相关信息查询项目库存相关信息
|
||||
*
|
||||
* @param inventoryItemParam 项目id
|
||||
* @return 项目库存相关信息
|
||||
*/
|
||||
@GetMapping(value = "/inventory-item-info")
|
||||
public R<?> getInventoryItemInfo(InventoryItemParam inventoryItemParam) {
|
||||
return commonService.getInventoryItemInfo(inventoryItemParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据追溯码获取药品/耗材信息
|
||||
*
|
||||
* @param traceNoList 追溯码列表
|
||||
* @return 项目信息
|
||||
*/
|
||||
@GetMapping(value = "/item-trace-no")
|
||||
public R<?> getItemInfoByTraceNo(@RequestParam List<String> traceNoList) {
|
||||
return commonService.getItemInfoByTraceNo(traceNoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 追溯码查询
|
||||
*
|
||||
* @param searchTraceNoParam 查询条件
|
||||
* @return 项目信息
|
||||
*/
|
||||
@GetMapping(value = "/search-trace-no")
|
||||
public R<?> searchTraceNo(SearchTraceNoParam searchTraceNoParam) {
|
||||
return commonService.searchTraceNo(searchTraceNoParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询费用性质
|
||||
*
|
||||
* @return 费用性质
|
||||
*/
|
||||
@GetMapping(value = "/contract-list")
|
||||
public R<?> getContractList() {
|
||||
return commonService.getContractMetadata();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室查询护士
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 护士列表
|
||||
*/
|
||||
@GetMapping(value = "/nurse-list")
|
||||
public R<?> getNurseListByOrg(Long orgId) {
|
||||
return commonService.getNurseListByOrg(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父级位置id查询他所有的子集
|
||||
*
|
||||
* @param locationId 位置id
|
||||
* @param locationForm 位置类型
|
||||
* @return 位置列表
|
||||
*/
|
||||
@GetMapping(value = "/child-location-list")
|
||||
public List<LocationDto> getChildLocation(Long locationId, Integer locationForm) {
|
||||
return commonService.getChildLocation(locationId, locationForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询登录者管理的病区
|
||||
*
|
||||
* @return 病区列表
|
||||
*/
|
||||
@GetMapping(value = "/practitioner-ward")
|
||||
public List<LocationDto> getPractitionerWard() {
|
||||
return commonService.getPractitionerWard();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.common.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 库存项目dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InventoryItemDto {
|
||||
|
||||
/** 项目类型 */
|
||||
private Integer itemType; // 1:药品 , 2: 耗材 , 3:诊疗
|
||||
private String itemType_enumText;
|
||||
|
||||
/**
|
||||
* 药品/耗材类型
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 采购单价 */
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
/** 项目定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionId;
|
||||
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String itemBusNo;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 商品名称 */
|
||||
private String productName;
|
||||
|
||||
/** 包装单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String volume;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 项目对应表名
|
||||
*/
|
||||
private String itemTableName;
|
||||
|
||||
/**
|
||||
* 产品批号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 原仓库 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgLocation;
|
||||
|
||||
/**
|
||||
* 单位列表
|
||||
*/
|
||||
private List<UnitDto> unitList;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user