Browse Source

对照组查询

pt
zhizhi wu 4 years ago
parent
commit
21ce2a9f13
  1. 8
      tcm/src/main/java/com/ccsens/tcm/api/InpatientController.java
  2. 25
      tcm/src/main/java/com/ccsens/tcm/persist/dao/InpatientDao.java
  3. 7
      tcm/src/main/java/com/ccsens/tcm/service/IInpatientService.java
  4. 12
      tcm/src/main/java/com/ccsens/tcm/service/InpatientService.java
  5. 10
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  6. 2
      tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java
  7. 4
      tcm/src/main/resources/application.yml
  8. 30
      tcm/src/main/resources/mapper_dao/InpatientDao.xml
  9. 2
      tcm/src/main/resources/mapper_dao/PatientDao.xml

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

@ -35,6 +35,14 @@ public class InpatientController {
@ApiImplicitParams({})
@RequestMapping(value="/query",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<InpatientVo.InpatientInfo>> queryInpatient() throws Exception {
List<InpatientVo.InpatientInfo> inpatientInfos = inpatientService.queryAllInpatient();
return JsonResponse.newInstance().ok(inpatientInfos);
}
@ApiOperation(value = "查询启用的对照组的信息",notes = "")
@ApiImplicitParams({})
@RequestMapping(value="/queryEnable",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<InpatientVo.InpatientInfo>> queryEnable() throws Exception {
List<InpatientVo.InpatientInfo> inpatientInfos = inpatientService.queryInpatient();
return JsonResponse.newInstance().ok(inpatientInfos);
}

25
tcm/src/main/java/com/ccsens/tcm/persist/dao/InpatientDao.java

@ -0,0 +1,25 @@
package com.ccsens.tcm.persist.dao;
import com.ccsens.tcm.bean.vo.InpatientVo;
import com.ccsens.tcm.persist.mapper.InpatientMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author whj
*/
public interface InpatientDao extends InpatientMapper {
/**
* 查询全部对照组含禁用
* @return
*/
List<InpatientVo.InpatientInfo> queryAllInpatient();
/**
* 根据ID查询对象含禁用
* @param id
* @return
*/
InpatientVo.InpatientInfo getAllById(@Param("id") Long id);
}

7
tcm/src/main/java/com/ccsens/tcm/service/IInpatientService.java

@ -10,9 +10,14 @@ import java.util.List;
public interface IInpatientService {
/**
* 查看有对照组
* 查看有对照组
* @return 返回对照组信息
*/
List<InpatientVo.InpatientInfo> queryInpatient();
/**
* 查询全部对照组
* @return
*/
List<InpatientVo.InpatientInfo> queryAllInpatient();
}

12
tcm/src/main/java/com/ccsens/tcm/service/InpatientService.java

@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.ccsens.tcm.bean.po.Inpatient;
import com.ccsens.tcm.bean.po.InpatientExample;
import com.ccsens.tcm.bean.vo.InpatientVo;
import com.ccsens.tcm.persist.mapper.InpatientMapper;
import com.ccsens.tcm.persist.dao.InpatientDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -25,7 +25,7 @@ import java.util.List;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class InpatientService implements IInpatientService{
@Resource
private InpatientMapper inpatientMapper;
private InpatientDao inpatientDao;
@Override
public List<InpatientVo.InpatientInfo> queryInpatient() {
@ -33,7 +33,8 @@ public class InpatientService implements IInpatientService{
InpatientExample inpatientExample = new InpatientExample();
inpatientExample.clear();
List<Inpatient> inpatients = inpatientMapper.selectByExample(inpatientExample);
inpatientExample.setOrderByClause("code");
List<Inpatient> inpatients = inpatientDao.selectByExample(inpatientExample);
inpatients.forEach(inpatient -> {
InpatientVo.InpatientInfo inpatientInfo = new InpatientVo.InpatientInfo();
BeanUtil.copyProperties(inpatient,inpatientInfo);
@ -41,4 +42,9 @@ public class InpatientService implements IInpatientService{
});
return inpatientInfos;
}
@Override
public List<InpatientVo.InpatientInfo> queryAllInpatient() {
return inpatientDao.queryAllInpatient();
}
}

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

@ -10,11 +10,13 @@ import com.ccsens.tcm.bean.dto.StatisticDto;
import com.ccsens.tcm.bean.po.*;
import com.ccsens.tcm.bean.vo.*;
import com.ccsens.tcm.persist.dao.DoctorDao;
import com.ccsens.tcm.persist.dao.InpatientDao;
import com.ccsens.tcm.persist.dao.PatientDao;
import com.ccsens.tcm.persist.mapper.*;
import com.ccsens.tcm.uitl.Constant;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -47,7 +49,7 @@ public class PatientService implements IPatientService {
@Resource
private BiologicalSamplesMapper biologicalSamplesMapper;
@Resource
private InpatientMapper inpatientMapper;
private InpatientDao inpatientDao;
@Resource
private HospitalMapper hospitalMapper;
@Resource
@ -73,7 +75,7 @@ public class PatientService implements IPatientService {
@Override
public void savePatient(PatientDto.SavePatient param, Long userId) {
Hospital hospital = selUserIdToHosId(userId);
Inpatient inpatient = inpatientMapper.selectByPrimaryKey(param.getInpatientId());
Inpatient inpatient = inpatientDao.selectByPrimaryKey(param.getInpatientId());
if (inpatient == null) {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
@ -310,7 +312,7 @@ public class PatientService implements IPatientService {
}
for (int i = 0; i < param.getInpatientId().length; i++) {
StatisticVo.SelGroupNum selGroupNum =new StatisticVo.SelGroupNum();
selGroupNum.setName(inpatientMapper.selectByPrimaryKey(param.getInpatientId()[i]).getName());
selGroupNum.setName(inpatientDao.getAllById(param.getInpatientId()[i]).getName());
List<StatisticVo.SelGroupList> selGroupList= patientDao.countAnalysis(param.getConditionList(),param.getConditionListDate(), param.getReportParams(),param.getInpatientId()[i],param.getTestQuestionsId(),param.getHospitalization(),param.getInputStatus(),param.getHospitalId());
selGroupNum.setInpatientId(param.getInpatientId()[i]);
selGroupNum.setList(selGroupList);
@ -467,6 +469,8 @@ public class PatientService implements IPatientService {
patientInformation.setCheckId(userId);
} else if (param.getInputStatus() == Constant.Patient.STATUS_CLOSE) {
patientInformation.setPassId(userId);
} else if (param.getInputStatus() == Constant.Patient.STATUS_DISABLE) {
patientInformation.setRecStatus(WebConstant.REC_STATUS.Disabled.value);
}
patientInformationMapper.updateByExampleSelective(patientInformation,patientInformationExample);
}

2
tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java

@ -47,6 +47,8 @@ public class Constant {
public static class Patient {
/**废弃*/
public final static byte STATUS_DISABLE = 4;
/**审核通过*/
public final static byte STATUS_PASS = 5;
/**已完结*/

4
tcm/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring:
profiles:
active: dev
include: common, util-dev
active: prod
include: common, util-prod

30
tcm/src/main/resources/mapper_dao/InpatientDao.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tcm.persist.dao.InpatientDao">
<select id="queryAllInpatient" resultType="com.ccsens.tcm.bean.vo.InpatientVo$InpatientInfo">
SELECT
id,
name,
remarks,
collection_num AS collectionNum
FROM
t_inpatient
WHERE
rec_status IN ( 0, 1 )
ORDER BY CODE
</select>
<select id="getAllById" resultType="com.ccsens.tcm.bean.vo.InpatientVo$InpatientInfo">
SELECT
id,
name,
remarks,
collection_num AS collectionNum
FROM
t_inpatient
WHERE
id = #{id}
AND rec_status IN ( 0, 1 )
</select>
</mapper>

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

@ -246,7 +246,7 @@
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
left join t_inpatient ti on ti.id=tpi.inpatient_id and ti.rec_status in (0,1)
where tpi.rec_status=0
<if test="testQuestionsId!=null and testQuestionsId!=0">

Loading…
Cancel
Save