1: 修改表 vp_disease_treatment_plan的relationType字段类型为Integer

dev_3.1.0
xueqingkun 10 months ago
parent 0863a35bea
commit d7d88712e3

@ -46,7 +46,7 @@ public class DiseaseTreatmentPlanManageController {
@GetMapping("/queryListByDiseaseId")
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId) {
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanManageService.queryListByDiseaseId(diseaseId);
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanManageService.queryListByDiseaseId(diseaseId,0);
// 前端大哥强烈要求把treatmentPlanId 转换为 firstMeasuresId
diseaseTreatmentPlanResVos.forEach(vo -> {
if (CollUtil.isEmpty(vo.getDrugIds())) {

@ -1,5 +1,6 @@
package com.supervision.manage.controller.medicalrec;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.supervision.manage.pojo.vo.*;
import com.supervision.manage.service.MedicalRecManageService;
@ -207,4 +208,29 @@ public class MedicalRecManageController {
return medicalRecManageService.updateDiagnosisCriteria(diseaseAncillaryReqVo);
}
@Operation(summary = "根据病历id查询疾病处置信息列表")
@GetMapping("/queryListByDiseaseId")
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(@Parameter(name = "medicalRecId", description = "病例id") String medicalRecId) {
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = medicalRecManageService.queryListByDiseaseId(medicalRecId);
// 前端大哥强烈要求把treatmentPlanId 转换为 firstMeasuresId
diseaseTreatmentPlanResVos.forEach(vo -> {
if (CollUtil.isEmpty(vo.getDrugIds())) {
vo.setFirstMeasuresId(vo.getTreatmentPlanId());
}
});
return diseaseTreatmentPlanResVos;
}
@Operation(summary = "修改处置计划")
@PutMapping("/updateDiseaseTreatmentPlan")
public boolean updateDiseaseTreatmentPlan(@RequestBody DiseaseTreatmentPlanReqVo diseaseTreatmentPlan) {
// 适配前端传入数据
diseaseTreatmentPlan.setTreatmentPlanId(diseaseTreatmentPlan.getFirstMeasuresId());
return medicalRecManageService.updateDiseaseTreatmentPlan(diseaseTreatmentPlan);
}
}

@ -9,7 +9,7 @@ import java.util.List;
public interface DiseaseTreatmentPlanManageService {
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId);
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId,Integer relationType);
DiseaseTreatmentPlan saveTreatmentPlan(DiseaseTreatmentPlanReqVo diseaseTreatmentPlan);

@ -66,4 +66,8 @@ public interface MedicalRecManageService {
List<DiseasePhysicalResVo> queryDiseasePhysical(String medicalRecId);
Boolean updateDiagnosisCriteria(DiagnosisCriteriaReqVo diseaseAncillaryReqVo);
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String medicalRecId);
boolean updateDiseaseTreatmentPlan(DiseaseTreatmentPlanReqVo diseaseTreatmentPlan);
}

@ -44,10 +44,11 @@ public class DiseaseTreatmentPlanManageServiceImpl implements DiseaseTreatmentPl
private final CommonDicService commonDicService;
@Override
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId) {
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId,Integer relationType) {
Assert.notEmpty(diseaseId,"疾病id不能为空");
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(diseaseId);
relationType = Objects.isNull(relationType) ? 0 : relationType;
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(diseaseId,relationType);
if (CollUtil.isEmpty(diseaseTreatmentPlanResVos)){
return diseaseTreatmentPlanResVos;
@ -181,7 +182,7 @@ public class DiseaseTreatmentPlanManageServiceImpl implements DiseaseTreatmentPl
DiseaseTreatmentPlanTreeNode rootNode = new DiseaseTreatmentPlanTreeNode(treatmentPlanTreeNode);
// 2.根据疾病id查询疾病处置计划信息
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = this.queryListByDiseaseId(diseaseId);
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = this.queryListByDiseaseId(diseaseId,0);
// 3. 初始化flag
if (CollUtil.isNotEmpty(diseaseTreatmentPlanResVos)){

@ -155,7 +155,7 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
@Override
public List<DiseaseTreatmentPlanResVo> queryDiseaseTreatmentPlanByCreat(String diseaseId) {
return diseaseTreatmentPlanManageService.queryListByDiseaseId(diseaseId);
return diseaseTreatmentPlanManageService.queryListByDiseaseId(diseaseId,0);
}
@Override
@ -247,7 +247,7 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
// 体格检查
medicalRecInfoVO.setPhysicalList(diseasePhysicalManageService.queryListByDiseaseId(medicalRec.getDiseaseId(),0));
// 处置计划
medicalRecInfoVO.setTreatmentPlanList(diseaseTreatmentPlanManageService.queryListByDiseaseId(medicalRec.getDiseaseId()));
medicalRecInfoVO.setTreatmentPlanList(diseaseTreatmentPlanManageService.queryListByDiseaseId(medicalRec.getDiseaseId(),0));
// 问答策略
List<MedicalRecQaVO> medicalRecQaVOS = queryMedicalRecQaInfo(id);
Map<Integer, List<MedicalRecQaVO>> qaListMap = medicalRecQaVOS.stream().collect(Collectors.groupingBy(MedicalRecQaVO::getAnswerType));
@ -545,6 +545,29 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
}
@Override
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String medicalRecId) {
// 在病历没有保存病历与处置计划的关联数据时直接通过medicalId不能够查询到数据这个时候使用对应疾病的数据
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanManageService.queryListByDiseaseId(medicalRecId, 1);
if (CollUtil.isNotEmpty(diseaseTreatmentPlanResVos)) {
return diseaseTreatmentPlanResVos;
}
log.info("queryDiseasePhysical:未找到该病历处置计划数据,使用对应疾病体格检查数据");
MedicalRec medicalRec = medicalRecService.getById(medicalRecId);
Assert.notNull(medicalRec, "未找到该病历");
Assert.notEmpty(medicalRec.getDiseaseId(), "未配置疾病信息");
return diseaseTreatmentPlanManageService.queryListByDiseaseId(medicalRec.getDiseaseId(),0);
}
@Override
public boolean updateDiseaseTreatmentPlan(DiseaseTreatmentPlanReqVo diseaseTreatmentPlan) {
Assert.notEmpty(diseaseTreatmentPlan.getId(), "id不能为空");
return false;
}
private void saveMedicalRecAssert(MedicalRecInfoReVo reqVO){
Assert.notEmpty(reqVO.getId(), "id不能为空");
Assert.notEmpty(reqVO.getPatientId(),"病人id不能为空");

@ -15,7 +15,7 @@ import java.util.List;
*/
public interface DiseaseTreatmentPlanMapper extends BaseMapper<DiseaseTreatmentPlan> {
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(@Param("diseaseId") String diseaseId);
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(@Param("diseaseId") String diseaseId,@Param("relationType") Integer relationType);
}

@ -14,5 +14,5 @@ import java.util.List;
*/
public interface DiseaseTreatmentPlanService extends IService<DiseaseTreatmentPlan> {
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId);
List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId,Integer relationType);
}

