|
|
|
@ -3,6 +3,7 @@ package com.docus.server.collection.service.impl;
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import com.docus.core.util.DateUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.core.exception.BaseException;
|
|
|
|
|
import com.docus.infrastructure.redis.service.IdService;
|
|
|
|
|
import com.docus.server.collection.dto.TBasicDto;
|
|
|
|
|
import com.docus.server.collection.entity.TBasic;
|
|
|
|
@ -194,6 +195,86 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
tBasicMapper.update(tBasic);
|
|
|
|
|
tBasicMapper.updateExtend(tBasicExtend);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void updateAdmissTBasic(TBasicDto tBasicDto) throws Exception {
|
|
|
|
|
//判断jzh是否存在
|
|
|
|
|
String patientId = tBasicMapper.getPatientId(tBasicDto.getJzh());
|
|
|
|
|
if (Func.isEmpty(patientId)) {
|
|
|
|
|
throw new BaseException("数据不存在,更新失败");
|
|
|
|
|
}
|
|
|
|
|
//数据类型转化,格式处理
|
|
|
|
|
Date admissDate=null;
|
|
|
|
|
if(Func.isNotEmpty(tBasicDto.getAdmissDate())){
|
|
|
|
|
admissDate = Func.parseDate(tBasicDto.getAdmissDate(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
}
|
|
|
|
|
Date disDate=null;
|
|
|
|
|
if(Func.isNotEmpty(tBasicDto.getDisDate())){
|
|
|
|
|
disDate = Func.parseDate(tBasicDto.getDisDate(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
}
|
|
|
|
|
String admissTimesStr = tBasicDto.getAdmissTimes();
|
|
|
|
|
Integer admissTimes=null;
|
|
|
|
|
if(NumberUtil.isInteger(admissTimesStr)){
|
|
|
|
|
admissTimes=Integer.parseInt(admissTimesStr);
|
|
|
|
|
}
|
|
|
|
|
String ageStr = tBasicDto.getAge();
|
|
|
|
|
if(Func.isNotEmpty(ageStr)){
|
|
|
|
|
ageStr =ageStr.substring(0,ageStr.length()-1);
|
|
|
|
|
}
|
|
|
|
|
Integer age=null;
|
|
|
|
|
if(NumberUtil.isInteger(ageStr)){
|
|
|
|
|
age=Integer.parseInt(ageStr);
|
|
|
|
|
}
|
|
|
|
|
String sexName=tBasicDto.getSexName();
|
|
|
|
|
if(Func.isNotEmpty(sexName)&&sexName.length()>1){
|
|
|
|
|
sexName=sexName.substring(0,1);
|
|
|
|
|
}
|
|
|
|
|
String admissDaysStr = tBasicDto.getAdmissDays();
|
|
|
|
|
Integer admissDays=null;
|
|
|
|
|
if(NumberUtil.isInteger(admissDaysStr)){
|
|
|
|
|
admissDays=Integer.parseInt(admissDaysStr);
|
|
|
|
|
}
|
|
|
|
|
String isDeadStr = tBasicDto.getIsDead();
|
|
|
|
|
Integer isDead=0;
|
|
|
|
|
if("死亡".equals(isDeadStr)){
|
|
|
|
|
isDead=1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//组装数据
|
|
|
|
|
TBasic tBasic=new TBasic();
|
|
|
|
|
|
|
|
|
|
tBasic.setJzh(tBasicDto.getJzh());
|
|
|
|
|
tBasic.setPatientId(patientId);
|
|
|
|
|
tBasic.setInpatientNo(tBasicDto.getInpatientNo());
|
|
|
|
|
tBasic.setAdmissTimes(admissTimes);
|
|
|
|
|
tBasic.setName(tBasicDto.getName());
|
|
|
|
|
tBasic.setAdmissDate(admissDate);
|
|
|
|
|
tBasic.setDisDate(disDate);
|
|
|
|
|
tBasic.setAdmissDept(tBasicDto.getAdmissDept());
|
|
|
|
|
tBasic.setAdmissDeptName(tBasicDto.getAdmissDeptName());
|
|
|
|
|
tBasic.setDisDeptName(tBasicDto.getDisDeptName());
|
|
|
|
|
tBasic.setAttending(tBasicDto.getAttending());
|
|
|
|
|
tBasic.setAttendingName(tBasicDto.getAttendingName());
|
|
|
|
|
tBasic.setAge(age);
|
|
|
|
|
tBasic.setSex(tBasicDto.getSex());
|
|
|
|
|
tBasic.setIdCard(tBasicDto.getIdCard());
|
|
|
|
|
tBasic.setDisDept(tBasicDto.getDisDept());
|
|
|
|
|
tBasic.setSexName(sexName);
|
|
|
|
|
tBasic.setBedNum(tBasicDto.getBedNum());
|
|
|
|
|
tBasic.setAdmissDays(admissDays);
|
|
|
|
|
tBasic.setIsDead(isDead);
|
|
|
|
|
|
|
|
|
|
TBasicExtend tBasicExtend=new TBasicExtend();
|
|
|
|
|
tBasicExtend.setPatientId(patientId);
|
|
|
|
|
tBasicExtend.setWardCode(tBasicDto.getWardCode());
|
|
|
|
|
tBasicExtend.setWardName(tBasicDto.getWardName());
|
|
|
|
|
tBasicExtend.setSdryIndex(tBasicDto.getSdryIndex());
|
|
|
|
|
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicMapper.update(tBasic);
|
|
|
|
|
tBasicMapper.updateExtend(tBasicExtend);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|