|
|
@ -590,22 +590,55 @@ public class PmsPatientServiceImpl implements IPmsPatientService { |
|
|
@DataSource(DataSourceType.SLAVE) |
|
|
@DataSource(DataSourceType.SLAVE) |
|
|
public void editPatientOtherMsgByHis(PmsPatientBody pmsPatientBody, PmsPatientPersonal pmsPatientPersonal, PmsPatientDiagnosis PmsPatientDiagnosis, PmsPatientParentIllness pmsPatientParentIllness) { |
|
|
public void editPatientOtherMsgByHis(PmsPatientBody pmsPatientBody, PmsPatientPersonal pmsPatientPersonal, PmsPatientDiagnosis PmsPatientDiagnosis, PmsPatientParentIllness pmsPatientParentIllness) { |
|
|
if(ObjectUtil.isNotNull(pmsPatientBody)){ |
|
|
if(ObjectUtil.isNotNull(pmsPatientBody)){ |
|
|
|
|
|
//根据就诊号和患者id查询就诊信息是否存在
|
|
|
|
|
|
PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample(); |
|
|
|
|
|
patientBodyExample.createCriteria().andOutpatientNoEqualTo(pmsPatientBody.getOutpatientNo()).andPatientIdEqualTo(pmsPatientBody.getPatientId()) |
|
|
|
|
|
.andDelFlagEqualTo((byte) 0); |
|
|
|
|
|
List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(patientBodyExample); |
|
|
|
|
|
if (CollUtil.isNotEmpty(pmsPatientBodies)) { |
|
|
|
|
|
//存在则修改
|
|
|
|
|
|
log.info("修改就诊信息:{}", pmsPatientBody); |
|
|
|
|
|
PmsPatientBody oldPatientBody = pmsPatientBodies.get(0); |
|
|
|
|
|
pmsPatientBody.setId(oldPatientBody.getId()); |
|
|
|
|
|
pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody); |
|
|
|
|
|
} else { |
|
|
|
|
|
//不存在则添加
|
|
|
log.info("添加就诊信息:{}", pmsPatientBody); |
|
|
log.info("添加就诊信息:{}", pmsPatientBody); |
|
|
|
|
|
pmsPatientBody.setId(IDGenerator.nextSnowflakeId()); |
|
|
pmsPatientBodyMapper.insertSelective(pmsPatientBody); |
|
|
pmsPatientBodyMapper.insertSelective(pmsPatientBody); |
|
|
} |
|
|
//首次添加就诊信息是,添加诊断和用药信息,后续同步不更新
|
|
|
if(ObjectUtil.isNotNull(pmsPatientPersonal)){ |
|
|
|
|
|
log.info("添加烟酒史等信息:{}", pmsPatientPersonal); |
|
|
|
|
|
pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal); |
|
|
|
|
|
} |
|
|
|
|
|
if(ObjectUtil.isNotNull(PmsPatientDiagnosis)){ |
|
|
if(ObjectUtil.isNotNull(PmsPatientDiagnosis)){ |
|
|
log.info("添加诊断信息:{}", PmsPatientDiagnosis); |
|
|
log.info("添加诊断信息:{}", PmsPatientDiagnosis); |
|
|
|
|
|
PmsPatientDiagnosis.setId(IDGenerator.nextSnowflakeId()); |
|
|
pmsPatientDiagnosisMapper.insertSelective(PmsPatientDiagnosis); |
|
|
pmsPatientDiagnosisMapper.insertSelective(PmsPatientDiagnosis); |
|
|
} |
|
|
} |
|
|
if(ObjectUtil.isNotNull(pmsPatientParentIllness)){ |
|
|
if(ObjectUtil.isNotNull(pmsPatientParentIllness)){ |
|
|
log.info("添加用药信息:{}", pmsPatientParentIllness); |
|
|
log.info("添加用药信息:{}", pmsPatientParentIllness); |
|
|
|
|
|
pmsPatientParentIllness.setId(IDGenerator.nextSnowflakeId()); |
|
|
pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness); |
|
|
pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(ObjectUtil.isNotNull(pmsPatientPersonal)){ |
|
|
|
|
|
//根据就诊号和患者id查询烟酒史
|
|
|
|
|
|
PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample(); |
|
|
|
|
|
patientPersonalExample.createCriteria().andVisitNoEqualTo(pmsPatientPersonal.getVisitNo()).andPatientIdEqualTo(pmsPatientPersonal.getPatientId()) |
|
|
|
|
|
.andDelFlagEqualTo((byte) 0); |
|
|
|
|
|
List<PmsPatientPersonal> pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample); |
|
|
|
|
|
if (CollUtil.isNotEmpty(pmsPatientPersonals)) { |
|
|
|
|
|
//存在则修改
|
|
|
|
|
|
log.info("修改烟酒史信息:{}", pmsPatientBody); |
|
|
|
|
|
PmsPatientPersonal oldPatientPersonal = pmsPatientPersonals.get(0); |
|
|
|
|
|
pmsPatientPersonal.setId(oldPatientPersonal.getId()); |
|
|
|
|
|
pmsPatientPersonalMapper.updateByPrimaryKeySelective(pmsPatientPersonal); |
|
|
|
|
|
}else { |
|
|
|
|
|
log.info("添加烟酒史等信息:{}", pmsPatientPersonal); |
|
|
|
|
|
pmsPatientPersonal.setId(IDGenerator.nextSnowflakeId()); |
|
|
|
|
|
pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Integer delPatient(PmsPatientDto.GetPatientById param) { |
|
|
public Integer delPatient(PmsPatientDto.GetPatientById param) { |
|
|
|