|
@@ -3,15 +3,18 @@ package com.lantone.daqe.facade;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.lantone.common.exception.Asserts;
|
|
import com.lantone.common.util.BeanUtil;
|
|
import com.lantone.common.util.BeanUtil;
|
|
import com.lantone.common.util.StringUtil;
|
|
import com.lantone.common.util.StringUtil;
|
|
import com.lantone.daqe.dto.GetDiseasePageDTO;
|
|
import com.lantone.daqe.dto.GetDiseasePageDTO;
|
|
import com.lantone.daqe.entity.DiseaseInfo;
|
|
import com.lantone.daqe.entity.DiseaseInfo;
|
|
import com.lantone.daqe.facade.base.DiseaseInfoFacade;
|
|
import com.lantone.daqe.facade.base.DiseaseInfoFacade;
|
|
-import com.lantone.daqe.vo.AddDiseaseVo;
|
|
|
|
-import com.lantone.daqe.vo.DelDiseaseByIdVo;
|
|
|
|
|
|
+import com.lantone.daqe.vo.AddDiseaseVO;
|
|
|
|
+import com.lantone.daqe.vo.DelDiseaseByIdVO;
|
|
import com.lantone.daqe.vo.GetDiseasePageVO;
|
|
import com.lantone.daqe.vo.GetDiseasePageVO;
|
|
-import com.lantone.daqe.vo.UpDiseaseByIdVo;
|
|
|
|
|
|
+import com.lantone.daqe.vo.MatchingDiseaseVO;
|
|
|
|
+import com.lantone.daqe.vo.UpDiseaseByIdVO;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -33,7 +36,6 @@ public class DiseaseManagementFacade {
|
|
|
|
|
|
QueryWrapper<DiseaseInfo> diseaseInfoQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<DiseaseInfo> diseaseInfoQueryWrapper = new QueryWrapper<>();
|
|
diseaseInfoQueryWrapper.eq(getDiseasePageVO.getHospitalId() != null, "hospital_id", getDiseasePageVO.getHospitalId());
|
|
diseaseInfoQueryWrapper.eq(getDiseasePageVO.getHospitalId() != null, "hospital_id", getDiseasePageVO.getHospitalId());
|
|
- diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getCode()), "code", getDiseasePageVO.getCode());
|
|
|
|
diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getName()), "name", getDiseasePageVO.getName());
|
|
diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getName()), "name", getDiseasePageVO.getName());
|
|
diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getStandard()), "standard", getDiseasePageVO.getStandard());
|
|
diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getStandard()), "standard", getDiseasePageVO.getStandard());
|
|
diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getIcd10()), "icd10", getDiseasePageVO.getIcd10());
|
|
diseaseInfoQueryWrapper.like(StringUtil.isNotBlank(getDiseasePageVO.getIcd10()), "icd10", getDiseasePageVO.getIcd10());
|
|
@@ -57,33 +59,51 @@ public class DiseaseManagementFacade {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param addDiseaseVo
|
|
|
|
- * @Description新增诊断
|
|
|
|
- * @Return java.lang.Boolean
|
|
|
|
|
|
+ * 新增诊断 业务处理
|
|
|
|
+ *
|
|
|
|
+ * @param addDiseaseVO
|
|
|
|
+ * @return 是否新增成功
|
|
*/
|
|
*/
|
|
- public Boolean addDisease(AddDiseaseVo addDiseaseVo) {
|
|
|
|
-
|
|
|
|
- return false;
|
|
|
|
|
|
+ public Boolean addDisease(AddDiseaseVO addDiseaseVO) {
|
|
|
|
+ DiseaseInfo diseaseInfo = new DiseaseInfo();
|
|
|
|
+ BeanUtil.copyProperties(addDiseaseVO, diseaseInfo);
|
|
|
|
+ if (diseaseInfoFacade.isExist(diseaseInfo)) {
|
|
|
|
+ Asserts.fail("该诊断已存在!");
|
|
|
|
+ }
|
|
|
|
+ return diseaseInfoFacade.save(diseaseInfo);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param upDiseaseByIdVo
|
|
|
|
|
|
+ * @param upDiseaseByIdVO
|
|
* @Description修改诊断
|
|
* @Description修改诊断
|
|
* @Return java.lang.Boolean
|
|
* @Return java.lang.Boolean
|
|
*/
|
|
*/
|
|
- public Boolean upDiseaseById(UpDiseaseByIdVo upDiseaseByIdVo) {
|
|
|
|
|
|
+ public Boolean upDiseaseById(UpDiseaseByIdVO upDiseaseByIdVO) {
|
|
|
|
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param delDiseaseByIdVo
|
|
|
|
- * @Description删除诊断
|
|
|
|
- * @Return java.lang.Boolean
|
|
|
|
|
|
+ * 通过id删除诊断
|
|
|
|
+ *
|
|
|
|
+ * @param delDiseaseByIdVO
|
|
|
|
+ * @return 是否删除成功
|
|
*/
|
|
*/
|
|
- public Boolean delDiseaseById(DelDiseaseByIdVo delDiseaseByIdVo) {
|
|
|
|
-
|
|
|
|
- return false;
|
|
|
|
|
|
+ public Boolean delDiseaseById(DelDiseaseByIdVO delDiseaseByIdVO) {
|
|
|
|
+ if (diseaseInfoFacade.getById(delDiseaseByIdVO.getId()) == null) {
|
|
|
|
+ Asserts.fail("该诊断不存在!");
|
|
|
|
+ }
|
|
|
|
+ return diseaseInfoFacade.removeById(delDiseaseByIdVO.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param matchingDiseaseVO
|
|
|
|
+ * @Description
|
|
|
|
+ * @Return java.lang.Boolean
|
|
|
|
+ */
|
|
|
|
+ public Boolean matchingDisease(MatchingDiseaseVO matchingDiseaseVO) {
|
|
|
|
+ DiseaseInfo diseaseInfo = new DiseaseInfo();
|
|
|
|
+ BeanUtils.copyProperties(matchingDiseaseVO, diseaseInfo);
|
|
|
|
+ return diseaseInfoFacade.updateById(diseaseInfo);
|
|
|
|
+ }
|
|
}
|
|
}
|