|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.docus.server.collection.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.docus.core.util.DateUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.core.exception.BaseException;
|
|
|
|
@ -11,6 +10,7 @@ import com.docus.server.collection.entity.TBasic;
|
|
|
|
|
import com.docus.server.collection.entity.TBasicExtend;
|
|
|
|
|
import com.docus.server.collection.mapper.TBasicMapper;
|
|
|
|
|
import com.docus.server.collection.service.ITBasicService;
|
|
|
|
|
import com.docus.server.report.entity.MaternalInfantRelationship;
|
|
|
|
|
import com.docus.server.rpc.SdRyHospitalRpc;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -18,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
@ -125,13 +126,12 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
} else {
|
|
|
|
|
tBasic.setIsOther(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sdryIndex = tBasicDto.getSdryIndex();
|
|
|
|
|
TBasicExtend tBasicExtend = new TBasicExtend();
|
|
|
|
|
tBasicExtend.setPatientId(patientId.toString());
|
|
|
|
|
tBasicExtend.setWardCode(tBasicDto.getWardCode());
|
|
|
|
|
tBasicExtend.setWardName(tBasicDto.getWardName());
|
|
|
|
|
tBasicExtend.setSdryIndex(tBasicDto.getSdryIndex());
|
|
|
|
|
|
|
|
|
|
tBasicExtend.setSdryIndex(sdryIndex == null ? null : sdryIndex.replace("z", "").replace("m", ""));
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicMapper.insert(tBasic);
|
|
|
|
|
tBasicMapper.insertExtend(tBasicExtend);
|
|
|
|
@ -339,13 +339,15 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
if (Func.isBlank(babyIndex)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
// 宝宝索引查妈妈索引
|
|
|
|
|
String parentSdRyIndex= tBasicMapper.getParentSdRyIndex(babyIndex);
|
|
|
|
|
if(Func.isBlank(parentSdRyIndex)){
|
|
|
|
|
// 宝宝索引查妈妈索引 和住院次数
|
|
|
|
|
MaternalInfantRelationship infantRelationship = tBasicMapper.getMaternalInfantRelationship(babyIndex);
|
|
|
|
|
|
|
|
|
|
if (Objects.isNull(infantRelationship) || Func.isBlank(infantRelationship.getMomId()) ) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
// 通过索引查病案主键
|
|
|
|
|
String parentPatientId=tBasicMapper.getPatientIdBySdRyIndex(parentSdRyIndex);
|
|
|
|
|
String parentSdRyIndex=infantRelationship.getMomId();
|
|
|
|
|
// 通过索引和住院次数查病案主键
|
|
|
|
|
String parentPatientId = tBasicMapper.getPatientIdBySdRyIndexAndAdmissTimes(parentSdRyIndex,infantRelationship.getParentTimes());
|
|
|
|
|
if (Func.isBlank(parentPatientId)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|