|
@@ -92,8 +92,8 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
|
|
|
|
|
|
@Override
|
|
|
public MzPatientMi queryByPatientId(String patientId) {
|
|
|
- MzPatientMi mzPatientMi= mzPatientMiMapper.selectByPatientId(patientId);
|
|
|
- if(mzPatientMi!=null){
|
|
|
+ MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
|
|
|
+ if (mzPatientMi != null) {
|
|
|
mzPatientMi.setGender(GenderEnum.getGenderByCode(mzPatientMi.getSex()).name);
|
|
|
mzPatientMi.setResponseTypeName(responceTypeService.queryMzNameByCode(mzPatientMi.getResponseType()));
|
|
|
}
|
|
@@ -106,14 +106,14 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
|
|
|
String patientNo = mzSerialNoService.getMzPatientNo();
|
|
|
mzPatientMi.setPatientId(patientNo);
|
|
|
mzPatientMi.setTimes(0);
|
|
|
- if(StringUtils.isBlank(mzPatientMi.getCertificateType())){
|
|
|
+ if (StringUtils.isBlank(mzPatientMi.getCertificateType())) {
|
|
|
mzPatientMi.setCertificateType(CertificateTypeEnum.JMSFZ.code);
|
|
|
}
|
|
|
if (StringUtils.isBlank(mzPatientMi.getIcCardNo())) {
|
|
|
mzPatientMi.setIcCardNo(patientNo);
|
|
|
}
|
|
|
- if (StringUtils.isBlank(mzPatientMi.getAddress())) {
|
|
|
- mzPatientMi.setAddress(mzPatientMi.getAddress().replaceAll("null",""));
|
|
|
+ if (mzPatientMi.getAddress() != null && StringUtils.isNotBlank(mzPatientMi.getAddress())) {
|
|
|
+ mzPatientMi.setAddress(mzPatientMi.getAddress().replaceAll("null", ""));
|
|
|
}
|
|
|
return mzPatientMiMapper.insertMzPatientMi(mzPatientMi);
|
|
|
}
|
|
@@ -134,27 +134,27 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
|
|
|
mzYjReqMapper.updateNameByPatientIdAndTimes(mzPatientMi.getName(), mzPatientMi.getPatientId(), null);
|
|
|
mzyReqrecMapper.updateNameByPatientIdAndTimes(mzPatientMi.getName(), mzPatientMi.getPatientId(), null);
|
|
|
//医技检查
|
|
|
- yjJcPatientMapper.updateYjJcPatient(new YjJcPatient(mzPatientMi.getPatientId(),mzPatientMi.getName()));
|
|
|
- log.info("修改病人信息{},",mzPatientMi.toString());
|
|
|
- if(updateLisData){
|
|
|
+ yjJcPatientMapper.updateYjJcPatient(new YjJcPatient(mzPatientMi.getPatientId(), mzPatientMi.getName()));
|
|
|
+ log.info("修改病人信息{},", mzPatientMi.toString());
|
|
|
+ if (updateLisData) {
|
|
|
//lis订单信息
|
|
|
- mOrderInfoMapper.updateMOrderInfo(new MOrderInfo(mzPatientMi.getPatientId(),mzPatientMi.getName()));
|
|
|
+ mOrderInfoMapper.updateMOrderInfo(new MOrderInfo(mzPatientMi.getPatientId(), mzPatientMi.getName()));
|
|
|
//lis病人信息
|
|
|
- mPtntInfoMapper.updateMPtntInfo(new MPtntInfo(mzPatientMi.getPatientId(),mzPatientMi.getName()));
|
|
|
+ mPtntInfoMapper.updateMPtntInfo(new MPtntInfo(mzPatientMi.getPatientId(), mzPatientMi.getName()));
|
|
|
}
|
|
|
try {
|
|
|
//住院病人姓名
|
|
|
aPatientMiMapper.updateMzPatientMiByMzno(new APatientMi(mzPatientMi.getPatientId(), mzPatientMi.getName()));
|
|
|
- }catch (DataIntegrityViolationException e){
|
|
|
- if(e.getMessage().contains("将截断字符串或二进制数据")){
|
|
|
+ } catch (DataIntegrityViolationException e) {
|
|
|
+ if (e.getMessage().contains("将截断字符串或二进制数据")) {
|
|
|
log.error("住院病人信息修改失败,错误信息{病人姓名超长}");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//修改住院病人
|
|
|
- zyActpatientMapper.updateNameByMzNo(mzPatientMi.getName(),mzPatientMi.getPatientId(),"zy_actpatient");
|
|
|
+ zyActpatientMapper.updateNameByMzNo(mzPatientMi.getName(), mzPatientMi.getPatientId(), "zy_actpatient");
|
|
|
//修改出院病人
|
|
|
- zyActpatientMapper.updateNameByMzNo(mzPatientMi.getName(),mzPatientMi.getPatientId(),"zy_inactpatient");
|
|
|
+ zyActpatientMapper.updateNameByMzNo(mzPatientMi.getName(), mzPatientMi.getPatientId(), "zy_inactpatient");
|
|
|
}
|
|
|
if (mzPatientMiDb != null && (StringUtils.isBlank(mzPatientMiDb.getIcCardNo()) || !mzPatientMiDb.getIcCardNo().equals(mzPatientMi.getIcCardNo()))) {
|
|
|
haiCiAdapterService.cardChangeNotice(mzPatientMiDb.getIcCardNo(), mzPatientMi.getIcCardNo(), new Date());
|
|
@@ -181,25 +181,25 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
|
|
|
@Override
|
|
|
public List<MzPatientMi> queryByPatientIds(List<String> patientIds) {
|
|
|
List<String> tempList = new ArrayList<>();
|
|
|
- List<MzPatientMi> mzPatientMis=null;
|
|
|
- int count=0;
|
|
|
- for(String patientId:patientIds){
|
|
|
+ List<MzPatientMi> mzPatientMis = null;
|
|
|
+ int count = 0;
|
|
|
+ for (String patientId : patientIds) {
|
|
|
tempList.add(patientId);
|
|
|
count++;
|
|
|
- if(count==1000){
|
|
|
- if(mzPatientMis==null){
|
|
|
- mzPatientMis=mzPatientMiMapper.selectByPatientIds(tempList);
|
|
|
- }else {
|
|
|
+ if (count == 1000) {
|
|
|
+ if (mzPatientMis == null) {
|
|
|
+ mzPatientMis = mzPatientMiMapper.selectByPatientIds(tempList);
|
|
|
+ } else {
|
|
|
mzPatientMis.addAll(mzPatientMiMapper.selectByPatientIds(tempList));
|
|
|
}
|
|
|
- count=0;
|
|
|
- tempList=new ArrayList<>();
|
|
|
+ count = 0;
|
|
|
+ tempList = new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
- if(count>0){
|
|
|
- if(mzPatientMis==null){
|
|
|
- mzPatientMis=mzPatientMiMapper.selectByPatientIds(tempList);
|
|
|
- }else {
|
|
|
+ if (count > 0) {
|
|
|
+ if (mzPatientMis == null) {
|
|
|
+ mzPatientMis = mzPatientMiMapper.selectByPatientIds(tempList);
|
|
|
+ } else {
|
|
|
mzPatientMis.addAll(mzPatientMiMapper.selectByPatientIds(tempList));
|
|
|
}
|
|
|
}
|
|
@@ -235,7 +235,7 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
|
|
|
|
|
|
@Override
|
|
|
public int queryCountYbZf(String patientId, Integer times) {
|
|
|
- return mzPatientMiMapper.countYbZf(patientId,times);
|
|
|
+ return mzPatientMiMapper.countYbZf(patientId, times);
|
|
|
}
|
|
|
|
|
|
|