病种目录更新
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
package com.openhis.web.datadictionary.assembler;
|
||||
|
||||
public class DiseaseManagementAssembler {
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.openhis.web.datadictionary.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* TODO:病种目录
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/datadictionary/disease")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class DiseaseManageController {
|
||||
private final IConditionDefinitionService iConditionDefinitionService;
|
||||
|
||||
/**
|
||||
* 病种目录分类查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-category")
|
||||
public R<?> getDiseaseCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病种目录分页列表
|
||||
*
|
||||
* @param searchKey 查询条件
|
||||
* @param status 查询条件-状态
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getDiseaseList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "status", defaultValue = "-1") Integer status,
|
||||
@RequestParam(value = "sourceEnum", defaultValue = "-1") Integer sourceEnum,
|
||||
@RequestParam(value = "id", defaultValue = "-1") Long id,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 查询【病种目录】分页列表
|
||||
Page<ConditionDefinition> diseasePage =
|
||||
iConditionDefinitionService.getPage(searchKey, status, sourceEnum, id,pageNo, pageSize);
|
||||
// 返回【病种目录列表DTO】分页
|
||||
return R.ok(diseasePage);
|
||||
}
|
||||
|
||||
// 病种目录编辑
|
||||
@PutMapping("/information")
|
||||
public R<?> editDisease(@RequestBody List<ConditionDefinition> conditionDefinitionList) {
|
||||
// 更新病种信息
|
||||
return iConditionDefinitionService.updateBatchById(conditionDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, null))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
// 新增外来病种目录
|
||||
@PostMapping("/information")
|
||||
public R<?> addDisease(@RequestBody ConditionDefinition conditionDefinition) {
|
||||
// 新增外来病种目录
|
||||
return iConditionDefinitionService.addDisease(conditionDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"病种目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
|
||||
}
|
||||
|
||||
// 新增医保病种目录
|
||||
@PostMapping("/information-yb")
|
||||
void AddYbDisease(@RequestBody ConditionDefinition conditionDefinition) {}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.openhis.web.datadictionary.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.web.datadictionary.dto.DiseaseInDto;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* TODO:病种目录
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/DataDictionary-DiseaseManagement")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class DiseaseManagementController {
|
||||
private final IConditionDefinitionService iConditionDefinitionService;
|
||||
|
||||
/**
|
||||
* 病种目录分类查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/GetDiseaseCategory")
|
||||
public List<ConditionDefinition> GetDiseaseCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 病种目录查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/GetDiseaseList")
|
||||
public List<ConditionDefinition> GetDiseaseList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 病种目录编辑
|
||||
@PutMapping("/EditDisease")
|
||||
void EditDisease() {}
|
||||
|
||||
// 新增外来病种目录
|
||||
@PostMapping("/AddDisease")
|
||||
void AddDisease(DiseaseInDto diseaseInDto) {
|
||||
ConditionDefinition conditionDefinition = new ConditionDefinition();
|
||||
BeanUtils.copyProperties(diseaseInDto,conditionDefinition);
|
||||
// iConditionDefinitionService.AddDisease(conditionDefinition);
|
||||
}
|
||||
|
||||
// 新增医保病种目录
|
||||
@PostMapping("/AddYbDisease")
|
||||
void AddYbDisease(@RequestParam int id) {}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.openhis.web.datadictionary.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 病种目录列表 dto
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DiseaseDto {
|
||||
/** 所属分类 */
|
||||
private Integer sourceEnum;
|
||||
|
||||
/** 编码 */
|
||||
private String code;
|
||||
|
||||
/** 诊断名称 */
|
||||
private String name;
|
||||
|
||||
/** 诊断名称拼音 */
|
||||
private String pyCode;
|
||||
|
||||
/** 诊断名称五笔拼音 */
|
||||
private String wbCode;
|
||||
|
||||
/** 类型 */
|
||||
private String typeCode;
|
||||
|
||||
/** 描述 */
|
||||
private String description;
|
||||
|
||||
/** 医保标记 */
|
||||
private Integer ybFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybCode;
|
||||
|
||||
/** 医保对码标记 */
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 删除状态 */
|
||||
private Integer deleteFlag;
|
||||
/** 租户 */
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
|
||||
@@ -10,5 +13,28 @@ import com.openhis.clinical.domain.ConditionDefinition;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IConditionDefinitionService extends IService<ConditionDefinition> {
|
||||
/**
|
||||
* 病种分类查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ConditionDefinition> getMedicationCategory();
|
||||
|
||||
/**
|
||||
* 查询病种目录分页列表
|
||||
*
|
||||
* @param searchKey 查询条件
|
||||
* @param status 查询条件-状态
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
Page<ConditionDefinition> getPage(String searchKey, Integer status, Integer source_enum, Long id, Integer pageNo,
|
||||
Integer pageSize);
|
||||
|
||||
// 新增病种目录
|
||||
boolean addDisease(ConditionDefinition conditionDefinition);
|
||||
|
||||
// 新增医保病种目录
|
||||
boolean addYbDisease(ConditionDefinition conditionDefinition);
|
||||
}
|
||||
@@ -1,11 +1,21 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.mapper.ConditionDefinitionMapper;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 诊断定义管理Service业务层处理
|
||||
@@ -13,7 +23,81 @@ import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ConditionDefinitionServiceImpl extends ServiceImpl<ConditionDefinitionMapper, ConditionDefinition> implements IConditionDefinitionService {
|
||||
@AllArgsConstructor
|
||||
public class ConditionDefinitionServiceImpl extends ServiceImpl<ConditionDefinitionMapper, ConditionDefinition>
|
||||
implements IConditionDefinitionService {
|
||||
|
||||
private final ConditionDefinitionMapper conditionDefinitionMapper;
|
||||
|
||||
@Override
|
||||
public List<ConditionDefinition> getMedicationCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病种目录分页列表
|
||||
*
|
||||
* @param searchKey 查询条件
|
||||
* @param status 查询条件-状态
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<ConditionDefinition> getPage(String searchKey, Integer status, Integer sourceEnum, Long id, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
Page<ConditionDefinition> conditionList;
|
||||
// 生成查询条件
|
||||
LambdaQueryWrapper<ConditionDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 模糊查询项目
|
||||
if (StringUtils.isNotEmpty(searchKey)) {
|
||||
// 模糊查询项目为【疾病编码】,【疾病名称】,【拼音】,【五笔】
|
||||
queryWrapper.and(q -> q.like(ConditionDefinition::getCondition_code, searchKey).or()
|
||||
.like(ConditionDefinition::getName, searchKey).or().like(ConditionDefinition::getPyStr, searchKey).or()
|
||||
.like(ConditionDefinition::getWbStr, searchKey));
|
||||
}
|
||||
// 查询状态
|
||||
if (status != -1) {
|
||||
queryWrapper.eq(ConditionDefinition::getStatusEnum, status);
|
||||
}
|
||||
// 分类查询
|
||||
if (sourceEnum != -1) {
|
||||
queryWrapper.eq(ConditionDefinition::getSourceEnum, sourceEnum);
|
||||
}
|
||||
// Id查询
|
||||
if (id != -1) {
|
||||
queryWrapper.eq(ConditionDefinition::getId, id);
|
||||
}
|
||||
// 查询删除状态
|
||||
queryWrapper.eq(ConditionDefinition::getDeleteFlag, DelFlag.NO.getCode());
|
||||
// 查询病种目录列表
|
||||
conditionList = conditionDefinitionMapper.selectPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
// 返回病种目录列表
|
||||
return conditionList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addDisease(ConditionDefinition conditionDefinition) {
|
||||
// 根据病种编码判断病种是否存在
|
||||
List<ConditionDefinition> conditionDefinitions =
|
||||
conditionDefinitionMapper.selectList(new LambdaQueryWrapper<ConditionDefinition>()
|
||||
.eq(ConditionDefinition::getCondition_code, conditionDefinition.getCondition_code()));
|
||||
if (conditionDefinitions.size() > 0) {
|
||||
return false;
|
||||
}
|
||||
// 新增病种
|
||||
int insert = conditionDefinitionMapper.insert(conditionDefinition);
|
||||
if (insert != 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addYbDisease(ConditionDefinition conditionDefinition) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user