diff --git a/tcm/src/main/java/com/ccsens/tcm/api/QuestionController.java b/tcm/src/main/java/com/ccsens/tcm/api/QuestionController.java index c3b231d9..104226ff 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/QuestionController.java +++ b/tcm/src/main/java/com/ccsens/tcm/api/QuestionController.java @@ -2,6 +2,7 @@ package com.ccsens.tcm.api; import com.ccsens.tcm.bean.dto.CodeVo; import com.ccsens.tcm.bean.dto.QuestionDto; +import com.ccsens.tcm.bean.po.Question; import com.ccsens.tcm.bean.vo.QuestionVo; import com.ccsens.tcm.service.IImportService; import com.ccsens.tcm.service.IQuestionService; @@ -54,5 +55,14 @@ public class QuestionController { log.info("查看试题及患者的答案成功"); return JsonResponse.newInstance().ok(patientCodes); } + @ApiOperation(value = "查询所有得题目的类型和题目相关信息",notes = "1007:查询所有试题") + @RequestMapping(value="/queryQuestion",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse> queryQuestion() throws Exception { + log.info("查询所有试题:{}"); + List subjectLists = questionService.queryQuestion(); + log.info("查询所有试题"); + return JsonResponse.newInstance().ok(subjectLists); + } + } diff --git a/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java b/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java index 6adf5922..5feec3c1 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java +++ b/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> countAnalysis(@ApiParam @Validated @RequestBody QueryDto params) { + public JsonResponse countAnalysis(@ApiParam @Validated @RequestBody QueryDto params) { log.info("病例分析参数:{}", params); + List stringLists=patientService.stringLists(params.getParam().getTestQuestionsId()); List 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 diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java b/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java index 5ec03dad..1ccb7d59 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java @@ -80,7 +80,18 @@ public class QuestionVo { @ApiModelProperty("选择之后关联的题目") private List questionVos; } - + @Data + @ApiModel("所有试题类型的信息") + public static class subjectLists{ + @ApiModelProperty("id") + private Long id; + @ApiModelProperty("code") + private String code; + @ApiModelProperty("名称") + private String name; + @ApiModelProperty("子类型") + private List optionVos; + } @Data @ApiModel("患者信息的试题类型") public static class PatientCode { diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java b/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java index e781ab2f..54fe2aad 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java +++ b/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 selGroupNums; + @ApiModelProperty("所有得内容分类") + private List 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 diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java b/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java index 567ec986..86c79f64 100644 --- a/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java +++ b/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java @@ -66,4 +66,6 @@ public interface PatientDao { List adjacentTasks(StatisticDto.RecentAnalysisDto param,Long userId); List selPatientProgress(Long userId); + + List stringLists(Long testQuestionsId); } diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionDao.java b/tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionDao.java index a3cc94fd..0a919924 100644 --- a/tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionDao.java +++ b/tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionDao.java @@ -50,4 +50,12 @@ public interface QuestionDao extends QuestionMapper { * @return 返回所有试题和答题记录 */ List getQuestionByOptionId(@Param("optionId")Long optionId, @Param("patientId")Long patientId, @Param("nums")Integer nums); + + /** + * 查询所有的试题的相关信息 + * @return + */ + List queryQuestion(); + + List queryQuestion1(); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java index 3fa56136..5efe920f 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java @@ -67,4 +67,6 @@ public interface IPatientService { PageInfo adjacentTasks(StatisticDto.RecentAnalysisDto param,Long userId); List selPatientProgress(Long userId); + + List stringLists(Long testQuestionsId); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/IQuestionService.java b/tcm/src/main/java/com/ccsens/tcm/service/IQuestionService.java index 3b804a62..bb4bdb92 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/IQuestionService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/IQuestionService.java @@ -16,4 +16,5 @@ public interface IQuestionService { */ List getQuestionAndAnswer(QuestionDto.QueryQuestionAndAnswer param); + List queryQuestion(); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java index 64cc44d4..0163fcf9 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/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 countAnalysis(StatisticDto.SelBinLCount param, Long userId) { List selGroupNumsList= new ArrayList(); if(param.getInpatientId()!=null && param.getInpatientId().length==0) { + StatisticVo.SelGroupNum selGroupNum =new StatisticVo.SelGroupNum(); + List 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 stringLists(Long testQuestionsId) { + List stringList=new ArrayList(); + if(ObjectUtil.isNotNull(testQuestionsId)){ + stringList= patientDao.stringLists(testQuestionsId); + }else { + stringList.add("总人数"); + } + return stringList; + } + } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java b/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java index e9bdd954..082094f5 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java @@ -55,4 +55,23 @@ public class QuestionService implements IQuestionService{ return patientCodeList; } + @Override + public List queryQuestion() { + // + List subjectLists= questionDao.queryQuestion(); + + + List subjectLists1= questionDao.queryQuestion1(); + if(subjectLists1.size()>0){ + subjectLists1.forEach(subject1 -> { + for (int i = 0; i < subjectLists.size(); i++) { + if(subjectLists.get(i).getId().equals(subject1.getId())){ + subjectLists.get(i).getOptionVos().addAll(subject1.getOptionVos()); + } + } + }); + } + return subjectLists; + } + } diff --git a/tcm/src/main/resources/mapper_dao/PatientDao.xml b/tcm/src/main/resources/mapper_dao/PatientDao.xml index fc9b6cf7..51c9e569 100644 --- a/tcm/src/main/resources/mapper_dao/PatientDao.xml +++ b/tcm/src/main/resources/mapper_dao/PatientDao.xml @@ -162,10 +162,11 @@ + \ No newline at end of file diff --git a/tcm/src/main/resources/mapper_dao/QuestionDao.xml b/tcm/src/main/resources/mapper_dao/QuestionDao.xml index e9d29431..f1bdb052 100644 --- a/tcm/src/main/resources/mapper_dao/QuestionDao.xml +++ b/tcm/src/main/resources/mapper_dao/QuestionDao.xml @@ -211,5 +211,65 @@ q.rec_status = 0 and q.relevance_option_id = #{optionId} + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file