This commit is contained in:
zhuangyuanke 2024-12-31 17:10:08 +08:00
parent f88b28b243
commit b54fee7a77
2 changed files with 195 additions and 184 deletions

View File

@ -114,14 +114,15 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
}
/**
* @description 患者管理患者档案列表
* @param patientInfo 患者信息查询传输对象
* @return 患者信息集合
* @description 患者管理患者档案列表
* @Author haown
* @Date 2024-08-05 14:46
*/
@DataScope(agencyAlias = "p", userAlias = "p.attending_physician_id")
@Override public List<PatientInfoVo> getPatientList(PatientInfoDto patientInfo) {
@Override
public List<PatientInfoVo> getPatientList(PatientInfoDto patientInfo) {
List<PatientInfoVo> patientInfoVoList = patientInfoMapper.getPatientList(patientInfo);
return patientInfoVoList;
}
@ -256,7 +257,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
return patientInfo;
}
@Override public PatientInfo updateBaseInfo(PatientBaseInfoDto patientInfo) {
@Override
public PatientInfo updateBaseInfo(PatientBaseInfoDto patientInfo) {
PatientInfo patientInfo1 = patientInfoMapper.selectPatientInfoById(patientInfo.getId());
BeanUtils.copyBeanProp(patientInfo1, patientInfo);
return updatePatientInfo(patientInfo1);
@ -304,6 +306,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
/**
* 设置患者就诊信息为空
*
* @param patientInfo 患者信息
*/
private void setVisitInfoNull(PatientInfo patientInfo) {
@ -320,6 +323,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
patientInfo.setVisitSerialNumber(null);
patientInfo.setInHospitalNumber(null);
}
/**
* 删除患者信息
*
@ -486,8 +490,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
item.setPatientInfoImportId(item.getId());
//居民信息去重
if (residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(item.getPatientName())
&& residentInfo.getPatientPhone().equals(item.getPatientPhone())).collect(Collectors.toSet()).size()==0)
{
&& residentInfo.getPatientPhone().equals(item.getPatientPhone())).collect(Collectors.toSet()).size() == 0) {
patientInfoImportList_forResident.add(item);
}
//如果已存在
@ -504,15 +507,22 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
log.info("居民表新增失败!");
return AjaxResult.error("居民信息新增失败;");
}
//设置居民ID
patientInfoImportList.forEach(item -> item.setResidentId(item.getId()));
patientInfoImportList_forResident.forEach(item ->
{
patientInfoImportList.stream().filter(item2 -> item2.getPatientName().equals(item.getPatientName())
&& item2.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport())
.setResidentId(item.getId());
}
);
}
//endregion
//设置为门诊患者
patientInfoImportList.forEach(item ->
{item.setPatientType(PatientTypeEnum.OUTPATIENT.getInfo());
item.setVisitMethod(VisitMethodConstants.OUTPATIENT_SERVICE);});
{
item.setPatientType(PatientTypeEnum.OUTPATIENT.getInfo());
item.setVisitMethod(VisitMethodConstants.OUTPATIENT_SERVICE);
});
//新增患者表
int i = patientInfoMapper.insertPatientInfoList(patientInfoImportList);
if (i <= 0) {
@ -651,7 +661,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
patientInfoImports.forEach(item -> item.setResidentId(item.getId()));
//设置为门诊患者
patientInfoImports.forEach(item ->
{item.setPatientType(PatientTypeEnum.OUTPATIENT.getInfo());
{
item.setPatientType(PatientTypeEnum.OUTPATIENT.getInfo());
item.setVisitMethod(VisitMethodConstants.OUTPATIENT_SERVICE);
});

View File

@ -906,7 +906,7 @@
) values
<foreach item="PatientInfoImport" index="index" collection="list" separator=",">
(
#{PatientInfoImport.id},
#{PatientInfoImport.residentId},
#{PatientInfoImport.patientInfoImportId},
#{PatientInfoImport.visitDate},
#{PatientInfoImport.inHospitalNumber},