web: 添加处置计划评估结果功能

dev_2.0.0
xueqingkun 1 year ago
parent 937e8c713a
commit 3eb0de3431

@ -10,7 +10,7 @@ import lombok.Data;
*
* @TableName vp_treatment_plan_drug
*/
@TableName(value ="vp_disease_treatment_plan")
@TableName(value ="vp_disease_treatment_plan_drug")
@Data
public class DiseaseTreatmentPlanDrug implements Serializable {
/**

@ -46,9 +46,11 @@ public class Process implements Serializable {
private String userId;
/**
* 0 1
* :
*
*
*/
@ApiModelProperty("任务状态 -1未开始 0进行中 1已完成")
@ApiModelProperty("任务状态 0:待问诊 1:待处置 2:已评估")
private Integer status;
@ApiModelProperty("实例类型 0学习实例 1:考核实例")

@ -36,7 +36,7 @@ public class TreatmentPlanRecord implements Serializable {
private Integer disposalMethod;
/**
* (0:1:2: 3: 4: 5: 6: 7: )
* (0: 1: 2: 3: 4: 5: 6: 7: )
*/
private Integer disposalPlan;

@ -26,9 +26,9 @@
<select id="queryAncillaryResultByProcessId"
resultType="com.supervision.vo.result.AncillaryRecordByResultDAO">
select t3.item_name as itemName,
t2.require_check as requireCheck,
t2.basis_confirm as basisConfirm,
t2.basis_identification as basisIdentification,
t2.require_check_flag as requireCheck,
t2.basis_confirm_flag as basisConfirm,
t2.basis_identification_flag as basisIdentification,
t1.id as recordId,
t3.id as itemId
from vp_diagnosis_ancillary_record t1

@ -31,9 +31,9 @@
select (IF(t4.location_name IS NULL, t3.tool_name,
CONCAT_WS(' | ', t3.tool_name, t4.location_name))) AS toolLocationName,
t1.id as recordId,
t2.require_check as requireCheck,
t2.basis_confirm as basisConfirm,
t2.basis_identification as basisIdentification,
t2.require_check_flag as requireCheck,
t2.basis_confirm_flag as basisConfirm,
t2.basis_identification_flag as basisIdentification,
t3.id as toolId,
t4.id as locationId
from vp_diagnosis_physical_record t1

@ -34,7 +34,7 @@
select
dtp.id as id,
dtp.disease_id as diseaseId,
dtp.plan_id as planId,
dtp.treatment_plan_id as planId,
ctp.disposal_plan as disposalPlan,
ctp.disposal_method as disposalMethod,
ctp.first_measures as firstMeasures,
@ -42,7 +42,7 @@
ctp.recommended_medication as recommendedMedication
from vp_disease_treatment_plan dtp
left join vp_config_treatment_plan ctp on dtp.plan_id = ctp.id
left join vp_config_treatment_plan ctp on dtp.treatment_plan_id = ctp.id
where dtp.disease_id = #{diseaseId}
</select>
</mapper>

@ -1,7 +1,11 @@
package com.supervision.pojo.vo;
import com.supervision.model.TreatmentPlanRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
public class DealPlanResVO {
@ -9,9 +13,18 @@ public class DealPlanResVO {
@ApiModelProperty("用户的治疗计划类型(0门诊 1住院)")
private Integer userTreatmentPlanType;
@ApiModelProperty("用户的治疗计划")
private String userTreatmentPlan;
@ApiModelProperty("处置方案列表")
private List<TreatmentPlanResult> drugTreatmentPlan;
private List<TreatmentPlanResult> otherTreatmentPlan;
@Data
@EqualsAndHashCode(callSuper = true)
public static class TreatmentPlanResult extends TreatmentPlanRecord {
@ApiModelProperty("结果标识 0:错误 1:正确")
private Integer flag;
@ApiModelProperty("治疗计划")
private String realTreatmentPlan;
}
}

@ -1,6 +1,7 @@
package com.supervision.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
@ -9,6 +10,7 @@ import com.supervision.model.*;
import com.supervision.model.Process;
import com.supervision.pojo.vo.*;
import com.supervision.service.*;
import com.supervision.vo.manage.DiseaseTreatmentPlanResVo;
import com.supervision.vo.result.AncillaryRecordByResultDAO;
import com.supervision.vo.result.PhysicalRecordByResultDAO;
import lombok.RequiredArgsConstructor;
@ -45,6 +47,13 @@ public class AskDiagnosisResultServiceImpl implements AskDiagnosisResultService
private final DiseaseService diseaseService;
private final TreatmentPlanRecordService treatmentPlanRecordService;
private final DiseaseTreatmentPlanService diseaseTreatmentPlanService;
private final DiseaseTreatmentPlanDrugService diseaseTreatmentPlanDrugService;
@Override
@Transactional(rollbackFor = Exception.class)
public void finishAsk(FinishAskReqVO reqVO) {
@ -63,6 +72,8 @@ public class AskDiagnosisResultServiceImpl implements AskDiagnosisResultService
diagnosisResult.setTreatmentPlanType(reqVO.getTreatmentPlanType());
diagnosisResult.setTreatmentPlan(reqVO.getTreatmentPlan());
diagnosisResultService.save(diagnosisResult);
// todo:修改流程状态
}
@Override
@ -87,15 +98,46 @@ public class AskDiagnosisResultServiceImpl implements AskDiagnosisResultService
// 5.全面检查-(暂无相关数据) 后面再看
diagnosisResultResVO.setFullCheck(null);
// 6.处置方案
diagnosisResultResVO.setDealPlan(createDealPlan(medicalRec, diagnosisResult, patient));
diagnosisResultResVO.setDealPlan(createDealPlan(process.getDiseaseId(), processId));
return diagnosisResultResVO;
}
private DealPlanResVO createDealPlan(MedicalRec medicalRec, DiagnosisResult diagnosisResult, Patient patient) {
private DealPlanResVO createDealPlan(String diseaseId, String processId) {
DealPlanResVO dealPlanResVO = new DealPlanResVO();
dealPlanResVO.setUserTreatmentPlanType(diagnosisResult.getTreatmentPlanType());
dealPlanResVO.setUserTreatmentPlan(diagnosisResult.getTreatmentPlan());
dealPlanResVO.setRealTreatmentPlan("2.0修改,后期修改这个问题");
// 1. 查询处置计划记录
List<TreatmentPlanRecord> treatmentPlanRecordList = treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list();
if (CollectionUtil.isEmpty(treatmentPlanRecordList)){
return dealPlanResVO;
}
// 2. 查询出疾病处置计划
List<DiseaseTreatmentPlanResVo> diseaseTreatmentPlanResVos = diseaseTreatmentPlanService.queryListByDiseaseId(diseaseId);
List<String> planIds = diseaseTreatmentPlanResVos.stream().map(DiseaseTreatmentPlanResVo::getPlanId).distinct().collect(Collectors.toList());
// 3. 查出疾病处置计划用药
List<DiseaseTreatmentPlanDrug> diseaseTreatmentPlanDrugList = diseaseTreatmentPlanDrugService.lambdaQuery().eq(DiseaseTreatmentPlanDrug::getDiseaseId, diseaseId).list();
List<String> drugIds = diseaseTreatmentPlanDrugList.stream().map(DiseaseTreatmentPlanDrug::getDrugId).distinct().collect(Collectors.toList());
// 4. 组装数据
ArrayList<DealPlanResVO.TreatmentPlanResult> drugTreatmentPlanResults = new ArrayList<>();
ArrayList<DealPlanResVO.TreatmentPlanResult> otherTreatmentPlanResults = new ArrayList<>();
for (TreatmentPlanRecord treatmentPlanRecord : treatmentPlanRecordList) {
DealPlanResVO.TreatmentPlanResult bean = BeanUtil.toBean(treatmentPlanRecord, DealPlanResVO.TreatmentPlanResult.class);
boolean flag = bean.getDisposalPlan().equals(1) ? drugIds.contains(bean.getDrugId()) : planIds.contains(bean.getTreatmentPlanId());
bean.setFlag(flag ? 1 : 0);
if (bean.getDisposalPlan().equals(1)){
drugTreatmentPlanResults.add(bean);
}else {
otherTreatmentPlanResults.add(bean);
}
}
dealPlanResVO.setUserTreatmentPlanType(CollectionUtil.getFirst(treatmentPlanRecordList).getDisposalMethod());
dealPlanResVO.setDrugTreatmentPlan(drugTreatmentPlanResults);
dealPlanResVO.setOtherTreatmentPlan(otherTreatmentPlanResults.stream().sorted(
Comparator.comparing(TreatmentPlanRecord::getDisposalPlan)).collect(Collectors.toList()));
return dealPlanResVO;
}

Loading…
Cancel
Save