@ -19,9 +19,9 @@ import java.util.List;
public class DiseaseTreatmentPlanServiceImpl extends ServiceImpl<DiseaseTreatmentPlanMapper, DiseaseTreatmentPlan>
implements DiseaseTreatmentPlanService {
@Override
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId) {
public List<DiseaseTreatmentPlanResVo> queryListByDiseaseId(String diseaseId,Integer relationType) {
return super.getBaseMapper().queryListByDiseaseId(diseaseId);
return super.getBaseMapper().queryListByDiseaseId(diseaseId,relationType);
}
}

@ -37,5 +37,8 @@
from vp_disease_treatment_plan dtp
left join vp_config_treatment_plan ctp on dtp.treatment_plan_id = ctp.id
where dtp.disease_id = #{diseaseId}
<if test="disposalMethod != null">
and dtp.relation_type = #{relationType}
</if>
</select>
</mapper>

@ -96,7 +96,7 @@ public class AskDiagnosisResultServiceImpl implements AskDiagnosisResultService
}
// 2. 查询出疾病处置计划(疾病配置的处置计划)
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(diseaseId);
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(diseaseId,0);
List<String> treatmentPlanId = diseaseTreatmentPlanResVos.stream().map(DiseaseTreatmentPlanResVo::getTreatmentPlanId).distinct().collect(Collectors.toList());
// 3. 查出疾病处置计划用药(疾病配置的用药计划)
@ -455,7 +455,7 @@ public class AskDiagnosisResultServiceImpl implements AskDiagnosisResultService
int userTreatmentPlanCount = userTreatmentPlanRecordList.size();
// 2. 查询出疾病处置计划(疾病配置的处置计划)
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(process.getDiseaseId());
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(process.getDiseaseId(),0);
Set<String> treatmentPlanIdSet = diseaseTreatmentPlanResVos.stream().map(DiseaseTreatmentPlanResVo::getTreatmentPlanId).collect(Collectors.toSet());
// 3. 查出疾病处置计划用药(疾病配置的用药计划)

Loading…
Cancel
Save