Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zy_Java 4 years ago
parent
commit
392eac3df0
  1. 10
      tcm/src/main/java/com/ccsens/tcm/api/QuestionController.java
  2. 8
      tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java
  3. 13
      tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java
  4. 12
      tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java
  5. 2
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  6. 8
      tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionDao.java
  7. 2
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  8. 1
      tcm/src/main/java/com/ccsens/tcm/service/IQuestionService.java
  9. 17
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  10. 19
      tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java
  11. 11
      tcm/src/main/resources/mapper_dao/PatientDao.xml
  12. 60
      tcm/src/main/resources/mapper_dao/QuestionDao.xml

10
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<List<QuestionVo.subjectLists>> queryQuestion() throws Exception {
log.info("查询所有试题:{}");
List<QuestionVo.subjectLists> subjectLists = questionService.queryQuestion();
log.info("查询所有试题");
return JsonResponse.newInstance().ok(subjectLists);
}
}

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

13
tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java

@ -80,7 +80,18 @@ public class QuestionVo {
@ApiModelProperty("选择之后关联的题目")
private List<CodeQuestionVo> questionVos;
}
@Data
@ApiModel("所有试题类型的信息")
public static class subjectLists{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("code")
private String code;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("子类型")
private List<subjectLists> optionVos;
}
@Data
@ApiModel("患者信息的试题类型")
public static class PatientCode {

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);
}

8
tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionDao.java

@ -50,4 +50,12 @@ public interface QuestionDao extends QuestionMapper {
* @return 返回所有试题和答题记录
*/
List<QuestionVo.PatientQuestion> getQuestionByOptionId(@Param("optionId")Long optionId, @Param("patientId")Long patientId, @Param("nums")Integer nums);
/**
* 查询所有的试题的相关信息
* @return
*/
List<QuestionVo.subjectLists> queryQuestion();
List<QuestionVo.subjectLists> queryQuestion1();
}

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);
}

1
tcm/src/main/java/com/ccsens/tcm/service/IQuestionService.java

@ -16,4 +16,5 @@ public interface IQuestionService {
*/
List<QuestionVo.PatientCode> getQuestionAndAnswer(QuestionDto.QueryQuestionAndAnswer param);
List<QuestionVo.subjectLists> queryQuestion();
}

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=new ArrayList<String>();
if(ObjectUtil.isNotNull(testQuestionsId)){
stringList= patientDao.stringLists(testQuestionsId);
}else {
stringList.add("总人数");
}
return stringList;
}
}

19
tcm/src/main/java/com/ccsens/tcm/service/QuestionService.java

@ -55,4 +55,23 @@ public class QuestionService implements IQuestionService{
return patientCodeList;
}
@Override
public List<QuestionVo.subjectLists> queryQuestion() {
//
List<QuestionVo.subjectLists> subjectLists= questionDao.queryQuestion();
List<QuestionVo.subjectLists> 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;
}
}

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>

60
tcm/src/main/resources/mapper_dao/QuestionDao.xml

@ -211,5 +211,65 @@
q.rec_status = 0
and q.relevance_option_id = #{optionId}
</select>
<resultMap id="queryQuestionMap" type="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="name" property="name"/>
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists">
<id column="id1" property="id"/>
<result column="code1" property="code"/>
<result column="name1" property="name"/>
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists">
<id property="id" column="id2"/>
<result property="name" column="question"/>
</collection>
</collection>
</resultMap>
<select id="queryQuestion" resultMap="queryQuestionMap">
SELECT
trc.id,
trc.`code`,
trc.`name`,
trc1.id AS id1,
trc1.`code` AS code1,
trc1.`name` AS name1,
tq.id AS id2,
tq.question
FROM
t_report_code trc
LEFT JOIN t_report_code trc1 ON trc1.parent_code = trc.CODE
AND trc1.LEVEL = 2
AND trc1.rec_status = 0
LEFT JOIN t_question tq ON tq.CODE = trc1.CODE
AND tq.rec_status = 0
WHERE
trc.LEVEL = 1
AND trc.rec_status =0
order by trc.sort,trc1.sort,tq.sort
</select>
<resultMap id="queryQuestion1Map" type="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="name" property="name"/>
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists">
<id property="id" column="id2"/>
<result column="question" property="name"/>
</collection>
</resultMap>
<select id="queryQuestion1" resultMap="queryQuestion1Map">
select trc.id,
trc.`code`,
trc.`name`,
tq.id AS id2,
tq.question
FROM
t_report_code trc, t_question tq
WHERE
trc.LEVEL = 1
AND trc.rec_status =0
and tq.CODE = trc.CODE
AND tq.rec_status = 0
order by trc.sort,tq.sort
</select>
</mapper>
Loading…
Cancel
Save