Browse Source

修改统计分析

recovery
wang0018 4 years ago
parent
commit
2fb12aba8d
  1. 8
      tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java
  2. 12
      tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java
  3. 2
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  4. 2
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  5. 17
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  6. 11
      tcm/src/main/resources/mapper_dao/PatientDao.xml

8
tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java

@ -45,11 +45,15 @@ public class StatisticalAnalysisController {
@MustLogin
@ApiOperation(value = "病例分析", notes = "w:病例分析")
@RequestMapping(value = "/countAnalysis", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<StatisticVo.SelGroupNum>> countAnalysis(@ApiParam @Validated @RequestBody QueryDto<StatisticDto.SelBinLCount> params) {
public JsonResponse<StatisticVo.SelGroupNumAdd> countAnalysis(@ApiParam @Validated @RequestBody QueryDto<StatisticDto.SelBinLCount> params) {
log.info("病例分析参数:{}", params);
List<String> stringLists=patientService.stringLists(params.getParam().getTestQuestionsId());
List<StatisticVo.SelGroupNum> selGroupNum = patientService.countAnalysis(params.getParam(), params.getUserId());
StatisticVo.SelGroupNumAdd selGroupNumAdd=new StatisticVo.SelGroupNumAdd();
selGroupNumAdd.setSelGroupNums(selGroupNum);
selGroupNumAdd.setStringList(stringLists);
log.info("病例分析调用完成");
return JsonResponse.newInstance().ok(selGroupNum);
return JsonResponse.newInstance().ok(selGroupNumAdd);
}
@MustLogin

12
tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java

@ -26,6 +26,16 @@ public class StatisticVo {
@ApiModelProperty("数量")
private Integer nums;
}
@Data
@ApiModel("病例分析-增加一个字段")
public static class SelGroupNumAdd{
@ApiModelProperty("病例分析")
private List<StatisticVo.SelGroupNum> selGroupNums;
@ApiModelProperty("所有得内容分类")
private List<String> stringList;
}
@Data
@ApiModel("病例分析")
public static class SelGroupNum{
@ -41,6 +51,8 @@ public class StatisticVo {
private String content;
@ApiModelProperty("数量")
private Integer nums;
@ApiModelProperty("对照组名称")
private String name;
}
@Data

2
tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java

@ -66,4 +66,6 @@ public interface PatientDao {
List<StatisticVo.RecentAnalysisVO> adjacentTasks(StatisticDto.RecentAnalysisDto param,Long userId);
List<StatisticVo.PatientProgressVo> selPatientProgress(Long userId);
List<String> stringLists(Long testQuestionsId);
}

2
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -67,4 +67,6 @@ public interface IPatientService {
PageInfo<StatisticVo.RecentAnalysisVO> adjacentTasks(StatisticDto.RecentAnalysisDto param,Long userId);
List<StatisticVo.PatientProgressVo> selPatientProgress(Long userId);
List<String> stringLists(Long testQuestionsId);
}

17
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -2,6 +2,7 @@ package com.ccsens.tcm.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tcm.bean.dto.BiologicalSamplesDto;
import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.PatientDto;
@ -265,6 +266,11 @@ public class PatientService implements IPatientService {
public List<StatisticVo.SelGroupNum> countAnalysis(StatisticDto.SelBinLCount param, Long userId) {
List<StatisticVo.SelGroupNum> selGroupNumsList= new ArrayList<StatisticVo.SelGroupNum>();
if(param.getInpatientId()!=null && param.getInpatientId().length==0) {
StatisticVo.SelGroupNum selGroupNum =new StatisticVo.SelGroupNum();
List<StatisticVo.SelGroupList> selGroupList= patientDao.countAnalysis(param.getConditionList(),param.getConditionListDate(),null,param.getTestQuestionsId(),param.getHospitalization(),param.getInputStatus(),param.getHospitalId());
selGroupNum.setInpatientId(null);
selGroupNum.setList(selGroupList);
selGroupNumsList.add(selGroupNum);
return selGroupNumsList;
}
for (int i = 0; i < param.getInpatientId().length; i++) {
@ -390,5 +396,16 @@ public class PatientService implements IPatientService {
return patientDao.selPatientProgress(userId);
}
@Override
public List<String> stringLists(Long testQuestionsId) {
List<String> stringList=Arrays.asList();
if(ObjectUtil.isNotNull(testQuestionsId)){
stringList= patientDao.stringLists(testQuestionsId);
}else {
stringList.add("总人数");
}
return stringList;
}
}

11
tcm/src/main/resources/mapper_dao/PatientDao.xml

@ -162,10 +162,11 @@
<select id="countAnalysis" resultType="com.ccsens.tcm.bean.vo.StatisticVo$SelGroupList">
<if test="testQuestionsId!=null and testQuestionsId!=0">
select tpr.contents as content,
select tpr.contents as content,ti.name,
count(distinct tpr.patient_id) as nums
from t_patient_information tpi
left join t_patient_record tpr on tpi.id=tpr.patient_id and tpr.rec_status=0 and tpr.contents_type =0
left join t_inpatient ti on ti.id=tpi.inpatient_id and ti.rec_status = 0
where tpi.rec_status=0
<if test="testQuestionsId!=null and testQuestionsId!=0">
@ -175,10 +176,11 @@
<if test="testQuestionsId==null or testQuestionsId==0">
SELECT
'' as content,
ti.name,
count( * ) AS nums
FROM
t_patient_information tpi
left join t_inpatient ti on ti.id=tpi.inpatient_id and ti.rec_status = 0
WHERE
tpi.rec_status = 0
</if>
@ -416,4 +418,9 @@
and tpr.created_at &gt; DATE_SUB(now(), INTERVAL 1 YEAR)
group by tpr.patient_id,tpr.collect_time
</select>
<select id="stringLists" resultType="java.lang.String">
select distinct tpr.contents from t_patient_record tpr
where tpr.rec_status=0
and tpr.test_questions_id=#{testQuestionsId}
</select>
</mapper>
Loading…
Cancel
Save