Browse Source

筛查添加换着档案

newMaster
zzc 3 months ago
parent
commit
3fadd49299
  1. 42
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java
  2. 2
      acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml

42
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java

@ -16,14 +16,12 @@ import com.acupuncture.common.core.redis.RedisCache;
import com.acupuncture.common.exception.base.BaseException;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.ScreeningDto;
import com.acupuncture.system.domain.po.ScrScreening;
import com.acupuncture.system.domain.po.ScrScreeningDetail;
import com.acupuncture.system.domain.po.ScrScreeningExample;
import com.acupuncture.system.domain.po.ScrScreeningRecord;
import com.acupuncture.system.domain.po.*;
import com.acupuncture.system.domain.vo.QuestionnaireVo;
import com.acupuncture.system.domain.vo.ScrScreenVo;
import com.acupuncture.system.persist.dao.ScreeningDao;
import com.acupuncture.system.persist.dao.ScreeningDetailDao;
import com.acupuncture.system.persist.mapper.PmsPatientMapper;
import com.acupuncture.system.persist.mapper.ScrScreeningRecordMapper;
import com.acupuncture.system.service.IScreeningService;
import com.github.pagehelper.PageInfo;
@ -56,6 +54,8 @@ public class ScreeningServiceImpl implements IScreeningService {
private ScrScreeningRecordMapper scrScreeningRecordMapper;
@Resource
private RedisCache redisCache;
@Resource
private PmsPatientMapper pmsPatientMapper;
/**
* 提交高危筛查问卷的时间
@ -416,6 +416,40 @@ public class ScreeningServiceImpl implements IScreeningService {
screeningDetail.setId(param.getDetailId());
screeningDetail.setSubmitStatus((byte) 1);
scrScreeningRecordMapper.updateByPrimaryKeySelective(screeningDetail);
//获取CODE查询是否已经新增患者档案
ScrScreeningDetailExample scrScreeningDetailExample = new ScrScreeningDetailExample();
scrScreeningDetailExample.createCriteria().andDelFlagEqualTo((byte) 0).andRecordIdEqualTo(param.getDetailId())
.andQuestionCodeIn(CollectionUtil.newArrayList("SCWJ-NAME", "SCWJ-SEX", "SCWJ-BIRTH",
"SCWJ-AGE", "SCWJ-PHONE"));
List<ScrScreeningDetail> scrScreeningDetails = screeningDetailDao.selectByExample(scrScreeningDetailExample);
if (CollectionUtil.isNotEmpty(scrScreeningDetails)) {
Map<String, ScrScreeningDetail> map = scrScreeningDetails.stream().collect(Collectors.toMap(ScrScreeningDetail::getQuestionCode, Function.identity()));
ScrScreeningDetail scrScreeningDetail = map.get("SCWJ-NAME");
ScrScreeningDetail scrScreeningDetail1 = map.get("SCWJ-PHONE");
if (scrScreeningDetail == null || scrScreeningDetail1 == null) {
return;
}
PmsPatientExample pmsPatientExample = new PmsPatientExample();
pmsPatientExample.createCriteria().andNameEqualTo(scrScreeningDetail.getAnswer()).andPhoneEqualTo(scrScreeningDetail1.getAnswer());
List<PmsPatient> pmsPatients = pmsPatientMapper.selectByExample(pmsPatientExample);
if (CollectionUtil.isEmpty(pmsPatients)) {
PmsPatient pmsPatient = new PmsPatient();
pmsPatient.setId(IdUtil.getSnowflakeNextId());
pmsPatient.setPhone(scrScreeningDetail1.getAnswer());
pmsPatient.setName(scrScreeningDetail.getAnswer());
if (ObjectUtil.isNotNull(map.get("SCWJ-BIRTH"))) {
pmsPatient.setBirthDate(DateUtil.parse(map.get("SCWJ-BIRTH").getAnswer()));
}
if (ObjectUtil.isNotNull(map.get("SCWJ-SEX"))) {
pmsPatient.setGender(Byte.parseByte(map.get("SCWJ-SEX").getAnswer()));
}
pmsPatient.setSource((byte) 0);
pmsPatient.setDelFlag((byte) 0);
pmsPatient.setCreateTime(new Date());
pmsPatientMapper.insertSelective(pmsPatient);
}
}
}
@Override

2
acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -56,6 +56,8 @@
p.name LIKE CONCAT('%', #{query.keywords}, '%')
OR p.pinyin_full LIKE CONCAT('%', #{query.keywords}, '%')
OR p.pinyin_simple LIKE CONCAT('%', #{query.keywords}, '%')
or p.id_card LIKE CONCAT('%', #{query.keywords}, '%')
or p.phone LIKE CONCAT('%', #{query.keywords}, '%')
)
</if>
</where>

Loading…
Cancel
Save